package ῲ.ⁱ.K.ῲ;

import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseIntArray;
import androidx.constraintlayout.motion.widget.MotionLayout;
import androidx.constraintlayout.widget.ConstraintAttribute;
import androidx.constraintlayout.widget.R$styleable;
import com.facebook.internal.security.CertificateUtil;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import ඓ.K.K.K.C1293;
import ῲ.ⁱ.K.ῲ.AbstractC2140;

/* renamed from: ῲ.ⁱ.K.ῲ.㴹  reason: contains not printable characters */
/* compiled from: KeyCycle */
public class C2163 extends AbstractC2109 {

    /* renamed from: Ԕ  reason: contains not printable characters */
    public float f7521 = Float.NaN;

    /* renamed from: Ԛ  reason: contains not printable characters */
    public float f7522 = Float.NaN;

    /* renamed from: ؿ  reason: contains not printable characters */
    public float f7523 = Float.NaN;

    /* renamed from: ݜ  reason: contains not printable characters */
    public float f7524 = Float.NaN;

    /* renamed from: ඓ  reason: contains not printable characters */
    public String f7525;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public float f7526 = Float.NaN;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public int f7527 = -1;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public float f7528 = 0.0f;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f7529 = -1;

    /* renamed from: 㑃  reason: contains not printable characters */
    public float f7530 = Float.NaN;

    /* renamed from: 㗗  reason: contains not printable characters */
    public float f7531 = Float.NaN;

    /* renamed from: 㗽  reason: contains not printable characters */
    public float f7532 = Float.NaN;

    /* renamed from: 㳳  reason: contains not printable characters */
    public float f7533 = Float.NaN;

    /* renamed from: 㴹  reason: contains not printable characters */
    public int f7534 = 0;

    /* renamed from: 㶋  reason: contains not printable characters */
    public float f7535 = Float.NaN;

    /* renamed from: 㿎  reason: contains not printable characters */
    public float f7536 = Float.NaN;

    /* renamed from: 䀟  reason: contains not printable characters */
    public float f7537 = Float.NaN;

    /* renamed from: 䁗  reason: contains not printable characters */
    public float f7538 = Float.NaN;

    /* renamed from: ῲ.ⁱ.K.ῲ.㴹$K  reason: contains not printable characters */
    /* compiled from: KeyCycle */
    public static class C2164 {

        /* renamed from: K  reason: contains not printable characters */
        public static SparseIntArray f7539 = new SparseIntArray();

        static {
            f7539.append(R$styleable.KeyCycle_motionTarget, 1);
            f7539.append(R$styleable.KeyCycle_framePosition, 2);
            f7539.append(R$styleable.KeyCycle_transitionEasing, 3);
            f7539.append(R$styleable.KeyCycle_curveFit, 4);
            f7539.append(R$styleable.KeyCycle_waveShape, 5);
            f7539.append(R$styleable.KeyCycle_wavePeriod, 6);
            f7539.append(R$styleable.KeyCycle_waveOffset, 7);
            f7539.append(R$styleable.KeyCycle_waveVariesBy, 8);
            f7539.append(R$styleable.KeyCycle_android_alpha, 9);
            f7539.append(R$styleable.KeyCycle_android_elevation, 10);
            f7539.append(R$styleable.KeyCycle_android_rotation, 11);
            f7539.append(R$styleable.KeyCycle_android_rotationX, 12);
            f7539.append(R$styleable.KeyCycle_android_rotationY, 13);
            f7539.append(R$styleable.KeyCycle_transitionPathRotate, 14);
            f7539.append(R$styleable.KeyCycle_android_scaleX, 15);
            f7539.append(R$styleable.KeyCycle_android_scaleY, 16);
            f7539.append(R$styleable.KeyCycle_android_translationX, 17);
            f7539.append(R$styleable.KeyCycle_android_translationY, 18);
            f7539.append(R$styleable.KeyCycle_android_translationZ, 19);
            f7539.append(R$styleable.KeyCycle_motionProgress, 20);
        }

