package androidx.compose.ui.viewinterop;

import android.graphics.Rect;
import android.view.View;
import android.view.ViewParent;
import j2.k;
import l1.i;

/* loaded from: classes.dex */
public abstract class f {
    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean d(View view, View view2) {
        for (ViewParent parent = view2.getParent(); parent != null; parent = parent.getParent()) {
            if (parent == view.getParent()) {
                return true;
            }
        }
        return false;
    }

    public static final l1.i e(l1.i iVar) {
        return androidx.compose.ui.focus.g.a(androidx.compose.ui.focus.g.a(iVar.f(FocusGroupPropertiesElement.f2812b)).f(FocusTargetPropertiesElement.f2813b));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Rect f(q1.g gVar, View view, View view2) {
        int[] iArr = new int[2];
        view.getLocationOnScreen(iArr);
        int[] iArr2 = new int[2];
        view2.getLocationOnScreen(iArr2);
        r1.i k10 = gVar.k();
        if (k10 == null) {
            return null;
        }
        return new Rect((((int) k10.i()) + iArr[0]) - iArr2[0], (((int) k10.l()) + iArr[1]) - iArr2[1], (((int) k10.j()) + iArr[0]) - iArr2[0], (((int) k10.e()) + iArr[1]) - iArr2[1]);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final View g(i.c cVar) {
        View R = k.m(cVar.P0()).R();
        if (R != null) {
            return R;
        }
        throw new IllegalStateException("Could not fetch interop view".toString());
    }
}
