package v4;

import android.os.Bundle;
import android.os.Parcelable;
import java.io.Serializable;

/* loaded from: classes.dex */
public abstract class w {

    /* renamed from: c, reason: collision with root package name */
    public static final l f39224c = new l(null);

    /* renamed from: d, reason: collision with root package name */
    public static final w f39225d = new f();

    /* renamed from: e, reason: collision with root package name */
    public static final w f39226e = new i();

    /* renamed from: f, reason: collision with root package name */
    public static final w f39227f = new e();

    /* renamed from: g, reason: collision with root package name */
    public static final w f39228g = new h();

    /* renamed from: h, reason: collision with root package name */
    public static final w f39229h = new g();

    /* renamed from: i, reason: collision with root package name */
    public static final w f39230i = new d();

    /* renamed from: j, reason: collision with root package name */
    public static final w f39231j = new c();

    /* renamed from: k, reason: collision with root package name */
    public static final w f39232k = new b();

    /* renamed from: l, reason: collision with root package name */
    public static final w f39233l = new a();

    /* renamed from: m, reason: collision with root package name */
    public static final w f39234m = new k();

    /* renamed from: n, reason: collision with root package name */
    public static final w f39235n = new j();

    /* renamed from: a, reason: collision with root package name */
    private final boolean f39236a;

    /* renamed from: b, reason: collision with root package name */
    private final String f39237b = "nav_type";

    /* loaded from: classes.dex */
    public static final class a extends w {
        a() {
            super(true);
        }

