package androidx.constraintlayout.motion.widget;

import a0.a0;
import a0.b0;
import a0.c0;
import a0.d0;
import a0.n;
import a0.q;
import a0.r;
import a0.s;
import a0.t;
import a0.u;
import a0.v;
import a0.w;
import a0.x;
import a0.y;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.Display;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.helper.widget.MotionEffect;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.h;
import androidx.constraintlayout.widget.o;
import androidx.core.view.i0;
import androidx.core.widget.NestedScrollView;
import com.google.android.gms.measurement.internal.u1;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import l.g2;
import l.l;
import v.m;
import w.d;
import x2.o0;
import xyz.stream.utils.f0;
import xyz.stream.utils.j0;

/* JADX INFO: loaded from: classes.dex */
public class MotionLayout extends ConstraintLayout implements i0 {

    /* JADX INFO: renamed from: g1, reason: collision with root package name */
    public static boolean f1093g1;
    public float A0;
    public boolean B0;
    public ArrayList C0;
    public ArrayList D0;
    public ArrayList E0;
    public CopyOnWriteArrayList F0;
    public int G0;
    public long H0;
    public float I0;
    public int J0;
    public float K0;
    public boolean L0;
    public int M0;
    public int N0;
    public int O0;
    public int P0;
    public int Q0;
    public b R;
    public int R0;
    public r S;
    public float S0;
    public Interpolator T;
    public final f0 T0;
    public float U;
    public boolean U0;
    public int V;
    public a V0;
    public int W;
    public Runnable W0;
    public final Rect X0;
    public boolean Y0;
    public TransitionState Z0;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public int f1094a0;
    public final v a1;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public int f1095b0;

    /* JADX INFO: renamed from: b1, reason: collision with root package name */
    public boolean f1096b1;

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public int f1097c0;

    /* JADX INFO: renamed from: c1, reason: collision with root package name */
    public final RectF f1098c1;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public boolean f1099d0;

    /* JADX INFO: renamed from: d1, reason: collision with root package name */
    public View f1100d1;

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    public final HashMap f1101e0;

    /* JADX INFO: renamed from: e1, reason: collision with root package name */
    public Matrix f1102e1;

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    public long f1103f0;

    /* JADX INFO: renamed from: f1, reason: collision with root package name */
    public final ArrayList f1104f1;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public float f1105g0;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public float f1106h0;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public float f1107i0;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public long f1108j0;

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public float f1109k0;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    public boolean f1110l0;

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    public boolean f1111m0;

    /* JADX INFO: renamed from: n0, reason: collision with root package name */
    public x f1112n0;

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    public int f1113o0;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    public u f1114p0;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public boolean f1115q0;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    public final z.a f1116r0;

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    public final t f1117s0;

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    public a0.a f1118t0;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    public int f1119u0;

    /* JADX INFO: renamed from: v0, reason: collision with root package name */
    public int f1120v0;

    /* JADX INFO: renamed from: w0, reason: collision with root package name */
    public boolean f1121w0;

    /* JADX INFO: renamed from: x0, reason: collision with root package name */
    public float f1122x0;

    /* JADX INFO: renamed from: y0, reason: collision with root package name */
    public float f1123y0;
    public long z0;

    /* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
    /* JADX WARN: Unknown enum class pattern. Please report as an issue! */
    public static final class TransitionState {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final TransitionState f1124a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public static final TransitionState f1125b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public static final TransitionState f1126c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public static final TransitionState f1127d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public static final /* synthetic */ TransitionState[] f1128e;

        static {
            TransitionState transitionState = new TransitionState("UNDEFINED", 0);
            f1124a = transitionState;
            TransitionState transitionState2 = new TransitionState("SETUP", 1);
            f1125b = transitionState2;
            TransitionState transitionState3 = new TransitionState("MOVING", 2);
            f1126c = transitionState3;
            TransitionState transitionState4 = new TransitionState("FINISHED", 3);
            f1127d = transitionState4;
            f1128e = new TransitionState[]{transitionState, transitionState2, transitionState3, transitionState4};
        }

        public static TransitionState valueOf(String str) {
            return (TransitionState) Enum.valueOf(TransitionState.class, str);
        }

        public static TransitionState[] values() {
            return (TransitionState[]) f1128e.clone();
        }
    }

    public MotionLayout(@NonNull Context context) {
        super(context);
        this.T = null;
        this.U = 0.0f;
        this.V = -1;
        this.W = -1;
        this.f1094a0 = -1;
        this.f1095b0 = 0;
        this.f1097c0 = 0;
        this.f1099d0 = true;
        this.f1101e0 = new HashMap();
        this.f1103f0 = 0L;
        this.f1105g0 = 1.0f;
        this.f1106h0 = 0.0f;
        this.f1107i0 = 0.0f;
        this.f1109k0 = 0.0f;
        this.f1111m0 = false;
        this.f1113o0 = 0;
        this.f1115q0 = false;
        this.f1116r0 = new z.a();
        this.f1117s0 = new t(this);
        this.f1121w0 = false;
        this.B0 = false;
        this.C0 = null;
        this.D0 = null;
        this.E0 = null;
        this.F0 = null;
        this.G0 = 0;
        this.H0 = -1L;
        this.I0 = 0.0f;
        this.J0 = 0;
        this.K0 = 0.0f;
        this.L0 = false;
        this.T0 = new f0(4);
        this.U0 = false;
        this.W0 = null;
        new HashMap();
        this.X0 = new Rect();
        this.Y0 = false;
        this.Z0 = TransitionState.f1124a;
        this.a1 = new v(this);
        this.f1096b1 = false;
        this.f1098c1 = new RectF();
        this.f1100d1 = null;
        this.f1102e1 = null;
        this.f1104f1 = new ArrayList();
        p(null);
    }

    public static Rect c(MotionLayout motionLayout, d dVar) {
        motionLayout.getClass();
        int iU = dVar.u();
        Rect rect = motionLayout.X0;
        rect.top = iU;
        rect.left = dVar.t();
        rect.right = dVar.s() + rect.left;
        rect.bottom = dVar.m() + rect.top;
        return rect;
    }

