//@ts-nocheck
import * as _m0 from "protobufjs/minimal";
import { isSet } from "../../../helpers";
/** AuthenticatorAddedEvent is an event triggered on Authenticator addition */

/** AuthenticatorAddedEvent is an event triggered on Authenticator addition */

/** AuthenticatorRemovedEvent is an event triggered on Authenticator removal */

/** AuthenticatorRemovedEvent is an event triggered on Authenticator removal */

/**
 * AuthenticatorSetActiveStateEvent is an event triggered on Authenticator
 * active state change
 */

/**
 * AuthenticatorSetActiveStateEvent is an event triggered on Authenticator
 * active state change
 */

function createBaseAuthenticatorAddedEvent() {
  return {
    sender: "",
    authenticatorType: "",
    authenticatorId: ""
  };
}
export const AuthenticatorAddedEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.sender !== "") {
      writer.uint32(10).string(message.sender);
    }
    if (message.authenticatorType !== "") {
      writer.uint32(18).string(message.authenticatorType);
    }
    if (message.authenticatorId !== "") {
      writer.uint32(26).string(message.authenticatorId);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseAuthenticatorAddedEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.sender = reader.string();
          break;
        case 2:
          message.authenticatorType = reader.string();
          break;
        case 3:
          message.authenticatorId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      sender: isSet(object.sender) ? String(object.sender) : "",
      authenticatorType: isSet(object.authenticatorType) ? String(object.authenticatorType) : "",
      authenticatorId: isSet(object.authenticatorId) ? String(object.authenticatorId) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.sender !== undefined && (obj.sender = message.sender);
    message.authenticatorType !== undefined && (obj.authenticatorType = message.authenticatorType);
    message.authenticatorId !== undefined && (obj.authenticatorId = message.authenticatorId);
    return obj;
  },
  fromPartial(object) {
    var _object$sender, _object$authenticator, _object$authenticator2;
    const message = createBaseAuthenticatorAddedEvent();
    message.sender = (_object$sender = object.sender) !== null && _object$sender !== void 0 ? _object$sender : "";
    message.authenticatorType = (_object$authenticator = object.authenticatorType) !== null && _object$authenticator !== void 0 ? _object$authenticator : "";
    message.authenticatorId = (_object$authenticator2 = object.authenticatorId) !== null && _object$authenticator2 !== void 0 ? _object$authenticator2 : "";
    return message;
  }
};
function createBaseAuthenticatorRemovedEvent() {
  return {
    sender: "",
    authenticatorId: ""
  };
}
export const AuthenticatorRemovedEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.sender !== "") {
      writer.uint32(10).string(message.sender);
    }
    if (message.authenticatorId !== "") {
      writer.uint32(18).string(message.authenticatorId);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseAuthenticatorRemovedEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.sender = reader.string();
          break;
        case 2:
          message.authenticatorId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      sender: isSet(object.sender) ? String(object.sender) : "",
      authenticatorId: isSet(object.authenticatorId) ? String(object.authenticatorId) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.sender !== undefined && (obj.sender = message.sender);
    message.authenticatorId !== undefined && (obj.authenticatorId = message.authenticatorId);
    return obj;
  },
  fromPartial(object) {
    var _object$sender2, _object$authenticator3;
    const message = createBaseAuthenticatorRemovedEvent();
    message.sender = (_object$sender2 = object.sender) !== null && _object$sender2 !== void 0 ? _object$sender2 : "";
    message.authenticatorId = (_object$authenticator3 = object.authenticatorId) !== null && _object$authenticator3 !== void 0 ? _object$authenticator3 : "";
    return message;
  }
};
function createBaseAuthenticatorSetActiveStateEvent() {
  return {
    sender: "",
    isSmartAccountActive: false
  };
}
export const AuthenticatorSetActiveStateEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.sender !== "") {
      writer.uint32(10).string(message.sender);
    }
    if (message.isSmartAccountActive === true) {
      writer.uint32(16).bool(message.isSmartAccountActive);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseAuthenticatorSetActiveStateEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.sender = reader.string();
          break;
        case 2:
          message.isSmartAccountActive = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      sender: isSet(object.sender) ? String(object.sender) : "",
      isSmartAccountActive: isSet(object.isSmartAccountActive) ? Boolean(object.isSmartAccountActive) : false
    };
  },
  toJSON(message) {
    const obj = {};
    message.sender !== undefined && (obj.sender = message.sender);
    message.isSmartAccountActive !== undefined && (obj.isSmartAccountActive = message.isSmartAccountActive);
    return obj;
  },
  fromPartial(object) {
    var _object$sender3, _object$isSmartAccoun;
    const message = createBaseAuthenticatorSetActiveStateEvent();
    message.sender = (_object$sender3 = object.sender) !== null && _object$sender3 !== void 0 ? _object$sender3 : "";
    message.isSmartAccountActive = (_object$isSmartAccoun = object.isSmartAccountActive) !== null && _object$isSmartAccoun !== void 0 ? _object$isSmartAccoun : false;
    return message;
  }
};