package androidx.compose.foundation.layout;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import e0.w;
import h2.d0;
import h2.f0;
import h2.g0;
import h2.p0;
import j2.b0;
import kotlin.jvm.internal.v;
import l1.i;
import rm.n0;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class n extends i.c implements b0 {
    private w C;

    /* loaded from: classes.dex */
    static final class a extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ p0 f1850p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ g0 f1851q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ n f1852r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(p0 p0Var, g0 g0Var, n nVar) {
            super(1);
            this.f1850p = p0Var;
            this.f1851q = g0Var;
            this.f1852r = nVar;
        }

        public final void a(p0.a aVar) {
            p0.a.h(aVar, this.f1850p, this.f1851q.Z0(this.f1852r.h2().b(this.f1851q.getLayoutDirection())), this.f1851q.Z0(this.f1852r.h2().c()), BitmapDescriptorFactory.HUE_RED, 4, null);
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((p0.a) obj);
            return n0.f34904a;
        }
    }

    public n(w wVar) {
        this.C = wVar;
    }

    @Override // j2.b0
    public f0 h(g0 g0Var, d0 d0Var, long j10) {
        boolean z10 = false;
        float f10 = 0;
        if (c3.h.s(this.C.b(g0Var.getLayoutDirection()), c3.h.t(f10)) >= 0 && c3.h.s(this.C.c(), c3.h.t(f10)) >= 0 && c3.h.s(this.C.d(g0Var.getLayoutDirection()), c3.h.t(f10)) >= 0 && c3.h.s(this.C.a(), c3.h.t(f10)) >= 0) {
            z10 = true;
        }
        if (!z10) {
            throw new IllegalArgumentException("Padding must be non-negative".toString());
        }
        int Z0 = g0Var.Z0(this.C.b(g0Var.getLayoutDirection())) + g0Var.Z0(this.C.d(g0Var.getLayoutDirection()));
        int Z02 = g0Var.Z0(this.C.c()) + g0Var.Z0(this.C.a());
        p0 Y = d0Var.Y(c3.c.n(j10, -Z0, -Z02));
        return g0.j0(g0Var, c3.c.i(j10, Y.S0() + Z0), c3.c.h(j10, Y.F0() + Z02), null, new a(Y, g0Var, this), 4, null);
    }

    public final w h2() {
        return this.C;
    }

    public final void i2(w wVar) {
        this.C = wVar;
    }
}