        @Override // v4.w
        public String b() {
            return "boolean[]";
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public boolean[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (boolean[]) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public boolean[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, boolean[] zArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putBooleanArray(key, zArr);
        }
    }

    /* loaded from: classes.dex */
    public static final class b extends w {
        b() {
            super(false);
        }

        @Override // v4.w
        public String b() {
            return "boolean";
        }

        @Override // v4.w
        public /* bridge */ /* synthetic */ void f(Bundle bundle, String str, Object obj) {
            i(bundle, str, ((Boolean) obj).booleanValue());
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Boolean a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (Boolean) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public Boolean h(String value) {
            boolean z10;
            kotlin.jvm.internal.t.g(value, "value");
            if (kotlin.jvm.internal.t.b(value, "true")) {
                z10 = true;
            } else {
                if (!kotlin.jvm.internal.t.b(value, "false")) {
                    throw new IllegalArgumentException("A boolean NavType only accepts \"true\" or \"false\" values.");
                }
                z10 = false;
            }
            return Boolean.valueOf(z10);
        }

        public void i(Bundle bundle, String key, boolean z10) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putBoolean(key, z10);
        }
    }

    /* loaded from: classes.dex */
    public static final class c extends w {
        c() {
            super(true);
        }

        @Override // v4.w
        public String b() {
            return "float[]";
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public float[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (float[]) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public float[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, float[] fArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putFloatArray(key, fArr);
        }
    }

    /* loaded from: classes.dex */
    public static final class d extends w {
        d() {
            super(false);
        }

        @Override // v4.w
        public String b() {
            return "float";
        }

        @Override // v4.w
        public /* bridge */ /* synthetic */ void f(Bundle bundle, String str, Object obj) {
            i(bundle, str, ((Number) obj).floatValue());
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Float a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            Object obj = bundle.get(key);
            if (obj != null) {
                return Float.valueOf(((Float) obj).floatValue());
            }
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Float");
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public Float h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            return Float.valueOf(Float.parseFloat(value));
        }

        public void i(Bundle bundle, String key, float f10) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putFloat(key, f10);
        }
    }

    /* loaded from: classes.dex */
    public static final class e extends w {
        e() {
            super(true);
        }

        @Override // v4.w
        public String b() {
            return "integer[]";
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public int[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (int[]) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public int[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, int[] iArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putIntArray(key, iArr);
        }
    }

    /* loaded from: classes.dex */
    public static final class f extends w {
        f() {
            super(false);
        }

        @Override // v4.w
        public String b() {
            return "integer";
        }

        @Override // v4.w
        public /* bridge */ /* synthetic */ void f(Bundle bundle, String str, Object obj) {
            i(bundle, str, ((Number) obj).intValue());
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Integer a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            Object obj = bundle.get(key);
            if (obj != null) {
                return Integer.valueOf(((Integer) obj).intValue());
            }
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public Integer h(String value) {
            boolean P;
            int parseInt;
            int a10;
            kotlin.jvm.internal.t.g(value, "value");
            P = kotlin.text.y.P(value, "0x", false, 2, null);
            if (P) {
                String substring = value.substring(2);
                kotlin.jvm.internal.t.f(substring, "this as java.lang.String).substring(startIndex)");
                a10 = kotlin.text.b.a(16);
                parseInt = Integer.parseInt(substring, a10);
            } else {
                parseInt = Integer.parseInt(value);
            }
            return Integer.valueOf(parseInt);
        }

        public void i(Bundle bundle, String key, int i10) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putInt(key, i10);
        }
    }

    /* loaded from: classes.dex */
    public static final class g extends w {
        g() {
            super(true);
        }

        @Override // v4.w
        public String b() {
            return "long[]";
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public long[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (long[]) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public long[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, long[] jArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putLongArray(key, jArr);
        }
    }

    /* loaded from: classes.dex */
    public static final class h extends w {
        h() {
            super(false);
        }

        @Override // v4.w
        public String b() {
            return "long";
        }

        @Override // v4.w
        public /* bridge */ /* synthetic */ void f(Bundle bundle, String str, Object obj) {
            i(bundle, str, ((Number) obj).longValue());
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Long a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            Object obj = bundle.get(key);
            if (obj != null) {
                return Long.valueOf(((Long) obj).longValue());
            }
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Long");
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public Long h(String value) {
            boolean y10;
            String str;
            boolean P;
            long parseLong;
            int a10;
            kotlin.jvm.internal.t.g(value, "value");
            y10 = kotlin.text.y.y(value, "L", false, 2, null);
            if (y10) {
                str = value.substring(0, value.length() - 1);
                kotlin.jvm.internal.t.f(str, "this as java.lang.String…ing(startIndex, endIndex)");
            } else {
                str = value;
            }
            P = kotlin.text.y.P(value, "0x", false, 2, null);
            if (P) {
                String substring = str.substring(2);
                kotlin.jvm.internal.t.f(substring, "this as java.lang.String).substring(startIndex)");
                a10 = kotlin.text.b.a(16);
                parseLong = Long.parseLong(substring, a10);
            } else {
                parseLong = Long.parseLong(str);
            }
            return Long.valueOf(parseLong);
        }

        public void i(Bundle bundle, String key, long j10) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putLong(key, j10);
        }
    }

    /* loaded from: classes.dex */
    public static final class i extends w {
        i() {
            super(false);
        }

        @Override // v4.w
        public String b() {
            return "reference";
        }

        @Override // v4.w
        public /* bridge */ /* synthetic */ void f(Bundle bundle, String str, Object obj) {
            i(bundle, str, ((Number) obj).intValue());
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Integer a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            Object obj = bundle.get(key);
            if (obj != null) {
                return Integer.valueOf(((Integer) obj).intValue());
            }
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public Integer h(String value) {
            boolean P;
            int parseInt;
            int a10;
            kotlin.jvm.internal.t.g(value, "value");
            P = kotlin.text.y.P(value, "0x", false, 2, null);
            if (P) {
                String substring = value.substring(2);
                kotlin.jvm.internal.t.f(substring, "this as java.lang.String).substring(startIndex)");
                a10 = kotlin.text.b.a(16);
                parseInt = Integer.parseInt(substring, a10);
            } else {
                parseInt = Integer.parseInt(value);
            }
            return Integer.valueOf(parseInt);
        }

        public void i(Bundle bundle, String key, int i10) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putInt(key, i10);
        }
    }

    /* loaded from: classes.dex */
    public static final class j extends w {
        j() {
            super(true);
        }

        @Override // v4.w
        public String b() {
            return "string[]";
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public String[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (String[]) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public String[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, String[] strArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putStringArray(key, strArr);
        }
    }

    /* loaded from: classes.dex */
    public static final class k extends w {
        k() {
            super(true);
        }

        @Override // v4.w
        public String b() {
            return "string";
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public String a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (String) bundle.get(key);
        }

        @Override // v4.w
        /* renamed from: h, reason: merged with bridge method [inline-methods] */
        public String h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            return value;
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, String str) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            bundle.putString(key, str);
        }
    }

    /* loaded from: classes.dex */
    public static final class l {
        private l() {
        }

        public /* synthetic */ l(kotlin.jvm.internal.k kVar) {
            this();
        }

        public w a(String str, String str2) {
            boolean P;
            boolean y10;
            w wVar = w.f39225d;
            if (kotlin.jvm.internal.t.b(wVar.b(), str)) {
                return wVar;
            }
            w wVar2 = w.f39227f;
            if (kotlin.jvm.internal.t.b(wVar2.b(), str)) {
                return wVar2;
            }
            w wVar3 = w.f39228g;
            if (kotlin.jvm.internal.t.b(wVar3.b(), str)) {
                return wVar3;
            }
            w wVar4 = w.f39229h;
            if (kotlin.jvm.internal.t.b(wVar4.b(), str)) {
                return wVar4;
            }
            w wVar5 = w.f39232k;
            if (kotlin.jvm.internal.t.b(wVar5.b(), str)) {
                return wVar5;
            }
            w wVar6 = w.f39233l;
            if (kotlin.jvm.internal.t.b(wVar6.b(), str)) {
                return wVar6;
            }
            w wVar7 = w.f39234m;
            if (kotlin.jvm.internal.t.b(wVar7.b(), str)) {
                return wVar7;
            }
            w wVar8 = w.f39235n;
            if (kotlin.jvm.internal.t.b(wVar8.b(), str)) {
                return wVar8;
            }
            w wVar9 = w.f39230i;
            if (kotlin.jvm.internal.t.b(wVar9.b(), str)) {
                return wVar9;
            }
            w wVar10 = w.f39231j;
            if (kotlin.jvm.internal.t.b(wVar10.b(), str)) {
                return wVar10;
            }
            w wVar11 = w.f39226e;
            if (kotlin.jvm.internal.t.b(wVar11.b(), str)) {
                return wVar11;
            }
            if (str == null || str.length() == 0) {
                return wVar7;
            }
            try {
                P = kotlin.text.y.P(str, ".", false, 2, null);
                String p10 = (!P || str2 == null) ? str : kotlin.jvm.internal.t.p(str2, str);
                y10 = kotlin.text.y.y(str, "[]", false, 2, null);
                if (y10) {
                    p10 = p10.substring(0, p10.length() - 2);
                    kotlin.jvm.internal.t.f(p10, "this as java.lang.String…ing(startIndex, endIndex)");
                    Class<?> cls = Class.forName(p10);
                    if (Parcelable.class.isAssignableFrom(cls)) {
                        return new n(cls);
                    }
                    if (Serializable.class.isAssignableFrom(cls)) {
                        return new p(cls);
                    }
                } else {
                    Class<?> cls2 = Class.forName(p10);
                    if (Parcelable.class.isAssignableFrom(cls2)) {
                        return new o(cls2);
                    }
                    if (Enum.class.isAssignableFrom(cls2)) {
                        return new m(cls2);
                    }
                    if (Serializable.class.isAssignableFrom(cls2)) {
                        return new q(cls2);
                    }
                }
                throw new IllegalArgumentException(kotlin.jvm.internal.t.p(p10, " is not Serializable or Parcelable."));
            } catch (ClassNotFoundException e10) {
                throw new RuntimeException(e10);
            }
        }

        public final w b(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            try {
                try {
                    try {
                        try {
                            w wVar = w.f39225d;
                            wVar.h(value);
                            return wVar;
                        } catch (IllegalArgumentException unused) {
                            w wVar2 = w.f39230i;
                            wVar2.h(value);
                            return wVar2;
                        }
                    } catch (IllegalArgumentException unused2) {
                        w wVar3 = w.f39228g;
                        wVar3.h(value);
                        return wVar3;
                    }
                } catch (IllegalArgumentException unused3) {
                    return w.f39234m;
                }
            } catch (IllegalArgumentException unused4) {
                w wVar4 = w.f39232k;
                wVar4.h(value);
                return wVar4;
            }
        }

        public final w c(Object obj) {
            if (obj instanceof Integer) {
                return w.f39225d;
            }
            if (obj instanceof int[]) {
                return w.f39227f;
            }
            if (obj instanceof Long) {
                return w.f39228g;
            }
            if (obj instanceof long[]) {
                return w.f39229h;
            }
            if (obj instanceof Float) {
                return w.f39230i;
            }
            if (obj instanceof float[]) {
                return w.f39231j;
            }
            if (obj instanceof Boolean) {
                return w.f39232k;
            }
            if (obj instanceof boolean[]) {
                return w.f39233l;
            }
            if ((obj instanceof String) || obj == null) {
                return w.f39234m;
            }
            if ((obj instanceof Object[]) && (((Object[]) obj) instanceof String[])) {
                return w.f39235n;
            }
            if (obj.getClass().isArray()) {
                Class<?> componentType = obj.getClass().getComponentType();
                kotlin.jvm.internal.t.d(componentType);
                if (Parcelable.class.isAssignableFrom(componentType)) {
                    Class<?> componentType2 = obj.getClass().getComponentType();
                    if (componentType2 != null) {
                        return new n(componentType2);
                    }
                    throw new NullPointerException("null cannot be cast to non-null type java.lang.Class<android.os.Parcelable>");
                }
            }
            if (obj.getClass().isArray()) {
                Class<?> componentType3 = obj.getClass().getComponentType();
                kotlin.jvm.internal.t.d(componentType3);
                if (Serializable.class.isAssignableFrom(componentType3)) {
                    Class<?> componentType4 = obj.getClass().getComponentType();
                    if (componentType4 != null) {
                        return new p(componentType4);
                    }
                    throw new NullPointerException("null cannot be cast to non-null type java.lang.Class<java.io.Serializable>");
                }
            }
            if (obj instanceof Parcelable) {
                return new o(obj.getClass());
            }
            if (obj instanceof Enum) {
                return new m(obj.getClass());
            }
            if (obj instanceof Serializable) {
                return new q(obj.getClass());
            }
            throw new IllegalArgumentException("Object of type " + ((Object) obj.getClass().getName()) + " is not supported for navigation arguments.");
        }
    }

    /* loaded from: classes.dex */
    public static final class m extends q {

        /* renamed from: p, reason: collision with root package name */
        private final Class f39238p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public m(Class type) {
            super(false, type);
            kotlin.jvm.internal.t.g(type, "type");
            if (type.isEnum()) {
                this.f39238p = type;
                return;
            }
            throw new IllegalArgumentException((type + " is not an Enum type.").toString());
        }

        @Override // v4.w.q, v4.w
        public String b() {
            String name = this.f39238p.getName();
            kotlin.jvm.internal.t.f(name, "type.name");
            return name;
        }

        @Override // v4.w.q
        /* renamed from: j, reason: merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */
        public Enum h(String value) {
            Object obj;
            boolean z10;
            kotlin.jvm.internal.t.g(value, "value");
            Object[] enumConstants = this.f39238p.getEnumConstants();
            kotlin.jvm.internal.t.f(enumConstants, "type.enumConstants");
            int length = enumConstants.length;
            int i10 = 0;
            while (true) {
                if (i10 >= length) {
                    obj = null;
                    break;
                }
                obj = enumConstants[i10];
                i10++;
                z10 = kotlin.text.y.z(((Enum) obj).name(), value, true);
                if (z10) {
                    break;
                }
            }
            Enum r32 = (Enum) obj;
            if (r32 != null) {
                return r32;
            }
            throw new IllegalArgumentException("Enum value " + value + " not found for type " + ((Object) this.f39238p.getName()) + '.');
        }
    }

    /* loaded from: classes.dex */
    public static final class n extends w {

        /* renamed from: o, reason: collision with root package name */
        private final Class f39239o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public n(Class type) {
            super(true);
            kotlin.jvm.internal.t.g(type, "type");
            if (!Parcelable.class.isAssignableFrom(type)) {
                throw new IllegalArgumentException((type + " does not implement Parcelable.").toString());
            }
            try {
                this.f39239o = Class.forName("[L" + ((Object) type.getName()) + ';');
            } catch (ClassNotFoundException e10) {
                throw new RuntimeException(e10);
            }
        }

        @Override // v4.w
        public String b() {
            String name = this.f39239o.getName();
            kotlin.jvm.internal.t.f(name, "arrayType.name");
            return name;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null || !kotlin.jvm.internal.t.b(n.class, obj.getClass())) {
                return false;
            }
            return kotlin.jvm.internal.t.b(this.f39239o, ((n) obj).f39239o);
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Parcelable[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (Parcelable[]) bundle.get(key);
        }

        @Override // v4.w
        public Parcelable[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        public int hashCode() {
            return this.f39239o.hashCode();
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, Parcelable[] parcelableArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            this.f39239o.cast(parcelableArr);
            bundle.putParcelableArray(key, parcelableArr);
        }
    }

    /* loaded from: classes.dex */
    public static final class o extends w {

        /* renamed from: o, reason: collision with root package name */
        private final Class f39240o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public o(Class type) {
            super(true);
            kotlin.jvm.internal.t.g(type, "type");
            boolean z10 = true;
            if (!Parcelable.class.isAssignableFrom(type) && !Serializable.class.isAssignableFrom(type)) {
                z10 = false;
            }
            if (z10) {
                this.f39240o = type;
                return;
            }
            throw new IllegalArgumentException((type + " does not implement Parcelable or Serializable.").toString());
        }

        @Override // v4.w
        public Object a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return bundle.get(key);
        }

        @Override // v4.w
        public String b() {
            String name = this.f39240o.getName();
            kotlin.jvm.internal.t.f(name, "type.name");
            return name;
        }

        @Override // v4.w
        /* renamed from: e */
        public Object h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Parcelables don't support default values.");
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null || !kotlin.jvm.internal.t.b(o.class, obj.getClass())) {
                return false;
            }
            return kotlin.jvm.internal.t.b(this.f39240o, ((o) obj).f39240o);
        }

        @Override // v4.w
        public void f(Bundle bundle, String key, Object obj) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            this.f39240o.cast(obj);
            if (obj == null || (obj instanceof Parcelable)) {
                bundle.putParcelable(key, (Parcelable) obj);
            } else if (obj instanceof Serializable) {
                bundle.putSerializable(key, (Serializable) obj);
            }
        }

        public int hashCode() {
            return this.f39240o.hashCode();
        }
    }

    /* loaded from: classes.dex */
    public static final class p extends w {

        /* renamed from: o, reason: collision with root package name */
        private final Class f39241o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public p(Class type) {
            super(true);
            kotlin.jvm.internal.t.g(type, "type");
            if (!Serializable.class.isAssignableFrom(type)) {
                throw new IllegalArgumentException((type + " does not implement Serializable.").toString());
            }
            try {
                this.f39241o = Class.forName("[L" + ((Object) type.getName()) + ';');
            } catch (ClassNotFoundException e10) {
                throw new RuntimeException(e10);
            }
        }

        @Override // v4.w
        public String b() {
            String name = this.f39241o.getName();
            kotlin.jvm.internal.t.f(name, "arrayType.name");
            return name;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null || !kotlin.jvm.internal.t.b(p.class, obj.getClass())) {
                return false;
            }
            return kotlin.jvm.internal.t.b(this.f39241o, ((p) obj).f39241o);
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Serializable[] a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (Serializable[]) bundle.get(key);
        }

        @Override // v4.w
        public Serializable[] h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Arrays don't support default values.");
        }

        public int hashCode() {
            return this.f39241o.hashCode();
        }

        /* JADX WARN: Multi-variable type inference failed */
        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, Serializable[] serializableArr) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            this.f39241o.cast(serializableArr);
            bundle.putSerializable(key, serializableArr);
        }
    }

