package com.google.android.gms.internal.p002firebaseauthapi; import com.google.android.gms.common.Scopes; import com.google.android.gms.common.util.Strings; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.json.JSONArray; import org.json.JSONObject; /* loaded from: classes.dex */ public final class zzaea { private final List zza; public zzaea() { this.zza = new ArrayList(); } public static zzaea zza(JSONArray jSONArray) { if (jSONArray == null || jSONArray.length() == 0) { return new zzaea(new ArrayList()); } ArrayList arrayList = new ArrayList(); for (int i10 = 0; i10 < jSONArray.length(); i10++) { JSONObject jSONObject = jSONArray.getJSONObject(i10); arrayList.add(jSONObject == null ? new zzadz() : new zzadz(Strings.emptyToNull(jSONObject.optString("federatedId", null)), Strings.emptyToNull(jSONObject.optString("displayName", null)), Strings.emptyToNull(jSONObject.optString("photoUrl", null)), Strings.emptyToNull(jSONObject.optString("providerId", null)), null, Strings.emptyToNull(jSONObject.optString("phoneNumber", null)), Strings.emptyToNull(jSONObject.optString(Scopes.EMAIL, null)))); } return new zzaea(arrayList); } public static zzaea zzb(zzaea zzaeaVar) { List list = zzaeaVar.zza; zzaea zzaeaVar2 = new zzaea(); if (list != null) { zzaeaVar2.zza.addAll(list); } return zzaeaVar2; } public final List zzc() { return this.zza; } public zzaea(List list) { if (list.isEmpty()) { this.zza = Collections.emptyList(); } else { this.zza = Collections.unmodifiableList(list); } } }