package E3;

import F.C0170y;
import F.k0;
import G0.B0;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.navigation.C1134i;
import androidx.recyclerview.widget.i0;
import java.util.Arrays;
import m.AbstractC2460a;

/* JADX INFO: loaded from: classes3.dex */
public final class j {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f1150a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f1151b;

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

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

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

    public j(String str) {
        this.f1150a = 0;
        C4.f fVar = new C4.f(2, false);
        this.f1153d = fVar;
        this.f1154e = fVar;
        this.f1151b = false;
        this.f1152c = str;
    }

    public void a(Object obj, String str) {
        C4.f fVar = new C4.f(2, false);
        ((C4.f) this.f1154e).f743d = fVar;
        this.f1154e = fVar;
        fVar.f742c = obj;
        fVar.f741b = str;
    }

    public void b(String str, long j4) {
        d(str, String.valueOf(j4));
    }

    public void c(String str, boolean z6) {
        d(str, String.valueOf(z6));
    }

    public void d(String str, String str2) {
        i iVar = new i(2, false);
        ((C4.f) this.f1154e).f743d = iVar;
        this.f1154e = iVar;
        iVar.f742c = str2;
        iVar.f741b = str;
    }

    public i0 e() {
        Intent intent = (Intent) this.f1152c;
        if (!intent.hasExtra("android.support.customtabs.extra.SESSION")) {
            Bundle bundle = new Bundle();
            bundle.putBinder("android.support.customtabs.extra.SESSION", null);
            intent.putExtras(bundle);
        }
        intent.putExtra("android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS", this.f1151b);
        ((C1134i) this.f1153d).getClass();
        intent.putExtras(new Bundle());
        intent.putExtra("androidx.browser.customtabs.extra.SHARE_STATE", 0);
        int i6 = Build.VERSION.SDK_INT;
        String strA = m.b.a();
        if (!TextUtils.isEmpty(strA)) {
            Bundle bundleExtra = intent.hasExtra("com.android.browser.headers") ? intent.getBundleExtra("com.android.browser.headers") : new Bundle();
            if (!bundleExtra.containsKey("Accept-Language")) {
                bundleExtra.putString("Accept-Language", strA);
                intent.putExtra("com.android.browser.headers", bundleExtra);
            }
        }
        if (i6 >= 34) {
            if (((ActivityOptions) this.f1154e) == null) {
                this.f1154e = AbstractC2460a.a();
            }
            m.c.a((ActivityOptions) this.f1154e, false);
        }
        ActivityOptions activityOptions = (ActivityOptions) this.f1154e;
        return new i0(6, intent, activityOptions != null ? activityOptions.toBundle() : null);
    }

    public String toString() {
        switch (this.f1150a) {
            case 0:
                boolean z6 = this.f1151b;
                StringBuilder sb = new StringBuilder(32);
                sb.append((String) this.f1152c);
                sb.append('{');
                String str = "";
                for (C4.f fVar = (C4.f) ((C4.f) this.f1153d).f743d; fVar != null; fVar = (C4.f) fVar.f743d) {
                    Object obj = fVar.f742c;
                    if ((fVar instanceof i) || obj != null || !z6) {
                        sb.append(str);
                        String str2 = (String) fVar.f741b;
                        if (str2 != null) {
                            sb.append(str2);
                            sb.append('=');
                        }
                        if (obj == null || !obj.getClass().isArray()) {
                            sb.append(obj);
                        } else {
                            String strDeepToString = Arrays.deepToString(new Object[]{obj});
                            sb.append((CharSequence) strDeepToString, 1, strDeepToString.length() - 1);
                        }
                        str = ", ";
                    }
                }
                sb.append('}');
                return sb.toString();
            default:
                return super.toString();
        }
    }

    public j(C0170y c0170y, B0 b02, k0 k0Var) {
        this.f1150a = 1;
        this.f1152c = c0170y;
        this.f1153d = b02;
        this.f1154e = k0Var;
        this.f1151b = true;
    }

    public j() {
        this.f1150a = 2;
        this.f1152c = new Intent("android.intent.action.VIEW");
        this.f1153d = new C1134i(10);
        this.f1151b = true;
    }
}
