package o; import java.util.Iterator; import java.util.Objects; /* loaded from: classes6.dex */ public final class fXR extends AbstractC13163fSk { private AbstractC13163fSk a; private fSL d; private Iterable e; public fXR(AbstractC13163fSk abstractC13163fSk, Iterable iterable, fSL fsl) { this.a = abstractC13163fSk; this.e = iterable; this.d = fsl; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv interfaceC13174fSv) { try { Iterator it = (Iterator) Objects.requireNonNull(this.e.iterator(), "The iterator returned by other is null"); try { if (!it.hasNext()) { EnumC13195fTi.e(interfaceC13174fSv); } else { this.a.subscribe(new HBt(interfaceC13174fSv, it, this.d)); } } catch (Throwable th) { C13147fSI.c(th); EnumC13195fTi.a(th, interfaceC13174fSv); } } catch (Throwable th2) { C13147fSI.c(th2); EnumC13195fTi.a(th2, interfaceC13174fSv); } } /* loaded from: classes6.dex */ static final class HBt implements InterfaceC13174fSv, fSJ { private Iterator a; private boolean b; private fSL c; private fSJ d; private InterfaceC13174fSv e; HBt(InterfaceC13174fSv interfaceC13174fSv, Iterator it, fSL fsl) { this.e = interfaceC13174fSv; this.a = it; this.c = fsl; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.d, fsj)) { this.d = fsj; this.e.onSubscribe(this); } } @Override // o.fSJ public final void dispose() { this.d.dispose(); } @Override // o.fSJ public final boolean isDisposed() { return this.d.isDisposed(); } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.b) { return; } try { try { this.e.onNext(Objects.requireNonNull(this.c.e(t, Objects.requireNonNull(this.a.next(), "The iterator returned a null value")), "The zipper function returned a null value")); try { if (this.a.hasNext()) { return; } this.b = true; this.d.dispose(); this.e.onComplete(); } catch (Throwable th) { C13147fSI.c(th); this.b = true; this.d.dispose(); this.e.onError(th); } } catch (Throwable th2) { C13147fSI.c(th2); this.b = true; this.d.dispose(); this.e.onError(th2); } } catch (Throwable th3) { C13147fSI.c(th3); this.b = true; this.d.dispose(); this.e.onError(th3); } } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.b) { C13418fZu.c(th); } else { this.b = true; this.e.onError(th); } } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.b) { return; } this.b = true; this.e.onComplete(); } } }