    public w(boolean z10) {
        this.f39236a = z10;
    }

    public abstract Object a(Bundle bundle, String str);

    public abstract String b();

    public boolean c() {
        return this.f39236a;
    }

    public final Object d(Bundle bundle, String key, String value) {
        kotlin.jvm.internal.t.g(bundle, "bundle");
        kotlin.jvm.internal.t.g(key, "key");
        kotlin.jvm.internal.t.g(value, "value");
        Object h10 = h(value);
        f(bundle, key, h10);
        return h10;
    }

    /* renamed from: e */
    public abstract Object h(String str);

    public abstract void f(Bundle bundle, String str, Object obj);

    public String toString() {
        return b();
    }

    /* loaded from: classes.dex */
    public static class q extends w {

        /* renamed from: o, reason: collision with root package name */
        private final Class f39242o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public q(Class type) {
            super(true);
            kotlin.jvm.internal.t.g(type, "type");
            if (Serializable.class.isAssignableFrom(type)) {
                if (true ^ type.isEnum()) {
                    this.f39242o = type;
                    return;
                }
                throw new IllegalArgumentException((type + " is an Enum. You should use EnumType instead.").toString());
            }
            throw new IllegalArgumentException((type + " does not implement Serializable.").toString());
        }

        @Override // v4.w
        public String b() {
            String name = this.f39242o.getName();
            kotlin.jvm.internal.t.f(name, "type.name");
            return name;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj instanceof q) {
                return kotlin.jvm.internal.t.b(this.f39242o, ((q) obj).f39242o);
            }
            return false;
        }

        @Override // v4.w
        /* renamed from: g, reason: merged with bridge method [inline-methods] */
        public Serializable a(Bundle bundle, String key) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            return (Serializable) bundle.get(key);
        }

        @Override // v4.w
        public Serializable h(String value) {
            kotlin.jvm.internal.t.g(value, "value");
            throw new UnsupportedOperationException("Serializables don't support default values.");
        }

        public int hashCode() {
            return this.f39242o.hashCode();
        }

        @Override // v4.w
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public void f(Bundle bundle, String key, Serializable value) {
            kotlin.jvm.internal.t.g(bundle, "bundle");
            kotlin.jvm.internal.t.g(key, "key");
            kotlin.jvm.internal.t.g(value, "value");
            this.f39242o.cast(value);
            bundle.putSerializable(key, value);
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public q(boolean z10, Class type) {
            super(z10);
            kotlin.jvm.internal.t.g(type, "type");
            if (Serializable.class.isAssignableFrom(type)) {
                this.f39242o = type;
                return;
            }
            throw new IllegalArgumentException((type + " does not implement Serializable.").toString());
        }
    }
}
