package h3;

import android.view.KeyEvent;
import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public final class Y0 implements J4.c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f17603a = 0;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ boolean f17604b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ n0.x f17605c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ D.H f17606d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ int f17607e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ V4.C f17608f;

    public Y0(boolean z6, D.H h5, int i6, n0.x xVar, V4.C c6) {
        this.f17604b = z6;
        this.f17606d = h5;
        this.f17607e = i6;
        this.f17605c = xVar;
        this.f17608f = c6;
    }

    /* JADX WARN: Type inference failed for: r5v17, types: [java.lang.Iterable, java.lang.Object, java.util.Collection] */
    /* JADX WARN: Type inference failed for: r5v6, types: [java.lang.Iterable, java.lang.Object, java.util.Collection] */
    @Override // J4.c
    public final Object invoke(Object obj) {
        int i6;
        n0.x xVar;
        D.H h5;
        int i7;
        switch (this.f17603a) {
            case 0:
                KeyEvent event = ((A0.c) obj).f76a;
                kotlin.jvm.internal.o.h(event, "event");
                if (!W.d.y(this.f17604b, event)) {
                    D.H h6 = this.f17606d;
                    if (h6 != null && (i6 = this.f17607e) >= 0 && (xVar = this.f17605c) != null && event.getAction() == 0 && event.getKeyCode() == 21) {
                        ?? r5 = h6.i().f901k;
                        if (!r5.isEmpty()) {
                            Iterator it = r5.iterator();
                            while (it.hasNext()) {
                                if (((D.x) it.next()).f907a == i6) {
                                }
                            }
                        }
                        V4.E.y(this.f17608f, null, null, new X0(h6, i6, xVar, null), 3);
                    }
                    break;
                }
                break;
            default:
                KeyEvent event2 = ((A0.c) obj).f76a;
                kotlin.jvm.internal.o.h(event2, "event");
                if (!W.d.y(this.f17604b, event2)) {
                    n0.x xVar2 = this.f17605c;
                    if (xVar2 != null && (h5 = this.f17606d) != null && (i7 = this.f17607e) >= 0) {
                        if (event2.getAction() == 0 && event2.getKeyCode() == 22) {
                            ?? r52 = h5.i().f901k;
                            if (!r52.isEmpty()) {
                                Iterator it2 = r52.iterator();
                                while (it2.hasNext()) {
                                    if (((D.x) it2.next()).f907a == i7) {
                                    }
                                }
                            }
                            V4.E.y(this.f17608f, null, null, new C2205v1(h5, i7, xVar2, null), 3);
                        }
                        break;
                    }
                }
                break;
        }
        return Boolean.FALSE;
    }

    public Y0(boolean z6, n0.x xVar, D.H h5, int i6, V4.C c6) {
        this.f17604b = z6;
        this.f17605c = xVar;
        this.f17606d = h5;
        this.f17607e = i6;
        this.f17608f = c6;
    }
}
