package f0;

import h2.f0;
import java.util.List;
import java.util.Map;
import tp.m0;

/* loaded from: classes.dex */
public final class s implements q, f0 {

    /* renamed from: a, reason: collision with root package name */
    private final t f17490a;

    /* renamed from: b, reason: collision with root package name */
    private int f17491b;

    /* renamed from: c, reason: collision with root package name */
    private boolean f17492c;

    /* renamed from: d, reason: collision with root package name */
    private float f17493d;

    /* renamed from: e, reason: collision with root package name */
    private final float f17494e;

    /* renamed from: f, reason: collision with root package name */
    private final boolean f17495f;

    /* renamed from: g, reason: collision with root package name */
    private final m0 f17496g;

    /* renamed from: h, reason: collision with root package name */
    private final c3.d f17497h;

    /* renamed from: i, reason: collision with root package name */
    private final long f17498i;

    /* renamed from: j, reason: collision with root package name */
    private final List f17499j;

    /* renamed from: k, reason: collision with root package name */
    private final int f17500k;

    /* renamed from: l, reason: collision with root package name */
    private final int f17501l;

    /* renamed from: m, reason: collision with root package name */
    private final int f17502m;

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

    /* renamed from: o, reason: collision with root package name */
    private final b0.q f17504o;

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

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

    /* renamed from: r, reason: collision with root package name */
    private final /* synthetic */ f0 f17507r;

    public /* synthetic */ s(t tVar, int i10, boolean z10, float f10, f0 f0Var, float f11, boolean z11, m0 m0Var, c3.d dVar, long j10, List list, int i11, int i12, int i13, boolean z12, b0.q qVar, int i14, int i15, kotlin.jvm.internal.k kVar) {
        this(tVar, i10, z10, f10, f0Var, f11, z11, m0Var, dVar, j10, list, i11, i12, i13, z12, qVar, i14, i15);
    }

    @Override // f0.q
    public long a() {
        return c3.s.a(getWidth(), getHeight());
    }

    @Override // f0.q
    public int b() {
        return this.f17505p;
    }

    @Override // f0.q
    public int c() {
        return this.f17501l;
    }

    @Override // f0.q
    public b0.q d() {
        return this.f17504o;
    }

    @Override // f0.q
    public int e() {
        return -f();
    }

    @Override // f0.q
    public int f() {
        return this.f17500k;
    }

    @Override // f0.q
    public int g() {
        return this.f17502m;
    }

    @Override // h2.f0
    public int getHeight() {
        return this.f17507r.getHeight();
    }

    @Override // h2.f0
    public int getWidth() {
        return this.f17507r.getWidth();
    }

    @Override // h2.f0
    public Map h() {
        return this.f17507r.h();
    }

    @Override // h2.f0
    public void i() {
        this.f17507r.i();
    }

    @Override // f0.q
    public int j() {
        return this.f17506q;
    }

    @Override // f0.q
    public List k() {
        return this.f17499j;
    }

    public final boolean l() {
        t tVar = this.f17490a;
        return ((tVar != null ? tVar.getIndex() : 0) == 0 && this.f17491b == 0) ? false : true;
    }

    public final boolean m() {
        return this.f17492c;
    }

    @Override // h2.f0
    public dn.l n() {
        return this.f17507r.n();
    }

    public final long o() {
        return this.f17498i;
    }

    public final float p() {
        return this.f17493d;
    }

    public final m0 q() {
        return this.f17496g;
    }

    public final c3.d r() {
        return this.f17497h;
    }

    public final t s() {
        return this.f17490a;
    }

    public final int t() {
        return this.f17491b;
    }

    public final float u() {
        return this.f17494e;
    }

    public final boolean v(int i10, boolean z10) {
        t tVar;
        Object c02;
        Object o02;
        if (this.f17495f || k().isEmpty() || (tVar = this.f17490a) == null) {
            return false;
        }
        int e10 = tVar.e();
        int i11 = this.f17491b - i10;
        if (!(i11 >= 0 && i11 < e10)) {
            return false;
        }
        c02 = sm.c0.c0(k());
        t tVar2 = (t) c02;
        o02 = sm.c0.o0(k());
        t tVar3 = (t) o02;
        if (tVar2.q() || tVar3.q()) {
            return false;
        }
        if (!(i10 >= 0 ? Math.min(f() - tVar2.b(), c() - tVar3.b()) > i10 : Math.min((tVar2.b() + tVar2.e()) - f(), (tVar3.b() + tVar3.e()) - c()) > (-i10))) {
            return false;
        }
        this.f17491b -= i10;
        List k10 = k();
        int size = k10.size();
        for (int i12 = 0; i12 < size; i12++) {
            ((t) k10.get(i12)).m(i10, z10);
        }
        this.f17493d = i10;
        if (!this.f17492c && i10 > 0) {
            this.f17492c = true;
        }
        return true;
    }

    private s(t tVar, int i10, boolean z10, float f10, f0 f0Var, float f11, boolean z11, m0 m0Var, c3.d dVar, long j10, List list, int i11, int i12, int i13, boolean z12, b0.q qVar, int i14, int i15) {
        this.f17490a = tVar;
        this.f17491b = i10;
        this.f17492c = z10;
        this.f17493d = f10;
        this.f17494e = f11;
        this.f17495f = z11;
        this.f17496g = m0Var;
        this.f17497h = dVar;
        this.f17498i = j10;
        this.f17499j = list;
        this.f17500k = i11;
        this.f17501l = i12;
        this.f17502m = i13;
        this.f17503n = z12;
        this.f17504o = qVar;
        this.f17505p = i14;
        this.f17506q = i15;
        this.f17507r = f0Var;
    }
}
