package J2;

import java.util.Iterator;

/* JADX INFO: renamed from: J2.k, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0418k implements InterfaceC0406e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final boolean f3398a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f3399b;

    public C0418k(boolean z6, String str) {
        this.f3398a = z6;
        this.f3399b = str;
    }

    @Override // J2.InterfaceC0406e
    public final boolean a(AbstractC0399a0 abstractC0399a0) {
        int i6;
        boolean z6 = this.f3398a;
        String strM = this.f3399b;
        if (z6 && strM == null) {
            strM = abstractC0399a0.m();
        }
        Y y6 = abstractC0399a0.f3371b;
        if (y6 != null) {
            Iterator it = y6.getChildren().iterator();
            i6 = 0;
            while (it.hasNext()) {
                AbstractC0399a0 abstractC0399a02 = (AbstractC0399a0) ((AbstractC0403c0) it.next());
                if (strM == null || abstractC0399a02.m().equals(strM)) {
                    i6++;
                }
            }
        } else {
            i6 = 1;
        }
        return i6 == 1;
    }

    public final String toString() {
        return this.f3398a ? com.google.android.recaptcha.internal.a.n(new StringBuilder("only-of-type <"), this.f3399b, ">") : "only-child";
    }
}
