package Z;

import androidx.datastore.preferences.protobuf.AbstractC0424b;
import androidx.datastore.preferences.protobuf.AbstractC0440s;
import androidx.datastore.preferences.protobuf.AbstractC0442u;
import androidx.datastore.preferences.protobuf.AbstractC0444w;
import androidx.datastore.preferences.protobuf.C0441t;
import androidx.datastore.preferences.protobuf.InterfaceC0443v;
import androidx.datastore.preferences.protobuf.P;
import androidx.datastore.preferences.protobuf.S;
import androidx.datastore.preferences.protobuf.T;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.RandomAccess;
import java.util.Set;
import n4.u0;
import u.AbstractC1563h;

/* JADX INFO: loaded from: classes.dex */
public final class e extends AbstractC0442u {
    private static final e DEFAULT_INSTANCE;
    private static volatile P PARSER = null;
    public static final int STRINGS_FIELD_NUMBER = 1;
    private InterfaceC0443v strings_ = S.f8027t;

    static {
        e eVar = new e();
        DEFAULT_INSTANCE = eVar;
        AbstractC0442u.j(e.class, eVar);
    }

    public static void l(e eVar, Set set) {
        InterfaceC0443v interfaceC0443v = eVar.strings_;
        if (!((AbstractC0424b) interfaceC0443v).f8052q) {
            S s8 = (S) interfaceC0443v;
            int i = s8.f8029s;
            eVar.strings_ = s8.c(i == 0 ? 10 : i * 2);
        }
        RandomAccess randomAccess = eVar.strings_;
        Charset charset = AbstractC0444w.f8140a;
        set.getClass();
        if (randomAccess instanceof ArrayList) {
            ((ArrayList) randomAccess).ensureCapacity(set.size() + ((S) randomAccess).f8029s);
        }
        S s9 = (S) randomAccess;
        int i5 = s9.f8029s;
        for (Object obj : set) {
            if (obj == null) {
                String str = "Element at index " + (s9.f8029s - i5) + " is null.";
                for (int i8 = s9.f8029s - 1; i8 >= i5; i8--) {
                    s9.remove(i8);
                }
                throw new NullPointerException(str);
            }
            s9.add(obj);
        }
    }

    public static e m() {
        return DEFAULT_INSTANCE;
    }

    public static d o() {
        return (d) ((AbstractC0440s) DEFAULT_INSTANCE.c(5));
    }

    @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\u0000\u0001\u0000\u0001\u001a", new Object[]{"strings_"});
            case 3:
                return new e();
            case 4:
                return new d(DEFAULT_INSTANCE);
            case 5:
                return DEFAULT_INSTANCE;
            case g.STRING_SET_FIELD_NUMBER /* 6 */:
                P p3 = PARSER;
                if (p3 != null) {
                    return p3;
                }
                synchronized (e.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 InterfaceC0443v n() {
        return this.strings_;
    }
}
