package k1;

import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import kotlin.collections.builders.ListBuilder;

/* JADX INFO: loaded from: classes.dex */
public final class i extends kotlin.collections.d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final e1.i f28989a;

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

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

    public i(e1.i iVar, ListBuilder listBuilder, ArrayList arrayList, androidx.collection.o oVar) {
        if (oVar.f957b != arrayList.size() + 1) {
            throw new IllegalArgumentException("Outline progress size is expected to be the cubics size + 1".toString());
        }
        int i10 = oVar.f957b;
        int i11 = 0;
        if (i10 == 0) {
            throw new NoSuchElementException("FloatList is empty.");
        }
        float[] fArr = oVar.f956a;
        float fC = 0.0f;
        if (fArr[0] != 0.0f) {
            throw new IllegalArgumentException("First outline progress value is expected to be zero".toString());
        }
        if (i10 == 0) {
            throw new NoSuchElementException("FloatList is empty.");
        }
        if (fArr[i10 - 1] != 1.0f) {
            throw new IllegalArgumentException("Last outline progress value is expected to be one".toString());
        }
        this.f28989a = iVar;
        this.f28991c = listBuilder;
        ArrayList arrayList2 = new ArrayList();
        int size = arrayList.size();
        while (i11 < size) {
            int i12 = i11 + 1;
            if (oVar.c(i12) - oVar.c(i11) > 1.0E-4f) {
                arrayList2.add(new h(this, (c) arrayList.get(i11), fC, oVar.c(i12)));
                fC = oVar.c(i12);
            }
            i11 = i12;
        }
        h hVar = (h) arrayList2.get(hb.a.b0(arrayList2));
        float f10 = hVar.f28986c;
        if (1.0f < f10) {
            throw new IllegalArgumentException("endOutlineProgress is expected to be equal or greater than startOutlineProgress".toString());
        }
        hVar.f28986c = f10;
        hVar.f28987d = 1.0f;
        this.f28990b = arrayList2;
    }

    @Override // kotlin.collections.AbstractCollection, java.util.Collection, java.util.List
    public final /* bridge */ boolean contains(Object obj) {
        if (obj instanceof h) {
            return super.contains((h) obj);
        }
        return false;
    }

    @Override // java.util.List
    public final Object get(int i10) {
        return (h) this.f28990b.get(i10);
    }

    @Override // kotlin.collections.AbstractCollection
    public final int getSize() {
        return this.f28990b.size();
    }

    @Override // kotlin.collections.d, java.util.List
    public final /* bridge */ int indexOf(Object obj) {
        if (obj instanceof h) {
            return super.indexOf((h) obj);
        }
        return -1;
    }

    @Override // kotlin.collections.d, java.util.List
    public final /* bridge */ int lastIndexOf(Object obj) {
        if (obj instanceof h) {
            return super.lastIndexOf((h) obj);
        }
        return -1;
    }
}
