package com.google.firebase.components; import com.google.android.gms.common.internal.Preconditions; import com.google.firebase.components.Component; import com.google.firebase.events.Publisher; import com.google.firebase.events.Subscriber; import com.google.firebase.inject.Provider; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; /* compiled from: com.google.firebase:firebase-common@@16.0.2 */ /* loaded from: classes.dex */ public final class zzf extends zza { private final List> a; private final Map, zzj> b = new HashMap(); private final zzh c; public zzf(Executor executor, Iterable iterable, Component... componentArr) { this.c = new zzh(executor); ArrayList arrayList = new ArrayList(); arrayList.add(Component.a(this.c, zzh.class, Subscriber.class, Publisher.class)); Iterator it = iterable.iterator(); while (it.hasNext()) { arrayList.addAll(it.next().getComponents()); } Collections.addAll(arrayList, componentArr); this.a = Collections.unmodifiableList(Component.AnonymousClass1.a(arrayList)); Iterator> it2 = this.a.iterator(); while (it2.hasNext()) { a(it2.next()); } a(); } @Override // com.google.firebase.components.ComponentContainer public final Provider b(Class cls) { Preconditions.a(cls, "Null interface requested."); return this.b.get(cls); } public final void a(boolean z) { for (Component component : this.a) { if (component.e() || (component.f() && z)) { a(component.a().iterator().next()); } } this.c.a(); } private void a(Component component) { zzj zzjVar = new zzj<>(component.c(), new zzl(component, this)); Iterator> it = component.a().iterator(); while (it.hasNext()) { this.b.put(it.next(), zzjVar); } } private void a() { for (Component component : this.a) { for (Dependency dependency : component.b()) { if (dependency.b() && !this.b.containsKey(dependency.a())) { throw new MissingDependencyException(String.format("Unsatisfied dependency for component %s: %s", component, dependency.a())); } } } } }