package o; import android.text.TextUtils; import java.util.ArrayList; import java.util.List; import java.util.NoSuchElementException; import o.InterfaceC9010dbe; import o.PRA; import o.ZI; import o.cWT; import o.wRi; /* loaded from: classes4.dex */ public class cWT extends ZI { boolean a; public AbstractC1237Yr b; public List c; private C1233Yp d; public final yGw e; private String g; private final C0281Da h; private C1019Twi i; private final EF m; /* renamed from: o, reason: collision with root package name */ private boolean f8629o; @InterfaceC13391fZD public cWT(C0281Da c0281Da, yGw ygw, EF ef, C16903sI c16903sI) { super(c16903sI); this.g = "000"; this.h = c0281Da; this.e = ygw; this.m = ef; this.i = ygw.a.n(); } @Override // o.ZI public final void w_() { super.w_(); yGw ygw = this.e; if (ygw.h.isDisposed()) { return; } ygw.h.dispose(); } public final void b(String str) { this.e.d(this.e.a.c(str).map(new fSS(this) { // from class: o.cWX private cWT b; @Override // o.fSS public final Object a(Object obj) { return cWT.a(this.b, (List) obj); } { this.b = this; } }), new fSQ(this) { // from class: o.cWV private cWT e; @Override // o.fSQ public final void c(Object obj) { cWT.d(this.e, (List) obj); } { this.e = this; } }, new fSQ(this) { // from class: o.cWU private cWT d; @Override // o.fSQ public final void c(Object obj) { cWT.c(this.d, (Throwable) obj); } { this.d = this; } }); } public final void e(final C1233Yp c1233Yp, final boolean z) { if (TextUtils.isEmpty(this.g)) { this.a = true; this.d = c1233Yp; this.f8629o = z; } else { if (this.b != null) { ZI.IeS ieS = new ZI.IeS(this, c1233Yp, z) { // from class: o.cWQ private boolean a; private C1233Yp b; private cWT c; @Override // o.ZI.IeS public final void e(Object obj) { cWT.e(this.c, this.b, this.a, (InterfaceC9010dbe.WNf) obj); } { this.c = this; this.b = c1233Yp; this.a = z; } }; if (this.f != 0) { ieS.e(this.f); return; } return; } ZI.IeS ieS2 = new ZI.IeS(this, c1233Yp, z) { // from class: o.cXa private C1233Yp b; private cWT c; private boolean d; @Override // o.ZI.IeS public final void e(Object obj) { cWT.c(this.c, this.b, this.d, (InterfaceC9010dbe.WNf) obj); } { this.c = this; this.b = c1233Yp; this.d = z; } }; if (this.f != 0) { ieS2.e(this.f); } } } /* loaded from: classes4.dex */ public final class Sts extends wRi.LWm> { private cWT e; private Sts(cWT cwt) { this.e = cwt; } /* JADX WARN: Multi-variable type inference failed */ @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { zEQ d; String str; YKU yku = new YKU((List) obj); YKU yku2 = new YKU(yku.a, new GEP(yku.b, new Jel() { // from class: o.cXl @Override // o.Jel public final boolean e(Object obj2) { boolean equalsIgnoreCase; equalsIgnoreCase = "000".equalsIgnoreCase(((LEE) obj2).c); return equalsIgnoreCase; } })); if (yku2.b.hasNext()) { d = zEQ.a(yku2.b.next()); } else { d = zEQ.d(); } cWT cwt = this.e; if (d.d == 0) { str = ""; } else { T t = d.d; if (t == 0) { throw new NoSuchElementException("No value present"); } str = ((LEE) t).c; } cwt.g = str; if (!this.e.a || this.e.d == null) { return; } this.e.a = false; cWT cwt2 = this.e; ZI.IeS ieS = new ZI.IeS(this) { // from class: o.cXj private cWT.Sts d; @Override // o.ZI.IeS public final void e(Object obj2) { cWT.Sts.e(this.d, (InterfaceC9010dbe.WNf) obj2); } { this.d = this; } }; if (cwt2.f != 0) { ieS.e(cwt2.f); } } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { C16903sI unused = this.e.j; guQ.a(C16903sI.b(th), new Object[0]); } public static /* synthetic */ void e(Sts sts, InterfaceC9010dbe.WNf wNf) { EF unused = sts.e.m; wNf.a(EF.d(sts.e.d, sts.e.g), sts.e.f8629o); } public /* synthetic */ Sts(cWT cwt, byte b) { this(cwt); } } public static /* synthetic */ void c(cWT cwt, C1233Yp c1233Yp, boolean z, InterfaceC9010dbe.WNf wNf) { EF ef = cwt.m; wNf.a(EF.d(c1233Yp, cwt.g), z); } public static /* synthetic */ C1233Yp a(cWT cwt, USY usy) { C0281Da c0281Da = cwt.h; return C0281Da.a(usy, cwt.e.b.T()); } public static /* synthetic */ void d(final cWT cwt, final List list) { final zEQ d; cwt.c = list; if (cwt.f != 0) { if (cwt.i == null) { ZI.IeS ieS = new ZI.IeS(list) { // from class: o.cXe private List a; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.WNf) obj).b(this.a); } { this.a = list; } }; if (cwt.f != 0) { ieS.e(cwt.f); return; } return; } YKU yku = new YKU(list); YKU yku2 = new YKU(yku.a, new GEP(yku.b, new Jel(cwt) { // from class: o.cXf private cWT e; @Override // o.Jel public final boolean e(Object obj) { boolean equals; equals = ((C1233Yp) obj).d.equals(this.e.i.b); return equals; } { this.e = cwt; } })); if (yku2.b.hasNext()) { d = zEQ.a(yku2.b.next()); } else { d = zEQ.d(); } if (d.d != 0 && qhK.OWN.name().equals(cwt.i.z)) { ZI.IeS ieS2 = new ZI.IeS(d) { // from class: o.cXc private zEQ c; @Override // o.ZI.IeS public final void e(Object obj) { cWT.e(this.c, (InterfaceC9010dbe.WNf) obj); } { this.c = d; } }; if (cwt.f != 0) { ieS2.e(cwt.f); return; } return; } if (qhK.OWN.name().equals(cwt.i.z)) { USY usy = new USY(); usy.a = cwt.i.b; usy.d = cwt.i.u; C0281Da c0281Da = cwt.h; final C1233Yp a = C0281Da.a(usy, cwt.e.b.T()); ZI.IeS ieS3 = new ZI.IeS(a) { // from class: o.cXg private C1233Yp e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.WNf) obj).e(this.e); } { this.e = a; } }; if (cwt.f != 0) { ieS3.e(cwt.f); } } } } public static /* synthetic */ List a(final cWT cwt, List list) { YKU yku = new YKU(list); return (List) new YKU(yku.a, new wxK(yku.b, new InterfaceC1244Ytw(cwt) { // from class: o.cWS private cWT b; @Override // o.InterfaceC1244Ytw public final Object d(Object obj) { return cWT.a(this.b, (USY) obj); } { this.b = cwt; } })).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8())); } public static /* synthetic */ void e(cWT cwt, C1233Yp c1233Yp, boolean z, InterfaceC9010dbe.WNf wNf) { EF ef = cwt.m; wNf.a(EF.e(cwt.b, c1233Yp), z); } public static /* synthetic */ void c(cWT cwt, Throwable th) { if (cwt.i(th)) { return; } ZI.IeS ieS = new ZI.IeS() { // from class: o.cXd @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.WNf) obj).b(new ArrayList()); } }; if (cwt.f != 0) { ieS.e(cwt.f); } } /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: Multi-variable type inference failed */ public static /* synthetic */ void e(zEQ zeq, InterfaceC9010dbe.WNf wNf) { T t = zeq.d; if (t != 0) { wNf.e((C1233Yp) t); return; } throw new NoSuchElementException("No value present"); } /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: Multi-variable type inference failed */ public static /* synthetic */ void b(zEQ zeq, InterfaceC9010dbe.WNf wNf) { T t = zeq.d; if (t != 0) { wNf.e((C1233Yp) t); return; } throw new NoSuchElementException("No value present"); } }