package zb;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.NotFoundException;
import com.google.zxing.ReaderException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class h extends j {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final j[] f37146b = new j[0];

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final j[] f37147a;

    public h(Map map) {
        Collection collection = map == null ? null : (Collection) map.get(DecodeHintType.f24317b);
        boolean z10 = (map == null || map.get(DecodeHintType.f24321f) == null) ? false : true;
        ArrayList arrayList = new ArrayList();
        if (collection != null) {
            if (collection.contains(BarcodeFormat.f24309h) || collection.contains(BarcodeFormat.R) || collection.contains(BarcodeFormat.f24308g) || collection.contains(BarcodeFormat.S)) {
                arrayList.add(new i(map));
            }
            if (collection.contains(BarcodeFormat.f24304c)) {
                arrayList.add(new c(z10));
            }
            if (collection.contains(BarcodeFormat.f24305d)) {
                arrayList.add(new d());
            }
            if (collection.contains(BarcodeFormat.f24306e)) {
                arrayList.add(new b());
            }
            if (collection.contains(BarcodeFormat.f24310i)) {
                arrayList.add(new g());
            }
            if (collection.contains(BarcodeFormat.f24303b)) {
                arrayList.add(new a());
            }
            if (collection.contains(BarcodeFormat.f24314m)) {
                arrayList.add(new ac.e());
            }
            if (collection.contains(BarcodeFormat.Q)) {
                arrayList.add(new bc.c());
            }
        }
        if (arrayList.isEmpty()) {
            arrayList.add(new i(map));
            arrayList.add(new c(false));
            arrayList.add(new a());
            arrayList.add(new d());
            arrayList.add(new b());
            arrayList.add(new g());
            arrayList.add(new ac.e());
            arrayList.add(new bc.c());
        }
        this.f37147a = (j[]) arrayList.toArray(f37146b);
    }

    @Override // zb.j
    public final ob.f c(int i10, tb.a aVar, Map map) throws NotFoundException {
        for (j jVar : this.f37147a) {
            try {
                return jVar.c(i10, aVar, map);
            } catch (ReaderException unused) {
            }
        }
        throw NotFoundException.a();
    }

    @Override // zb.j, ob.e
    public final void reset() {
        for (j jVar : this.f37147a) {
            jVar.reset();
        }
    }
}
