package ug;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.t;
import sm.u;
import sm.v;

/* loaded from: classes4.dex */
public final class a extends c {

    /* renamed from: c, reason: collision with root package name */
    private static final List f37174c;

    /* renamed from: d, reason: collision with root package name */
    public static final C0892a f37175d = new C0892a(null);

    /* renamed from: b, reason: collision with root package name */
    private final e f37176b;

    /* renamed from: ug.a$a, reason: collision with other inner class name */
    /* loaded from: classes4.dex */
    public static final class C0892a {
        private C0892a() {
        }

        public /* synthetic */ C0892a(k kVar) {
            this();
        }
    }

    static {
        List n10;
        n10 = u.n("or", "and");
        f37174c = n10;
    }

    public a(e definition) {
        t.g(definition, "definition");
        this.f37176b = definition;
    }

    @Override // ug.c
    public /* synthetic */ vg.e a() {
        int v10;
        if (!(this.f37176b.e() instanceof String) || !(this.f37176b.a() instanceof List) || this.f37176b.a().isEmpty()) {
            return null;
        }
        String e10 = this.f37176b.e();
        Locale locale = Locale.ROOT;
        t.f(locale, "Locale.ROOT");
        if (e10 == null) {
            throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
        }
        String lowerCase = e10.toLowerCase(locale);
        t.f(lowerCase, "(this as java.lang.String).toLowerCase(locale)");
        if (!f37174c.contains(lowerCase)) {
            wg.t.b("LaunchRulesEngine", "GroupCondition", "Unsupported logical operator: " + lowerCase, new Object[0]);
            return null;
        }
        List a10 = this.f37176b.a();
        v10 = v.v(a10, 10);
        ArrayList arrayList = new ArrayList(v10);
        Iterator it = a10.iterator();
        while (it.hasNext()) {
            arrayList.add(((c) it.next()).a());
        }
        return new vg.h(arrayList, lowerCase);
    }
}
