package F1;

import android.os.Build;
import android.view.View;
import android.view.WindowInsets;
import java.lang.reflect.Field;
import java.util.Objects;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final m0 f1457b;

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

    static {
        int i6 = Build.VERSION.SDK_INT;
        if (i6 >= 34) {
            f1457b = g0.f1438s;
        } else if (i6 >= 30) {
            f1457b = f0.f1437r;
        } else {
            f1457b = h0.f1442b;
        }
    }

    public m0(WindowInsets windowInsets) {
        int i6 = Build.VERSION.SDK_INT;
        if (i6 >= 34) {
            this.f1458a = new g0(this, windowInsets);
            return;
        }
        if (i6 >= 30) {
            this.f1458a = new f0(this, windowInsets);
            return;
        }
        if (i6 >= 29) {
            this.f1458a = new e0(this, windowInsets);
        } else if (i6 >= 28) {
            this.f1458a = new d0(this, windowInsets);
        } else {
            this.f1458a = new c0(this, windowInsets);
        }
    }

    public static z1.b a(z1.b bVar, int i6, int i7, int i8, int i9) {
        int iMax = Math.max(0, bVar.f26269a - i6);
        int iMax2 = Math.max(0, bVar.f26270b - i7);
        int iMax3 = Math.max(0, bVar.f26271c - i8);
        int iMax4 = Math.max(0, bVar.f26272d - i9);
        return (iMax == i6 && iMax2 == i7 && iMax3 == i8 && iMax4 == i9) ? bVar : z1.b.b(iMax, iMax2, iMax3, iMax4);
    }

    public static m0 c(View view, WindowInsets windowInsets) {
        windowInsets.getClass();
        m0 m0Var = new m0(windowInsets);
        if (view != null && view.isAttachedToWindow()) {
            Field field = F.f1367a;
            m0 m0VarA = AbstractC0196z.a(view);
            h0 h0Var = m0Var.f1458a;
            h0Var.t(m0VarA);
            h0Var.d(view.getRootView());
            h0Var.v(view.getWindowSystemUiVisibility());
        }
        return m0Var;
    }

    public final WindowInsets b() {
        h0 h0Var = this.f1458a;
        if (h0Var instanceof b0) {
            return ((b0) h0Var).f1426c;
        }
        return null;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof m0)) {
            return false;
        }
        return Objects.equals(this.f1458a, ((m0) obj).f1458a);
    }

    public final int hashCode() {
        h0 h0Var = this.f1458a;
        if (h0Var == null) {
            return 0;
        }
        return h0Var.hashCode();
    }

    public m0(m0 m0Var) {
        if (m0Var != null) {
            h0 h0Var = m0Var.f1458a;
            int i6 = Build.VERSION.SDK_INT;
            if (i6 >= 34 && (h0Var instanceof g0)) {
                this.f1458a = new g0(this, (g0) h0Var);
            } else if (i6 >= 30 && (h0Var instanceof f0)) {
                this.f1458a = new f0(this, (f0) h0Var);
            } else if (i6 >= 29 && (h0Var instanceof e0)) {
                this.f1458a = new e0(this, (e0) h0Var);
            } else if (i6 >= 28 && (h0Var instanceof d0)) {
                this.f1458a = new d0(this, (d0) h0Var);
            } else if (h0Var instanceof c0) {
                this.f1458a = new c0(this, (c0) h0Var);
            } else if (h0Var instanceof b0) {
                this.f1458a = new b0(this, (b0) h0Var);
            } else {
                this.f1458a = new h0(this);
            }
            h0Var.e(this);
            return;
        }
        this.f1458a = new h0(this);
    }
}
