package com.google.android.gms.internal.pal;

import android.view.View;
import java.util.HashMap;
import java.util.List;

/* JADX INFO: loaded from: classes2.dex */
public final class q4 extends w4 {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final /* synthetic */ int f21158h = 0;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public Object f21159i;

    public q4(y3 y3Var, ea eaVar, int i10) {
        super(y3Var, "tPxcLkiesd8JzrYIyuRbLGxWAQfsX+C1jrJaS2rsRu6lU/ve1b9hEzSSzo6VwqXx", "0RWQk7vrKrAXtxwBYq7T9nI/JnUnK0yiZtx30+mk7/g=", eaVar, i10, 31);
        this.f21159i = null;
    }

    @Override // com.google.android.gms.internal.pal.w4
    public final void a() {
        int i10 = 2;
        switch (this.f21158h) {
            case 0:
                ea eaVar = this.f21306d;
                if (eaVar.f20700c) {
                    eaVar.i();
                    eaVar.f20700c = false;
                }
                l1.x0((l1) eaVar.f20699b, -1L);
                ea eaVar2 = this.f21306d;
                if (eaVar2.f20700c) {
                    eaVar2.i();
                    eaVar2.f20700c = false;
                }
                l1.y0((l1) eaVar2.f20699b, -1L);
                if (((List) this.f21159i) == null) {
                    this.f21159i = (List) this.f21307e.invoke(null, this.f21303a.f21348a);
                }
                List list = (List) this.f21159i;
                if (list == null || list.size() != 2) {
                    return;
                }
                synchronized (this.f21306d) {
                    ea eaVar3 = this.f21306d;
                    long jLongValue = ((Long) ((List) this.f21159i).get(0)).longValue();
                    if (eaVar3.f20700c) {
                        eaVar3.i();
                        eaVar3.f20700c = false;
                    }
                    l1.x0((l1) eaVar3.f20699b, jLongValue);
                    ea eaVar4 = this.f21306d;
                    long jLongValue2 = ((Long) ((List) this.f21159i).get(1)).longValue();
                    if (eaVar4.f20700c) {
                        eaVar4.i();
                        eaVar4.f20700c = false;
                    }
                    l1.y0((l1) eaVar4.f20699b, jLongValue2);
                    break;
                }
                return;
            case 1:
                StackTraceElement[] stackTraceElementArr = (StackTraceElement[]) this.f21159i;
                if (stackTraceElementArr != null) {
                    n3 n3Var = new n3((String) this.f21307e.invoke(null, stackTraceElementArr), 1);
                    synchronized (this.f21306d) {
                        try {
                            ea eaVar5 = this.f21306d;
                            long jLongValue3 = n3Var.f21094b.longValue();
                            if (eaVar5.f20700c) {
                                eaVar5.i();
                                eaVar5.f20700c = false;
                            }
                            l1.v((l1) eaVar5.f20699b, jLongValue3);
                            if (((Boolean) n3Var.f21095c).booleanValue()) {
                                ea eaVar6 = this.f21306d;
                                if (true == ((Boolean) n3Var.f21096d).booleanValue()) {
                                    i10 = 1;
                                }
                                if (eaVar6.f20700c) {
                                    eaVar6.i();
                                    eaVar6.f20700c = false;
                                }
                                l1.a0((l1) eaVar6.f20699b, i10);
                            } else {
                                ea eaVar7 = this.f21306d;
                                if (eaVar7.f20700c) {
                                    eaVar7.i();
                                    eaVar7.f20700c = false;
                                }
                                l1.a0((l1) eaVar7.f20699b, 3);
                            }
                        } finally {
                        }
                        break;
                    }
                    return;
                }
                return;
            default:
                if (((View) this.f21159i) != null) {
                    g5 g5Var = l5.f21056u;
                    f5 f5Var = f5.f20904d;
                    Boolean bool = (Boolean) f5Var.f20907c.b(g5Var);
                    Boolean bool2 = (Boolean) f5Var.f20907c.b(l5.f21058w);
                    String str = (String) this.f21307e.invoke(null, (View) this.f21159i, this.f21303a.f21348a.getResources().getDisplayMetrics(), bool, bool2);
                    b4 b4Var = new b4();
                    HashMap mapA = z2.a(str);
                    if (mapA != null) {
                        b4Var.f20717a = (Long) mapA.get(0);
                        b4Var.f20718b = (Long) mapA.get(1);
                        b4Var.f20719c = (Long) mapA.get(2);
                        b4Var.f20720d = (Long) mapA.get(3);
                        b4Var.f20721e = (Long) mapA.get(4);
                    }
                    e0 e0VarN = u0.n();
                    long jLongValue4 = b4Var.f20717a.longValue();
                    if (e0VarN.f20700c) {
                        e0VarN.i();
                        e0VarN.f20700c = false;
                    }
                    u0.p((u0) e0VarN.f20699b, jLongValue4);
                    long jLongValue5 = b4Var.f20718b.longValue();
                    if (e0VarN.f20700c) {
                        e0VarN.i();
                        e0VarN.f20700c = false;
                    }
                    u0.q((u0) e0VarN.f20699b, jLongValue5);
                    long jLongValue6 = b4Var.f20719c.longValue();
                    if (e0VarN.f20700c) {
                        e0VarN.i();
                        e0VarN.f20700c = false;
                    }
                    u0.r((u0) e0VarN.f20699b, jLongValue6);
                    if (bool2.booleanValue()) {
                        long jLongValue7 = b4Var.f20721e.longValue();
                        if (e0VarN.f20700c) {
                            e0VarN.i();
                            e0VarN.f20700c = false;
                        }
                        u0.o((u0) e0VarN.f20699b, jLongValue7);
                    }
                    if (bool.booleanValue()) {
                        long jLongValue8 = b4Var.f20720d.longValue();
                        if (e0VarN.f20700c) {
                            e0VarN.i();
                            e0VarN.f20700c = false;
                        }
                        u0.s((u0) e0VarN.f20699b, jLongValue8);
                    }
                    u0 u0Var = (u0) e0VarN.g();
                    ea eaVar8 = this.f21306d;
                    if (eaVar8.f20700c) {
                        eaVar8.i();
                        eaVar8.f20700c = false;
                    }
                    l1.F((l1) eaVar8.f20699b, u0Var);
                    return;
                }
                return;
        }
    }

    public q4(y3 y3Var, ea eaVar, int i10, View view) {
        super(y3Var, "xcWDoPM3ZfO4P10VSUmZKRTMvsXPXnglJL31bwAJBgJGdSUy2IQG17s4MILOncV2", "9rXsTdb/WXYONX554dN5CJ2eqpcy9gFPMPi8uAjaHTA=", eaVar, i10, 57);
        this.f21159i = view;
    }

    public q4(y3 y3Var, ea eaVar, int i10, StackTraceElement[] stackTraceElementArr) {
        super(y3Var, "d2tnKFzXPwiZyQGi+81r0jKuUmc/wF2bs8mf3rZLUgisIeswnimQDm/skPYjpEo4", "e/DvqiTz4SkFtBEBn/3V8Pr2h2slHO4xuLOBAItCJ4w=", eaVar, i10, 45);
        this.f21159i = stackTraceElementArr;
    }
}
