package w2;

import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.Collections;
import java.util.Set;

/* JADX INFO: loaded from: classes.dex */
public final class c {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f34126e;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f34128g;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public float f34135n;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public String f34122a = "";

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public String f34123b = "";

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Set f34124c = Collections.emptySet();

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public String f34125d = "";

    @Nullable
    private String fontFamily = null;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f34127f = false;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f34129h = false;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final int f34130i = -1;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f34131j = -1;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f34132k = -1;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int f34133l = -1;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public int f34134m = -1;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public int f34136o = -1;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public boolean f34137p = false;

    private static int updateScoreForMatch(int i10, String str, @Nullable String str2, int i11) {
        if (str.isEmpty() || i10 == -1) {
            return i10;
        }
        if (str.equals(str2)) {
            return i10 + i11;
        }
        return -1;
    }

    @Nullable
    public String getFontFamily() {
        return this.fontFamily;
    }

    public int getSpecificityScore(@Nullable String str, @Nullable String str2, Set<String> set, @Nullable String str3) {
        if (this.f34122a.isEmpty() && this.f34123b.isEmpty() && this.f34124c.isEmpty() && this.f34125d.isEmpty()) {
            return TextUtils.isEmpty(str2) ? 1 : 0;
        }
        int iUpdateScoreForMatch = updateScoreForMatch(updateScoreForMatch(updateScoreForMatch(0, this.f34122a, str, 1073741824), this.f34123b, str2, 2), this.f34125d, str3, 4);
        if (iUpdateScoreForMatch == -1 || !set.containsAll(this.f34124c)) {
            return 0;
        }
        return (this.f34124c.size() * 4) + iUpdateScoreForMatch;
    }

    @CanIgnoreReturnValue
    public c setFontFamily(@Nullable String str) {
        this.fontFamily = str == null ? null : com.google.common.base.h.q(str);
        return this;
    }
}
