package o; import java.util.NoSuchElementException; /* renamed from: o.fXg, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C13333fXg extends AbstractC13175fSw { private InterfaceC13169fSq b; private T e; public C13333fXg(InterfaceC13169fSq interfaceC13169fSq, T t) { this.b = interfaceC13169fSq; this.e = t; } @Override // o.AbstractC13175fSw public final void e(InterfaceC13176fSx interfaceC13176fSx) { this.b.subscribe(new IeS(interfaceC13176fSx, this.e)); } /* renamed from: o.fXg$IeS */ /* loaded from: classes6.dex */ static final class IeS implements InterfaceC13174fSv, fSJ { private boolean a; private T b; private InterfaceC13176fSx c; private fSJ d; private T e; IeS(InterfaceC13176fSx interfaceC13176fSx, T t) { this.c = interfaceC13176fSx; this.b = t; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.d, fsj)) { this.d = fsj; this.c.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.a) { return; } if (this.e == null) { this.e = t; return; } this.a = true; this.d.dispose(); this.c.onError(new IllegalArgumentException("Sequence contains more than one element!")); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.a) { C13418fZu.c(th); } else { this.a = true; this.c.onError(th); } } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.a) { return; } this.a = true; T t = this.e; this.e = null; if (t == null) { t = this.b; } if (t != null) { this.c.e(t); } else { this.c.onError(new NoSuchElementException()); } } } }