"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var scalapb_exports = {};
__export(scalapb_exports, {
  Collection: () => Collection,
  EnumOptions: () => EnumOptions,
  EnumValueOptions: () => EnumValueOptions,
  FieldOptions: () => FieldOptions,
  FieldTransformation: () => FieldTransformation,
  MatchType: () => MatchType,
  MessageOptions: () => MessageOptions,
  OneofOptions: () => OneofOptions,
  PreprocessorOutput: () => PreprocessorOutput,
  ScalaPbOptions: () => ScalaPbOptions,
  ScalaPbOptions_AuxEnumOptions: () => ScalaPbOptions_AuxEnumOptions,
  ScalaPbOptions_AuxEnumValueOptions: () => ScalaPbOptions_AuxEnumValueOptions,
  ScalaPbOptions_AuxFieldOptions: () => ScalaPbOptions_AuxFieldOptions,
  ScalaPbOptions_AuxMessageOptions: () => ScalaPbOptions_AuxMessageOptions,
  ScalaPbOptions_EnumValueNaming: () => ScalaPbOptions_EnumValueNaming,
  ScalaPbOptions_OptionsScope: () => ScalaPbOptions_OptionsScope
});
module.exports = __toCommonJS(scalapb_exports);
var import_runtime = require("@protobuf-ts/runtime");
var import_runtime2 = require("@protobuf-ts/runtime");
var import_runtime3 = require("@protobuf-ts/runtime");
var import_runtime4 = require("@protobuf-ts/runtime");
var import_descriptor = require("../google/protobuf/descriptor.cjs");
var import_descriptor2 = require("../google/protobuf/descriptor.cjs");
var ScalaPbOptions_OptionsScope = /* @__PURE__ */ ((ScalaPbOptions_OptionsScope2) => {
  ScalaPbOptions_OptionsScope2[ScalaPbOptions_OptionsScope2["FILE"] = 0] = "FILE";
  ScalaPbOptions_OptionsScope2[ScalaPbOptions_OptionsScope2["PACKAGE"] = 1] = "PACKAGE";
  return ScalaPbOptions_OptionsScope2;
})(ScalaPbOptions_OptionsScope || {});
var ScalaPbOptions_EnumValueNaming = /* @__PURE__ */ ((ScalaPbOptions_EnumValueNaming2) => {
  ScalaPbOptions_EnumValueNaming2[ScalaPbOptions_EnumValueNaming2["AS_IN_PROTO"] = 0] = "AS_IN_PROTO";
  ScalaPbOptions_EnumValueNaming2[ScalaPbOptions_EnumValueNaming2["CAMEL_CASE"] = 1] = "CAMEL_CASE";
  return ScalaPbOptions_EnumValueNaming2;
})(ScalaPbOptions_EnumValueNaming || {});
var MatchType = /* @__PURE__ */ ((MatchType2) => {
  MatchType2[MatchType2["CONTAINS"] = 0] = "CONTAINS";
  MatchType2[MatchType2["EXACT"] = 1] = "EXACT";
  MatchType2[MatchType2["PRESENCE"] = 2] = "PRESENCE";
  return MatchType2;
})(MatchType || {});
class ScalaPbOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.ScalaPbOptions", [
      {
        no: 1,
        name: "package_name",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 2,
        name: "flat_package",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 3,
        name: "import",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 4,
        name: "preamble",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 5,
        name: "single_file",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 7,
        name: "no_primitive_wrappers",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 6,
        name: "primitive_wrappers",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 8,
        name: "collection_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 9,
        name: "preserve_unknown_fields",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 10,
        name: "object_name",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 11,
        name: "scope",
        kind: "enum",
        opt: true,
        T: () => [
          "scalapb.ScalaPbOptions.OptionsScope",
          ScalaPbOptions_OptionsScope
        ]
      },
      {
        no: 12,
        name: "lenses",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 13,
        name: "retain_source_code_info",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 14,
        name: "map_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 15,
        name: "no_default_values_in_constructor",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 16,
        name: "enum_value_naming",
        kind: "enum",
        opt: true,
        T: () => [
          "scalapb.ScalaPbOptions.EnumValueNaming",
          ScalaPbOptions_EnumValueNaming
        ]
      },
      {
        no: 17,
        name: "enum_strip_prefix",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 21,
        name: "bytes_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 23,
        name: "java_conversions",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 18,
        name: "aux_message_options",
        kind: "message",
        repeat: 2,
        T: () => ScalaPbOptions_AuxMessageOptions
      },
      {
        no: 19,
        name: "aux_field_options",
        kind: "message",
        repeat: 2,
        T: () => ScalaPbOptions_AuxFieldOptions
      },
      {
        no: 20,
        name: "aux_enum_options",
        kind: "message",
        repeat: 2,
        T: () => ScalaPbOptions_AuxEnumOptions
      },
      {
        no: 22,
        name: "aux_enum_value_options",
        kind: "message",
        repeat: 2,
        T: () => ScalaPbOptions_AuxEnumValueOptions
      },
      {
        no: 24,
        name: "preprocessors",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 25,
        name: "field_transformations",
        kind: "message",
        repeat: 2,
        T: () => FieldTransformation
      },
      {
        no: 26,
        name: "ignore_all_transformations",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 27,
        name: "getters",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 28,
        name: "scala3_sources",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 999,
        name: "test_only_no_java_conversions",
        kind: "scalar",
        opt: true,
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.import = [];
    message.preamble = [];
    message.auxMessageOptions = [];
    message.auxFieldOptions = [];
    message.auxEnumOptions = [];
    message.auxEnumValueOptions = [];
    message.preprocessors = [];
    message.fieldTransformations = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string package_name */
        1:
          message.packageName = reader.string();
          break;
        case /* optional bool flat_package */
        2:
          message.flatPackage = reader.bool();
          break;
        case /* repeated string import */
        3:
          message.import.push(reader.string());
          break;
        case /* repeated string preamble */
        4:
          message.preamble.push(reader.string());
          break;
        case /* optional bool single_file */
        5:
          message.singleFile = reader.bool();
          break;
        case /* optional bool no_primitive_wrappers */
        7:
          message.noPrimitiveWrappers = reader.bool();
          break;
        case /* optional bool primitive_wrappers */
        6:
          message.primitiveWrappers = reader.bool();
          break;
        case /* optional string collection_type */
        8:
          message.collectionType = reader.string();
          break;
        case /* optional bool preserve_unknown_fields = 9 [default = true] */
        9:
          message.preserveUnknownFields = reader.bool();
          break;
        case /* optional string object_name */
        10:
          message.objectName = reader.string();
          break;
        case /* optional scalapb.ScalaPbOptions.OptionsScope scope */
        11:
          message.scope = reader.int32();
          break;
        case /* optional bool lenses = 12 [default = true] */
        12:
          message.lenses = reader.bool();
          break;
        case /* optional bool retain_source_code_info */
        13:
          message.retainSourceCodeInfo = reader.bool();
          break;
        case /* optional string map_type */
        14:
          message.mapType = reader.string();
          break;
        case /* optional bool no_default_values_in_constructor */
        15:
          message.noDefaultValuesInConstructor = reader.bool();
          break;
        case /* optional scalapb.ScalaPbOptions.EnumValueNaming enum_value_naming */
        16:
          message.enumValueNaming = reader.int32();
          break;
        case /* optional bool enum_strip_prefix = 17 [default = false] */
        17:
          message.enumStripPrefix = reader.bool();
          break;
        case /* optional string bytes_type */
        21:
          message.bytesType = reader.string();
          break;
        case /* optional bool java_conversions */
        23:
          message.javaConversions = reader.bool();
          break;
        case /* repeated scalapb.ScalaPbOptions.AuxMessageOptions aux_message_options */
        18:
          message.auxMessageOptions.push(
            ScalaPbOptions_AuxMessageOptions.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* repeated scalapb.ScalaPbOptions.AuxFieldOptions aux_field_options */
        19:
          message.auxFieldOptions.push(
            ScalaPbOptions_AuxFieldOptions.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* repeated scalapb.ScalaPbOptions.AuxEnumOptions aux_enum_options */
        20:
          message.auxEnumOptions.push(
            ScalaPbOptions_AuxEnumOptions.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* repeated scalapb.ScalaPbOptions.AuxEnumValueOptions aux_enum_value_options */
        22:
          message.auxEnumValueOptions.push(
            ScalaPbOptions_AuxEnumValueOptions.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* repeated string preprocessors */
        24:
          message.preprocessors.push(reader.string());
          break;
        case /* repeated scalapb.FieldTransformation field_transformations */
        25:
          message.fieldTransformations.push(
            FieldTransformation.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* optional bool ignore_all_transformations */
        26:
          message.ignoreAllTransformations = reader.bool();
          break;
        case /* optional bool getters = 27 [default = true] */
        27:
          message.getters = reader.bool();
          break;
        case /* optional bool scala3_sources */
        28:
          message.scala3Sources = reader.bool();
          break;
        case /* optional bool test_only_no_java_conversions */
        999:
          message.testOnlyNoJavaConversions = reader.bool();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.packageName !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.packageName);
    if (message.flatPackage !== void 0)
      writer.tag(2, import_runtime.WireType.Varint).bool(message.flatPackage);
    for (let i = 0; i < message.import.length; i++)
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.import[i]);
    for (let i = 0; i < message.preamble.length; i++)
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.preamble[i]);
    if (message.singleFile !== void 0)
      writer.tag(5, import_runtime.WireType.Varint).bool(message.singleFile);
    if (message.primitiveWrappers !== void 0)
      writer.tag(6, import_runtime.WireType.Varint).bool(message.primitiveWrappers);
    if (message.noPrimitiveWrappers !== void 0)
      writer.tag(7, import_runtime.WireType.Varint).bool(message.noPrimitiveWrappers);
    if (message.collectionType !== void 0)
      writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.collectionType);
    if (message.preserveUnknownFields !== void 0)
      writer.tag(9, import_runtime.WireType.Varint).bool(message.preserveUnknownFields);
    if (message.objectName !== void 0)
      writer.tag(10, import_runtime.WireType.LengthDelimited).string(message.objectName);
    if (message.scope !== void 0)
      writer.tag(11, import_runtime.WireType.Varint).int32(message.scope);
    if (message.lenses !== void 0)
      writer.tag(12, import_runtime.WireType.Varint).bool(message.lenses);
    if (message.retainSourceCodeInfo !== void 0)
      writer.tag(13, import_runtime.WireType.Varint).bool(message.retainSourceCodeInfo);
    if (message.mapType !== void 0)
      writer.tag(14, import_runtime.WireType.LengthDelimited).string(message.mapType);
    if (message.noDefaultValuesInConstructor !== void 0)
      writer.tag(15, import_runtime.WireType.Varint).bool(message.noDefaultValuesInConstructor);
    if (message.enumValueNaming !== void 0)
      writer.tag(16, import_runtime.WireType.Varint).int32(message.enumValueNaming);
    if (message.enumStripPrefix !== void 0)
      writer.tag(17, import_runtime.WireType.Varint).bool(message.enumStripPrefix);
    for (let i = 0; i < message.auxMessageOptions.length; i++)
      ScalaPbOptions_AuxMessageOptions.internalBinaryWrite(
        message.auxMessageOptions[i],
        writer.tag(18, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.auxFieldOptions.length; i++)
      ScalaPbOptions_AuxFieldOptions.internalBinaryWrite(
        message.auxFieldOptions[i],
        writer.tag(19, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.auxEnumOptions.length; i++)
      ScalaPbOptions_AuxEnumOptions.internalBinaryWrite(
        message.auxEnumOptions[i],
        writer.tag(20, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.bytesType !== void 0)
      writer.tag(21, import_runtime.WireType.LengthDelimited).string(message.bytesType);
    for (let i = 0; i < message.auxEnumValueOptions.length; i++)
      ScalaPbOptions_AuxEnumValueOptions.internalBinaryWrite(
        message.auxEnumValueOptions[i],
        writer.tag(22, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.javaConversions !== void 0)
      writer.tag(23, import_runtime.WireType.Varint).bool(message.javaConversions);
    for (let i = 0; i < message.preprocessors.length; i++)
      writer.tag(24, import_runtime.WireType.LengthDelimited).string(message.preprocessors[i]);
    for (let i = 0; i < message.fieldTransformations.length; i++)
      FieldTransformation.internalBinaryWrite(
        message.fieldTransformations[i],
        writer.tag(25, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.ignoreAllTransformations !== void 0)
      writer.tag(26, import_runtime.WireType.Varint).bool(message.ignoreAllTransformations);
    if (message.getters !== void 0)
      writer.tag(27, import_runtime.WireType.Varint).bool(message.getters);
    if (message.scala3Sources !== void 0)
      writer.tag(28, import_runtime.WireType.Varint).bool(message.scala3Sources);
    if (message.testOnlyNoJavaConversions !== void 0)
      writer.tag(999, import_runtime.WireType.Varint).bool(message.testOnlyNoJavaConversions);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ScalaPbOptions = new ScalaPbOptions$Type();
class ScalaPbOptions_AuxMessageOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.ScalaPbOptions.AuxMessageOptions", [
      {
        no: 1,
        name: "target",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 2,
        name: "options",
        kind: "message",
        T: () => MessageOptions
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string target */
        1:
          message.target = reader.string();
          break;
        case /* optional scalapb.MessageOptions options */
        2:
          message.options = MessageOptions.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.options
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.target !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.target);
    if (message.options)
      MessageOptions.internalBinaryWrite(
        message.options,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ScalaPbOptions_AuxMessageOptions = new ScalaPbOptions_AuxMessageOptions$Type();
class ScalaPbOptions_AuxFieldOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.ScalaPbOptions.AuxFieldOptions", [
      {
        no: 1,
        name: "target",
        kind: "scalar",
        opt: true,
        T: 9
      },
      { no: 2, name: "options", kind: "message", T: () => FieldOptions }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string target */
        1:
          message.target = reader.string();
          break;
        case /* optional scalapb.FieldOptions options */
        2:
          message.options = FieldOptions.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.options
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.target !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.target);
    if (message.options)
      FieldOptions.internalBinaryWrite(
        message.options,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ScalaPbOptions_AuxFieldOptions = new ScalaPbOptions_AuxFieldOptions$Type();
class ScalaPbOptions_AuxEnumOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.ScalaPbOptions.AuxEnumOptions", [
      {
        no: 1,
        name: "target",
        kind: "scalar",
        opt: true,
        T: 9
      },
      { no: 2, name: "options", kind: "message", T: () => EnumOptions }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string target */
        1:
          message.target = reader.string();
          break;
        case /* optional scalapb.EnumOptions options */
        2:
          message.options = EnumOptions.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.options
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.target !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.target);
    if (message.options)
      EnumOptions.internalBinaryWrite(
        message.options,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ScalaPbOptions_AuxEnumOptions = new ScalaPbOptions_AuxEnumOptions$Type();
class ScalaPbOptions_AuxEnumValueOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.ScalaPbOptions.AuxEnumValueOptions", [
      {
        no: 1,
        name: "target",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 2,
        name: "options",
        kind: "message",
        T: () => EnumValueOptions
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string target */
        1:
          message.target = reader.string();
          break;
        case /* optional scalapb.EnumValueOptions options */
        2:
          message.options = EnumValueOptions.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.options
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.target !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.target);
    if (message.options)
      EnumValueOptions.internalBinaryWrite(
        message.options,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ScalaPbOptions_AuxEnumValueOptions = new ScalaPbOptions_AuxEnumValueOptions$Type();
class MessageOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.MessageOptions", [
      {
        no: 1,
        name: "extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "companion_extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 3,
        name: "annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 4,
        name: "type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 5,
        name: "companion_annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 6,
        name: "sealed_oneof_extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 7,
        name: "no_box",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 8,
        name: "unknown_fields_annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 9,
        name: "no_default_values_in_constructor",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 10,
        name: "sealed_oneof_companion_extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 11,
        name: "derives",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 12,
        name: "sealed_oneof_derives",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.extends = [];
    message.companionExtends = [];
    message.annotations = [];
    message.companionAnnotations = [];
    message.sealedOneofExtends = [];
    message.unknownFieldsAnnotations = [];
    message.sealedOneofCompanionExtends = [];
    message.derives = [];
    message.sealedOneofDerives = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string extends */
        1:
          message.extends.push(reader.string());
          break;
        case /* repeated string companion_extends */
        2:
          message.companionExtends.push(reader.string());
          break;
        case /* repeated string annotations */
        3:
          message.annotations.push(reader.string());
          break;
        case /* optional string type */
        4:
          message.type = reader.string();
          break;
        case /* repeated string companion_annotations */
        5:
          message.companionAnnotations.push(reader.string());
          break;
        case /* repeated string sealed_oneof_extends */
        6:
          message.sealedOneofExtends.push(reader.string());
          break;
        case /* optional bool no_box */
        7:
          message.noBox = reader.bool();
          break;
        case /* repeated string unknown_fields_annotations */
        8:
          message.unknownFieldsAnnotations.push(reader.string());
          break;
        case /* optional bool no_default_values_in_constructor */
        9:
          message.noDefaultValuesInConstructor = reader.bool();
          break;
        case /* repeated string sealed_oneof_companion_extends */
        10:
          message.sealedOneofCompanionExtends.push(reader.string());
          break;
        case /* repeated string derives */
        11:
          message.derives.push(reader.string());
          break;
        case /* repeated string sealed_oneof_derives */
        12:
          message.sealedOneofDerives.push(reader.string());
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.extends.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.extends[i]);
    for (let i = 0; i < message.companionExtends.length; i++)
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.companionExtends[i]);
    for (let i = 0; i < message.annotations.length; i++)
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.annotations[i]);
    if (message.type !== void 0)
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.type);
    for (let i = 0; i < message.companionAnnotations.length; i++)
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.companionAnnotations[i]);
    for (let i = 0; i < message.sealedOneofExtends.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.sealedOneofExtends[i]);
    if (message.noBox !== void 0)
      writer.tag(7, import_runtime.WireType.Varint).bool(message.noBox);
    for (let i = 0; i < message.unknownFieldsAnnotations.length; i++)
      writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.unknownFieldsAnnotations[i]);
    if (message.noDefaultValuesInConstructor !== void 0)
      writer.tag(9, import_runtime.WireType.Varint).bool(message.noDefaultValuesInConstructor);
    for (let i = 0; i < message.sealedOneofCompanionExtends.length; i++)
      writer.tag(10, import_runtime.WireType.LengthDelimited).string(message.sealedOneofCompanionExtends[i]);
    for (let i = 0; i < message.derives.length; i++)
      writer.tag(11, import_runtime.WireType.LengthDelimited).string(message.derives[i]);
    for (let i = 0; i < message.sealedOneofDerives.length; i++)
      writer.tag(12, import_runtime.WireType.LengthDelimited).string(message.sealedOneofDerives[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const MessageOptions = new MessageOptions$Type();
class Collection$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.Collection", [
      {
        no: 1,
        name: "type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 2,
        name: "non_empty",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 3,
        name: "adapter",
        kind: "scalar",
        opt: true,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string type */
        1:
          message.type = reader.string();
          break;
        case /* optional bool non_empty */
        2:
          message.nonEmpty = reader.bool();
          break;
        case /* optional string adapter */
        3:
          message.adapter = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.type !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.type);
    if (message.nonEmpty !== void 0)
      writer.tag(2, import_runtime.WireType.Varint).bool(message.nonEmpty);
    if (message.adapter !== void 0)
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.adapter);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Collection = new Collection$Type();
class FieldOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.FieldOptions", [
      {
        no: 1,
        name: "type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 2,
        name: "scala_name",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 3,
        name: "collection_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      { no: 8, name: "collection", kind: "message", T: () => Collection },
      {
        no: 4,
        name: "key_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 5,
        name: "value_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 6,
        name: "annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 7,
        name: "map_type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 9,
        name: "no_default_value_in_constructor",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 30,
        name: "no_box",
        kind: "scalar",
        opt: true,
        T: 8
      },
      {
        no: 31,
        name: "required",
        kind: "scalar",
        opt: true,
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.annotations = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional string type */
        1:
          message.type = reader.string();
          break;
        case /* optional string scala_name */
        2:
          message.scalaName = reader.string();
          break;
        case /* optional string collection_type */
        3:
          message.collectionType = reader.string();
          break;
        case /* optional scalapb.Collection collection */
        8:
          message.collection = Collection.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.collection
          );
          break;
        case /* optional string key_type */
        4:
          message.keyType = reader.string();
          break;
        case /* optional string value_type */
        5:
          message.valueType = reader.string();
          break;
        case /* repeated string annotations */
        6:
          message.annotations.push(reader.string());
          break;
        case /* optional string map_type */
        7:
          message.mapType = reader.string();
          break;
        case /* optional bool no_default_value_in_constructor */
        9:
          message.noDefaultValueInConstructor = reader.bool();
          break;
        case /* optional bool no_box */
        30:
          message.noBox = reader.bool();
          break;
        case /* optional bool required */
        31:
          message.required = reader.bool();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.type !== void 0)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.type);
    if (message.scalaName !== void 0)
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.scalaName);
    if (message.collectionType !== void 0)
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.collectionType);
    if (message.keyType !== void 0)
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.keyType);
    if (message.valueType !== void 0)
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.valueType);
    for (let i = 0; i < message.annotations.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.annotations[i]);
    if (message.mapType !== void 0)
      writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.mapType);
    if (message.collection)
      Collection.internalBinaryWrite(
        message.collection,
        writer.tag(8, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.noDefaultValueInConstructor !== void 0)
      writer.tag(9, import_runtime.WireType.Varint).bool(message.noDefaultValueInConstructor);
    if (message.noBox !== void 0)
      writer.tag(30, import_runtime.WireType.Varint).bool(message.noBox);
    if (message.required !== void 0)
      writer.tag(31, import_runtime.WireType.Varint).bool(message.required);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const FieldOptions = new FieldOptions$Type();
class EnumOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.EnumOptions", [
      {
        no: 1,
        name: "extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "companion_extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 3,
        name: "type",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 4,
        name: "base_annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 5,
        name: "recognized_annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 6,
        name: "unrecognized_annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.extends = [];
    message.companionExtends = [];
    message.baseAnnotations = [];
    message.recognizedAnnotations = [];
    message.unrecognizedAnnotations = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string extends */
        1:
          message.extends.push(reader.string());
          break;
        case /* repeated string companion_extends */
        2:
          message.companionExtends.push(reader.string());
          break;
        case /* optional string type */
        3:
          message.type = reader.string();
          break;
        case /* repeated string base_annotations */
        4:
          message.baseAnnotations.push(reader.string());
          break;
        case /* repeated string recognized_annotations */
        5:
          message.recognizedAnnotations.push(reader.string());
          break;
        case /* repeated string unrecognized_annotations */
        6:
          message.unrecognizedAnnotations.push(reader.string());
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.extends.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.extends[i]);
    for (let i = 0; i < message.companionExtends.length; i++)
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.companionExtends[i]);
    if (message.type !== void 0)
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.type);
    for (let i = 0; i < message.baseAnnotations.length; i++)
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.baseAnnotations[i]);
    for (let i = 0; i < message.recognizedAnnotations.length; i++)
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.recognizedAnnotations[i]);
    for (let i = 0; i < message.unrecognizedAnnotations.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.unrecognizedAnnotations[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const EnumOptions = new EnumOptions$Type();
class EnumValueOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.EnumValueOptions", [
      {
        no: 1,
        name: "extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "scala_name",
        kind: "scalar",
        opt: true,
        T: 9
      },
      {
        no: 3,
        name: "annotations",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.extends = [];
    message.annotations = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string extends */
        1:
          message.extends.push(reader.string());
          break;
        case /* optional string scala_name */
        2:
          message.scalaName = reader.string();
          break;
        case /* repeated string annotations */
        3:
          message.annotations.push(reader.string());
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.extends.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.extends[i]);
    if (message.scalaName !== void 0)
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.scalaName);
    for (let i = 0; i < message.annotations.length; i++)
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.annotations[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const EnumValueOptions = new EnumValueOptions$Type();
class OneofOptions$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.OneofOptions", [
      {
        no: 1,
        name: "extends",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "scala_name",
        kind: "scalar",
        opt: true,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.extends = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string extends */
        1:
          message.extends.push(reader.string());
          break;
        case /* optional string scala_name */
        2:
          message.scalaName = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.extends.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.extends[i]);
    if (message.scalaName !== void 0)
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.scalaName);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const OneofOptions = new OneofOptions$Type();
class FieldTransformation$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.FieldTransformation", [
      {
        no: 1,
        name: "when",
        kind: "message",
        T: () => import_descriptor2.FieldDescriptorProto
      },
      {
        no: 2,
        name: "match_type",
        kind: "enum",
        opt: true,
        T: () => ["scalapb.MatchType", MatchType]
      },
      { no: 3, name: "set", kind: "message", T: () => import_descriptor.FieldOptions }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* optional google.protobuf.FieldDescriptorProto when */
        1:
          message.when = import_descriptor2.FieldDescriptorProto.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.when
          );
          break;
        case /* optional scalapb.MatchType match_type = 2 [default = CONTAINS] */
        2:
          message.matchType = reader.int32();
          break;
        case /* optional google.protobuf.FieldOptions set */
        3:
          message.set = import_descriptor.FieldOptions.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.set
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.when)
      import_descriptor2.FieldDescriptorProto.internalBinaryWrite(
        message.when,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.matchType !== void 0)
      writer.tag(2, import_runtime.WireType.Varint).int32(message.matchType);
    if (message.set)
      import_descriptor.FieldOptions.internalBinaryWrite(
        message.set,
        writer.tag(3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const FieldTransformation = new FieldTransformation$Type();
class PreprocessorOutput$Type extends import_runtime4.MessageType {
  constructor() {
    super("scalapb.PreprocessorOutput", [
      {
        no: 1,
        name: "options_by_file",
        kind: "map",
        K: 9,
        V: { kind: "message", T: () => ScalaPbOptions }
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.optionsByFile = {};
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* map<string, scalapb.ScalaPbOptions> options_by_file */
        1:
          this.binaryReadMap1(message.optionsByFile, reader, options);
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  binaryReadMap1(map, reader, options) {
    let len = reader.uint32(), end = reader.pos + len, key, val;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case 1:
          key = reader.string();
          break;
        case 2:
          val = ScalaPbOptions.internalBinaryRead(
            reader,
            reader.uint32(),
            options
          );
          break;
        default:
          throw new globalThis.Error(
            "unknown map entry field for scalapb.PreprocessorOutput.options_by_file"
          );
      }
    }
    map[key ?? ""] = val ?? ScalaPbOptions.create();
  }
  internalBinaryWrite(message, writer, options) {
    for (let k of globalThis.Object.keys(message.optionsByFile)) {
      writer.tag(1, import_runtime.WireType.LengthDelimited).fork().tag(1, import_runtime.WireType.LengthDelimited).string(k);
      writer.tag(2, import_runtime.WireType.LengthDelimited).fork();
      ScalaPbOptions.internalBinaryWrite(
        message.optionsByFile[k],
        writer,
        options
      );
      writer.join().join();
    }
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PreprocessorOutput = new PreprocessorOutput$Type();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Collection,
  EnumOptions,
  EnumValueOptions,
  FieldOptions,
  FieldTransformation,
  MatchType,
  MessageOptions,
  OneofOptions,
  PreprocessorOutput,
  ScalaPbOptions,
  ScalaPbOptions_AuxEnumOptions,
  ScalaPbOptions_AuxEnumValueOptions,
  ScalaPbOptions_AuxFieldOptions,
  ScalaPbOptions_AuxMessageOptions,
  ScalaPbOptions_EnumValueNaming,
  ScalaPbOptions_OptionsScope
});
//# sourceMappingURL=scalapb.cjs.map