package q;

import F.C0171z;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.MutableLongState;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.SnapshotLongStateKt;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.State;
import androidx.compose.runtime.snapshots.SnapshotStateList;
import c0.C1217r;

/* JADX INFO: loaded from: classes.dex */
public final class A0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final F.I f23134a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final A0 f23135b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final String f23136c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final MutableState f23137d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final MutableLongState f23139f = SnapshotLongStateKt.mutableLongStateOf(0);

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final MutableLongState f23140g = SnapshotLongStateKt.mutableLongStateOf(Long.MIN_VALUE);

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final MutableState f23141h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final SnapshotStateList f23142i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final SnapshotStateList f23143j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final MutableState f23144k;
    public final State l;

    public A0(F.I i6, A0 a02, String str) {
        this.f23134a = i6;
        this.f23135b = a02;
        this.f23136c = str;
        this.f23137d = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(i6.b(), null, 2, null);
        this.f23138e = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(new x0(i6.b(), i6.b()), null, 2, null);
        Boolean bool = Boolean.FALSE;
        this.f23141h = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(bool, null, 2, null);
        this.f23142i = SnapshotStateKt.mutableStateListOf();
        this.f23143j = SnapshotStateKt.mutableStateListOf();
        this.f23144k = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(bool, null, 2, null);
        this.l = SnapshotStateKt.derivedStateOf(new C2801t0(this, 1));
        i6.j(this);
    }

    public final void a(Object obj, Composer composer, int i6) {
        int i7;
        Composer composerStartRestartGroup = composer.startRestartGroup(-1493585151);
        if ((i6 & 6) == 0) {
            i7 = ((i6 & 8) == 0 ? composerStartRestartGroup.changed(obj) : composerStartRestartGroup.changedInstance(obj) ? 4 : 2) | i6;
        } else {
            i7 = i6;
        }
        if ((i6 & 48) == 0) {
            i7 |= composerStartRestartGroup.changed(this) ? 32 : 16;
        }
        if (composerStartRestartGroup.shouldExecute((i7 & 19) != 18, i7 & 1)) {
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventStart(-1493585151, i7, -1, "androidx.compose.animation.core.Transition.animateTo (Transition.kt:1180)");
            }
            if (g()) {
                composerStartRestartGroup.startReplaceGroup(416369985);
            } else {
                composerStartRestartGroup.startReplaceGroup(466062241);
                p(obj);
                int i8 = i7 & 112;
                boolean z6 = i8 == 32;
                Object objRememberedValue = composerStartRestartGroup.rememberedValue();
                if (z6 || objRememberedValue == Composer.Companion.getEmpty()) {
                    objRememberedValue = SnapshotStateKt.derivedStateOf(new C2801t0(this, 0));
                    composerStartRestartGroup.updateRememberedValue(objRememberedValue);
                }
                if (((Boolean) ((State) objRememberedValue).getValue()).booleanValue()) {
                    composerStartRestartGroup.startReplaceGroup(466470356);
                    Object objRememberedValue2 = composerStartRestartGroup.rememberedValue();
                    Composer.Companion companion = Composer.Companion;
                    if (objRememberedValue2 == companion.getEmpty()) {
                        objRememberedValue2 = EffectsKt.createCompositionCoroutineScope(A4.k.f106a, composerStartRestartGroup);
                        composerStartRestartGroup.updateRememberedValue(objRememberedValue2);
                    }
                    V4.C c6 = (V4.C) objRememberedValue2;
                    boolean zChangedInstance = composerStartRestartGroup.changedInstance(c6) | (i8 == 32);
                    Object objRememberedValue3 = composerStartRestartGroup.rememberedValue();
                    if (zChangedInstance || objRememberedValue3 == companion.getEmpty()) {
                        objRememberedValue3 = new C1217r(19, c6, this);
                        composerStartRestartGroup.updateRememberedValue(objRememberedValue3);
                    }
                    EffectsKt.DisposableEffect(c6, this, (J4.c) objRememberedValue3, composerStartRestartGroup, i8);
                } else {
                    composerStartRestartGroup.startReplaceGroup(416369985);
                }
                composerStartRestartGroup.endReplaceGroup();
            }
            composerStartRestartGroup.endReplaceGroup();
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventEnd();
            }
        } else {
            composerStartRestartGroup.skipToGroupEnd();
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new C0171z(this, obj, i6, 22));
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final long b() {
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        long jMax = 0;
        for (int i6 = 0; i6 < size; i6++) {
            jMax = Math.max(jMax, ((y0) snapshotStateList.get(i6)).f23485o.getLongValue());
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            jMax = Math.max(jMax, ((A0) snapshotStateList2.get(i7)).b());
        }
        return jMax;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void c() {
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i6 = 0; i6 < size; i6++) {
            y0 y0Var = (y0) snapshotStateList.get(i6);
            y0Var.f23480f = null;
            y0Var.f23479e = null;
            y0Var.l = false;
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            ((A0) snapshotStateList2.get(i7)).c();
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final boolean d() {
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i6 = 0; i6 < size; i6++) {
            if (((y0) snapshotStateList.get(i6)).f23479e != null) {
                return true;
            }
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            if (((A0) snapshotStateList2.get(i7)).d()) {
                return true;
            }
        }
        return false;
    }

    public final long e() {
        A0 a02 = this.f23135b;
        return a02 != null ? a02.e() : this.f23139f.getLongValue();
    }

    public final w0 f() {
        return (w0) this.f23138e.getValue();
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final boolean g() {
        return ((Boolean) this.f23144k.getValue()).booleanValue();
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void h(long j4, boolean z6) {
        MutableLongState mutableLongState = this.f23140g;
        long longValue = mutableLongState.getLongValue();
        F.I i6 = this.f23134a;
        if (longValue == Long.MIN_VALUE) {
            mutableLongState.setLongValue(j4);
            ((MutableState) i6.f1203a).setValue(Boolean.TRUE);
        } else if (!((Boolean) ((MutableState) i6.f1203a).getValue()).booleanValue()) {
            ((MutableState) i6.f1203a).setValue(Boolean.TRUE);
        }
        this.f23141h.setValue(Boolean.FALSE);
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        boolean z7 = true;
        for (int i7 = 0; i7 < size; i7++) {
            y0 y0Var = (y0) snapshotStateList.get(i7);
            boolean zBooleanValue = ((Boolean) y0Var.f23481j.getValue()).booleanValue();
            MutableState mutableState = y0Var.f23481j;
            if (!zBooleanValue) {
                long jB = z6 ? y0Var.b().b() : j4;
                y0Var.d(y0Var.b().f(jB));
                y0Var.f23484n = y0Var.b().d(jB);
                if (y0Var.b().e(jB)) {
                    mutableState.setValue(Boolean.TRUE);
                }
            }
            if (!((Boolean) mutableState.getValue()).booleanValue()) {
                z7 = false;
            }
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i8 = 0; i8 < size2; i8++) {
            A0 a02 = (A0) snapshotStateList2.get(i8);
            T value = a02.f23137d.getValue();
            F.I i9 = a02.f23134a;
            if (!kotlin.jvm.internal.o.c(value, i9.b())) {
                a02.h(j4, z6);
            }
            if (!kotlin.jvm.internal.o.c(a02.f23137d.getValue(), i9.b())) {
                z7 = false;
            }
        }
        if (z7) {
            i();
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void i() {
        this.f23140g.setLongValue(Long.MIN_VALUE);
        F.I i6 = this.f23134a;
        if (i6 instanceof P) {
            ((P) i6).i(this.f23137d.getValue());
        }
        n(0L);
        ((MutableState) i6.f1203a).setValue(Boolean.FALSE);
        SnapshotStateList snapshotStateList = this.f23143j;
        int size = snapshotStateList.size();
        for (int i7 = 0; i7 < size; i7++) {
            ((A0) snapshotStateList.get(i7)).i();
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void j(float f6) {
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i6 = 0; i6 < size; i6++) {
            y0 y0Var = (y0) snapshotStateList.get(i6);
            y0Var.getClass();
            if (f6 == -4.0f || f6 == -5.0f) {
                C2799s0 c2799s0 = y0Var.f23480f;
                if (c2799s0 != null) {
                    y0Var.b().h(c2799s0.f23425c);
                    y0Var.f23479e = null;
                    y0Var.f23480f = null;
                }
                Object obj = f6 == -4.0f ? y0Var.b().f23426d : y0Var.b().f23425c;
                y0Var.b().h(obj);
                y0Var.b().i(obj);
                y0Var.d(obj);
                y0Var.f23485o.setLongValue(y0Var.b().b());
            } else {
                y0Var.f23482k.setFloatValue(f6);
            }
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            ((A0) snapshotStateList2.get(i7)).j(f6);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void k(Object obj, Object obj2) {
        this.f23140g.setLongValue(Long.MIN_VALUE);
        Boolean bool = Boolean.FALSE;
        F.I i6 = this.f23134a;
        ((MutableState) i6.f1203a).setValue(bool);
        boolean zG = g();
        MutableState mutableState = this.f23137d;
        if (!zG || !kotlin.jvm.internal.o.c(i6.b(), obj) || !kotlin.jvm.internal.o.c(mutableState.getValue(), obj2)) {
            if (!kotlin.jvm.internal.o.c(i6.b(), obj) && (i6 instanceof P)) {
                ((P) i6).i(obj);
            }
            mutableState.setValue(obj2);
            this.f23144k.setValue(Boolean.TRUE);
            this.f23138e.setValue(new x0(obj, obj2));
        }
        SnapshotStateList snapshotStateList = this.f23143j;
        int size = snapshotStateList.size();
        for (int i7 = 0; i7 < size; i7++) {
            A0 a02 = (A0) snapshotStateList.get(i7);
            kotlin.jvm.internal.o.f(a02, "null cannot be cast to non-null type androidx.compose.animation.core.Transition<kotlin.Any>");
            if (a02.g()) {
                a02.k(a02.f23134a.b(), a02.f23137d.getValue());
            }
        }
        SnapshotStateList snapshotStateList2 = this.f23142i;
        int size2 = snapshotStateList2.size();
        for (int i8 = 0; i8 < size2; i8++) {
            ((y0) snapshotStateList2.get(i8)).c(0L);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void l(long j4) {
        MutableLongState mutableLongState = this.f23140g;
        if (mutableLongState.getLongValue() == Long.MIN_VALUE) {
            mutableLongState.setLongValue(j4);
        }
        n(j4);
        this.f23141h.setValue(Boolean.FALSE);
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i6 = 0; i6 < size; i6++) {
            ((y0) snapshotStateList.get(i6)).c(j4);
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            A0 a02 = (A0) snapshotStateList2.get(i7);
            if (!kotlin.jvm.internal.o.c(a02.f23137d.getValue(), a02.f23134a.b())) {
                a02.l(j4);
            }
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void m(C2764a0 c2764a0) {
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i6 = 0; i6 < size; i6++) {
            y0 y0Var = (y0) snapshotStateList.get(i6);
            if (!kotlin.jvm.internal.o.c(y0Var.b().f23425c, y0Var.b().f23426d)) {
                y0Var.f23480f = y0Var.b();
                y0Var.f23479e = c2764a0;
            }
            MutableState mutableState = y0Var.f23483m;
            y0Var.f23478d.setValue(new C2799s0(y0Var.f23487q, y0Var.f23475a, mutableState.getValue(), mutableState.getValue(), y0Var.f23484n.c()));
            y0Var.f23485o.setLongValue(y0Var.b().b());
            y0Var.l = true;
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            ((A0) snapshotStateList2.get(i7)).m(c2764a0);
        }
    }

    public final void n(long j4) {
        if (this.f23135b == null) {
            this.f23139f.setLongValue(j4);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void o() {
        C2799s0 c2799s0;
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i6 = 0; i6 < size; i6++) {
            y0 y0Var = (y0) snapshotStateList.get(i6);
            C2764a0 c2764a0 = y0Var.f23479e;
            if (c2764a0 != null && (c2799s0 = y0Var.f23480f) != null) {
                long jE0 = L4.a.e0(c2764a0.f23269g * ((double) c2764a0.f23266d));
                Object objF = c2799s0.f(jE0);
                if (y0Var.l) {
                    y0Var.b().i(objF);
                }
                y0Var.b().h(objF);
                y0Var.f23485o.setLongValue(y0Var.b().b());
                if (y0Var.f23482k.getFloatValue() == -2.0f || y0Var.l) {
                    y0Var.d(objF);
                } else {
                    y0Var.c(y0Var.f23488r.e());
                }
                if (jE0 >= c2764a0.f23269g) {
                    y0Var.f23479e = null;
                    y0Var.f23480f = null;
                } else {
                    c2764a0.f23265c = false;
                }
            }
        }
        SnapshotStateList snapshotStateList2 = this.f23143j;
        int size2 = snapshotStateList2.size();
        for (int i7 = 0; i7 < size2; i7++) {
            ((A0) snapshotStateList2.get(i7)).o();
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void p(Object obj) {
        MutableState mutableState = this.f23137d;
        if (kotlin.jvm.internal.o.c(mutableState.getValue(), obj)) {
            return;
        }
        this.f23138e.setValue(new x0(mutableState.getValue(), obj));
        F.I i6 = this.f23134a;
        if (!kotlin.jvm.internal.o.c(i6.b(), mutableState.getValue())) {
            i6.i(mutableState.getValue());
        }
        mutableState.setValue(obj);
        if (this.f23140g.getLongValue() == Long.MIN_VALUE) {
            this.f23141h.setValue(Boolean.TRUE);
        }
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        for (int i7 = 0; i7 < size; i7++) {
            ((y0) snapshotStateList.get(i7)).f23482k.setFloatValue(-2.0f);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final String toString() {
        SnapshotStateList snapshotStateList = this.f23142i;
        int size = snapshotStateList.size();
        String str = "Transition animation values: ";
        for (int i6 = 0; i6 < size; i6++) {
            str = str + ((y0) snapshotStateList.get(i6)) + ", ";
        }
        return str;
    }
}