    /* JADX WARN: Removed duplicated region for block: B:123:0x0318  */
    /* JADX WARN: Removed duplicated region for block: B:134:0x0343  */
    /* JADX WARN: Removed duplicated region for block: B:139:0x0360  */
    /* JADX WARN: Removed duplicated region for block: B:142:0x0370  */
    /* JADX WARN: Removed duplicated region for block: B:147:0x0391  */
    /* JADX WARN: Removed duplicated region for block: B:148:0x039b  */
    /* JADX WARN: Removed duplicated region for block: B:151:0x03a8  */
    /* JADX WARN: Removed duplicated region for block: B:153:0x03b6  */
    /*  JADX ERROR: NullPointerException in pass: LoopRegionVisitor
        java.lang.NullPointerException: Cannot invoke "jadx.core.dex.instructions.args.SSAVar.use(jadx.core.dex.instructions.args.RegisterArg)" because "ssaVar" is null
        	at jadx.core.dex.nodes.InsnNode.rebindArgs(InsnNode.java:506)
        	at jadx.core.dex.nodes.InsnNode.rebindArgs(InsnNode.java:509)
        */
    @Override // androidx.constraintlayout.widget.ConstraintLayout, android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void dispatchDraw(android.graphics.Canvas r35) {
        /*
            Method dump skipped, instruction units count: 1323
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.motion.widget.MotionLayout.dispatchDraw(android.graphics.Canvas):void");
    }

    @IdRes
    public int[] getConstraintSetIds() {
        b bVar = this.R;
        if (bVar == null) {
            return null;
        }
        SparseArray sparseArray = bVar.f1140g;
        int size = sparseArray.size();
        int[] iArr = new int[size];
        for (int i10 = 0; i10 < size; i10++) {
            iArr[i10] = sparseArray.keyAt(i10);
        }
        return iArr;
    }

    public int getCurrentState() {
        return this.W;
    }

    public ArrayList<b0> getDefinedTransitions() {
        b bVar = this.R;
        if (bVar == null) {
            return null;
        }
        return bVar.f1137d;
    }

    public a0.a getDesignTool() {
        if (this.f1118t0 == null) {
            this.f1118t0 = new a0.a();
        }
        return this.f1118t0;
    }

    public int getEndState() {
        return this.f1094a0;
    }

    public long getNanoTime() {
        return System.nanoTime();
    }

    public float getProgress() {
        return this.f1107i0;
    }

    public b getScene() {
        return this.R;
    }

    public int getStartState() {
        return this.V;
    }

    public float getTargetPosition() {
        return this.f1109k0;
    }

    public Bundle getTransitionState() {
        if (this.V0 == null) {
            this.V0 = new a(this);
        }
        a aVar = this.V0;
        MotionLayout motionLayout = aVar.f1133e;
        aVar.f1132d = motionLayout.f1094a0;
        aVar.f1131c = motionLayout.V;
        aVar.f1130b = motionLayout.getVelocity();
        aVar.f1129a = motionLayout.getProgress();
        a aVar2 = this.V0;
        aVar2.getClass();
        Bundle bundle = new Bundle();
        bundle.putFloat("motion.progress", aVar2.f1129a);
        bundle.putFloat("motion.velocity", aVar2.f1130b);
        bundle.putInt("motion.StartState", aVar2.f1131c);
        bundle.putInt("motion.EndState", aVar2.f1132d);
        return bundle;
    }

    public long getTransitionTimeMs() {
        if (this.R != null) {
            this.f1105g0 = r0.c() / 1000.0f;
        }
        return (long) (this.f1105g0 * 1000.0f);
    }

    public float getVelocity() {
        return this.U;
    }

    public final void h(float f10) {
        if (this.R == null) {
            return;
        }
        float f11 = this.f1107i0;
        float f12 = this.f1106h0;
        if (f11 != f12 && this.f1110l0) {
            this.f1107i0 = f12;
        }
        float f13 = this.f1107i0;
        if (f13 == f10) {
            return;
        }
        this.f1115q0 = false;
        this.f1109k0 = f10;
        this.f1105g0 = r0.c() / 1000.0f;
        setProgress(this.f1109k0);
        this.S = null;
        this.T = this.R.e();
        this.f1110l0 = false;
        this.f1103f0 = getNanoTime();
        this.f1111m0 = true;
        this.f1106h0 = f13;
        this.f1107i0 = f13;
        invalidate();
    }

    public final void i(boolean z10) {
        int childCount = getChildCount();
        for (int i10 = 0; i10 < childCount; i10++) {
            q qVar = (q) this.f1101e0.get(getChildAt(i10));
            if (qVar != null && "button".equals(o6.b.q(qVar.f167b)) && qVar.A != null) {
                int i11 = 0;
                while (true) {
                    n[] nVarArr = qVar.A;
                    if (i11 < nVarArr.length) {
                        nVarArr[i11].h(z10 ? -100.0f : 100.0f, qVar.f167b);
                        i11++;
                    }
                }
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:112:0x01ae  */
    /* JADX WARN: Removed duplicated region for block: B:118:0x01bb  */
    /* JADX WARN: Removed duplicated region for block: B:121:0x01c8  */
    /* JADX WARN: Removed duplicated region for block: B:126:0x01e1  */
    /* JADX WARN: Removed duplicated region for block: B:129:0x01e9  */
    /* JADX WARN: Removed duplicated region for block: B:145:0x021b  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x00e2 A[PHI: r3
      0x00e2: PHI (r3v16 float) = (r3v15 float), (r3v17 float), (r3v17 float) binds: [B:47:0x00ad, B:58:0x00d6, B:60:0x00da] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:72:0x010f  */
    /* JADX WARN: Removed duplicated region for block: B:75:0x0118  */
    /* JADX WARN: Removed duplicated region for block: B:90:0x014d  */
    /* JADX WARN: Removed duplicated region for block: B:91:0x014f  */
    /* JADX WARN: Removed duplicated region for block: B:94:0x0157  */
    /* JADX WARN: Removed duplicated region for block: B:97:0x016e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void j(boolean z10) {
        boolean z11;
        char c6;
        TransitionState transitionState;
        int childCount;
        Interpolator interpolator;
        int i10;
        int i11;
        boolean z12;
        if (this.f1108j0 == -1) {
            this.f1108j0 = getNanoTime();
        }
        float f10 = this.f1107i0;
        if (f10 > 0.0f && f10 < 1.0f) {
            this.W = -1;
        }
        boolean z13 = false;
        if (this.B0 || (this.f1111m0 && (z10 || this.f1109k0 != f10))) {
            float fSignum = Math.signum(this.f1109k0 - f10);
            long nanoTime = getNanoTime();
            r rVar = this.S;
            float f11 = !(rVar instanceof r) ? (((nanoTime - this.f1108j0) * fSignum) * 1.0E-9f) / this.f1105g0 : 0.0f;
            float f12 = this.f1107i0 + f11;
            if (this.f1110l0) {
                f12 = this.f1109k0;
            }
            if ((fSignum <= 0.0f || f12 < this.f1109k0) && (fSignum > 0.0f || f12 > this.f1109k0)) {
                z11 = false;
            } else {
                f12 = this.f1109k0;
                this.f1111m0 = false;
                z11 = true;
            }
            this.f1107i0 = f12;
            this.f1106h0 = f12;
            this.f1108j0 = nanoTime;
            if (rVar == null || z11) {
                this.U = f11;
            } else if (this.f1115q0) {
                float interpolation = rVar.getInterpolation((nanoTime - this.f1103f0) * 1.0E-9f);
                r rVar2 = this.S;
                z.a aVar = this.f1116r0;
                c6 = rVar2 == aVar ? aVar.f36982c.a() ? (char) 2 : (char) 1 : (char) 0;
                this.f1107i0 = interpolation;
                this.f1108j0 = nanoTime;
                r rVar3 = this.S;
                if (rVar3 instanceof r) {
                    float fA = rVar3.a();
                    this.U = fA;
                    if (Math.abs(fA) * this.f1105g0 <= 1.0E-5f && c6 == 2) {
                        this.f1111m0 = false;
                    }
                    if (fA > 0.0f && interpolation >= 1.0f) {
                        this.f1107i0 = 1.0f;
                        this.f1111m0 = false;
                        interpolation = 1.0f;
                    }
                    if (fA >= 0.0f || interpolation > 0.0f) {
                        f12 = interpolation;
                    } else {
                        this.f1107i0 = 0.0f;
                        this.f1111m0 = false;
                        f12 = 0.0f;
                    }
                    if (Math.abs(this.U) > 1.0E-5f) {
                        setState(TransitionState.f1126c);
                    }
                    transitionState = TransitionState.f1127d;
                    if (c6 != 1) {
                        if ((fSignum > 0.0f && f12 >= this.f1109k0) || (fSignum <= 0.0f && f12 <= this.f1109k0)) {
                            f12 = this.f1109k0;
                            this.f1111m0 = false;
                        }
                        if (f12 >= 1.0f || f12 <= 0.0f) {
                            this.f1111m0 = false;
                            setState(transitionState);
                        }
                    }
                    childCount = getChildCount();
                    this.B0 = false;
                    long nanoTime2 = getNanoTime();
                    this.S0 = f12;
                    Interpolator interpolator2 = this.T;
                    float interpolation2 = interpolator2 != null ? f12 : interpolator2.getInterpolation(f12);
                    interpolator = this.T;
                    if (interpolator != null) {
                        float interpolation3 = interpolator.getInterpolation((fSignum / this.f1105g0) + f12);
                        this.U = interpolation3;
                        this.U = interpolation3 - this.T.getInterpolation(f12);
                    }
                    for (i10 = 0; i10 < childCount; i10++) {
                        View childAt = getChildAt(i10);
                        q qVar = (q) this.f1101e0.get(childAt);
                        if (qVar != null) {
                            this.B0 = qVar.f(interpolation2, nanoTime2, childAt, this.T0) | this.B0;
                        }
                    }
                    boolean z14 = (fSignum <= 0.0f && f12 >= this.f1109k0) || (fSignum <= 0.0f && f12 <= this.f1109k0);
                    if (!this.B0 && !this.f1111m0 && z14) {
                        setState(transitionState);
                    }
                    if (this.L0) {
                        requestLayout();
                    }
                    this.B0 = (!z14) | this.B0;
                    if (f12 > 0.0f || (i11 = this.V) == -1 || this.W == i11) {
                        z13 = false;
                    } else {
                        this.W = i11;
                        this.R.b(i11).a(this);
                        setState(transitionState);
                        z13 = true;
                    }
                    if (f12 >= 1.0d) {
                        int i12 = this.W;
                        int i13 = this.f1094a0;
                        if (i12 != i13) {
                            this.W = i13;
                            this.R.b(i13).a(this);
                            setState(transitionState);
                            z13 = true;
                        }
                    }
                    if (!this.B0 || this.f1111m0) {
                        invalidate();
                    } else if ((fSignum > 0.0f && f12 == 1.0f) || (fSignum < 0.0f && f12 == 0.0f)) {
                        setState(transitionState);
                    }
                    if (!this.B0 && !this.f1111m0 && ((fSignum > 0.0f && f12 == 1.0f) || (fSignum < 0.0f && f12 == 0.0f))) {
                        q();
                    }
                }
            } else {
                float interpolation4 = rVar.getInterpolation(f12);
                r rVar4 = this.S;
                if (rVar4 instanceof r) {
                    this.U = rVar4.a();
                } else {
                    this.U = ((rVar4.getInterpolation(f12 + f11) - interpolation4) * fSignum) / f11;
                }
                f12 = interpolation4;
            }
            c6 = 0;
            if (Math.abs(this.U) > 1.0E-5f) {
            }
            transitionState = TransitionState.f1127d;
            if (c6 != 1) {
            }
            childCount = getChildCount();
            this.B0 = false;
            long nanoTime22 = getNanoTime();
            this.S0 = f12;
            Interpolator interpolator22 = this.T;
            if (interpolator22 != null) {
            }
            interpolator = this.T;
            if (interpolator != null) {
            }
            while (i10 < childCount) {
            }
            if (fSignum <= 0.0f) {
                if (!this.B0) {
                    setState(transitionState);
                }
                if (this.L0) {
                }
                this.B0 = (!z14) | this.B0;
                if (f12 > 0.0f) {
                    z13 = false;
                    if (f12 >= 1.0d) {
                    }
                    if (this.B0) {
                        invalidate();
                        if (!this.B0) {
                            q();
                        }
                    }
                }
            } else {
                if (!this.B0) {
                }
                if (this.L0) {
                }
                this.B0 = (!z14) | this.B0;
                if (f12 > 0.0f) {
                }
            }
        }
        float f13 = this.f1107i0;
        if (f13 < 1.0f) {
            if (f13 <= 0.0f) {
                int i14 = this.W;
                int i15 = this.V;
                z12 = i14 == i15 ? z13 : true;
                this.W = i15;
            }
            this.f1096b1 |= z13;
            if (z13 && !this.U0) {
                requestLayout();
            }
            this.f1106h0 = this.f1107i0;
        }
        int i16 = this.W;
        int i17 = this.f1094a0;
        z12 = i16 == i17 ? z13 : true;
        this.W = i17;
        z13 = z12;
        this.f1096b1 |= z13;
        if (z13) {
            requestLayout();
        }
        this.f1106h0 = this.f1107i0;
    }

    public final void k() {
        CopyOnWriteArrayList copyOnWriteArrayList;
        CopyOnWriteArrayList copyOnWriteArrayList2;
        if ((this.f1112n0 == null && ((copyOnWriteArrayList2 = this.F0) == null || copyOnWriteArrayList2.isEmpty())) || this.K0 == this.f1106h0) {
            return;
        }
        if (this.J0 != -1 && (copyOnWriteArrayList = this.F0) != null) {
            Iterator it = copyOnWriteArrayList.iterator();
            while (it.hasNext()) {
                ((x) it.next()).getClass();
            }
        }
        this.J0 = -1;
        this.K0 = this.f1106h0;
        x xVar = this.f1112n0;
        if (xVar != null) {
            xVar.b();
        }
        CopyOnWriteArrayList copyOnWriteArrayList3 = this.F0;
        if (copyOnWriteArrayList3 != null) {
            Iterator it2 = copyOnWriteArrayList3.iterator();
            while (it2.hasNext()) {
                ((x) it2.next()).b();
            }
        }
    }

    public final void l() {
        CopyOnWriteArrayList copyOnWriteArrayList;
        if ((this.f1112n0 != null || ((copyOnWriteArrayList = this.F0) != null && !copyOnWriteArrayList.isEmpty())) && this.J0 == -1) {
            this.J0 = this.W;
            ArrayList arrayList = this.f1104f1;
            int iIntValue = !arrayList.isEmpty() ? ((Integer) u1.e(arrayList, 1)).intValue() : -1;
            int i10 = this.W;
            if (iIntValue != i10 && i10 != -1) {
                arrayList.add(Integer.valueOf(i10));
            }
        }
        r();
        Runnable runnable = this.W0;
        if (runnable != null) {
            runnable.run();
            this.W0 = null;
        }
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public final void loadLayoutDescription(int i10) {
        b0 b0Var;
        if (i10 == 0) {
            this.R = null;
            return;
        }
        try {
            b bVar = new b(getContext(), this, i10);
            this.R = bVar;
            int i11 = -1;
            if (this.W == -1) {
                this.W = bVar.h();
                this.V = this.R.h();
                b0 b0Var2 = this.R.f1136c;
                if (b0Var2 != null) {
                    i11 = b0Var2.f10c;
                }
                this.f1094a0 = i11;
            }
            if (!isAttachedToWindow()) {
                this.R = null;
                return;
            }
            try {
                Display display = getDisplay();
                if (display != null) {
                    display.getRotation();
                }
                b bVar2 = this.R;
                if (bVar2 != null) {
                    o oVarB = bVar2.b(this.W);
                    this.R.n(this);
                    ArrayList arrayList = this.E0;
                    if (arrayList != null) {
                        Iterator it = arrayList.iterator();
                        while (it.hasNext()) {
                            ((MotionHelper) it.next()).getClass();
                        }
                    }
                    if (oVarB != null) {
                        oVarB.b(this);
                    }
                    this.V = this.W;
                }
                q();
                a aVar = this.V0;
                if (aVar != null) {
                    if (this.Y0) {
                        post(new s(0, this));
                        return;
                    } else {
                        aVar.a();
                        return;
                    }
                }
                b bVar3 = this.R;
                if (bVar3 == null || (b0Var = bVar3.f1136c) == null || b0Var.f21n != 4) {
                    return;
                }
                u();
                setState(TransitionState.f1125b);
                setState(TransitionState.f1126c);
            } catch (Exception e10) {
                throw new IllegalArgumentException("unable to parse MotionScene file", e10);
            }
        } catch (Exception e11) {
            throw new IllegalArgumentException("unable to parse MotionScene file", e11);
        }
    }

    public final void m(int i10, float f10, float f11, float f12, float[] fArr) {
        View viewById = getViewById(i10);
        q qVar = (q) this.f1101e0.get(viewById);
        if (qVar != null) {
            qVar.d(f10, f11, f12, fArr);
            viewById.getY();
        } else {
            if (viewById == null) {
                return;
            }
            viewById.getContext().getResources().getResourceName(i10);
        }
    }

    public final b0 n(int i10) {
        for (b0 b0Var : this.R.f1137d) {
            if (b0Var.f8a == i10) {
                return b0Var;
            }
        }
        return null;
    }

    public final boolean o(float f10, float f11, MotionEvent motionEvent, View view) {
        boolean z10;
        boolean zOnTouchEvent;
        if (view instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) view;
            for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
                if (o((r3.getLeft() + f10) - view.getScrollX(), (r3.getTop() + f11) - view.getScrollY(), motionEvent, viewGroup.getChildAt(childCount))) {
                    z10 = true;
                    break;
                }
            }
            z10 = false;
        } else {
            z10 = false;
        }
        if (!z10) {
            RectF rectF = this.f1098c1;
            rectF.set(f10, f11, (view.getRight() + f10) - view.getLeft(), (view.getBottom() + f11) - view.getTop());
            if (motionEvent.getAction() != 0 || rectF.contains(motionEvent.getX(), motionEvent.getY())) {
                float f12 = -f10;
                float f13 = -f11;
                Matrix matrix = view.getMatrix();
                if (matrix.isIdentity()) {
                    motionEvent.offsetLocation(f12, f13);
                    zOnTouchEvent = view.onTouchEvent(motionEvent);
                    motionEvent.offsetLocation(-f12, -f13);
                } else {
                    MotionEvent motionEventObtain = MotionEvent.obtain(motionEvent);
                    motionEventObtain.offsetLocation(f12, f13);
                    if (this.f1102e1 == null) {
                        this.f1102e1 = new Matrix();
                    }
                    matrix.invert(this.f1102e1);
                    motionEventObtain.transform(this.f1102e1);
                    zOnTouchEvent = view.onTouchEvent(motionEventObtain);
                    motionEventObtain.recycle();
                }
                if (zOnTouchEvent) {
                    return true;
                }
            }
        }
        return z10;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        b0 b0Var;
        int i10;
        super.onAttachedToWindow();
        Display display = getDisplay();
        if (display != null) {
            display.getRotation();
        }
        b bVar = this.R;
        if (bVar != null && (i10 = this.W) != -1) {
            o oVarB = bVar.b(i10);
            this.R.n(this);
            ArrayList arrayList = this.E0;
            if (arrayList != null) {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    ((MotionHelper) it.next()).getClass();
                }
            }
            if (oVarB != null) {
                oVarB.b(this);
            }
            this.V = this.W;
        }
        q();
        a aVar = this.V0;
        if (aVar != null) {
            if (this.Y0) {
                post(new s(1, this));
                return;
            } else {
                aVar.a();
                return;
            }
        }
        b bVar2 = this.R;
        if (bVar2 == null || (b0Var = bVar2.f1136c) == null || b0Var.f21n != 4) {
            return;
        }
        u();
        setState(TransitionState.f1125b);
        setState(TransitionState.f1126c);
    }

    /* JADX WARN: Removed duplicated region for block: B:63:0x00fe  */
    @Override // android.view.ViewGroup
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        c cVar;
        int i10;
        RectF rectFB;
        int currentState;
        d0 d0Var;
        int i11;
        b bVar = this.R;
        if (bVar != null && this.f1099d0) {
            l.b0 b0Var = bVar.f1150q;
            if (b0Var != null && (currentState = ((MotionLayout) b0Var.f29639a).getCurrentState()) != -1) {
                if (((HashSet) b0Var.f29641c) == null) {
                    b0Var.f29641c = new HashSet();
                    for (d0 d0Var2 : (ArrayList) b0Var.f29640b) {
                        int childCount = ((MotionLayout) b0Var.f29639a).getChildCount();
                        for (int i12 = 0; i12 < childCount; i12++) {
                            View childAt = ((MotionLayout) b0Var.f29639a).getChildAt(i12);
                            if (d0Var2.c(childAt)) {
                                childAt.getId();
                                ((HashSet) b0Var.f29641c).add(childAt);
                            }
                        }
                    }
                }
                float x10 = motionEvent.getX();
                float y10 = motionEvent.getY();
                Rect rect = new Rect();
                int action = motionEvent.getAction();
                ArrayList arrayList = (ArrayList) b0Var.f29643e;
                int i13 = 2;
                if (arrayList != null && !arrayList.isEmpty()) {
                    for (c0 c0Var : (ArrayList) b0Var.f29643e) {
                        if (action != 1) {
                            if (action != 2) {
                                c0Var.getClass();
                            } else {
                                View view = c0Var.f32c.f167b;
                                Rect rect2 = c0Var.f41l;
                                view.getHitRect(rect2);
                                if (!rect2.contains((int) x10, (int) y10) && !c0Var.f37h) {
                                    c0Var.b();
                                }
                            }
                        } else if (!c0Var.f37h) {
                            c0Var.b();
                        }
                    }
                }
                if (action == 0 || action == 1) {
                    b bVar2 = ((MotionLayout) b0Var.f29639a).R;
                    o oVarB = bVar2 == null ? null : bVar2.b(currentState);
                    for (d0 d0Var3 : (ArrayList) b0Var.f29640b) {
                        int i14 = d0Var3.f45b;
                        if (i14 == 1) {
                            if (action == 0) {
                                for (View view2 : (HashSet) b0Var.f29641c) {
                                    if (d0Var3.c(view2)) {
                                        view2.getHitRect(rect);
                                        if (rect.contains((int) x10, (int) y10)) {
                                            d0Var = d0Var3;
                                            i11 = i13;
                                            d0Var3.a(b0Var, (MotionLayout) b0Var.f29639a, currentState, oVarB, view2);
                                        } else {
                                            d0Var = d0Var3;
                                            i11 = i13;
                                        }
                                        d0Var3 = d0Var;
                                        i13 = i11;
                                    }
                                }
                            }
                        } else if (i14 == i13) {
                            if (action == 1) {
                            }
                        } else if (i14 != 3 || action != 0) {
                        }
                        i13 = i13;
                    }
                }
            }
            b0 b0Var2 = this.R.f1136c;
            if (b0Var2 != null && (true ^ b0Var2.f22o) && (cVar = b0Var2.f19l) != null && ((motionEvent.getAction() != 0 || (rectFB = cVar.b(this, new RectF())) == null || rectFB.contains(motionEvent.getX(), motionEvent.getY())) && (i10 = cVar.f1157e) != -1)) {
                View view3 = this.f1100d1;
                if (view3 == null || view3.getId() != i10) {
                    this.f1100d1 = findViewById(i10);
                }
                if (this.f1100d1 != null) {
                    RectF rectF = this.f1098c1;
                    rectF.set(r1.getLeft(), this.f1100d1.getTop(), this.f1100d1.getRight(), this.f1100d1.getBottom());
                    if (rectF.contains(motionEvent.getX(), motionEvent.getY()) && !o(this.f1100d1.getLeft(), this.f1100d1.getTop(), motionEvent, this.f1100d1)) {
                        return onTouchEvent(motionEvent);
                    }
                }
            }
        }
        return false;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout, android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z10, int i10, int i11, int i12, int i13) {
        this.U0 = true;
        try {
            if (this.R == null) {
                super.onLayout(z10, i10, i11, i12, i13);
                return;
            }
            int i14 = i12 - i10;
            int i15 = i13 - i11;
            if (this.f1119u0 != i14 || this.f1120v0 != i15) {
                s();
                j(true);
            }
            this.f1119u0 = i14;
            this.f1120v0 = i15;
        } finally {
            this.U0 = false;
        }
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout, android.view.View
    public final void onMeasure(int i10, int i11) {
        boolean z10;
        if (this.R == null) {
            super.onMeasure(i10, i11);
            return;
        }
        boolean z11 = true;
        boolean z12 = (this.f1095b0 == i10 && this.f1097c0 == i11) ? false : true;
        if (this.f1096b1) {
            this.f1096b1 = false;
            q();
            r();
            z12 = true;
        }
        if (this.mDirtyHierarchy) {
            z12 = true;
        }
        this.f1095b0 = i10;
        this.f1097c0 = i11;
        int iH = this.R.h();
        b0 b0Var = this.R.f1136c;
        int i12 = b0Var == null ? -1 : b0Var.f10c;
        v vVar = this.a1;
        if ((!z12 && iH == vVar.f212a && i12 == vVar.f213b) || this.V == -1) {
            if (z12) {
                super.onMeasure(i10, i11);
            }
            z10 = true;
        } else {
            super.onMeasure(i10, i11);
            vVar.k(this.R.b(iH), this.R.b(i12));
            vVar.l();
            vVar.f212a = iH;
            vVar.f213b = i12;
            z10 = false;
        }
        if (this.L0 || z10) {
            int paddingBottom = getPaddingBottom() + getPaddingTop();
            int iS = this.mLayoutWidget.s() + getPaddingRight() + getPaddingLeft();
            int iM = this.mLayoutWidget.m() + paddingBottom;
            int i13 = this.Q0;
            if (i13 == Integer.MIN_VALUE || i13 == 0) {
                iS = (int) ((this.S0 * (this.O0 - r1)) + this.M0);
                requestLayout();
            }
            int i14 = this.R0;
            if (i14 == Integer.MIN_VALUE || i14 == 0) {
                iM = (int) ((this.S0 * (this.P0 - r2)) + this.N0);
                requestLayout();
            }
            setMeasuredDimension(iS, iM);
        }
        float fSignum = Math.signum(this.f1109k0 - this.f1107i0);
        long nanoTime = getNanoTime();
        r rVar = this.S;
        float interpolation = this.f1107i0 + (!(rVar instanceof z.a) ? (((nanoTime - this.f1108j0) * fSignum) * 1.0E-9f) / this.f1105g0 : 0.0f);
        if (this.f1110l0) {
            interpolation = this.f1109k0;
        }
        if ((fSignum <= 0.0f || interpolation < this.f1109k0) && (fSignum > 0.0f || interpolation > this.f1109k0)) {
            z11 = false;
        } else {
            interpolation = this.f1109k0;
        }
        if (rVar != null && !z11) {
            interpolation = this.f1115q0 ? rVar.getInterpolation((nanoTime - this.f1103f0) * 1.0E-9f) : rVar.getInterpolation(interpolation);
        }
        if ((fSignum > 0.0f && interpolation >= this.f1109k0) || (fSignum <= 0.0f && interpolation <= this.f1109k0)) {
            interpolation = this.f1109k0;
        }
        this.S0 = interpolation;
        int childCount = getChildCount();
        long nanoTime2 = getNanoTime();
        Interpolator interpolator = this.T;
        if (interpolator != null) {
            interpolation = interpolator.getInterpolation(interpolation);
        }
        for (int i15 = 0; i15 < childCount; i15++) {
            View childAt = getChildAt(i15);
            q qVar = (q) this.f1101e0.get(childAt);
            if (qVar != null) {
                qVar.f(interpolation, nanoTime2, childAt, this.T0);
            }
        }
        if (this.L0) {
            requestLayout();
        }
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onNestedFling(View view, float f10, float f11, boolean z10) {
        return false;
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onNestedPreFling(View view, float f10, float f11) {
        return false;
    }

    /* JADX WARN: Type inference failed for: r1v3 */
    /* JADX WARN: Type inference failed for: r1v4, types: [boolean] */
    /* JADX WARN: Type inference failed for: r1v5 */
    @Override // androidx.core.view.h0
    public final void onNestedPreScroll(View view, int i10, int i11, int[] iArr, int i12) {
        b0 b0Var;
        boolean z10;
        ?? r12;
        c cVar;
        float f10;
        c cVar2;
        c cVar3;
        c cVar4;
        int i13;
        b bVar = this.R;
        if (bVar == null || (b0Var = bVar.f1136c) == null || !(!b0Var.f22o)) {
            return;
        }
        int i14 = -1;
        if (!z10 || (cVar4 = b0Var.f19l) == null || (i13 = cVar4.f1157e) == -1 || view.getId() == i13) {
            b0 b0Var2 = bVar.f1136c;
            if (b0Var2 != null && (cVar3 = b0Var2.f19l) != null && cVar3.f1173u) {
                c cVar5 = b0Var.f19l;
                if (cVar5 != null && (cVar5.f1175w & 4) != 0) {
                    i14 = i11;
                }
                float f11 = this.f1106h0;
                if ((f11 == 1.0f || f11 == 0.0f) && view.canScrollVertically(i14)) {
                    return;
                }
            }
            c cVar6 = b0Var.f19l;
            if (cVar6 != null && (cVar6.f1175w & 1) != 0) {
                float f12 = i10;
                float f13 = i11;
                b0 b0Var3 = bVar.f1136c;
                if (b0Var3 == null || (cVar2 = b0Var3.f19l) == null) {
                    f10 = 0.0f;
                } else {
                    cVar2.f1170r.m(cVar2.f1156d, cVar2.f1170r.getProgress(), cVar2.f1160h, cVar2.f1159g, cVar2.f1166n);
                    float f14 = cVar2.f1163k;
                    float[] fArr = cVar2.f1166n;
                    if (f14 != 0.0f) {
                        if (fArr[0] == 0.0f) {
                            fArr[0] = 1.0E-7f;
                        }
                        f10 = (f12 * f14) / fArr[0];
                    } else {
                        if (fArr[1] == 0.0f) {
                            fArr[1] = 1.0E-7f;
                        }
                        f10 = (f13 * cVar2.f1164l) / fArr[1];
                    }
                }
                float f15 = this.f1107i0;
                if ((f15 <= 0.0f && f10 < 0.0f) || (f15 >= 1.0f && f10 > 0.0f)) {
                    view.setNestedScrollingEnabled(false);
                    view.post(new l(this, view, 2));
                    return;
                }
            }
            float f16 = this.f1106h0;
            long nanoTime = getNanoTime();
            float f17 = i10;
            this.f1122x0 = f17;
            float f18 = i11;
            this.f1123y0 = f18;
            this.A0 = (float) ((nanoTime - this.z0) * 1.0E-9d);
            this.z0 = nanoTime;
            b0 b0Var4 = bVar.f1136c;
            if (b0Var4 != null && (cVar = b0Var4.f19l) != null) {
                MotionLayout motionLayout = cVar.f1170r;
                float progress = motionLayout.getProgress();
                if (!cVar.f1165m) {
                    cVar.f1165m = true;
                    motionLayout.setProgress(progress);
                }
                cVar.f1170r.m(cVar.f1156d, progress, cVar.f1160h, cVar.f1159g, cVar.f1166n);
                float f19 = cVar.f1163k;
                float[] fArr2 = cVar.f1166n;
                if (Math.abs((cVar.f1164l * fArr2[1]) + (f19 * fArr2[0])) < 0.01d) {
                    fArr2[0] = 0.01f;
                    fArr2[1] = 0.01f;
                }
                float f20 = cVar.f1163k;
                float fMax = Math.max(Math.min(progress + (f20 != 0.0f ? (f17 * f20) / fArr2[0] : (f18 * cVar.f1164l) / fArr2[1]), 1.0f), 0.0f);
                if (fMax != motionLayout.getProgress()) {
                    motionLayout.setProgress(fMax);
                }
            }
            if (f16 != this.f1106h0) {
                iArr[0] = i10;
                r12 = 1;
                iArr[1] = i11;
            } else {
                r12 = 1;
            }
            j(false);
            if (iArr[0] == 0 && iArr[r12] == 0) {
                return;
            }
            this.f1121w0 = r12;
        }
    }

    @Override // androidx.core.view.h0
    public final void onNestedScroll(View view, int i10, int i11, int i12, int i13, int i14) {
    }

    @Override // androidx.core.view.h0
    public final void onNestedScrollAccepted(View view, View view2, int i10, int i11) {
        this.z0 = getNanoTime();
        this.A0 = 0.0f;
        this.f1122x0 = 0.0f;
        this.f1123y0 = 0.0f;
    }

    @Override // android.view.View
    public final void onRtlPropertiesChanged(int i10) {
        c cVar;
        b bVar = this.R;
        if (bVar != null) {
            boolean zIsRtl = isRtl();
            bVar.f1149p = zIsRtl;
            b0 b0Var = bVar.f1136c;
            if (b0Var == null || (cVar = b0Var.f19l) == null) {
                return;
            }
            cVar.c(zIsRtl);
        }
    }

    @Override // androidx.core.view.h0
    public final boolean onStartNestedScroll(View view, View view2, int i10, int i11) {
        b0 b0Var;
        c cVar;
        b bVar = this.R;
        return (bVar == null || (b0Var = bVar.f1136c) == null || (cVar = b0Var.f19l) == null || (cVar.f1175w & 2) != 0) ? false : true;
    }

    @Override // androidx.core.view.h0
    public final void onStopNestedScroll(View view, int i10) {
        c cVar;
        int i11;
        b bVar = this.R;
        if (bVar != null) {
            float f10 = this.A0;
            if (f10 == 0.0f) {
                return;
            }
            float f11 = this.f1122x0 / f10;
            float f12 = this.f1123y0 / f10;
            b0 b0Var = bVar.f1136c;
            if (b0Var == null || (cVar = b0Var.f19l) == null) {
                return;
            }
            cVar.f1165m = false;
            MotionLayout motionLayout = cVar.f1170r;
            float progress = motionLayout.getProgress();
            cVar.f1170r.m(cVar.f1156d, progress, cVar.f1160h, cVar.f1159g, cVar.f1166n);
            float f13 = cVar.f1163k;
            float[] fArr = cVar.f1166n;
            float f14 = f13 != 0.0f ? (f11 * f13) / fArr[0] : (f12 * cVar.f1164l) / fArr[1];
            if (!Float.isNaN(f14)) {
                progress += f14 / 3.0f;
            }
            if (progress == 0.0f || progress == 1.0f || (i11 = cVar.f1155c) == 3) {
                return;
            }
            motionLayout.t(((double) progress) >= 0.5d ? 1.0f : 0.0f, f14, i11);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:110:0x022c  */
    /* JADX WARN: Removed duplicated region for block: B:113:0x0232  */
    /* JADX WARN: Removed duplicated region for block: B:130:0x0263  */
    /* JADX WARN: Removed duplicated region for block: B:201:0x04bc  */
    /* JADX WARN: Removed duplicated region for block: B:202:0x04df  */
    /* JADX WARN: Removed duplicated region for block: B:205:0x04f9  */
    /* JADX WARN: Removed duplicated region for block: B:207:0x0507  */
    /* JADX WARN: Removed duplicated region for block: B:235:0x0565  */
    /* JADX WARN: Removed duplicated region for block: B:239:0x0570  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        b bVar;
        w wVar;
        w wVar2;
        c cVar;
        char c6;
        char c10;
        int i10;
        char c11;
        char c12;
        char c13;
        float right;
        float f10;
        int top;
        int bottom;
        int i11;
        float f11;
        int i12;
        View viewFindViewById;
        char c14;
        MotionEvent motionEvent2;
        RectF rectF;
        b0 b0Var;
        int iC;
        Iterator it;
        RectF rectF2;
        b0 b0Var2;
        float f12;
        float f13;
        RectF rectF3;
        MotionLayout motionLayout = this;
        b bVar2 = motionLayout.R;
        if (bVar2 == null || !motionLayout.f1099d0 || !bVar2.p()) {
            return super.onTouchEvent(motionEvent);
        }
        b bVar3 = motionLayout.R;
        if (bVar3.f1136c != null && !(!r3.f22o)) {
            return super.onTouchEvent(motionEvent);
        }
        int currentState = getCurrentState();
        RectF rectF4 = new RectF();
        w wVar3 = bVar3.f1148o;
        MotionLayout motionLayout2 = bVar3.f1134a;
        if (wVar3 == null) {
            motionLayout2.getClass();
            w wVar4 = w.f219b;
            wVar4.f220a = VelocityTracker.obtain();
            bVar3.f1148o = wVar4;
        }
        VelocityTracker velocityTracker = bVar3.f1148o.f220a;
        if (velocityTracker != null) {
            velocityTracker.addMovement(motionEvent);
        }
        if (currentState != -1) {
            int action = motionEvent.getAction();
            if (action == 0) {
                bVar3.f1151r = motionEvent.getRawX();
                bVar3.f1152s = motionEvent.getRawY();
                bVar3.f1145l = motionEvent;
                bVar3.f1146m = false;
                c cVar2 = bVar3.f1136c.f19l;
                if (cVar2 != null) {
                    RectF rectFA = cVar2.a(motionLayout2, rectF4);
                    if (rectFA == null || rectFA.contains(bVar3.f1145l.getX(), bVar3.f1145l.getY())) {
                        RectF rectFB = bVar3.f1136c.f19l.b(motionLayout2, rectF4);
                        if (rectFB == null || rectFB.contains(bVar3.f1145l.getX(), bVar3.f1145l.getY())) {
                            bVar3.f1147n = false;
                        } else {
                            bVar3.f1147n = true;
                        }
                        c cVar3 = bVar3.f1136c.f19l;
                        float f14 = bVar3.f1151r;
                        float f15 = bVar3.f1152s;
                        cVar3.f1168p = f14;
                        cVar3.f1169q = f15;
                    } else {
                        bVar3.f1145l = null;
                        bVar3.f1146m = true;
                    }
                }
            } else if (action == 2 && !bVar3.f1146m) {
                float rawY = motionEvent.getRawY() - bVar3.f1152s;
                float rawX = motionEvent.getRawX() - bVar3.f1151r;
                if ((rawX != 0.0d || rawY != 0.0d) && (motionEvent2 = bVar3.f1145l) != null) {
                    if (currentState != -1) {
                        o0 o0Var = bVar3.f1135b;
                        if (o0Var == null || (iC = o0Var.c(currentState)) == -1) {
                            iC = currentState;
                        }
                        ArrayList arrayList = new ArrayList();
                        for (b0 b0Var3 : bVar3.f1137d) {
                            if (b0Var3.f11d == iC || b0Var3.f10c == iC) {
                                arrayList.add(b0Var3);
                            }
                        }
                        RectF rectF5 = new RectF();
                        Iterator it2 = arrayList.iterator();
                        float f16 = 0.0f;
                        b0Var = null;
                        while (it2.hasNext()) {
                            b0 b0Var4 = (b0) it2.next();
                            if (b0Var4.f22o) {
                                it = it2;
                            } else {
                                c cVar4 = b0Var4.f19l;
                                if (cVar4 != null) {
                                    cVar4.c(bVar3.f1149p);
                                    RectF rectFB2 = b0Var4.f19l.b(motionLayout2, rectF5);
                                    if (rectFB2 != null) {
                                        it = it2;
                                        if (!rectFB2.contains(motionEvent2.getX(), motionEvent2.getY())) {
                                        }
                                    } else {
                                        it = it2;
                                    }
                                    RectF rectFA2 = b0Var4.f19l.a(motionLayout2, rectF5);
                                    if (rectFA2 == null || rectFA2.contains(motionEvent2.getX(), motionEvent2.getY())) {
                                        c cVar5 = b0Var4.f19l;
                                        float fAtan2 = (cVar5.f1164l * rawY) + (cVar5.f1163k * rawX);
                                        if (cVar5.f1162j) {
                                            float x10 = motionEvent2.getX();
                                            b0Var4.f19l.getClass();
                                            float y10 = motionEvent2.getY();
                                            b0Var4.f19l.getClass();
                                            rectF2 = rectF5;
                                            f12 = rawY;
                                            f13 = rawX;
                                            double dAtan2 = Math.atan2(rawY + r11, rawX + r6);
                                            double d10 = x10 - 0.5f;
                                            b0Var2 = b0Var;
                                            rectF3 = rectF4;
                                            fAtan2 = ((float) (dAtan2 - Math.atan2(d10, y10 - 0.5f))) * 10.0f;
                                        } else {
                                            rectF2 = rectF5;
                                            rectF3 = rectF4;
                                            b0Var2 = b0Var;
                                            f12 = rawY;
                                            f13 = rawX;
                                        }
                                        float f17 = fAtan2 * (b0Var4.f10c == currentState ? -1.0f : 1.1f);
                                        if (f17 > f16) {
                                            f16 = f17;
                                            b0Var = b0Var4;
                                        }
                                        rectF4 = rectF3;
                                        it2 = it;
                                        rectF5 = rectF2;
                                        rawY = f12;
                                        rawX = f13;
                                    }
                                } else {
                                    rectF2 = rectF5;
                                    it = it2;
                                    b0Var2 = b0Var;
                                    f12 = rawY;
                                    f13 = rawX;
                                    rectF3 = rectF4;
                                }
                                b0Var = b0Var2;
                                rectF4 = rectF3;
                                it2 = it;
                                rectF5 = rectF2;
                                rawY = f12;
                                rawX = f13;
                            }
                            it2 = it;
                        }
                        rectF = rectF4;
                    } else {
                        rectF = rectF4;
                        b0Var = bVar3.f1136c;
                    }
                    if (b0Var != null) {
                        motionLayout.setTransition(b0Var);
                        RectF rectFB3 = bVar3.f1136c.f19l.b(motionLayout2, rectF);
                        bVar3.f1147n = (rectFB3 == null || rectFB3.contains(bVar3.f1145l.getX(), bVar3.f1145l.getY())) ? false : true;
                        c cVar6 = bVar3.f1136c.f19l;
                        float f18 = bVar3.f1151r;
                        float f19 = bVar3.f1152s;
                        cVar6.f1168p = f18;
                        cVar6.f1169q = f19;
                        cVar6.f1165m = false;
                    }
                    if (!bVar3.f1146m) {
                    }
                }
            }
        } else if (!bVar3.f1146m) {
            b0 b0Var5 = bVar3.f1136c;
            if (b0Var5 == null || (cVar = b0Var5.f19l) == null || bVar3.f1147n) {
                bVar = bVar3;
            } else {
                w wVar5 = bVar3.f1148o;
                boolean z10 = cVar.f1162j;
                TransitionState transitionState = TransitionState.f1127d;
                float[] fArr = cVar.f1166n;
                MotionLayout motionLayout3 = cVar.f1170r;
                if (z10) {
                    VelocityTracker velocityTracker2 = wVar5.f220a;
                    if (velocityTracker2 != null) {
                        velocityTracker2.addMovement(motionEvent);
                    }
                    int action2 = motionEvent.getAction();
                    if (action2 != 0) {
                        int[] iArr = cVar.f1167o;
                        if (action2 == 1) {
                            bVar = bVar3;
                            cVar.f1165m = false;
                            VelocityTracker velocityTracker3 = wVar5.f220a;
                            if (velocityTracker3 != null) {
                                velocityTracker3.computeCurrentVelocity(16);
                            }
                            VelocityTracker velocityTracker4 = wVar5.f220a;
                            float xVelocity = velocityTracker4 != null ? velocityTracker4.getXVelocity() : 0.0f;
                            VelocityTracker velocityTracker5 = wVar5.f220a;
                            float yVelocity = velocityTracker5 != null ? velocityTracker5.getYVelocity() : 0.0f;
                            float progress = motionLayout3.getProgress();
                            float width = motionLayout3.getWidth() / 2.0f;
                            float height = motionLayout3.getHeight() / 2.0f;
                            int i13 = cVar.f1161i;
                            if (i13 != -1) {
                                View viewFindViewById2 = motionLayout3.findViewById(i13);
                                motionLayout3.getLocationOnScreen(iArr);
                                right = iArr[0] + ((viewFindViewById2.getRight() + viewFindViewById2.getLeft()) / 2.0f);
                                f10 = iArr[1];
                                top = viewFindViewById2.getTop();
                                bottom = viewFindViewById2.getBottom();
                            } else {
                                int i14 = cVar.f1156d;
                                if (i14 != -1) {
                                    View viewFindViewById3 = motionLayout3.findViewById(((q) motionLayout3.f1101e0.get(motionLayout3.findViewById(i14))).f171f.f231k);
                                    motionLayout3.getLocationOnScreen(iArr);
                                    right = iArr[0] + ((viewFindViewById3.getRight() + viewFindViewById3.getLeft()) / 2.0f);
                                    f10 = iArr[1];
                                    top = viewFindViewById3.getTop();
                                    bottom = viewFindViewById3.getBottom();
                                }
                                float rawX2 = motionEvent.getRawX() - width;
                                double degrees = Math.toDegrees(Math.atan2(motionEvent.getRawY() - height, rawX2));
                                i11 = cVar.f1156d;
                                if (i11 == -1) {
                                    cVar.f1170r.m(i11, progress, cVar.f1160h, cVar.f1159g, cVar.f1166n);
                                    fArr[1] = (float) Math.toDegrees(fArr[1]);
                                } else {
                                    fArr[1] = 360.0f;
                                }
                                float degrees2 = ((float) (Math.toDegrees(Math.atan2(yVelocity + r5, xVelocity + rawX2)) - degrees)) * 62.5f;
                                f11 = Float.isNaN(degrees2) ? (((degrees2 * 3.0f) * cVar.f1174v) / fArr[1]) + progress : progress;
                                if (f11 == 0.0f && f11 != 1.0f && (i12 = cVar.f1155c) != 3) {
                                    float fAbs = (degrees2 * cVar.f1174v) / fArr[1];
                                    float f20 = ((double) f11) < 0.5d ? 0.0f : 1.0f;
                                    if (i12 == 6) {
                                        if (progress + fAbs < 0.0f) {
                                            fAbs = Math.abs(fAbs);
                                        }
                                        f20 = 1.0f;
                                    }
                                    if (cVar.f1155c == 7) {
                                        if (progress + fAbs > 1.0f) {
                                            fAbs = -Math.abs(fAbs);
                                        }
                                        f20 = 0.0f;
                                    }
                                    motionLayout3.t(f20, fAbs * 3.0f, cVar.f1155c);
                                    if (0.0f >= progress || 1.0f <= progress) {
                                        motionLayout3.setState(transitionState);
                                    }
                                } else if (0.0f < f11 || 1.0f <= f11) {
                                    motionLayout3.setState(transitionState);
                                }
                            }
                            float f21 = right;
                            height = ((bottom + top) / 2.0f) + f10;
                            width = f21;
                            float rawX22 = motionEvent.getRawX() - width;
                            double degrees3 = Math.toDegrees(Math.atan2(motionEvent.getRawY() - height, rawX22));
                            i11 = cVar.f1156d;
                            if (i11 == -1) {
                            }
                            float degrees22 = ((float) (Math.toDegrees(Math.atan2(yVelocity + r5, xVelocity + rawX22)) - degrees3)) * 62.5f;
                            if (Float.isNaN(degrees22)) {
                            }
                            if (f11 == 0.0f) {
                                if (0.0f < f11) {
                                    motionLayout3.setState(transitionState);
                                }
                            }
                        } else if (action2 != 2) {
                            bVar = bVar3;
                        } else {
                            motionEvent.getRawY();
                            motionEvent.getRawX();
                            float width2 = motionLayout3.getWidth() / 2.0f;
                            float height2 = motionLayout3.getHeight() / 2.0f;
                            int i15 = cVar.f1161i;
                            if (i15 != -1) {
                                View viewFindViewById4 = motionLayout3.findViewById(i15);
                                motionLayout3.getLocationOnScreen(iArr);
                                height2 = ((viewFindViewById4.getBottom() + viewFindViewById4.getTop()) / 2.0f) + iArr[1];
                                width2 = iArr[0] + ((viewFindViewById4.getRight() + viewFindViewById4.getLeft()) / 2.0f);
                            } else {
                                int i16 = cVar.f1156d;
                                if (i16 != -1 && (viewFindViewById = motionLayout3.findViewById(((q) motionLayout3.f1101e0.get(motionLayout3.findViewById(i16))).f171f.f231k)) != null) {
                                    motionLayout3.getLocationOnScreen(iArr);
                                    width2 = iArr[0] + ((viewFindViewById.getRight() + viewFindViewById.getLeft()) / 2.0f);
                                    height2 = iArr[1] + ((viewFindViewById.getBottom() + viewFindViewById.getTop()) / 2.0f);
                                }
                            }
                            float rawX3 = motionEvent.getRawX() - width2;
                            float rawY2 = motionEvent.getRawY() - height2;
                            float fAtan22 = (float) (((Math.atan2(motionEvent.getRawY() - height2, motionEvent.getRawX() - width2) - Math.atan2(cVar.f1169q - height2, cVar.f1168p - width2)) * 180.0d) / 3.141592653589793d);
                            if (fAtan22 > 330.0f) {
                                fAtan22 -= 360.0f;
                            } else if (fAtan22 < -330.0f) {
                                fAtan22 += 360.0f;
                            }
                            if (Math.abs(fAtan22) > 0.01d || cVar.f1165m) {
                                float progress2 = motionLayout3.getProgress();
                                if (!cVar.f1165m) {
                                    cVar.f1165m = true;
                                    motionLayout3.setProgress(progress2);
                                }
                                int i17 = cVar.f1156d;
                                if (i17 != -1) {
                                    bVar = bVar3;
                                    cVar.f1170r.m(i17, progress2, cVar.f1160h, cVar.f1159g, cVar.f1166n);
                                    c14 = 1;
                                    fArr[1] = (float) Math.toDegrees(fArr[1]);
                                } else {
                                    bVar = bVar3;
                                    c14 = 1;
                                    fArr[1] = 360.0f;
                                }
                                float fMax = Math.max(Math.min(((fAtan22 * cVar.f1174v) / fArr[c14]) + progress2, 1.0f), 0.0f);
                                float progress3 = motionLayout3.getProgress();
                                if (fMax != progress3) {
                                    if (progress3 == 0.0f || progress3 == 1.0f) {
                                        motionLayout3.i(progress3 == 0.0f);
                                    }
                                    motionLayout3.setProgress(fMax);
                                    VelocityTracker velocityTracker6 = wVar5.f220a;
                                    if (velocityTracker6 != null) {
                                        velocityTracker6.computeCurrentVelocity(1000);
                                    }
                                    VelocityTracker velocityTracker7 = wVar5.f220a;
                                    float xVelocity2 = velocityTracker7 != null ? velocityTracker7.getXVelocity() : 0.0f;
                                    VelocityTracker velocityTracker8 = wVar5.f220a;
                                    double yVelocity2 = velocityTracker8 != null ? velocityTracker8.getYVelocity() : 0.0f;
                                    double d11 = xVelocity2;
                                    motionLayout3.U = (float) Math.toDegrees((float) ((Math.sin(Math.atan2(yVelocity2, d11) - r11) * Math.hypot(yVelocity2, d11)) / Math.hypot(rawX3, rawY2)));
                                } else {
                                    motionLayout3.U = 0.0f;
                                }
                                cVar.f1168p = motionEvent.getRawX();
                                cVar.f1169q = motionEvent.getRawY();
                            }
                        }
                    } else {
                        bVar = bVar3;
                        cVar.f1168p = motionEvent.getRawX();
                        cVar.f1169q = motionEvent.getRawY();
                        cVar.f1165m = false;
                    }
                } else {
                    bVar = bVar3;
                    VelocityTracker velocityTracker9 = wVar5.f220a;
                    if (velocityTracker9 != null) {
                        velocityTracker9.addMovement(motionEvent);
                    }
                    int action3 = motionEvent.getAction();
                    if (action3 == 0) {
                        cVar.f1168p = motionEvent.getRawX();
                        cVar.f1169q = motionEvent.getRawY();
                        cVar.f1165m = false;
                    } else if (action3 == 1) {
                        cVar.f1165m = false;
                        VelocityTracker velocityTracker10 = wVar5.f220a;
                        if (velocityTracker10 != null) {
                            velocityTracker10.computeCurrentVelocity(1000);
                        }
                        VelocityTracker velocityTracker11 = wVar5.f220a;
                        float xVelocity3 = velocityTracker11 != null ? velocityTracker11.getXVelocity() : 0.0f;
                        VelocityTracker velocityTracker12 = wVar5.f220a;
                        float yVelocity3 = velocityTracker12 != null ? velocityTracker12.getYVelocity() : 0.0f;
                        float progress4 = motionLayout3.getProgress();
                        int i18 = cVar.f1156d;
                        if (i18 != -1) {
                            cVar.f1170r.m(i18, progress4, cVar.f1160h, cVar.f1159g, cVar.f1166n);
                            c10 = 0;
                            c6 = 1;
                        } else {
                            float fMin = Math.min(motionLayout3.getWidth(), motionLayout3.getHeight());
                            c6 = 1;
                            fArr[1] = cVar.f1164l * fMin;
                            c10 = 0;
                            fArr[0] = fMin * cVar.f1163k;
                        }
                        float fAbs2 = cVar.f1163k != 0.0f ? xVelocity3 / fArr[c10] : yVelocity3 / fArr[c6];
                        float f22 = !Float.isNaN(fAbs2) ? (fAbs2 / 3.0f) + progress4 : progress4;
                        if (f22 != 0.0f && f22 != 1.0f && (i10 = cVar.f1155c) != 3) {
                            float f23 = ((double) f22) < 0.5d ? 0.0f : 1.0f;
                            if (i10 == 6) {
                                if (progress4 + fAbs2 < 0.0f) {
                                    fAbs2 = Math.abs(fAbs2);
                                }
                                f23 = 1.0f;
                            }
                            if (cVar.f1155c == 7) {
                                if (progress4 + fAbs2 > 1.0f) {
                                    fAbs2 = -Math.abs(fAbs2);
                                }
                                f23 = 0.0f;
                            }
                            motionLayout3.t(f23, fAbs2, cVar.f1155c);
                            if (0.0f >= progress4 || 1.0f <= progress4) {
                                motionLayout3.setState(transitionState);
                            }
                        } else if (0.0f >= f22 || 1.0f <= f22) {
                            motionLayout3.setState(transitionState);
                        }
                    } else if (action3 == 2) {
                        float rawY3 = motionEvent.getRawY() - cVar.f1169q;
                        float rawX4 = motionEvent.getRawX() - cVar.f1168p;
                        if (Math.abs((cVar.f1164l * rawY3) + (cVar.f1163k * rawX4)) > cVar.f1176x || cVar.f1165m) {
                            float progress5 = motionLayout3.getProgress();
                            if (!cVar.f1165m) {
                                cVar.f1165m = true;
                                motionLayout3.setProgress(progress5);
                            }
                            int i19 = cVar.f1156d;
                            if (i19 != -1) {
                                cVar.f1170r.m(i19, progress5, cVar.f1160h, cVar.f1159g, cVar.f1166n);
                                c12 = 0;
                                c11 = 1;
                            } else {
                                float fMin2 = Math.min(motionLayout3.getWidth(), motionLayout3.getHeight());
                                c11 = 1;
                                fArr[1] = cVar.f1164l * fMin2;
                                c12 = 0;
                                fArr[0] = fMin2 * cVar.f1163k;
                            }
                            if (Math.abs(((cVar.f1164l * fArr[c11]) + (cVar.f1163k * fArr[c12])) * cVar.f1174v) < 0.01d) {
                                c13 = 0;
                                fArr[0] = 0.01f;
                                fArr[c11] = 0.01f;
                            } else {
                                c13 = 0;
                            }
                            float fMax2 = Math.max(Math.min(progress5 + (cVar.f1163k != 0.0f ? rawX4 / fArr[c13] : rawY3 / fArr[c11]), 1.0f), 0.0f);
                            if (cVar.f1155c == 6) {
                                fMax2 = Math.max(fMax2, 0.01f);
                            }
                            if (cVar.f1155c == 7) {
                                fMax2 = Math.min(fMax2, 0.99f);
                            }
                            float progress6 = motionLayout3.getProgress();
                            if (fMax2 != progress6) {
                                if (progress6 == 0.0f || progress6 == 1.0f) {
                                    motionLayout3.i(progress6 == 0.0f);
                                }
                                motionLayout3.setProgress(fMax2);
                                VelocityTracker velocityTracker13 = wVar5.f220a;
                                if (velocityTracker13 != null) {
                                    velocityTracker13.computeCurrentVelocity(1000);
                                }
                                VelocityTracker velocityTracker14 = wVar5.f220a;
                                float xVelocity4 = velocityTracker14 != null ? velocityTracker14.getXVelocity() : 0.0f;
                                VelocityTracker velocityTracker15 = wVar5.f220a;
                                motionLayout3.U = cVar.f1163k != 0.0f ? xVelocity4 / fArr[0] : (velocityTracker15 != null ? velocityTracker15.getYVelocity() : 0.0f) / fArr[1];
                            } else {
                                motionLayout3.U = 0.0f;
                            }
                            cVar.f1168p = motionEvent.getRawX();
                            cVar.f1169q = motionEvent.getRawY();
                        }
                    }
                }
            }
            b bVar4 = bVar;
            bVar4.f1151r = motionEvent.getRawX();
            bVar4.f1152s = motionEvent.getRawY();
            if (motionEvent.getAction() != 1 || (wVar = bVar4.f1148o) == null) {
                motionLayout = this;
            } else {
                VelocityTracker velocityTracker16 = wVar.f220a;
                if (velocityTracker16 != null) {
                    velocityTracker16.recycle();
                    wVar2 = null;
                    wVar.f220a = null;
                } else {
                    wVar2 = null;
                }
                bVar4.f1148o = wVar2;
                motionLayout = this;
                int i20 = motionLayout.W;
                if (i20 != -1) {
                    bVar4.a(i20, motionLayout);
                }
            }
        }
        b0 b0Var6 = motionLayout.R.f1136c;
        if ((b0Var6.f25r & 4) != 0) {
            return b0Var6.f19l.f1165m;
        }
        return true;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout, android.view.ViewGroup
    public final void onViewAdded(View view) {
        super.onViewAdded(view);
        if (view instanceof MotionHelper) {
            MotionHelper motionHelper = (MotionHelper) view;
            if (this.F0 == null) {
                this.F0 = new CopyOnWriteArrayList();
            }
            this.F0.add(motionHelper);
            if (motionHelper.f1089j) {
                if (this.C0 == null) {
                    this.C0 = new ArrayList();
                }
                this.C0.add(motionHelper);
            }
            if (motionHelper.f1090k) {
                if (this.D0 == null) {
                    this.D0 = new ArrayList();
                }
                this.D0.add(motionHelper);
            }
            if (motionHelper instanceof MotionEffect) {
                if (this.E0 == null) {
                    this.E0 = new ArrayList();
                }
                this.E0.add(motionHelper);
            }
        }
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout, android.view.ViewGroup
    public final void onViewRemoved(View view) {
        super.onViewRemoved(view);
        ArrayList arrayList = this.C0;
        if (arrayList != null) {
            arrayList.remove(view);
        }
        ArrayList arrayList2 = this.D0;
        if (arrayList2 != null) {
            arrayList2.remove(view);
        }
    }

    public final void p(AttributeSet attributeSet) {
        b bVar;
        b bVar2;
        f1093g1 = isInEditMode();
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, androidx.constraintlayout.widget.s.MotionLayout);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            boolean z10 = true;
            for (int i10 = 0; i10 < indexCount; i10++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i10);
                if (index == androidx.constraintlayout.widget.s.MotionLayout_layoutDescription) {
                    this.R = new b(getContext(), this, typedArrayObtainStyledAttributes.getResourceId(index, -1));
                } else if (index == androidx.constraintlayout.widget.s.MotionLayout_currentState) {
                    this.W = typedArrayObtainStyledAttributes.getResourceId(index, -1);
                } else if (index == androidx.constraintlayout.widget.s.MotionLayout_motionProgress) {
                    this.f1109k0 = typedArrayObtainStyledAttributes.getFloat(index, 0.0f);
                    this.f1111m0 = true;
                } else if (index == androidx.constraintlayout.widget.s.MotionLayout_applyMotionScene) {
                    z10 = typedArrayObtainStyledAttributes.getBoolean(index, z10);
                } else if (index == androidx.constraintlayout.widget.s.MotionLayout_showPaths) {
                    if (this.f1113o0 == 0) {
                        this.f1113o0 = typedArrayObtainStyledAttributes.getBoolean(index, false) ? 2 : 0;
                    }
                } else if (index == androidx.constraintlayout.widget.s.MotionLayout_motionDebug) {
                    this.f1113o0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                }
            }
            typedArrayObtainStyledAttributes.recycle();
            if (!z10) {
                this.R = null;
            }
        }
        if (this.f1113o0 != 0 && (bVar2 = this.R) != null) {
            int iH = bVar2.h();
            b bVar3 = this.R;
            o oVarB = bVar3.b(bVar3.h());
            o6.b.p(getContext(), iH);
            int childCount = getChildCount();
            for (int i11 = 0; i11 < childCount; i11++) {
                View childAt = getChildAt(i11);
                if (oVarB.i(childAt.getId()) == null) {
                    o6.b.q(childAt);
                }
            }
            Integer[] numArr = (Integer[]) oVarB.f1481g.keySet().toArray(new Integer[0]);
            int length = numArr.length;
            int[] iArr = new int[length];
            for (int i12 = 0; i12 < length; i12++) {
                iArr[i12] = numArr[i12].intValue();
            }
            for (int i13 = 0; i13 < length; i13++) {
                int i14 = iArr[i13];
                o6.b.p(getContext(), i14);
                findViewById(iArr[i13]);
                int i15 = oVarB.h(i14).f1391e.f1402d;
                int i16 = oVarB.h(i14).f1391e.f1400c;
            }
            SparseIntArray sparseIntArray = new SparseIntArray();
            SparseIntArray sparseIntArray2 = new SparseIntArray();
            for (b0 b0Var : this.R.f1137d) {
                b0 b0Var2 = this.R.f1136c;
                int i17 = b0Var.f11d;
                int i18 = b0Var.f10c;
                o6.b.p(getContext(), i17);
                o6.b.p(getContext(), i18);
                sparseIntArray.get(i17);
                sparseIntArray2.get(i18);
                sparseIntArray.put(i17, i18);
                sparseIntArray2.put(i18, i17);
                this.R.b(i17);
                this.R.b(i18);
            }
        }
        if (this.W != -1 || (bVar = this.R) == null) {
            return;
        }
        this.W = bVar.h();
        this.V = this.R.h();
        b0 b0Var3 = this.R.f1136c;
        this.f1094a0 = b0Var3 != null ? b0Var3.f10c : -1;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public final void parseLayoutDescription(int i10) {
        this.mConstraintLayoutSpec = null;
    }

    public final void q() {
        b0 b0Var;
        c cVar;
        View viewFindViewById;
        View viewFindViewById2;
        b bVar = this.R;
        if (bVar == null) {
            return;
        }
        if (bVar.a(this.W, this)) {
            requestLayout();
            return;
        }
        int i10 = this.W;
        View view = null;
        if (i10 != -1) {
            b bVar2 = this.R;
            ArrayList<b0> arrayList = bVar2.f1137d;
            for (b0 b0Var2 : arrayList) {
                if (b0Var2.f20m.size() > 0) {
                    Iterator it = b0Var2.f20m.iterator();
                    while (it.hasNext()) {
                        int i11 = ((a0) it.next()).f6b;
                        if (i11 != -1 && (viewFindViewById2 = findViewById(i11)) != null) {
                            viewFindViewById2.setOnClickListener(null);
                        }
                    }
                }
            }
            ArrayList<b0> arrayList2 = bVar2.f1139f;
            for (b0 b0Var3 : arrayList2) {
                if (b0Var3.f20m.size() > 0) {
                    Iterator it2 = b0Var3.f20m.iterator();
                    while (it2.hasNext()) {
                        int i12 = ((a0) it2.next()).f6b;
                        if (i12 != -1 && (viewFindViewById = findViewById(i12)) != null) {
                            viewFindViewById.setOnClickListener(null);
                        }
                    }
                }
            }
            for (b0 b0Var4 : arrayList) {
                if (b0Var4.f20m.size() > 0) {
                    Iterator it3 = b0Var4.f20m.iterator();
                    while (it3.hasNext()) {
                        ((a0) it3.next()).a(this, i10, b0Var4);
                    }
                }
            }
            for (b0 b0Var5 : arrayList2) {
                if (b0Var5.f20m.size() > 0) {
                    Iterator it4 = b0Var5.f20m.iterator();
                    while (it4.hasNext()) {
                        ((a0) it4.next()).a(this, i10, b0Var5);
                    }
                }
            }
        }
        if (!this.R.p() || (b0Var = this.R.f1136c) == null || (cVar = b0Var.f19l) == null) {
            return;
        }
        int i13 = cVar.f1156d;
        if (i13 != -1) {
            MotionLayout motionLayout = cVar.f1170r;
            View viewFindViewById3 = motionLayout.findViewById(i13);
            if (viewFindViewById3 == null) {
                o6.b.p(motionLayout.getContext(), cVar.f1156d);
            }
            view = viewFindViewById3;
        }
        if (view instanceof NestedScrollView) {
            NestedScrollView nestedScrollView = (NestedScrollView) view;
            nestedScrollView.setOnTouchListener(new g2(cVar, 1));
            nestedScrollView.setOnScrollChangeListener(new j0(cVar, 4));
        }
    }

    public final void r() {
        CopyOnWriteArrayList copyOnWriteArrayList;
        if (this.f1112n0 == null && ((copyOnWriteArrayList = this.F0) == null || copyOnWriteArrayList.isEmpty())) {
            return;
        }
        ArrayList<Integer> arrayList = this.f1104f1;
        for (Integer num : arrayList) {
            x xVar = this.f1112n0;
            if (xVar != null) {
                xVar.a(num.intValue());
            }
            CopyOnWriteArrayList copyOnWriteArrayList2 = this.F0;
            if (copyOnWriteArrayList2 != null) {
                Iterator it = copyOnWriteArrayList2.iterator();
                while (it.hasNext()) {
                    ((x) it.next()).a(num.intValue());
                }
            }
        }
        arrayList.clear();
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout, android.view.View, android.view.ViewParent
    public final void requestLayout() {
        b bVar;
        b0 b0Var;
        if (!this.L0 && this.W == -1 && (bVar = this.R) != null && (b0Var = bVar.f1136c) != null) {
            int i10 = b0Var.f24q;
            if (i10 == 0) {
                return;
            }
            if (i10 == 2) {
                int childCount = getChildCount();
                for (int i11 = 0; i11 < childCount; i11++) {
                    ((q) this.f1101e0.get(getChildAt(i11))).f169d = true;
                }
                return;
            }
        }
        super.requestLayout();
    }

    public final void s() {
        this.a1.l();
        invalidate();
    }

    public void setDebugMode(int i10) {
        this.f1113o0 = i10;
        invalidate();
    }

    public void setDelayedApplicationOfInitialState(boolean z10) {
        this.Y0 = z10;
    }

    public void setInteractionEnabled(boolean z10) {
        this.f1099d0 = z10;
    }

    public void setInterpolatedProgress(float f10) {
        if (this.R != null) {
            setState(TransitionState.f1126c);
            Interpolator interpolatorE = this.R.e();
            if (interpolatorE != null) {
                setProgress(interpolatorE.getInterpolation(f10));
                return;
            }
        }
        setProgress(f10);
    }

    public void setOnHide(float f10) {
        ArrayList arrayList = this.D0;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i10 = 0; i10 < size; i10++) {
                ((MotionHelper) this.D0.get(i10)).setProgress(f10);
            }
        }
    }

    public void setOnShow(float f10) {
        ArrayList arrayList = this.C0;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i10 = 0; i10 < size; i10++) {
                ((MotionHelper) this.C0.get(i10)).setProgress(f10);
            }
        }
    }

    public void setProgress(float f10, float f11) {
        if (!isAttachedToWindow()) {
            if (this.V0 == null) {
                this.V0 = new a(this);
            }
            a aVar = this.V0;
            aVar.f1129a = f10;
            aVar.f1130b = f11;
            return;
        }
        setProgress(f10);
        setState(TransitionState.f1126c);
        this.U = f11;
        if (f11 != 0.0f) {
            h(f11 > 0.0f ? 1.0f : 0.0f);
        } else {
            if (f10 == 0.0f || f10 == 1.0f) {
                return;
            }
            h(f10 > 0.5f ? 1.0f : 0.0f);
        }
    }

    public void setScene(b bVar) {
        c cVar;
        this.R = bVar;
        boolean zIsRtl = isRtl();
        bVar.f1149p = zIsRtl;
        b0 b0Var = bVar.f1136c;
        if (b0Var != null && (cVar = b0Var.f19l) != null) {
            cVar.c(zIsRtl);
        }
        s();
    }

    public void setStartState(int i10) {
        if (isAttachedToWindow()) {
            this.W = i10;
            return;
        }
        if (this.V0 == null) {
            this.V0 = new a(this);
        }
        a aVar = this.V0;
        aVar.f1131c = i10;
        aVar.f1132d = i10;
    }

    public void setState(TransitionState transitionState) {
        TransitionState transitionState2 = TransitionState.f1127d;
        if (transitionState == transitionState2 && this.W == -1) {
            return;
        }
        TransitionState transitionState3 = this.Z0;
        this.Z0 = transitionState;
        TransitionState transitionState4 = TransitionState.f1126c;
        if (transitionState3 == transitionState4 && transitionState == transitionState4) {
            k();
        }
        int iOrdinal = transitionState3.ordinal();
        if (iOrdinal != 0 && iOrdinal != 1) {
            if (iOrdinal == 2 && transitionState == transitionState2) {
                l();
                return;
            }
            return;
        }
        if (transitionState == transitionState4) {
            k();
        }
        if (transitionState == transitionState2) {
            l();
        }
    }

    public void setTransition(b0 b0Var) {
        c cVar;
        b bVar = this.R;
        bVar.f1136c = b0Var;
        if (b0Var != null && (cVar = b0Var.f19l) != null) {
            cVar.c(bVar.f1149p);
        }
        setState(TransitionState.f1125b);
        int i10 = this.W;
        b0 b0Var2 = this.R.f1136c;
        if (i10 == (b0Var2 == null ? -1 : b0Var2.f10c)) {
            this.f1107i0 = 1.0f;
            this.f1106h0 = 1.0f;
            this.f1109k0 = 1.0f;
        } else {
            this.f1107i0 = 0.0f;
            this.f1106h0 = 0.0f;
            this.f1109k0 = 0.0f;
        }
        this.f1108j0 = (b0Var.f25r & 1) != 0 ? -1L : getNanoTime();
        int iH = this.R.h();
        b bVar2 = this.R;
        b0 b0Var3 = bVar2.f1136c;
        int i11 = b0Var3 != null ? b0Var3.f10c : -1;
        if (iH == this.V && i11 == this.f1094a0) {
            return;
        }
        this.V = iH;
        this.f1094a0 = i11;
        bVar2.o(iH, i11);
        o oVarB = this.R.b(this.V);
        o oVarB2 = this.R.b(this.f1094a0);
        v vVar = this.a1;
        vVar.k(oVarB, oVarB2);
        int i12 = this.V;
        int i13 = this.f1094a0;
        vVar.f212a = i12;
        vVar.f213b = i13;
        vVar.l();
        s();
    }

    public void setTransitionDuration(int i10) {
        b bVar = this.R;
        if (bVar == null) {
            return;
        }
        b0 b0Var = bVar.f1136c;
        if (b0Var != null) {
            b0Var.f15h = Math.max(i10, 8);
        } else {
            bVar.f1143j = i10;
        }
    }

    public void setTransitionListener(x xVar) {
        this.f1112n0 = xVar;
    }

    public void setTransitionState(Bundle bundle) {
        if (this.V0 == null) {
            this.V0 = new a(this);
        }
        a aVar = this.V0;
        aVar.getClass();
        aVar.f1129a = bundle.getFloat("motion.progress");
        aVar.f1130b = bundle.getFloat("motion.velocity");
        aVar.f1131c = bundle.getInt("motion.StartState");
        aVar.f1132d = bundle.getInt("motion.EndState");
        if (isAttachedToWindow()) {
            this.V0.a();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:26:0x0073  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0085  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x00c5  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void t(float f10, float f11, int i10) {
        c cVar;
        c cVar2;
        c cVar3;
        float f12 = f10;
        if (this.R == null || this.f1107i0 == f12) {
            return;
        }
        this.f1115q0 = true;
        this.f1103f0 = getNanoTime();
        float fC = this.R.c() / 1000.0f;
        this.f1105g0 = fC;
        this.f1109k0 = f12;
        this.f1111m0 = true;
        z.a aVar = this.f1116r0;
        if (i10 == 0 || i10 == 1 || i10 == 2) {
            if (i10 == 1 || i10 == 7) {
                f12 = 0.0f;
            } else if (i10 == 2 || i10 == 6) {
                f12 = 1.0f;
            }
            b bVar = this.R;
            b0 b0Var = bVar.f1136c;
            if (b0Var == null || (cVar2 = b0Var.f19l) == null || cVar2.D == 0) {
                float f13 = this.f1107i0;
                float fG = bVar.g();
                b0 b0Var2 = this.R.f1136c;
                aVar.b(f13, f12, f11, fC, fG, (b0Var2 == null || (cVar = b0Var2.f19l) == null) ? 0.0f : cVar.f1171s);
            } else {
                float f14 = this.f1107i0;
                float f15 = cVar2.f1178z;
                float f16 = cVar2.A;
                float f17 = cVar2.f1177y;
                float f18 = cVar2.B;
                int i11 = cVar2.C;
                if (aVar.f36981b == null) {
                    m mVar = new m();
                    mVar.f33597a = 0.5d;
                    mVar.f33605i = 0;
                    aVar.f36981b = mVar;
                }
                m mVar2 = aVar.f36981b;
                aVar.f36982c = mVar2;
                mVar2.f33599c = f12;
                mVar2.f33597a = f17;
                mVar2.f33601e = f14;
                mVar2.f33598b = f16;
                mVar2.f33603g = f15;
                mVar2.f33604h = f18;
                mVar2.f33605i = i11;
                mVar2.f33600d = 0.0f;
            }
            int i12 = this.W;
            this.f1109k0 = f12;
            this.W = i12;
            this.S = aVar;
        } else {
            t tVar = this.f1117s0;
            if (i10 == 4) {
                float f19 = this.f1107i0;
                float fG2 = this.R.g();
                tVar.f194a = f11;
                tVar.f195b = f19;
                tVar.f196c = fG2;
                this.S = tVar;
            } else if (i10 == 5) {
                float f20 = this.f1107i0;
                float fG3 = this.R.g();
                if (f11 > 0.0f) {
                    float f21 = f11 / fG3;
                    if (((f11 * f21) - (((fG3 * f21) * f21) / 2.0f)) + f20 > 1.0f) {
                        float f22 = this.f1107i0;
                        float fG4 = this.R.g();
                        tVar.f194a = f11;
                        tVar.f195b = f22;
                        tVar.f196c = fG4;
                        this.S = tVar;
                    } else {
                        z.a aVar2 = this.f1116r0;
                        float f23 = this.f1107i0;
                        float f24 = this.f1105g0;
                        float fG5 = this.R.g();
                        b0 b0Var3 = this.R.f1136c;
                        aVar2.b(f23, f10, f11, f24, fG5, (b0Var3 == null || (cVar3 = b0Var3.f19l) == null) ? 0.0f : cVar3.f1171s);
                        this.U = 0.0f;
                        int i13 = this.W;
                        this.f1109k0 = f12;
                        this.W = i13;
                        this.S = aVar;
                    }
                } else {
                    float f25 = (-f11) / fG3;
                    if ((((fG3 * f25) * f25) / 2.0f) + (f11 * f25) + f20 < 0.0f) {
                    }
                }
            } else if (i10 == 6 || i10 == 7) {
            }
        }
        this.f1110l0 = false;
        this.f1103f0 = getNanoTime();
        invalidate();
    }

    @Override // android.view.View
    public final String toString() {
        Context context = getContext();
        return o6.b.p(context, this.V) + "->" + o6.b.p(context, this.f1094a0) + " (pos:" + this.f1107i0 + " Dpos/Dt:" + this.U;
    }

    public final void u() {
        h(1.0f);
        this.W0 = null;
    }

    public final void v(int i10, int i11) {
        o0 o0Var;
        b bVar = this.R;
        if (bVar != null && (o0Var = bVar.f1135b) != null) {
            int i12 = this.W;
            float f10 = -1;
            androidx.constraintlayout.widget.v vVar = (androidx.constraintlayout.widget.v) ((SparseArray) o0Var.f34557a).get(i10);
            if (vVar == null) {
                i12 = i10;
            } else {
                ArrayList arrayList = vVar.f1492b;
                int i13 = vVar.f1493c;
                if (f10 != -1.0f && f10 != -1.0f) {
                    Iterator it = arrayList.iterator();
                    androidx.constraintlayout.widget.w wVar = null;
                    while (true) {
                        if (it.hasNext()) {
                            androidx.constraintlayout.widget.w wVar2 = (androidx.constraintlayout.widget.w) it.next();
                            if (wVar2.a(f10, f10)) {
                                if (i12 == wVar2.f1498e) {
                                    break;
                                } else {
                                    wVar = wVar2;
                                }
                            }
                        } else if (wVar != null) {
                            i12 = wVar.f1498e;
                        }
                    }
                    i12 = i13;
                } else if (i13 != i12) {
                    Iterator it2 = arrayList.iterator();
                    while (it2.hasNext()) {
                        if (i12 == ((androidx.constraintlayout.widget.w) it2.next()).f1498e) {
                            break;
                        }
                    }
                    i12 = i13;
                }
            }
            if (i12 != -1) {
                i10 = i12;
            }
        }
        int i14 = this.W;
        if (i14 == i10) {
            return;
        }
        if (this.V == i10) {
            h(0.0f);
            if (i11 > 0) {
                this.f1105g0 = i11 / 1000.0f;
                return;
            }
            return;
        }
        if (this.f1094a0 == i10) {
            h(1.0f);
            if (i11 > 0) {
                this.f1105g0 = i11 / 1000.0f;
                return;
            }
            return;
        }
        this.f1094a0 = i10;
        if (i14 != -1) {
            setTransition(i14, i10);
            h(1.0f);
            this.f1107i0 = 0.0f;
            u();
            if (i11 > 0) {
                this.f1105g0 = i11 / 1000.0f;
                return;
            }
            return;
        }
        this.f1115q0 = false;
        this.f1109k0 = 1.0f;
        this.f1106h0 = 0.0f;
        this.f1107i0 = 0.0f;
        this.f1108j0 = getNanoTime();
        this.f1103f0 = getNanoTime();
        this.f1110l0 = false;
        this.S = null;
        if (i11 == -1) {
            this.f1105g0 = this.R.c() / 1000.0f;
        }
        this.V = -1;
        this.R.o(-1, this.f1094a0);
        SparseArray sparseArray = new SparseArray();
        if (i11 == 0) {
            this.f1105g0 = this.R.c() / 1000.0f;
        } else if (i11 > 0) {
            this.f1105g0 = i11 / 1000.0f;
        }
        int childCount = getChildCount();
        HashMap map = this.f1101e0;
        map.clear();
        for (int i15 = 0; i15 < childCount; i15++) {
            View childAt = getChildAt(i15);
            map.put(childAt, new q(childAt));
            sparseArray.put(childAt.getId(), (q) map.get(childAt));
        }
        this.f1111m0 = true;
        o oVarB = this.R.b(i10);
        v vVar2 = this.a1;
        vVar2.k(null, oVarB);
        s();
        vVar2.f();
        int childCount2 = getChildCount();
        for (int i16 = 0; i16 < childCount2; i16++) {
            View childAt2 = getChildAt(i16);
            q qVar = (q) map.get(childAt2);
            if (qVar != null) {
                y yVar = qVar.f171f;
                yVar.f223c = 0.0f;
                yVar.f224d = 0.0f;
                yVar.g(childAt2.getX(), childAt2.getY(), childAt2.getWidth(), childAt2.getHeight());
                a0.o oVar = qVar.f173h;
                oVar.getClass();
                childAt2.getX();
                childAt2.getY();
                childAt2.getWidth();
                childAt2.getHeight();
                oVar.f154c = childAt2.getVisibility();
                oVar.f156e = childAt2.getVisibility() != 0 ? 0.0f : childAt2.getAlpha();
                oVar.f157f = childAt2.getElevation();
                oVar.f158g = childAt2.getRotation();
                oVar.f159h = childAt2.getRotationX();
                oVar.f152a = childAt2.getRotationY();
                oVar.f160i = childAt2.getScaleX();
                oVar.f161j = childAt2.getScaleY();
                oVar.f162k = childAt2.getPivotX();
                oVar.f163l = childAt2.getPivotY();
                oVar.f164m = childAt2.getTranslationX();
                oVar.Q = childAt2.getTranslationY();
                oVar.R = childAt2.getTranslationZ();
            }
        }
        int width = getWidth();
        int height = getHeight();
        if (this.E0 != null) {
            for (int i17 = 0; i17 < childCount; i17++) {
                q qVar2 = (q) map.get(getChildAt(i17));
                if (qVar2 != null) {
                    this.R.f(qVar2);
                }
            }
            Iterator it3 = this.E0.iterator();
            while (it3.hasNext()) {
                ((MotionHelper) it3.next()).s(this, map);
            }
            for (int i18 = 0; i18 < childCount; i18++) {
                q qVar3 = (q) map.get(getChildAt(i18));
                if (qVar3 != null) {
                    qVar3.i(width, height, getNanoTime());
                }
            }
        } else {
            for (int i19 = 0; i19 < childCount; i19++) {
                q qVar4 = (q) map.get(getChildAt(i19));
                if (qVar4 != null) {
                    this.R.f(qVar4);
                    qVar4.i(width, height, getNanoTime());
                }
            }
        }
        b0 b0Var = this.R.f1136c;
        float f11 = b0Var != null ? b0Var.f16i : 0.0f;
        if (f11 != 0.0f) {
            float fMin = Float.MAX_VALUE;
            float fMax = -3.4028235E38f;
            for (int i20 = 0; i20 < childCount; i20++) {
                y yVar2 = ((q) map.get(getChildAt(i20))).f172g;
                float f12 = yVar2.f226f + yVar2.f225e;
                fMin = Math.min(fMin, f12);
                fMax = Math.max(fMax, f12);
            }
            for (int i21 = 0; i21 < childCount; i21++) {
                q qVar5 = (q) map.get(getChildAt(i21));
                y yVar3 = qVar5.f172g;
                float f13 = yVar3.f225e;
                float f14 = yVar3.f226f;
                qVar5.f179n = 1.0f / (1.0f - f11);
                qVar5.f178m = f11 - ((((f13 + f14) - fMin) * f11) / (fMax - fMin));
            }
        }
        this.f1106h0 = 0.0f;
        this.f1107i0 = 0.0f;
        this.f1111m0 = true;
        invalidate();
    }

    public final void w(int i10, o oVar) {
        b bVar = this.R;
        if (bVar != null) {
            bVar.f1140g.put(i10, oVar);
        }
        this.a1.k(this.R.b(this.V), this.R.b(this.f1094a0));
        s();
        if (this.W == i10) {
            oVar.b(this);
        }
    }

    public final void x(int i10, View... viewArr) {
        b bVar = this.R;
        if (bVar != null) {
            l.b0 b0Var = bVar.f1150q;
            b0Var.getClass();
            ArrayList arrayList = new ArrayList();
            for (d0 d0Var : (ArrayList) b0Var.f29640b) {
                if (d0Var.f44a == i10) {
                    for (View view : viewArr) {
                        if (d0Var.b(view)) {
                            arrayList.add(view);
                        }
                    }
                    if (!arrayList.isEmpty()) {
                        View[] viewArr2 = (View[]) arrayList.toArray(new View[0]);
                        int currentState = ((MotionLayout) b0Var.f29639a).getCurrentState();
                        if (d0Var.f48e == 2) {
                            d0Var.a(b0Var, (MotionLayout) b0Var.f29639a, currentState, null, viewArr2);
                        } else if (currentState == -1) {
                            ((MotionLayout) b0Var.f29639a).toString();
                        } else {
                            b bVar2 = ((MotionLayout) b0Var.f29639a).R;
                            o oVarB = bVar2 == null ? null : bVar2.b(currentState);
                            if (oVarB != null) {
                                d0Var.a(b0Var, (MotionLayout) b0Var.f29639a, currentState, oVarB, viewArr2);
                            }
                        }
                        arrayList.clear();
                    }
                }
            }
        }
    }

    @Override // androidx.core.view.i0
    public final void onNestedScroll(View view, int i10, int i11, int i12, int i13, int i14, int[] iArr) {
        if (this.f1121w0 || i10 != 0 || i11 != 0) {
            iArr[0] = iArr[0] + i12;
            iArr[1] = iArr[1] + i13;
        }
        this.f1121w0 = false;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void setState(int i10, int i11, int i12) {
        setState(TransitionState.f1125b);
        this.W = i10;
        this.V = -1;
        this.f1094a0 = -1;
        h hVar = this.mConstraintLayoutSpec;
        if (hVar != null) {
            hVar.b(i11, i12, i10);
            return;
        }
        b bVar = this.R;
        if (bVar != null) {
            bVar.b(i10).b(this);
        }
    }

    public void setProgress(float f10) {
        if (f10 >= 0.0f) {
            int i10 = (f10 > 1.0f ? 1 : (f10 == 1.0f ? 0 : -1));
        }
        if (!isAttachedToWindow()) {
            if (this.V0 == null) {
                this.V0 = new a(this);
            }
            this.V0.f1129a = f10;
            return;
        }
        TransitionState transitionState = TransitionState.f1127d;
        TransitionState transitionState2 = TransitionState.f1126c;
        if (f10 <= 0.0f) {
            if (this.f1107i0 == 1.0f && this.W == this.f1094a0) {
                setState(transitionState2);
            }
            this.W = this.V;
            if (this.f1107i0 == 0.0f) {
                setState(transitionState);
            }
        } else if (f10 >= 1.0f) {
            if (this.f1107i0 == 0.0f && this.W == this.V) {
                setState(transitionState2);
            }
            this.W = this.f1094a0;
            if (this.f1107i0 == 1.0f) {
                setState(transitionState);
            }
        } else {
            this.W = -1;
            setState(transitionState2);
        }
        if (this.R == null) {
            return;
        }
        this.f1110l0 = true;
        this.f1109k0 = f10;
        this.f1106h0 = f10;
        this.f1108j0 = -1L;
        this.f1103f0 = -1L;
        this.S = null;
        this.f1111m0 = true;
        invalidate();
    }

    public MotionLayout(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        super(context, attributeSet);
        this.T = null;
        this.U = 0.0f;
        this.V = -1;
        this.W = -1;
        this.f1094a0 = -1;
        this.f1095b0 = 0;
        this.f1097c0 = 0;
        this.f1099d0 = true;
        this.f1101e0 = new HashMap();
        this.f1103f0 = 0L;
        this.f1105g0 = 1.0f;
        this.f1106h0 = 0.0f;
        this.f1107i0 = 0.0f;
        this.f1109k0 = 0.0f;
        this.f1111m0 = false;
        this.f1113o0 = 0;
        this.f1115q0 = false;
        this.f1116r0 = new z.a();
        this.f1117s0 = new t(this);
        this.f1121w0 = false;
        this.B0 = false;
        this.C0 = null;
        this.D0 = null;
        this.E0 = null;
        this.F0 = null;
        this.G0 = 0;
        this.H0 = -1L;
        this.I0 = 0.0f;
        this.J0 = 0;
        this.K0 = 0.0f;
        this.L0 = false;
        this.T0 = new f0(4);
        this.U0 = false;
        this.W0 = null;
        new HashMap();
        this.X0 = new Rect();
        this.Y0 = false;
        this.Z0 = TransitionState.f1124a;
        this.a1 = new v(this);
        this.f1096b1 = false;
        this.f1098c1 = new RectF();
        this.f1100d1 = null;
        this.f1102e1 = null;
        this.f1104f1 = new ArrayList();
        p(attributeSet);
    }

    public void setTransition(int i10, int i11) {
        if (!isAttachedToWindow()) {
            if (this.V0 == null) {
                this.V0 = new a(this);
            }
            a aVar = this.V0;
            aVar.f1131c = i10;
            aVar.f1132d = i11;
            return;
        }
        b bVar = this.R;
        if (bVar != null) {
            this.V = i10;
            this.f1094a0 = i11;
            bVar.o(i10, i11);
            this.a1.k(this.R.b(i10), this.R.b(i11));
            s();
            this.f1107i0 = 0.0f;
            h(0.0f);
        }
    }

    public MotionLayout(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        this.T = null;
        this.U = 0.0f;
        this.V = -1;
        this.W = -1;
        this.f1094a0 = -1;
        this.f1095b0 = 0;
        this.f1097c0 = 0;
        this.f1099d0 = true;
        this.f1101e0 = new HashMap();
        this.f1103f0 = 0L;
        this.f1105g0 = 1.0f;
        this.f1106h0 = 0.0f;
        this.f1107i0 = 0.0f;
        this.f1109k0 = 0.0f;
        this.f1111m0 = false;
        this.f1113o0 = 0;
        this.f1115q0 = false;
        this.f1116r0 = new z.a();
        this.f1117s0 = new t(this);
        this.f1121w0 = false;
        this.B0 = false;
        this.C0 = null;
        this.D0 = null;
        this.E0 = null;
        this.F0 = null;
        this.G0 = 0;
        this.H0 = -1L;
        this.I0 = 0.0f;
        this.J0 = 0;
        this.K0 = 0.0f;
        this.L0 = false;
        this.T0 = new f0(4);
        this.U0 = false;
        this.W0 = null;
        new HashMap();
        this.X0 = new Rect();
        this.Y0 = false;
        this.Z0 = TransitionState.f1124a;
        this.a1 = new v(this);
        this.f1096b1 = false;
        this.f1098c1 = new RectF();
        this.f1100d1 = null;
        this.f1102e1 = null;
        this.f1104f1 = new ArrayList();
        p(attributeSet);
    }

    public void setTransition(int i10) {
        if (this.R != null) {
            b0 b0VarN = n(i10);
            this.V = b0VarN.f11d;
            this.f1094a0 = b0VarN.f10c;
            if (!isAttachedToWindow()) {
                if (this.V0 == null) {
                    this.V0 = new a(this);
                }
                a aVar = this.V0;
                aVar.f1131c = this.V;
                aVar.f1132d = this.f1094a0;
                return;
            }
            int i11 = this.W;
            float f10 = i11 == this.V ? 0.0f : i11 == this.f1094a0 ? 1.0f : Float.NaN;
            b bVar = this.R;
            bVar.f1136c = b0VarN;
            c cVar = b0VarN.f19l;
            if (cVar != null) {
                cVar.c(bVar.f1149p);
            }
            this.a1.k(this.R.b(this.V), this.R.b(this.f1094a0));
            s();
            if (this.f1107i0 != f10) {
                if (f10 == 0.0f) {
                    i(true);
                    this.R.b(this.V).b(this);
                } else if (f10 == 1.0f) {
                    i(false);
                    this.R.b(this.f1094a0).b(this);
                }
            }
            this.f1107i0 = Float.isNaN(f10) ? 0.0f : f10;
            if (Float.isNaN(f10)) {
                o6.b.o();
                h(0.0f);
            } else {
                setProgress(f10);
            }
        }
    }
}
