package D;

import C0.C0104e;
import I0.AbstractC0300j0;
import J0.C0358f0;
import J0.C0395y0;
import J0.Z0;
import K.V0;
import M2.AbstractC0535o0;
import T0.AbstractC0602m;
import T0.C0594e;
import T0.C0600k;
import T0.C0601l;
import V2.L3;
import V2.R2;
import android.app.PendingIntent;
import androidx.compose.runtime.MutableIntState;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import androidx.compose.runtime.collection.MutableVector;
import com.debridstream.tv.data.home.HomeMetaItem;
import com.debridstream.tv.screens.CloudManagerViewModel;
import d3.v2;
import h3.AbstractC2211w1;
import h3.C3;
import h3.E0;
import h3.G3;
import h3.Z1;
import j$.time.LocalDateTime;
import java.util.List;
import o0.C2632c;
import q.AbstractC2761L;
import w4.C3137A;
import x.C3144a;
import x.C3162g;
import x.C3171j;
import x.InterfaceC3153d;
import x.L1;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class q implements J4.a {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Object f849d;

    public /* synthetic */ q(MutableState mutableState, State state, MutableState mutableState2) {
        this.f846a = 8;
        this.f848c = mutableState;
        this.f847b = state;
        this.f849d = mutableState2;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:69:0x0196  */
    @Override // J4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke() throws PendingIntent.CanceledException {
        Long lValueOf;
        C3137A c3137a = C3137A.f25453a;
        Object obj = this.f848c;
        Object obj2 = this.f849d;
        Object obj3 = this.f847b;
        switch (this.f846a) {
            case 0:
                l lVar = (l) ((State) obj3).getValue();
                H h5 = (H) obj;
                break;
            case 1:
                break;
            case 2:
                H.j jVar = (H.j) obj3;
                C2632c c2632cT0 = H.j.t0(jVar, (AbstractC0300j0) obj, (C0104e) obj2);
                if (c2632cT0 != null) {
                    C3171j c3171j = jVar.f2090a;
                    if (h1.l.a(c3171j.f25841k, 0L)) {
                        A.b.c("Expected BringIntoViewRequester to not be used before parents are placed.");
                    }
                }
                break;
            case 3:
                C0358f0 c0358f0 = (C0358f0) obj2;
                AbstractC0602m abstractC0602m = (AbstractC0602m) ((C0594e) obj).f6503a;
                ((V0) obj3).getClass();
                if (abstractC0602m instanceof C0601l) {
                    ((C0601l) abstractC0602m).getClass();
                    try {
                        c0358f0.a(((C0601l) abstractC0602m).f6525a);
                    } catch (IllegalArgumentException unused) {
                    }
                } else if (abstractC0602m instanceof C0600k) {
                    ((C0600k) abstractC0602m).getClass();
                }
                break;
            case 4:
                float f6 = AbstractC0535o0.f4860g;
                ((J4.f) obj3).invoke(null, Integer.valueOf(((MutableIntState) obj2).getIntValue()), Integer.valueOf(((X2.i) obj).f8597e));
                break;
            case 5:
                ((J4.c) obj3).invoke((HomeMetaItem) obj);
                ((MutableState) obj2).setValue(null);
                break;
            case 6:
                break;
            case 7:
                break;
            case 8:
                MutableState mutableState = (MutableState) obj;
                if (v2.J(mutableState) > 0) {
                    State state = (State) obj3;
                    lValueOf = ((Number) state.getValue()).longValue() < ((Number) mutableState.getValue()).longValue() ? Long.valueOf(((Number) mutableState.getValue()).longValue() - ((Number) state.getValue()).longValue()) : null;
                }
                String strN = lValueOf != null ? A0.a.n("Ends at ", ((LocalDateTime) ((MutableState) obj2).getValue()).plusSeconds(lValueOf.longValue() / 1000).format(v2.f16088c)) : null;
                if (strN == null) {
                }
                break;
            case 9:
                if (!((List) obj3).isEmpty()) {
                    ((CloudManagerViewModel) obj).goBackFolder();
                } else {
                    ((J4.a) obj2).invoke();
                }
                break;
            case 10:
                ((MutableState) obj).setValue(Boolean.FALSE);
                V4.E.y((V4.C) obj3, null, null, new E0((n0.x) obj2, null), 3);
                break;
            case 11:
                a3.J j4 = (a3.J) obj3;
                if (AbstractC2211w1.e((MutableState) obj2) || ((Boolean) j4.f10562b.invoke()).booleanValue()) {
                    j4.f10561a.invoke();
                } else {
                    ((J4.a) obj).invoke();
                }
                break;
            case 12:
                ((J4.c) obj3).invoke(((R2) obj).f7513a);
                w4.p pVar = Z1.f17674a;
                ((MutableState) obj2).setValue(null);
                break;
            case 13:
                n0.k.a((n0.k) obj3);
                Z0 z02 = (Z0) obj;
                if (z02 != null) {
                    ((C0395y0) z02).a();
                }
                ((J4.a) obj2).invoke();
                break;
            case 14:
                break;
            case 15:
                MutableState mutableState2 = (MutableState) obj3;
                mutableState2.setValue(null);
                String string = S4.p.o1((String) ((MutableState) obj).getValue()).toString();
                if (string.length() != 0) {
                    L3 l32 = L3.f7428a;
                    Object objU = L3.u(string);
                    if (!(objU instanceof w4.m)) {
                        ((J4.c) obj2).invoke(string);
                    }
                    Throwable thA = w4.n.a(objU);
                    if (thA != null) {
                        String message = thA.getMessage();
                        if (message == null) {
                            message = "Invalid add-on URL";
                        }
                        mutableState2.setValue(message);
                    }
                } else {
                    mutableState2.setValue("Please enter an add-on URL");
                }
                break;
            case 16:
                float f7 = G3.f16846a;
                ((MutableState) obj).setValue(Boolean.FALSE);
                V4.E.y((V4.C) obj3, null, null, new C3((String) obj2, null), 3);
                break;
            default:
                C3171j c3171j2 = (C3171j) obj3;
                C3144a c3144a = c3171j2.f25839f;
                while (true) {
                    if (c3144a.f25742a.getSize() != 0) {
                        MutableVector mutableVector = c3144a.f25742a;
                        C2632c c2632c = (C2632c) ((C3162g) mutableVector.last()).f25784a.invoke();
                        if (c2632c == null ? true : C3171j.u0(c3171j2, c2632c, 0L, 0L, 3)) {
                            ((C3162g) AbstractC2761L.e(1, mutableVector)).f25785b.resumeWith(c3137a);
                        }
                    }
                }
                if (c3171j2.f25840j) {
                    C2632c c2632c2 = (C2632c) c3171j2.f25838e.invoke();
                    if (c2632c2 != null && C3171j.u0(c3171j2, c2632c2, 0L, 0L, 3)) {
                        c3171j2.f25840j = false;
                    }
                }
                ((L1) obj).f25627e = C3171j.t0(c3171j2, (InterfaceC3153d) obj2, 0L);
                break;
        }
        return c3137a;
        return c3137a;
    }

    public /* synthetic */ q(Object obj, Object obj2, Object obj3, int i6) {
        this.f846a = i6;
        this.f847b = obj;
        this.f848c = obj2;
        this.f849d = obj3;
    }
}
