package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.vg0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2734vg0 implements InterfaceC3007ya0 {
    public final C1597jh0 l;
    public final MV m;
    public final MV n;

    /* renamed from: o, reason: collision with root package name */
    public final MV f758o;
    public final MV p;
    public final IV q;
    public boolean r;
    public final MV s;
    public Y6 t;
    public final KV u;
    public boolean v;
    public final C1201fa0 w;
    public final /* synthetic */ C3114zg0 x;

    /* JADX WARN: Type inference failed for: r10v9, types: [java.lang.Object, java.util.Map] */
    public C2734vg0(C3114zg0 c3114zg0, Object obj, Y6 y6, C1597jh0 c1597jh0) {
        this.x = c3114zg0;
        this.l = c1597jh0;
        MV mvX = AbstractC0752ap.X(obj);
        this.m = mvX;
        Object objG = null;
        this.n = AbstractC0752ap.X(IJ.G(0.0f, 0.0f, null, 7));
        this.f758o = AbstractC0752ap.X(new Mc0(b(), c1597jh0, obj, mvX.getValue(), y6));
        this.p = AbstractC0752ap.X(Boolean.TRUE);
        this.q = new IV(-1.0f);
        this.s = AbstractC0752ap.X(obj);
        this.t = y6;
        this.u = new KV(a().c());
        Float f = (Float) Fk0.a.get(c1597jh0);
        if (f != null) {
            float fFloatValue = f.floatValue();
            Y6 y62 = (Y6) c1597jh0.a.g(obj);
            int iB = y62.b();
            for (int i = 0; i < iB; i++) {
                y62.e(i, fFloatValue);
            }
            objG = this.l.b.g(y62);
        }
        this.w = IJ.G(0.0f, 0.0f, objG, 3);
    }

    public final Mc0 a() {
        return (Mc0) this.f758o.getValue();
    }

    public final InterfaceC3052yy b() {
        return (InterfaceC3052yy) this.n.getValue();
    }

    public final void c() {
        if (this.q.g() == -1.0f) {
            this.v = true;
            boolean zC = F3.c(a().c, a().d);
            MV mv = this.s;
            if (zC) {
                mv.setValue(a().c);
            } else {
                mv.setValue(a().b(0L));
                this.t = a().f(0L);
            }
        }
    }

    public final void e(boolean z, Object obj) {
        C3114zg0 c3114zg0 = this.x;
        MV mv = c3114zg0.h;
        MV mv2 = this.m;
        boolean zC = F3.c(null, mv2.getValue());
        KV kv = this.u;
        MV mv3 = this.f758o;
        if (zC) {
            mv3.setValue(new Mc0(this.w, this.l, obj, obj, this.t.c()));
            this.r = true;
            kv.g(a().c());
            return;
        }
        InterfaceC3052yy interfaceC3052yyB = (!z || this.v || (b() instanceof C1201fa0)) ? b() : this.w;
        long jMax = 0;
        mv3.setValue(new Mc0(c3114zg0.e() <= 0 ? interfaceC3052yyB : new C2437sa0(interfaceC3052yyB, c3114zg0.e()), this.l, obj, mv2.getValue(), this.t));
        kv.g(a().c());
        this.r = false;
        mv.setValue(Boolean.TRUE);
        if (c3114zg0.g()) {
            H90 h90 = c3114zg0.i;
            int size = h90.size();
            for (int i = 0; i < size; i++) {
                C2734vg0 c2734vg0 = (C2734vg0) h90.get(i);
                KV kv2 = c2734vg0.u;
                jMax = Math.max(jMax, ((A90) AbstractC2884x90.t(kv2.m, kv2)).c);
                c2734vg0.c();
            }
            mv.setValue(Boolean.FALSE);
        }
    }

    public final void f(Object obj, Object obj2, InterfaceC3052yy interfaceC3052yy) {
        this.m.setValue(obj2);
        this.n.setValue(interfaceC3052yy);
        if (F3.c(a().d, obj) && F3.c(a().c, obj2)) {
            return;
        }
        e(false, obj);
    }

    public final void g(Object obj, InterfaceC3052yy interfaceC3052yy) {
        if (this.r && F3.c(obj, null)) {
            return;
        }
        MV mv = this.m;
        boolean zC = F3.c(mv.getValue(), obj);
        IV iv = this.q;
        if (zC && iv.g() == -1.0f) {
            return;
        }
        mv.setValue(obj);
        this.n.setValue(interfaceC3052yy);
        float fG = iv.g();
        MV mv2 = this.s;
        Object value = fG == -3.0f ? obj : mv2.getValue();
        MV mv3 = this.p;
        e(!((Boolean) mv3.getValue()).booleanValue(), value);
        mv3.setValue(Boolean.valueOf(iv.g() == -3.0f));
        if (iv.g() >= 0.0f) {
            mv2.setValue(a().b((long) (iv.g() * a().c())));
        } else if (iv.g() == -3.0f) {
            mv2.setValue(obj);
        }
        this.r = false;
        iv.h(-1.0f);
    }

    @Override // o.InterfaceC3007ya0
    public final Object getValue() {
        return this.s.getValue();
    }

    public final String toString() {
        return "current value: " + this.s.getValue() + ", target: " + this.m.getValue() + ", spec: " + b();
    }
}
