package l0;

import androidx.compose.ui.platform.r1;
import androidx.compose.ui.platform.t1;
import l1.i;
import v2.i;
import y0.y3;

/* loaded from: classes.dex */
public abstract class o {

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

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

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

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ q2.o0 f27149r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public a(int i10, int i11, q2.o0 o0Var) {
            super(1);
            this.f27147p = i10;
            this.f27148q = i11;
            this.f27149r = o0Var;
        }

        public final void a(t1 t1Var) {
            throw null;
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            android.support.v4.media.session.b.a(obj);
            a(null);
            return rm.n0.f34904a;
        }
    }

    /* loaded from: classes.dex */
    static final class b extends kotlin.jvm.internal.v implements dn.q {

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

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

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ q2.o0 f27152r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        b(int i10, int i11, q2.o0 o0Var) {
            super(3);
            this.f27150p = i10;
            this.f27151q = i11;
            this.f27152r = o0Var;
        }

        private static final Object b(y3 y3Var) {
            return y3Var.getValue();
        }

        public final l1.i a(l1.i iVar, y0.m mVar, int i10) {
            mVar.S(408240218);
            if (y0.p.H()) {
                y0.p.Q(408240218, i10, -1, "androidx.compose.foundation.text.heightInLines.<anonymous> (HeightInLinesModifier.kt:59)");
            }
            o.b(this.f27150p, this.f27151q);
            if (this.f27150p == 1 && this.f27151q == Integer.MAX_VALUE) {
                i.a aVar = l1.i.f27362a;
                if (y0.p.H()) {
                    y0.p.P();
                }
                mVar.H();
                return aVar;
            }
            c3.d dVar = (c3.d) mVar.t(androidx.compose.ui.platform.c1.d());
            i.b bVar = (i.b) mVar.t(androidx.compose.ui.platform.c1.f());
            c3.t tVar = (c3.t) mVar.t(androidx.compose.ui.platform.c1.j());
            boolean R = mVar.R(this.f27152r) | mVar.R(tVar);
            q2.o0 o0Var = this.f27152r;
            Object f10 = mVar.f();
            if (R || f10 == y0.m.f51621a.a()) {
                f10 = q2.p0.d(o0Var, tVar);
                mVar.I(f10);
            }
            q2.o0 o0Var2 = (q2.o0) f10;
            boolean R2 = mVar.R(bVar) | mVar.R(o0Var2);
            Object f11 = mVar.f();
            if (R2 || f11 == y0.m.f51621a.a()) {
                v2.i j10 = o0Var2.j();
                v2.r o10 = o0Var2.o();
                if (o10 == null) {
                    o10 = v2.r.f38997q.c();
                }
                v2.p m10 = o0Var2.m();
                int i11 = m10 != null ? m10.i() : v2.p.f38987b.b();
                v2.q n10 = o0Var2.n();
                f11 = bVar.b(j10, o10, i11, n10 != null ? n10.k() : v2.q.f38991b.a());
                mVar.I(f11);
            }
            y3 y3Var = (y3) f11;
            boolean R3 = mVar.R(b(y3Var)) | mVar.R(dVar) | mVar.R(bVar) | mVar.R(this.f27152r) | mVar.R(tVar);
            Object f12 = mVar.f();
            if (R3 || f12 == y0.m.f51621a.a()) {
                f12 = Integer.valueOf(c3.r.f(o0.a(o0Var2, dVar, bVar, o0.c(), 1)));
                mVar.I(f12);
            }
            int intValue = ((Number) f12).intValue();
            boolean R4 = mVar.R(tVar) | mVar.R(dVar) | mVar.R(bVar) | mVar.R(this.f27152r) | mVar.R(b(y3Var));
            Object f13 = mVar.f();
            if (R4 || f13 == y0.m.f51621a.a()) {
                f13 = Integer.valueOf(c3.r.f(o0.a(o0Var2, dVar, bVar, o0.c() + '\n' + o0.c(), 2)));
                mVar.I(f13);
            }
            int intValue2 = ((Number) f13).intValue() - intValue;
            int i12 = this.f27150p;
            Integer valueOf = i12 == 1 ? null : Integer.valueOf(((i12 - 1) * intValue2) + intValue);
            int i13 = this.f27151q;
            Integer valueOf2 = i13 != Integer.MAX_VALUE ? Integer.valueOf(intValue + (intValue2 * (i13 - 1))) : null;
            l1.i j11 = androidx.compose.foundation.layout.o.j(l1.i.f27362a, valueOf != null ? dVar.w(valueOf.intValue()) : c3.h.f7410q.c(), valueOf2 != null ? dVar.w(valueOf2.intValue()) : c3.h.f7410q.c());
            if (y0.p.H()) {
                y0.p.P();
            }
            mVar.H();
            return j11;
        }

        @Override // dn.q
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3) {
            return a((l1.i) obj, (y0.m) obj2, ((Number) obj3).intValue());
        }
    }

    public static final l1.i a(l1.i iVar, q2.o0 o0Var, int i10, int i11) {
        return l1.h.b(iVar, r1.b() ? new a(i10, i11, o0Var) : r1.a(), new b(i10, i11, o0Var));
    }

    public static final void b(int i10, int i11) {
        if (!(i10 > 0 && i11 > 0)) {
            throw new IllegalArgumentException(("both minLines " + i10 + " and maxLines " + i11 + " must be greater than zero").toString());
        }
        if (i10 <= i11) {
            return;
        }
        throw new IllegalArgumentException(("minLines " + i10 + " must be less than or equal to maxLines " + i11).toString());
    }
}
