package o;

import android.os.Build;
import android.view.WindowInsets;
import android.view.WindowInsetsAnimation;
import android.view.WindowInsetsAnimation$Callback;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.ql0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2270ql0 extends WindowInsetsAnimation$Callback {
    public final AbstractC2071oh a;
    public List b;
    public ArrayList c;
    public final HashMap d;

    public C2270ql0(AbstractC2071oh abstractC2071oh) {
        super(abstractC2071oh.l);
        this.d = new HashMap();
        this.a = abstractC2071oh;
    }

    public final C2554tl0 a(WindowInsetsAnimation windowInsetsAnimation) {
        C2554tl0 c2554tl0 = (C2554tl0) this.d.get(windowInsetsAnimation);
        if (c2554tl0 == null) {
            c2554tl0 = new C2554tl0(0, null, 0L);
            if (Build.VERSION.SDK_INT >= 30) {
                c2554tl0.a = new C2364rl0(windowInsetsAnimation);
            }
            this.d.put(windowInsetsAnimation, c2554tl0);
        }
        return c2554tl0;
    }

    public final void onEnd(WindowInsetsAnimation windowInsetsAnimation) {
        this.a.d(a(windowInsetsAnimation));
        this.d.remove(windowInsetsAnimation);
    }

    public final void onPrepare(WindowInsetsAnimation windowInsetsAnimation) {
        a(windowInsetsAnimation);
        this.a.e();
    }

    public final WindowInsets onProgress(WindowInsets windowInsets, List list) {
        ArrayList arrayList = this.c;
        if (arrayList == null) {
            ArrayList arrayList2 = new ArrayList(list.size());
            this.c = arrayList2;
            this.b = Collections.unmodifiableList(arrayList2);
        } else {
            arrayList.clear();
        }
        for (int size = list.size() - 1; size >= 0; size--) {
            WindowInsetsAnimation windowInsetsAnimationI = AbstractC2175pl0.i(list.get(size));
            C2554tl0 c2554tl0A = a(windowInsetsAnimationI);
            c2554tl0A.a.e(windowInsetsAnimationI.getFraction());
            this.c.add(c2554tl0A);
        }
        return this.a.f(Kl0.g(null, windowInsets), this.b).f();
    }

    public final WindowInsetsAnimation.Bounds onStart(WindowInsetsAnimation windowInsetsAnimation, WindowInsetsAnimation.Bounds bounds) {
        C3040yr c3040yrG = this.a.g(a(windowInsetsAnimation), new C3040yr(bounds));
        c3040yrG.getClass();
        AbstractC3055z0.l();
        return AbstractC2175pl0.g(((LH) c3040yrG.m).d(), ((LH) c3040yrG.n).d());
    }
}
