package a0;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.SparseIntArray;
import androidx.constraintlayout.motion.widget.MotionLayout;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public final class l extends c {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f115e = -1;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public float f116f = Float.NaN;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public float f117g = Float.NaN;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public float f118h = Float.NaN;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public float f119i = Float.NaN;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public float f120j = Float.NaN;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public float f121k = Float.NaN;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public float f122l = Float.NaN;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public float f123m = Float.NaN;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public float f124n = Float.NaN;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public float f125o = Float.NaN;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public float f126p = Float.NaN;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public float f127q = Float.NaN;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public int f128r = 0;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public float f129s = Float.NaN;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public float f130t = 0.0f;

    public l() {
        this.f29d = new HashMap();
    }

    @Override // a0.c
    public final void a(HashMap map) {
        throw new IllegalArgumentException(" KeyTimeCycles do not support SplineSet");
    }

    @Override // a0.c
    /* JADX INFO: renamed from: b */
    public final c clone() {
        l lVar = new l();
        super.c(this);
        lVar.f115e = this.f115e;
        lVar.f128r = this.f128r;
        lVar.f129s = this.f129s;
        lVar.f130t = this.f130t;
        lVar.f127q = this.f127q;
        lVar.f116f = this.f116f;
        lVar.f117g = this.f117g;
        lVar.f118h = this.f118h;
        lVar.f121k = this.f121k;
        lVar.f119i = this.f119i;
        lVar.f120j = this.f120j;
        lVar.f122l = this.f122l;
        lVar.f123m = this.f123m;
        lVar.f124n = this.f124n;
        lVar.f125o = this.f125o;
        lVar.f126p = this.f126p;
        return lVar;
    }

    @Override // a0.c
    public final void d(HashSet hashSet) {
        if (!Float.isNaN(this.f116f)) {
            hashSet.add("alpha");
        }
        if (!Float.isNaN(this.f117g)) {
            hashSet.add("elevation");
        }
        if (!Float.isNaN(this.f118h)) {
            hashSet.add("rotation");
        }
        if (!Float.isNaN(this.f119i)) {
            hashSet.add("rotationX");
        }
        if (!Float.isNaN(this.f120j)) {
            hashSet.add("rotationY");
        }
        if (!Float.isNaN(this.f124n)) {
            hashSet.add("translationX");
        }
        if (!Float.isNaN(this.f125o)) {
            hashSet.add("translationY");
        }
        if (!Float.isNaN(this.f126p)) {
            hashSet.add("translationZ");
        }
        if (!Float.isNaN(this.f121k)) {
            hashSet.add("transitionPathRotate");
        }
        if (!Float.isNaN(this.f122l)) {
            hashSet.add("scaleX");
        }
        if (!Float.isNaN(this.f123m)) {
            hashSet.add("scaleY");
        }
        if (!Float.isNaN(this.f127q)) {
            hashSet.add("progress");
        }
        if (this.f29d.size() > 0) {
            Iterator it = this.f29d.keySet().iterator();
            while (it.hasNext()) {
                hashSet.add("CUSTOM," + ((String) it.next()));
            }
        }
    }

    @Override // a0.c
    public final void e(Context context, AttributeSet attributeSet) {
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, androidx.constraintlayout.widget.s.KeyTimeCycle);
        SparseIntArray sparseIntArray = k.f114a;
        int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
        for (int i10 = 0; i10 < indexCount; i10++) {
            int index = typedArrayObtainStyledAttributes.getIndex(i10);
            SparseIntArray sparseIntArray2 = k.f114a;
            switch (sparseIntArray2.get(index)) {
                case 1:
                    this.f116f = typedArrayObtainStyledAttributes.getFloat(index, this.f116f);
                    break;
                case 2:
                    this.f117g = typedArrayObtainStyledAttributes.getDimension(index, this.f117g);
                    break;
                case 3:
                case 11:
                default:
                    Integer.toHexString(index);
                    sparseIntArray2.get(index);
                    break;
                case 4:
                    this.f118h = typedArrayObtainStyledAttributes.getFloat(index, this.f118h);
                    break;
                case 5:
                    this.f119i = typedArrayObtainStyledAttributes.getFloat(index, this.f119i);
                    break;
                case 6:
                    this.f120j = typedArrayObtainStyledAttributes.getFloat(index, this.f120j);
                    break;
                case 7:
                    this.f122l = typedArrayObtainStyledAttributes.getFloat(index, this.f122l);
                    break;
                case 8:
                    this.f121k = typedArrayObtainStyledAttributes.getFloat(index, this.f121k);
                    break;
                case 9:
                    typedArrayObtainStyledAttributes.getString(index);
                    break;
                case 10:
                    if (MotionLayout.f1093g1) {
                        int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, this.f27b);
                        this.f27b = resourceId;
                        if (resourceId == -1) {
                            this.f28c = typedArrayObtainStyledAttributes.getString(index);
                        }
                    } else if (typedArrayObtainStyledAttributes.peekValue(index).type == 3) {
                        this.f28c = typedArrayObtainStyledAttributes.getString(index);
                    } else {
                        this.f27b = typedArrayObtainStyledAttributes.getResourceId(index, this.f27b);
                    }
                    break;
                case 12:
                    this.f26a = typedArrayObtainStyledAttributes.getInt(index, this.f26a);
                    break;
                case 13:
                    this.f115e = typedArrayObtainStyledAttributes.getInteger(index, this.f115e);
                    break;
                case 14:
                    this.f123m = typedArrayObtainStyledAttributes.getFloat(index, this.f123m);
                    break;
                case 15:
                    this.f124n = typedArrayObtainStyledAttributes.getDimension(index, this.f124n);
                    break;
                case 16:
                    this.f125o = typedArrayObtainStyledAttributes.getDimension(index, this.f125o);
                    break;
                case 17:
                    this.f126p = typedArrayObtainStyledAttributes.getDimension(index, this.f126p);
                    break;
                case 18:
                    this.f127q = typedArrayObtainStyledAttributes.getFloat(index, this.f127q);
                    break;
                case 19:
                    if (typedArrayObtainStyledAttributes.peekValue(index).type == 3) {
                        typedArrayObtainStyledAttributes.getString(index);
                        this.f128r = 7;
                    } else {
                        this.f128r = typedArrayObtainStyledAttributes.getInt(index, this.f128r);
                    }
                    break;
                case 20:
                    this.f129s = typedArrayObtainStyledAttributes.getFloat(index, this.f129s);
                    break;
                case 21:
                    if (typedArrayObtainStyledAttributes.peekValue(index).type == 5) {
                        this.f130t = typedArrayObtainStyledAttributes.getDimension(index, this.f130t);
                    } else {
                        this.f130t = typedArrayObtainStyledAttributes.getFloat(index, this.f130t);
                    }
                    break;
            }
        }
    }

    @Override // a0.c
    public final void f(HashMap map) {
        if (this.f115e == -1) {
            return;
        }
        if (!Float.isNaN(this.f116f)) {
            map.put("alpha", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f117g)) {
            map.put("elevation", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f118h)) {
            map.put("rotation", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f119i)) {
            map.put("rotationX", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f120j)) {
            map.put("rotationY", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f124n)) {
            map.put("translationX", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f125o)) {
            map.put("translationY", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f126p)) {
            map.put("translationZ", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f121k)) {
            map.put("transitionPathRotate", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f122l)) {
            map.put("scaleX", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f122l)) {
            map.put("scaleY", Integer.valueOf(this.f115e));
        }
        if (!Float.isNaN(this.f127q)) {
            map.put("progress", Integer.valueOf(this.f115e));
        }
        if (this.f29d.size() > 0) {
            Iterator it = this.f29d.keySet().iterator();
            while (it.hasNext()) {
                map.put(defpackage.e.i("CUSTOM,", (String) it.next()), Integer.valueOf(this.f115e));
            }
        }
    }

    public final void h(HashMap map) {
        for (String str : map.keySet()) {
            z.p pVar = (z.p) map.get(str);
            if (pVar != null) {
                if (!str.startsWith("CUSTOM")) {
                    switch (str) {
                        case "rotationX":
                            if (Float.isNaN(this.f119i)) {
                                break;
                            } else {
                                pVar.b(this.f119i, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "rotationY":
                            if (Float.isNaN(this.f120j)) {
                                break;
                            } else {
                                pVar.b(this.f120j, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "translationX":
                            if (Float.isNaN(this.f124n)) {
                                break;
                            } else {
                                pVar.b(this.f124n, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "translationY":
                            if (Float.isNaN(this.f125o)) {
                                break;
                            } else {
                                pVar.b(this.f125o, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "translationZ":
                            if (Float.isNaN(this.f126p)) {
                                break;
                            } else {
                                pVar.b(this.f126p, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "progress":
                            if (Float.isNaN(this.f127q)) {
                                break;
                            } else {
                                pVar.b(this.f127q, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "scaleX":
                            if (Float.isNaN(this.f122l)) {
                                break;
                            } else {
                                pVar.b(this.f122l, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "scaleY":
                            if (Float.isNaN(this.f123m)) {
                                break;
                            } else {
                                pVar.b(this.f123m, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "rotation":
                            if (Float.isNaN(this.f118h)) {
                                break;
                            } else {
                                pVar.b(this.f118h, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "elevation":
                            if (Float.isNaN(this.f117g)) {
                                break;
                            } else {
                                pVar.b(this.f117g, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "transitionPathRotate":
                            if (Float.isNaN(this.f121k)) {
                                break;
                            } else {
                                pVar.b(this.f121k, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                        case "alpha":
                            if (Float.isNaN(this.f116f)) {
                                break;
                            } else {
                                pVar.b(this.f116f, this.f129s, this.f130t, this.f26a, this.f128r);
                                break;
                            }
                            break;
                    }
                } else {
                    androidx.constraintlayout.widget.a aVar = (androidx.constraintlayout.widget.a) this.f29d.get(str.substring(7));
                    if (aVar != null) {
                        z.m mVar = (z.m) pVar;
                        int i10 = this.f26a;
                        float f10 = this.f129s;
                        int i11 = this.f128r;
                        float f11 = this.f130t;
                        mVar.f37004l.append(i10, aVar);
                        mVar.f37005m.append(i10, new float[]{f10, f11});
                        mVar.f33622b = Math.max(mVar.f33622b, i11);
                    }
                }
            }
        }
    }
}
