package u1;

import c3.t;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import r1.m;
import s1.a0;
import s1.d1;
import s1.e1;
import s1.f1;
import s1.g0;
import s1.g1;
import s1.h0;
import s1.l;
import s1.p0;
import s1.t1;
import s1.u;
import s1.u0;
import s1.u1;
import s1.y;

/* loaded from: classes.dex */
public final class a implements f {

    /* renamed from: p, reason: collision with root package name */
    private final C0873a f36752p = new C0873a(null, null, null, 0, 15, null);

    /* renamed from: q, reason: collision with root package name */
    private final d f36753q = new b();

    /* renamed from: r, reason: collision with root package name */
    private d1 f36754r;

    /* renamed from: s, reason: collision with root package name */
    private d1 f36755s;

    /* renamed from: u1.a$a, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public static final class C0873a {

        /* renamed from: a, reason: collision with root package name */
        private c3.d f36756a;

        /* renamed from: b, reason: collision with root package name */
        private t f36757b;

        /* renamed from: c, reason: collision with root package name */
        private a0 f36758c;

        /* renamed from: d, reason: collision with root package name */
        private long f36759d;

        public /* synthetic */ C0873a(c3.d dVar, t tVar, a0 a0Var, long j10, kotlin.jvm.internal.k kVar) {
            this(dVar, tVar, a0Var, j10);
        }

        public final c3.d a() {
            return this.f36756a;
        }

        public final t b() {
            return this.f36757b;
        }

        public final a0 c() {
            return this.f36758c;
        }

        public final long d() {
            return this.f36759d;
        }

