package pl;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

/* loaded from: classes3.dex */
public final class p extends r {

    /* renamed from: b, reason: collision with root package name */
    private static final r[] f32904b = new r[0];

    /* renamed from: a, reason: collision with root package name */
    private final r[] f32905a;

    public p(Map map) {
        Collection collection = map == null ? null : (Collection) map.get(yk.e.POSSIBLE_FORMATS);
        boolean z10 = (map == null || map.get(yk.e.ASSUME_CODE_39_CHECK_DIGIT) == null) ? false : true;
        ArrayList arrayList = new ArrayList();
        if (collection != null) {
            if (collection.contains(yk.a.EAN_13) || collection.contains(yk.a.UPC_A) || collection.contains(yk.a.EAN_8) || collection.contains(yk.a.UPC_E)) {
                arrayList.add(new q(map));
            }
            if (collection.contains(yk.a.CODE_39)) {
                arrayList.add(new e(z10));
            }
            if (collection.contains(yk.a.CODE_93)) {
                arrayList.add(new g());
            }
            if (collection.contains(yk.a.CODE_128)) {
                arrayList.add(new c());
            }
            if (collection.contains(yk.a.ITF)) {
                arrayList.add(new n());
            }
            if (collection.contains(yk.a.CODABAR)) {
                arrayList.add(new a());
            }
            if (collection.contains(yk.a.RSS_14)) {
                arrayList.add(new ql.e());
            }
            if (collection.contains(yk.a.RSS_EXPANDED)) {
                arrayList.add(new rl.d());
            }
        }
        if (arrayList.isEmpty()) {
            arrayList.add(new q(map));
            arrayList.add(new e());
            arrayList.add(new a());
            arrayList.add(new g());
            arrayList.add(new c());
            arrayList.add(new n());
            arrayList.add(new ql.e());
            arrayList.add(new rl.d());
        }
        this.f32905a = (r[]) arrayList.toArray(f32904b);
    }

    @Override // pl.r
    public yk.q c(int i10, fl.a aVar, Map map) {
        r[] rVarArr = this.f32905a;
        for (int i11 = 0; i11 < rVarArr.length; i11++) {
            try {
                return rVarArr[i11].c(i10, aVar, map);
            } catch (yk.p unused) {
            }
        }
        throw yk.m.a();
    }

    @Override // pl.r, yk.o
    public void reset() {
        for (r rVar : this.f32905a) {
            rVar.reset();
        }
    }
}
