package h2;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class i0 {

    /* renamed from: a, reason: collision with root package name */
    public static final i0 f20698a = new i0();

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class a implements d0 {

        /* renamed from: p, reason: collision with root package name */
        private final n f20699p;

        /* renamed from: q, reason: collision with root package name */
        private final c f20700q;

        /* renamed from: r, reason: collision with root package name */
        private final d f20701r;

        public a(n nVar, c cVar, d dVar) {
            this.f20699p = nVar;
            this.f20700q = cVar;
            this.f20701r = dVar;
        }

        @Override // h2.n
        public int T(int i10) {
            return this.f20699p.T(i10);
        }

        @Override // h2.n
        public int X(int i10) {
            return this.f20699p.X(i10);
        }

        @Override // h2.d0
        public p0 Y(long j10) {
            if (this.f20701r == d.Width) {
                return new b(this.f20700q == c.Max ? this.f20699p.X(c3.b.k(j10)) : this.f20699p.T(c3.b.k(j10)), c3.b.g(j10) ? c3.b.k(j10) : 32767);
            }
            return new b(c3.b.h(j10) ? c3.b.l(j10) : 32767, this.f20700q == c.Max ? this.f20699p.s(c3.b.l(j10)) : this.f20699p.v0(c3.b.l(j10)));
        }

        @Override // h2.n
        public Object p() {
            return this.f20699p.p();
        }

        @Override // h2.n
        public int s(int i10) {
            return this.f20699p.s(i10);
        }

        @Override // h2.n
        public int v0(int i10) {
            return this.f20699p.v0(i10);
        }
    }

    /* loaded from: classes.dex */
    private static final class b extends p0 {
        public b(int i10, int i11) {
            c1(c3.s.a(i10, i11));
        }

        /* JADX INFO: Access modifiers changed from: protected */
        @Override // h2.p0
        public void V0(long j10, float f10, dn.l lVar) {
        }

        @Override // h2.h0
        public int u0(h2.a aVar) {
            return Integer.MIN_VALUE;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public enum c {
        Min,
        Max
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public enum d {
        Width,
        Height
    }

    private i0() {
    }

    public final int a(x xVar, o oVar, n nVar, int i10) {
        return xVar.h(new r(oVar, oVar.getLayoutDirection()), new a(nVar, c.Max, d.Height), c3.c.b(0, i10, 0, 0, 13, null)).getHeight();
    }

    public final int b(x xVar, o oVar, n nVar, int i10) {
        return xVar.h(new r(oVar, oVar.getLayoutDirection()), new a(nVar, c.Max, d.Width), c3.c.b(0, 0, 0, i10, 7, null)).getWidth();
    }

    public final int c(x xVar, o oVar, n nVar, int i10) {
        return xVar.h(new r(oVar, oVar.getLayoutDirection()), new a(nVar, c.Min, d.Height), c3.c.b(0, i10, 0, 0, 13, null)).getHeight();
    }

    public final int d(x xVar, o oVar, n nVar, int i10) {
        return xVar.h(new r(oVar, oVar.getLayoutDirection()), new a(nVar, c.Min, d.Width), c3.c.b(0, 0, 0, i10, 7, null)).getWidth();
    }
}
