package defpackage; import c.a.q.m0.c.e; import com.discord.rtcconnection.mediaengine.MediaEngineConnection; import d0.g0.w; import d0.z.d.m; import d0.z.d.o; import java.util.Objects; import kotlin.Unit; import kotlin.jvm.functions.Function1; /* compiled from: kotlin-style lambda group */ /* renamed from: l reason: default package */ public final class l extends o implements Function1 { public final /* synthetic */ int i; public final /* synthetic */ Object j; public final /* synthetic */ Object k; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public l(int i, Object obj, Object obj2) { super(1); this.i = i; this.j = obj; this.k = obj2; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kotlin.jvm.functions.Function1 public final Unit invoke(MediaEngineConnection.d dVar) { MediaEngineConnection.FailedConnectionException.FailureType failureType; int i = this.i; if (i == 0) { MediaEngineConnection.d dVar2 = dVar; m.checkNotNullParameter(dVar2, "it"); e eVar = (e) this.j; dVar2.onConnected(eVar, (MediaEngineConnection.TransportInfo) this.k, eVar.j); return Unit.a; } else if (i == 1) { MediaEngineConnection.d dVar3 = dVar; m.checkNotNullParameter(dVar3, "it"); dVar3.onError((e) this.j, new MediaEngineConnection.FailedConnectionException("No connection info. Error message from media engine: " + ((String) this.k), MediaEngineConnection.FailedConnectionException.FailureType.NO_CONNECTION_INFO)); return Unit.a; } else if (i == 2) { MediaEngineConnection.d dVar4 = dVar; m.checkNotNullParameter(dVar4, "it"); e eVar2 = (e) this.j; String str = (String) this.k; Objects.requireNonNull(MediaEngineConnection.FailedConnectionException.FailureType.Companion); boolean z2 = false; if (str != null ? w.contains((CharSequence) str, (CharSequence) "Disconnected before we managed to connect", true) : false) { failureType = MediaEngineConnection.FailedConnectionException.FailureType.DISCONNECTED_BEFORE_CONNECTION_ESTABLISHED; } else { if (str != null ? w.contains((CharSequence) str, (CharSequence) "OnConnectAttemptTimedOut", true) : false) { failureType = MediaEngineConnection.FailedConnectionException.FailureType.TIMEOUT; } else { if (str != null) { z2 = w.contains((CharSequence) str, (CharSequence) "OnAddressIPResolved", true); } failureType = z2 ? MediaEngineConnection.FailedConnectionException.FailureType.ADDRESS_IP_RESOLVED : MediaEngineConnection.FailedConnectionException.FailureType.UNKNOWN; } } dVar4.onError(eVar2, new MediaEngineConnection.FailedConnectionException(str, failureType)); return Unit.a; } else { throw null; } } }