package h3;

import android.content.Context;
import androidx.compose.runtime.MutableState;
import java.util.Iterator;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class V1 extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ V2.T2 f17525a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ J4.c f17526b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Context f17527c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ J4.c f17528d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ MutableState f17530f;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ MutableState f17531j;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public V1(V2.T2 t22, J4.c cVar, Context context, J4.c cVar2, MutableState mutableState, MutableState mutableState2, MutableState mutableState3, A4.d dVar) {
        super(2, dVar);
        this.f17525a = t22;
        this.f17526b = cVar;
        this.f17527c = context;
        this.f17528d = cVar2;
        this.f17529e = mutableState;
        this.f17530f = mutableState2;
        this.f17531j = mutableState3;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new V1(this.f17525a, this.f17526b, this.f17527c, this.f17528d, this.f17529e, this.f17530f, this.f17531j, dVar);
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((V1) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x0099  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        Object next;
        B4.a aVar = B4.a.f492a;
        AbstractC2467b.l(obj);
        V2.T2 t22 = this.f17525a;
        long j4 = t22.f7552j;
        String str = t22.f7553k;
        C3137A c3137a = C3137A.f25453a;
        if (j4 > 0 && str != null && !S4.p.Q0(str) && !t22.f7544b && !t22.f7545c) {
            Iterator it = t22.f7543a.iterator();
            while (true) {
                if (!it.hasNext()) {
                    next = null;
                    break;
                }
                next = it.next();
                if (kotlin.jvm.internal.o.c(((V2.R2) next).f7513a, str)) {
                    break;
                }
            }
            V2.R2 r22 = (V2.R2) next;
            if (r22 == null) {
                return c3137a;
            }
            this.f17526b.invoke(new Long(j4));
            String profileKey = r22.f7513a;
            if (!kotlin.jvm.internal.o.c(profileKey, "kids")) {
                Context context = this.f17527c;
                kotlin.jvm.internal.o.h(context, "context");
                kotlin.jvm.internal.o.h(profileKey, "profileKey");
                boolean z6 = false;
                String string = context.getApplicationContext().getSharedPreferences("debridstream_profile_pins", 0).getString(profileKey, null);
                if (string != null && string.length() == 4) {
                    z6 = true;
                }
                if (z6) {
                    w4.p pVar = Z1.f17674a;
                    this.f17529e.setValue(r22);
                    this.f17530f.setValue("");
                    this.f17531j.setValue(null);
                } else {
                    this.f17528d.invoke(r22);
                }
            }
        }
        return c3137a;
    }
}
