package Z;

import androidx.datastore.preferences.protobuf.AbstractC0440s;
import androidx.datastore.preferences.protobuf.AbstractC0442u;
import androidx.datastore.preferences.protobuf.C0431i;
import androidx.datastore.preferences.protobuf.C0432j;
import androidx.datastore.preferences.protobuf.C0435m;
import androidx.datastore.preferences.protobuf.C0441t;
import androidx.datastore.preferences.protobuf.C0446y;
import androidx.datastore.preferences.protobuf.G;
import androidx.datastore.preferences.protobuf.P;
import androidx.datastore.preferences.protobuf.Q;
import androidx.datastore.preferences.protobuf.T;
import androidx.datastore.preferences.protobuf.U;
import androidx.datastore.preferences.protobuf.a0;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.Map;
import n4.u0;
import u.AbstractC1563h;

/* JADX INFO: loaded from: classes.dex */
public final class c extends AbstractC0442u {
    private static final c DEFAULT_INSTANCE;
    private static volatile P PARSER = null;
    public static final int PREFERENCES_FIELD_NUMBER = 1;
    private G preferences_ = G.f8000r;

    static {
        c cVar = new c();
        DEFAULT_INSTANCE = cVar;
        AbstractC0442u.j(c.class, cVar);
    }

    public static G l(c cVar) {
        G g8 = cVar.preferences_;
        if (!g8.f8001q) {
            cVar.preferences_ = g8.d();
        }
        return cVar.preferences_;
    }

    public static a n() {
        return (a) ((AbstractC0440s) DEFAULT_INSTANCE.c(5));
    }

    public static c o(InputStream inputStream) {
        c cVar = DEFAULT_INSTANCE;
        C0431i c0431i = new C0431i(inputStream);
        C0435m c0435mA = C0435m.a();
        AbstractC0442u abstractC0442uI = cVar.i();
        try {
            Q q8 = Q.f8024c;
            q8.getClass();
            U uA = q8.a(abstractC0442uI.getClass());
            C0432j c0432j = (C0432j) c0431i.f3474b;
            if (c0432j == null) {
                c0432j = new C0432j(c0431i);
            }
            uA.f(abstractC0442uI, c0432j, c0435mA);
            uA.d(abstractC0442uI);
            if (AbstractC0442u.f(abstractC0442uI, true)) {
                return (c) abstractC0442uI;
            }
            throw new C0446y(new a0().getMessage());
        } catch (a0 e8) {
            throw new C0446y(e8.getMessage());
        } catch (C0446y e9) {
            if (e9.f8142q) {
                throw new C0446y(e9.getMessage(), e9);
            }
            throw e9;
        } catch (IOException e10) {
            if (e10.getCause() instanceof C0446y) {
                throw ((C0446y) e10.getCause());
            }
            throw new C0446y(e10.getMessage(), e10);
        } catch (RuntimeException e11) {
            if (e11.getCause() instanceof C0446y) {
                throw ((C0446y) e11.getCause());
            }
            throw e11;
        }
    }

    @Override // androidx.datastore.preferences.protobuf.AbstractC0442u
    public final Object c(int i) {
        P c0441t;
        switch (AbstractC1563h.c(i)) {
            case u0.f15495q /* 0 */:
                return (byte) 1;
            case 1:
                return null;
            case 2:
                return new T(DEFAULT_INSTANCE, "\u0001\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u00012", new Object[]{"preferences_", b.f7360a});
            case 3:
                return new c();
            case 4:
                return new a(DEFAULT_INSTANCE);
            case 5:
                return DEFAULT_INSTANCE;
            case g.STRING_SET_FIELD_NUMBER /* 6 */:
                P p3 = PARSER;
                if (p3 != null) {
                    return p3;
                }
                synchronized (c.class) {
                    try {
                        c0441t = PARSER;
                        if (c0441t == null) {
                            c0441t = new C0441t();
                            PARSER = c0441t;
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                    break;
                }
                return c0441t;
            default:
                throw new UnsupportedOperationException();
        }
    }

    public final Map m() {
        return Collections.unmodifiableMap(this.preferences_);
    }
}
