package defpackage;

import com.bumptech.glide.load.engine.GlideException;
import java.util.ArrayList;
import java.util.List;

/* renamed from: ᵳʦˊˉ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4543 implements InterfaceC2918, InterfaceC0782 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public boolean f16893;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public List f16894;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final InterfaceC3956 f16895;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public InterfaceC0782 f16896;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final ArrayList f16897;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public EnumC5505 f16898;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public int f16899;

    public C4543(ArrayList arrayList, InterfaceC3956 interfaceC3956) {
        this.f16895 = interfaceC3956;
        if (arrayList.isEmpty()) {
            ᵹˉᵞ.ˌᵜᵹᵩ("Must not be empty.");
            throw null;
        }
        this.f16897 = arrayList;
        this.f16899 = 0;
    }

    @Override // defpackage.InterfaceC2918
    public final void cancel() {
        this.f16893 = true;
        ArrayList arrayList = this.f16897;
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayList.get(i);
            i++;
            ((InterfaceC2918) obj).cancel();
        }
    }

    @Override // defpackage.InterfaceC2918
    /* renamed from: ˇʼʤˎ */
    public final void mo5387(EnumC5505 enumC5505, InterfaceC0782 interfaceC0782) {
        this.f16898 = enumC5505;
        this.f16896 = interfaceC0782;
        this.f16894 = (List) this.f16895.mo8275();
        ((InterfaceC2918) this.f16897.get(this.f16899)).mo5387(enumC5505, this);
        if (this.f16893) {
            cancel();
        }
    }

    @Override // defpackage.InterfaceC0782
    /* renamed from: ˎˏʜʾ */
    public final void mo2869(Object obj) {
        if (obj != null) {
            this.f16896.mo2869(obj);
        } else {
            m9656();
        }
    }

    @Override // defpackage.InterfaceC2918
    /* renamed from: ˏˋٴ */
    public final int mo5388() {
        return ((InterfaceC2918) this.f16897.get(0)).mo5388();
    }

    @Override // defpackage.InterfaceC0782
    /* renamed from: ˏᵙ */
    public final void mo2870(Exception exc) {
        List list = this.f16894;
        ᵼᵙᵖᵱ.ˏˋٴ(list, "Argument must not be null");
        list.add(exc);
        m9656();
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m9656() {
        if (this.f16893) {
            return;
        }
        if (this.f16899 < this.f16897.size() - 1) {
            this.f16899++;
            mo5387(this.f16898, this.f16896);
        } else {
            ᵼᵙᵖᵱ.ˇʼʤˎ(this.f16894);
            this.f16896.mo2870(new GlideException("Fetch failed", new ArrayList(this.f16894)));
        }
    }

    @Override // defpackage.InterfaceC2918
    /* renamed from: ᵴᵳ */
    public final Class mo1817() {
        return ((InterfaceC2918) this.f16897.get(0)).mo1817();
    }

    @Override // defpackage.InterfaceC2918
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo5389() {
        List list = this.f16894;
        if (list != null) {
            this.f16895.mo8276(list);
        }
        this.f16894 = null;
        ArrayList arrayList = this.f16897;
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayList.get(i);
            i++;
            ((InterfaceC2918) obj).mo5389();
        }
    }
}
