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

import android.net.Uri;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Pair;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final class vo extends androidx.browser.customtabs.d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final AtomicBoolean f17725a = new AtomicBoolean(false);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final List f17726b = Arrays.asList(((String) n7.y.f31093e.f31096c.b(ao.f8857fb)).split(","));

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final wo f17727c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final gr0 f17728d;

    @Nullable
    private final androidx.browser.customtabs.d zzd;

    public vo(@NonNull wo woVar, @Nullable androidx.browser.customtabs.d dVar, gr0 gr0Var) {
        this.zzd = dVar;
        this.f17727c = woVar;
        this.f17728d = gr0Var;
    }

    @Override // androidx.browser.customtabs.d
    public final void extraCallback(String str, @Nullable Bundle bundle) {
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            dVar.extraCallback(str, bundle);
        }
    }

    @Override // androidx.browser.customtabs.d
    @Nullable
    public final Bundle extraCallbackWithResult(String str, @Nullable Bundle bundle) {
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            return dVar.extraCallbackWithResult(str, bundle);
        }
        return null;
    }

    @Override // androidx.browser.customtabs.d
    public final void onActivityResized(int i10, int i11, Bundle bundle) {
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            dVar.onActivityResized(i10, i11, bundle);
        }
    }

    @Override // androidx.browser.customtabs.d
    public final void onMessageChannelReady(@Nullable Bundle bundle) {
        this.f17725a.set(false);
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            dVar.onMessageChannelReady(bundle);
        }
    }

    @Override // androidx.browser.customtabs.d
    public final void onNavigationEvent(int i10, @Nullable Bundle bundle) {
        this.f17725a.set(false);
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            dVar.onNavigationEvent(i10, bundle);
        }
        m7.n nVar = m7.n.C;
        nVar.f30472k.getClass();
        long jCurrentTimeMillis = System.currentTimeMillis();
        wo woVar = this.f17727c;
        woVar.f18158j = jCurrentTimeMillis;
        List list = this.f17726b;
        if (list == null || !list.contains(String.valueOf(i10))) {
            return;
        }
        nVar.f30472k.getClass();
        woVar.f18157i = SystemClock.elapsedRealtime() + ((long) ((Integer) n7.y.f31093e.f31096c.b(ao.f8806cb)).intValue());
        if (woVar.f18153e == null) {
            woVar.f18153e = new mv1(woVar, 15);
        }
        woVar.d();
        com.google.android.gms.ads.nonagon.signalgeneration.b.zze(this.f17728d, null, "pact_action", new Pair("pe", "pact_reqpmc"));
    }

    @Override // androidx.browser.customtabs.d
    public final void onPostMessage(String str, @Nullable Bundle bundle) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            if (jSONObject.optInt("gpa", -1) == 0) {
                this.f17725a.set(true);
                com.google.android.gms.ads.nonagon.signalgeneration.b.zze(this.f17728d, null, "pact_action", new Pair("pe", "pact_con"));
                this.f17727c.a(jSONObject.getString("paw_id"));
            }
        } catch (JSONException unused) {
            p7.l0.h();
        }
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            dVar.onPostMessage(str, bundle);
        }
    }

    @Override // androidx.browser.customtabs.d
    public final void onRelationshipValidationResult(int i10, Uri uri, boolean z10, @Nullable Bundle bundle) {
        androidx.browser.customtabs.d dVar = this.zzd;
        if (dVar != null) {
            dVar.onRelationshipValidationResult(i10, uri, z10, bundle);
        }
    }
}
