package r2;

import android.os.Bundle;
import h3.C2167o4;
import n2.AbstractC2612c;
import q2.C2843f;
import q2.C2844g;

/* JADX INFO: loaded from: classes.dex */
public final class j implements g5.a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final j f23926a = new j();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final i5.h f23927b = W.a.R("androidx.savedstate.SavedState", new i5.g[0], new C2167o4(12));

    @Override // g5.a
    public final Object deserialize(j5.c decoder) {
        kotlin.jvm.internal.o.h(decoder, "decoder");
        if (!(decoder instanceof C2843f)) {
            throw new IllegalArgumentException(m1.g.f(f23927b.f19087a, decoder).toString());
        }
        C2843f c2843f = (C2843f) decoder;
        boolean zC = kotlin.jvm.internal.o.c(c2843f.f23619i, "");
        Bundle bundle = c2843f.f23617g;
        return zC ? bundle : AbstractC2612c.o(bundle, c2843f.f23619i);
    }

    @Override // g5.a
    public final i5.g getDescriptor() {
        return f23927b;
    }

    @Override // g5.a
    public final void serialize(j5.d encoder, Object obj) {
        Bundle value = (Bundle) obj;
        kotlin.jvm.internal.o.h(encoder, "encoder");
        kotlin.jvm.internal.o.h(value, "value");
        if (!(encoder instanceof C2844g)) {
            throw new IllegalArgumentException(m1.g.g(encoder, f23927b.f19087a).toString());
        }
        C2844g c2844g = (C2844g) encoder;
        boolean zC = kotlin.jvm.internal.o.c(c2844g.l, "");
        Bundle bundle = c2844g.f23622j;
        if (zC) {
            bundle.putAll(value);
        } else {
            m1.g.m(bundle, c2844g.l, value);
        }
    }
}
