var o = Object.defineProperty;
var n = (e, t) => o(e, "name", { value: t, configurable: !0 });
class h {
  static {
    n(this, "InternalFieldList");
  }
  constructor(t, s) {
    this._fields = t, this._normalizer = s;
  }
  findJsonName(t) {
    if (!this.jsonNames) {
      const s = {};
      for (const i of this.list())
        s[i.jsonName] = s[i.name] = i;
      this.jsonNames = s;
    }
    return this.jsonNames[t];
  }
  find(t) {
    if (!this.numbers) {
      const s = {};
      for (const i of this.list())
        s[i.no] = i;
      this.numbers = s;
    }
    return this.numbers[t];
  }
  list() {
    return this.all || (this.all = this._normalizer(this._fields)), this.all;
  }
  byNumber() {
    return this.numbersAsc || (this.numbersAsc = this.list().concat().sort((t, s) => t.no - s.no)), this.numbersAsc;
  }
  byMember() {
    if (!this.members) {
      this.members = [];
      const t = this.members;
      let s;
      for (const i of this.list())
        i.oneof ? i.oneof !== s && (s = i.oneof, t.push(s)) : t.push(i);
    }
    return this.members;
  }
}
export {
  h as InternalFieldList
};
