package o;

import android.view.View;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.jN, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1569jN extends LP implements SD, InterfaceC1905mt, P50, InterfaceC1575jT {
    public C2540te0 A;
    public InterfaceC1101eX B;
    public View C;
    public InterfaceC2281qr D;
    public InterfaceC1006dX E;
    public C0095Dr G;
    public C1470iI I;
    public C1210ff J;
    public S1 z;
    public final MV F = new MV(null, C0669Zu.O);
    public long H = 9205357640488583168L;

    public C1569jN(S1 s1, C2540te0 c2540te0, InterfaceC1101eX interfaceC1101eX) {
        this.z = s1;
        this.A = c2540te0;
        this.B = interfaceC1101eX;
    }

    @Override // o.LP
    public final void A0() {
        InterfaceC1006dX interfaceC1006dX = this.E;
        if (interfaceC1006dX != null) {
            ((C1197fX) interfaceC1006dX).b();
        }
        this.E = null;
    }

    public final long H0() {
        if (this.G == null) {
            this.G = AbstractC0752ap.E(new C1475iN(this, 2));
        }
        C0095Dr c0095Dr = this.G;
        if (c0095Dr != null) {
            return ((C1765lT) c0095Dr.getValue()).a;
        }
        return 9205357640488583168L;
    }

    public final void I0() {
        InterfaceC1006dX interfaceC1006dX = this.E;
        if (interfaceC1006dX != null) {
            ((C1197fX) interfaceC1006dX).b();
        }
        View viewF = this.C;
        if (viewF == null) {
            viewF = AbstractC0662Zn.F(this);
        }
        this.C = viewF;
        InterfaceC2281qr interfaceC2281qr = this.D;
        if (interfaceC2281qr == null) {
            interfaceC2281qr = AbstractC2539te.S(this).I;
        }
        this.D = interfaceC2281qr;
        this.E = this.B.b(viewF, interfaceC2281qr);
        K0();
    }

    public final void J0() {
        InterfaceC2281qr interfaceC2281qr = this.D;
        if (interfaceC2281qr == null) {
            interfaceC2281qr = AbstractC2539te.S(this).I;
            this.D = interfaceC2281qr;
        }
        long j = ((C1765lT) this.z.g(interfaceC2281qr)).a;
        if ((j & 9223372034707292159L) == 9205357640488583168L || (9223372034707292159L & H0()) == 9205357640488583168L) {
            this.H = 9205357640488583168L;
            InterfaceC1006dX interfaceC1006dX = this.E;
            if (interfaceC1006dX != null) {
                ((C1197fX) interfaceC1006dX).b();
                return;
            }
            return;
        }
        this.H = C1765lT.e(H0(), j);
        if (this.E == null) {
            I0();
        }
        InterfaceC1006dX interfaceC1006dX2 = this.E;
        if (interfaceC1006dX2 != null) {
            interfaceC1006dX2.a(this.H, 9205357640488583168L);
        }
        K0();
    }

    @Override // o.InterfaceC1575jT
    public final void K() {
        AbstractC2841wm0.A(this, new C1475iN(this, 0));
    }

    public final void K0() {
        InterfaceC2281qr interfaceC2281qr;
        InterfaceC1006dX interfaceC1006dX = this.E;
        if (interfaceC1006dX == null || (interfaceC2281qr = this.D) == null) {
            return;
        }
        C1197fX c1197fX = (C1197fX) interfaceC1006dX;
        long jC = c1197fX.c();
        C1470iI c1470iI = this.I;
        if (c1470iI != null && jC == c1470iI.a) {
            return;
        }
        this.A.g(new C0226Is(interfaceC2281qr.z(C1884mi0.O(c1197fX.c()))));
        this.I = new C1470iI(c1197fX.c());
    }

    @Override // o.SD
    public final void U(AbstractC2239qS abstractC2239qS) {
        this.F.setValue(abstractC2239qS);
    }

    @Override // o.P50
    public final void d0(N50 n50) {
        n50.d(AbstractC1664kN.a, new C1475iN(this, 1));
    }

    @Override // o.InterfaceC1905mt
    public final void r(C2610uK c2610uK) {
        c2610uK.a();
        C1210ff c1210ff = this.J;
        if (c1210ff != null) {
            c1210ff.p(Oh0.a);
        }
    }

    @Override // o.LP
    public final void z0() {
        K();
        this.J = AbstractC2841wm0.a(0, 0, 7);
        AbstractC1692kh0.C(v0(), null, new D9(this, null, 4), 1);
    }
}