        public final a0 e() {
            return this.f36758c;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof C0873a)) {
                return false;
            }
            C0873a c0873a = (C0873a) obj;
            return kotlin.jvm.internal.t.b(this.f36756a, c0873a.f36756a) && this.f36757b == c0873a.f36757b && kotlin.jvm.internal.t.b(this.f36758c, c0873a.f36758c) && m.f(this.f36759d, c0873a.f36759d);
        }

        public final c3.d f() {
            return this.f36756a;
        }

        public final t g() {
            return this.f36757b;
        }

        public final long h() {
            return this.f36759d;
        }

        public int hashCode() {
            return (((((this.f36756a.hashCode() * 31) + this.f36757b.hashCode()) * 31) + this.f36758c.hashCode()) * 31) + m.j(this.f36759d);
        }

        public final void i(a0 a0Var) {
            this.f36758c = a0Var;
        }

        public final void j(c3.d dVar) {
            this.f36756a = dVar;
        }

        public final void k(t tVar) {
            this.f36757b = tVar;
        }

        public final void l(long j10) {
            this.f36759d = j10;
        }

        public String toString() {
            return "DrawParams(density=" + this.f36756a + ", layoutDirection=" + this.f36757b + ", canvas=" + this.f36758c + ", size=" + ((Object) m.l(this.f36759d)) + ')';
        }

        private C0873a(c3.d dVar, t tVar, a0 a0Var, long j10) {
            this.f36756a = dVar;
            this.f36757b = tVar;
            this.f36758c = a0Var;
            this.f36759d = j10;
        }

        public /* synthetic */ C0873a(c3.d dVar, t tVar, a0 a0Var, long j10, int i10, kotlin.jvm.internal.k kVar) {
            this((i10 & 1) != 0 ? e.a() : dVar, (i10 & 2) != 0 ? t.Ltr : tVar, (i10 & 4) != 0 ? new i() : a0Var, (i10 & 8) != 0 ? m.f34339b.b() : j10, null);
        }
    }

    /* loaded from: classes.dex */
    public static final class b implements d {

        /* renamed from: a, reason: collision with root package name */
        private final h f36760a = u1.b.a(this);

        /* renamed from: b, reason: collision with root package name */
        private v1.c f36761b;

        b() {
        }

        @Override // u1.d
        public void a(c3.d dVar) {
            a.this.C().j(dVar);
        }

        @Override // u1.d
        public long b() {
            return a.this.C().h();
        }

        @Override // u1.d
        public void c(t tVar) {
            a.this.C().k(tVar);
        }

        @Override // u1.d
        public void d(a0 a0Var) {
            a.this.C().i(a0Var);
        }

        @Override // u1.d
        public void e(v1.c cVar) {
            this.f36761b = cVar;
        }

        @Override // u1.d
        public h f() {
            return this.f36760a;
        }

        @Override // u1.d
        public void g(long j10) {
            a.this.C().l(j10);
        }

        @Override // u1.d
        public c3.d getDensity() {
            return a.this.C().f();
        }

        @Override // u1.d
        public t getLayoutDirection() {
            return a.this.C().g();
        }

        @Override // u1.d
        public v1.c h() {
            return this.f36761b;
        }

        @Override // u1.d
        public a0 i() {
            return a.this.C().e();
        }
    }

    static /* synthetic */ d1 B(a aVar, y yVar, float f10, float f11, int i10, int i11, g1 g1Var, float f12, h0 h0Var, int i12, int i13, int i14, Object obj) {
        return aVar.z(yVar, f10, f11, i10, i11, g1Var, f12, h0Var, i12, (i14 & 512) != 0 ? f.f36765k.b() : i13);
    }

    private final long I(long j10, float f10) {
        return !((f10 > 1.0f ? 1 : (f10 == 1.0f ? 0 : -1)) == 0) ? g0.l(j10, g0.o(j10) * f10, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 14, null) : j10;
    }

    private final d1 L() {
        d1 d1Var = this.f36754r;
        if (d1Var != null) {
            return d1Var;
        }
        d1 a10 = l.a();
        a10.F(e1.f35240a.a());
        this.f36754r = a10;
        return a10;
    }

    private final d1 M() {
        d1 d1Var = this.f36755s;
        if (d1Var != null) {
            return d1Var;
        }
        d1 a10 = l.a();
        a10.F(e1.f35240a.b());
        this.f36755s = a10;
        return a10;
    }

    private final d1 N(g gVar) {
        if (kotlin.jvm.internal.t.b(gVar, j.f36769a)) {
            return L();
        }
        if (!(gVar instanceof k)) {
            throw new rm.t();
        }
        d1 M = M();
        k kVar = (k) gVar;
        if (!(M.J() == kVar.f())) {
            M.I(kVar.f());
        }
        if (!t1.e(M.D(), kVar.b())) {
            M.s(kVar.b());
        }
        if (!(M.u() == kVar.d())) {
            M.z(kVar.d());
        }
        if (!u1.e(M.r(), kVar.c())) {
            M.E(kVar.c());
        }
        M.H();
        kVar.e();
        if (kotlin.jvm.internal.t.b(null, null)) {
            return M;
        }
        kVar.e();
        M.y(null);
        return M;
    }

    private final d1 h(long j10, g gVar, float f10, h0 h0Var, int i10, int i11) {
        d1 N = N(gVar);
        long I = I(j10, f10);
        if (!g0.n(N.c(), I)) {
            N.G(I);
        }
        if (N.x() != null) {
            N.w(null);
        }
        if (!kotlin.jvm.internal.t.b(N.g(), h0Var)) {
            N.C(h0Var);
        }
        if (!u.E(N.q(), i10)) {
            N.t(i10);
        }
        if (!p0.d(N.B(), i11)) {
            N.A(i11);
        }
        return N;
    }

    static /* synthetic */ d1 p(a aVar, long j10, g gVar, float f10, h0 h0Var, int i10, int i11, int i12, Object obj) {
        return aVar.h(j10, gVar, f10, h0Var, i10, (i12 & 32) != 0 ? f.f36765k.b() : i11);
    }

    private final d1 q(y yVar, g gVar, float f10, h0 h0Var, int i10, int i11) {
        d1 N = N(gVar);
        if (yVar != null) {
            yVar.a(b(), N, f10);
        } else {
            if (N.x() != null) {
                N.w(null);
            }
            long c10 = N.c();
            g0.a aVar = g0.f35254b;
            if (!g0.n(c10, aVar.a())) {
                N.G(aVar.a());
            }
            if (!(N.b() == f10)) {
                N.a(f10);
            }
        }
        if (!kotlin.jvm.internal.t.b(N.g(), h0Var)) {
            N.C(h0Var);
        }
        if (!u.E(N.q(), i10)) {
            N.t(i10);
        }
        if (!p0.d(N.B(), i11)) {
            N.A(i11);
        }
        return N;
    }

    static /* synthetic */ d1 r(a aVar, y yVar, g gVar, float f10, h0 h0Var, int i10, int i11, int i12, Object obj) {
        if ((i12 & 32) != 0) {
            i11 = f.f36765k.b();
        }
        return aVar.q(yVar, gVar, f10, h0Var, i10, i11);
    }

    private final d1 s(long j10, float f10, float f11, int i10, int i11, g1 g1Var, float f12, h0 h0Var, int i12, int i13) {
        d1 M = M();
        long I = I(j10, f12);
        if (!g0.n(M.c(), I)) {
            M.G(I);
        }
        if (M.x() != null) {
            M.w(null);
        }
        if (!kotlin.jvm.internal.t.b(M.g(), h0Var)) {
            M.C(h0Var);
        }
        if (!u.E(M.q(), i12)) {
            M.t(i12);
        }
        if (!(M.J() == f10)) {
            M.I(f10);
        }
        if (!(M.u() == f11)) {
            M.z(f11);
        }
        if (!t1.e(M.D(), i10)) {
            M.s(i10);
        }
        if (!u1.e(M.r(), i11)) {
            M.E(i11);
        }
        M.H();
        if (!kotlin.jvm.internal.t.b(null, g1Var)) {
            M.y(g1Var);
        }
        if (!p0.d(M.B(), i13)) {
            M.A(i13);
        }
        return M;
    }

    static /* synthetic */ d1 x(a aVar, long j10, float f10, float f11, int i10, int i11, g1 g1Var, float f12, h0 h0Var, int i12, int i13, int i14, Object obj) {
        return aVar.s(j10, f10, f11, i10, i11, g1Var, f12, h0Var, i12, (i14 & 512) != 0 ? f.f36765k.b() : i13);
    }

    private final d1 z(y yVar, float f10, float f11, int i10, int i11, g1 g1Var, float f12, h0 h0Var, int i12, int i13) {
        d1 M = M();
        if (yVar != null) {
            yVar.a(b(), M, f12);
        } else {
            if (!(M.b() == f12)) {
                M.a(f12);
            }
        }
        if (!kotlin.jvm.internal.t.b(M.g(), h0Var)) {
            M.C(h0Var);
        }
        if (!u.E(M.q(), i12)) {
            M.t(i12);
        }
        if (!(M.J() == f10)) {
            M.I(f10);
        }
        if (!(M.u() == f11)) {
            M.z(f11);
        }
        if (!t1.e(M.D(), i10)) {
            M.s(i10);
        }
        if (!u1.e(M.r(), i11)) {
            M.E(i11);
        }
        M.H();
        if (!kotlin.jvm.internal.t.b(null, g1Var)) {
            M.y(g1Var);
        }
        if (!p0.d(M.B(), i13)) {
            M.A(i13);
        }
        return M;
    }

    @Override // u1.f
    public void B1(long j10, float f10, long j11, float f11, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().v(j11, f10, p(this, j10, gVar, f11, h0Var, i10, 0, 32, null));
    }

    public final C0873a C() {
        return this.f36752p;
    }

    @Override // c3.l
    public float G0() {
        return this.f36752p.f().G0();
    }

    @Override // u1.f
    public void J0(f1 f1Var, long j10, float f10, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().k(f1Var, p(this, j10, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // u1.f
    public void K(y yVar, long j10, long j11, long j12, float f10, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().e(r1.g.m(j10), r1.g.n(j10), r1.g.m(j10) + m.i(j11), r1.g.n(j10) + m.g(j11), r1.a.d(j12), r1.a.e(j12), r(this, yVar, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // u1.f
    public void O0(long j10, long j11, long j12, long j13, g gVar, float f10, h0 h0Var, int i10) {
        this.f36752p.e().e(r1.g.m(j11), r1.g.n(j11), r1.g.m(j11) + m.i(j12), r1.g.n(j11) + m.g(j12), r1.a.d(j13), r1.a.e(j13), p(this, j10, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // u1.f
    public d Q0() {
        return this.f36753q;
    }

    @Override // u1.f
    public void S(u0 u0Var, long j10, long j11, long j12, long j13, float f10, g gVar, h0 h0Var, int i10, int i11) {
        this.f36752p.e().j(u0Var, j10, j11, j12, j13, q(null, gVar, f10, h0Var, i10, i11));
    }

    @Override // u1.f
    public void b1(y yVar, long j10, long j11, float f10, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().i(r1.g.m(j10), r1.g.n(j10), r1.g.m(j10) + m.i(j11), r1.g.n(j10) + m.g(j11), r(this, yVar, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // u1.f
    public void c0(u0 u0Var, long j10, float f10, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().s(u0Var, j10, r(this, null, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // u1.f
    public void f1(long j10, long j11, long j12, float f10, int i10, g1 g1Var, float f11, h0 h0Var, int i11) {
        this.f36752p.e().g(j11, j12, x(this, j10, f10, 4.0f, i10, u1.f35361a.b(), g1Var, f11, h0Var, i11, 0, 512, null));
    }

    @Override // u1.f
    public void g1(long j10, long j11, long j12, float f10, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().i(r1.g.m(j11), r1.g.n(j11), r1.g.m(j11) + m.i(j12), r1.g.n(j11) + m.g(j12), p(this, j10, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // c3.d
    public float getDensity() {
        return this.f36752p.f().getDensity();
    }

    @Override // u1.f
    public t getLayoutDirection() {
        return this.f36752p.g();
    }

    @Override // u1.f
    public void h1(f1 f1Var, y yVar, float f10, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().k(f1Var, r(this, yVar, gVar, f10, h0Var, i10, 0, 32, null));
    }

    @Override // u1.f
    public void m1(y yVar, long j10, long j11, float f10, int i10, g1 g1Var, float f11, h0 h0Var, int i11) {
        this.f36752p.e().g(j10, j11, B(this, yVar, f10, 4.0f, i10, u1.f35361a.b(), g1Var, f11, h0Var, i11, 0, 512, null));
    }

    @Override // u1.f
    public void x1(long j10, float f10, float f11, boolean z10, long j11, long j12, float f12, g gVar, h0 h0Var, int i10) {
        this.f36752p.e().p(r1.g.m(j11), r1.g.n(j11), r1.g.m(j11) + m.i(j12), r1.g.n(j11) + m.g(j12), f10, f11, z10, p(this, j10, gVar, f12, h0Var, i10, 0, 32, null));
    }
}