        /* renamed from: K  reason: contains not printable characters */
        public static /* synthetic */ void m5688(C2163 r5, TypedArray typedArray) {
            int indexCount = typedArray.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = typedArray.getIndex(i);
                switch (f7539.get(index)) {
                    case 1:
                        if (!MotionLayout.f691) {
                            if (typedArray.peekValue(index).type == 3) {
                                r5.f7329 = typedArray.getString(index);
                                break;
                            } else {
                                r5.f7330 = typedArray.getResourceId(index, r5.f7330);
                                break;
                            }
                        } else {
                            r5.f7330 = typedArray.getResourceId(index, r5.f7330);
                            if (r5.f7330 == -1) {
                                r5.f7329 = typedArray.getString(index);
                                break;
                            } else {
                                break;
                            }
                        }
                    case 2:
                        r5.f7331 = typedArray.getInt(index, r5.f7331);
                        break;
                    case 3:
                        r5.f7525 = typedArray.getString(index);
                        break;
                    case 4:
                        r5.f7534 = typedArray.getInteger(index, r5.f7534);
                        break;
                    case 5:
                        r5.f7529 = typedArray.getInt(index, r5.f7529);
                        break;
                    case 6:
                        r5.f7536 = typedArray.getFloat(index, r5.f7536);
                        break;
                    case 7:
                        if (typedArray.peekValue(index).type == 5) {
                            r5.f7528 = typedArray.getDimension(index, r5.f7528);
                            break;
                        } else {
                            r5.f7528 = typedArray.getFloat(index, r5.f7528);
                            break;
                        }
                    case 8:
                        r5.f7527 = typedArray.getInt(index, r5.f7527);
                        break;
                    case 9:
                        r5.f7530 = typedArray.getFloat(index, r5.f7530);
                        break;
                    case 10:
                        r5.f7538 = typedArray.getDimension(index, r5.f7538);
                        break;
                    case 11:
                        r5.f7521 = typedArray.getFloat(index, r5.f7521);
                        break;
                    case 12:
                        r5.f7523 = typedArray.getFloat(index, r5.f7523);
                        break;
                    case 13:
                        r5.f7526 = typedArray.getFloat(index, r5.f7526);
                        break;
                    case 14:
                        r5.f7531 = typedArray.getFloat(index, r5.f7531);
                        break;
                    case 15:
                        r5.f7532 = typedArray.getFloat(index, r5.f7532);
                        break;
                    case 16:
                        r5.f7524 = typedArray.getFloat(index, r5.f7524);
                        break;
                    case 17:
                        r5.f7537 = typedArray.getDimension(index, r5.f7537);
                        break;
                    case 18:
                        r5.f7522 = typedArray.getDimension(index, r5.f7522);
                        break;
                    case 19:
                        int i2 = Build.VERSION.SDK_INT;
                        r5.f7535 = typedArray.getDimension(index, r5.f7535);
                        break;
                    case 20:
                        r5.f7533 = typedArray.getFloat(index, r5.f7533);
                        break;
                    default:
                        StringBuilder r3 = C1293.m3416("unused attribute 0x");
                        r3.append(Integer.toHexString(index));
                        r3.append("   ");
                        r3.append(f7539.get(index));
                        Log.e("KeyCycle", r3.toString());
                        break;
                }
            }
        }
    }

    public C2163() {
        this.f7332 = new HashMap<>();
    }

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARNING: Code restructure failed: missing block: B:31:0x009e, code lost:
        if (r1.equals("scaleY") != false) goto L_0x00ec;
     */
    /* renamed from: ʬ  reason: contains not printable characters */
    public void m5684(HashMap<String, AbstractC2140> hashMap) {
        float f;
        Iterator<String> it2 = hashMap.keySet().iterator();
        while (it2.hasNext()) {
            String next = it2.next();
            char c = 7;
            if (next.startsWith("CUSTOM")) {
                ConstraintAttribute constraintAttribute = this.f7332.get(next.substring(7));
                if (constraintAttribute != null && constraintAttribute.f984 == ConstraintAttribute.AttributeType.FLOAT_TYPE) {
                    AbstractC2140 r1 = hashMap.get(next);
                    int i = this.f7331;
                    int i2 = this.f7529;
                    int i3 = this.f7527;
                    r1.f7484.add(new AbstractC2140.C2143(i, this.f7536, this.f7528, constraintAttribute.m544()));
                    if (i3 != -1) {
                        r1.f7481 = i3;
                    }
                    r1.f7485 = i2;
                    r1.f7482 = constraintAttribute;
                }
            } else {
                switch (next.hashCode()) {
                    case -1249320806:
                        if (next.equals("rotationX")) {
                            c = 3;
                            break;
                        }
                        c = 65535;
                        break;
                    case -1249320805:
                        if (next.equals("rotationY")) {
                            c = 4;
                            break;
                        }
                        c = 65535;
                        break;
                    case -1225497657:
                        if (next.equals("translationX")) {
                            c = '\b';
                            break;
                        }
                        c = 65535;
                        break;
                    case -1225497656:
                        if (next.equals("translationY")) {
                            c = '\t';
                            break;
                        }
                        c = 65535;
                        break;
                    case -1225497655:
                        if (next.equals("translationZ")) {
                            c = '\n';
                            break;
                        }
                        c = 65535;
                        break;
                    case -1001078227:
                        if (next.equals("progress")) {
                            c = '\f';
                            break;
                        }
                        c = 65535;
                        break;
                    case -908189618:
                        if (next.equals("scaleX")) {
                            c = 6;
                            break;
                        }
                        c = 65535;
                        break;
                    case -908189617:
                        break;
                    case -40300674:
                        if (next.equals("rotation")) {
                            c = 2;
                            break;
                        }
                        c = 65535;
                        break;
                    case -4379043:
                        if (next.equals("elevation")) {
                            c = 1;
                            break;
                        }
                        c = 65535;
                        break;
                    case 37232917:
                        if (next.equals("transitionPathRotate")) {
                            c = 5;
                            break;
                        }
                        c = 65535;
                        break;
                    case 92909918:
                        if (next.equals("alpha")) {
                            c = 0;
                            break;
                        }
                        c = 65535;
                        break;
                    case 156108012:
                        if (next.equals("waveOffset")) {
                            c = 11;
                            break;
                        }
                        c = 65535;
                        break;
                    default:
                        c = 65535;
                        break;
                }
                switch (c) {
                    case 0:
                        f = this.f7530;
                        break;
                    case 1:
                        f = this.f7538;
                        break;
                    case 2:
                        f = this.f7521;
                        break;
                    case 3:
                        f = this.f7523;
                        break;
                    case 4:
                        f = this.f7526;
                        break;
                    case 5:
                        f = this.f7531;
                        break;
                    case 6:
                        f = this.f7532;
                        break;
                    case 7:
                        f = this.f7524;
                        break;
                    case '\b':
                        f = this.f7537;
                        break;
                    case '\t':
                        f = this.f7522;
                        break;
                    case '\n':
                        f = this.f7535;
                        break;
                    case 11:
                        f = this.f7528;
                        break;
                    case '\f':
                        f = this.f7533;
                        break;
                    default:
                        Log.v("KeyCycle", "WARNING! KeyCycle UNKNOWN  " + next);
                        f = Float.NaN;
                        break;
                }
                if (!Float.isNaN(f)) {
                    AbstractC2140 r12 = hashMap.get(next);
                    int i4 = this.f7331;
                    int i5 = this.f7529;
                    int i6 = this.f7527;
                    r12.f7484.add(new AbstractC2140.C2143(i4, this.f7536, this.f7528, f));
                    if (i6 != -1) {
                        r12.f7481 = i6;
                    }
                    r12.f7485 = i5;
                }
            }
        }
    }

    @Override // ῲ.ⁱ.K.ῲ.AbstractC2109
    /* renamed from: K  reason: contains not printable characters */
    public void m5685(Context context, AttributeSet attributeSet) {
        C2164.m5688(this, context.obtainStyledAttributes(attributeSet, R$styleable.KeyCycle));
    }

    @Override // ῲ.ⁱ.K.ῲ.AbstractC2109
    /* renamed from: K  reason: contains not printable characters */
    public void m5687(HashSet<String> hashSet) {
        if (!Float.isNaN(this.f7530)) {
            hashSet.add("alpha");
        }
        if (!Float.isNaN(this.f7538)) {
            hashSet.add("elevation");
        }
        if (!Float.isNaN(this.f7521)) {
            hashSet.add("rotation");
        }
        if (!Float.isNaN(this.f7523)) {
            hashSet.add("rotationX");
        }
        if (!Float.isNaN(this.f7526)) {
            hashSet.add("rotationY");
        }
        if (!Float.isNaN(this.f7532)) {
            hashSet.add("scaleX");
        }
        if (!Float.isNaN(this.f7524)) {
            hashSet.add("scaleY");
        }
        if (!Float.isNaN(this.f7531)) {
            hashSet.add("transitionPathRotate");
        }
        if (!Float.isNaN(this.f7537)) {
            hashSet.add("translationX");
        }
        if (!Float.isNaN(this.f7522)) {
            hashSet.add("translationY");
        }
        if (!Float.isNaN(this.f7535)) {
            hashSet.add("translationZ");
        }
        if (this.f7332.size() > 0) {
            Iterator<String> it2 = this.f7332.keySet().iterator();
            while (it2.hasNext()) {
                hashSet.add("CUSTOM," + it2.next());
            }
        }
    }

    @Override // ῲ.ⁱ.K.ῲ.AbstractC2109
    /* renamed from: K  reason: contains not printable characters */
    public void m5686(HashMap<String, AbstractC2113> hashMap) {
        StringBuilder r0 = C1293.m3416("add ");
        r0.append(hashMap.size());
        r0.append(" values");
        String sb = r0.toString();
        StackTraceElement[] stackTrace = new Throwable().getStackTrace();
        int min = Math.min(2, stackTrace.length - 1);
        String str = " ";
        for (int i = 1; i <= min; i++) {
            StackTraceElement stackTraceElement = stackTrace[i];
            StringBuilder r7 = C1293.m3416(".(");
            r7.append(stackTrace[i].getFileName());
            r7.append(CertificateUtil.DELIMITER);
            r7.append(stackTrace[i].getLineNumber());
            r7.append(") ");
            r7.append(stackTrace[i].getMethodName());
            String sb2 = r7.toString();
            str = C1293.m3412(str, " ");
            Log.v("KeyCycle", sb + str + sb2 + str);
        }
        for (String str2 : hashMap.keySet()) {
            AbstractC2113 r2 = hashMap.get(str2);
            char c = 65535;
            switch (str2.hashCode()) {
                case -1249320806:
                    if (str2.equals("rotationX")) {
                        c = 3;
                        break;
                    }
                    break;
                case -1249320805:
                    if (str2.equals("rotationY")) {
                        c = 4;
                        break;
                    }
                    break;
                case -1225497657:
                    if (str2.equals("translationX")) {
                        c = '\b';
                        break;
                    }
                    break;
                case -1225497656:
                    if (str2.equals("translationY")) {
                        c = '\t';
                        break;
                    }
                    break;
                case -1225497655:
                    if (str2.equals("translationZ")) {
                        c = '\n';
                        break;
                    }
                    break;
                case -1001078227:
                    if (str2.equals("progress")) {
                        c = '\f';
                        break;
                    }
                    break;
                case -908189618:
                    if (str2.equals("scaleX")) {
                        c = 6;
                        break;
                    }
                    break;
                case -908189617:
                    if (str2.equals("scaleY")) {
                        c = 7;
                        break;
                    }
                    break;
                case -40300674:
                    if (str2.equals("rotation")) {
                        c = 2;
                        break;
                    }
                    break;
                case -4379043:
                    if (str2.equals("elevation")) {
                        c = 1;
                        break;
                    }
                    break;
                case 37232917:
                    if (str2.equals("transitionPathRotate")) {
                        c = 5;
                        break;
                    }
                    break;
                case 92909918:
                    if (str2.equals("alpha")) {
                        c = 0;
                        break;
                    }
                    break;
                case 156108012:
                    if (str2.equals("waveOffset")) {
                        c = 11;
                        break;
                    }
                    break;
            }
            switch (c) {
                case 0:
                    r2.m5603(this.f7331, this.f7530);
                    break;
                case 1:
                    r2.m5603(this.f7331, this.f7538);
                    break;
                case 2:
                    r2.m5603(this.f7331, this.f7521);
                    break;
                case 3:
                    r2.m5603(this.f7331, this.f7523);
                    break;
                case 4:
                    r2.m5603(this.f7331, this.f7526);
                    break;
                case 5:
                    r2.m5603(this.f7331, this.f7531);
                    break;
                case 6:
                    r2.m5603(this.f7331, this.f7532);
                    break;
                case 7:
                    r2.m5603(this.f7331, this.f7524);
                    break;
                case '\b':
                    r2.m5603(this.f7331, this.f7537);
                    break;
                case '\t':
                    r2.m5603(this.f7331, this.f7522);
                    break;
                case '\n':
                    r2.m5603(this.f7331, this.f7535);
                    break;
                case 11:
                    r2.m5603(this.f7331, this.f7528);
                    break;
                case '\f':
                    r2.m5603(this.f7331, this.f7533);
                    break;
                default:
                    Log.v("KeyCycle", "WARNING KeyCycle UNKNOWN  " + str2);
                    break;
            }
        }
    }
}
