package 㴹.K.Ԕ.ඓ.K;

import ඓ.ⁱ.K.ඓ.C1252;
import 㳳.ʬ.AbstractC2397;
import 㴹.K.AbstractC2431;
import 㴹.K.AbstractC2511;
import 㴹.K.Ԕ.ʬ.AbstractC2433;
import 㴹.K.Ԕ.ʬ.AbstractC2436;
import 㴹.K.Ԕ.ῲ.C2456;
import 㴹.K.Ԕ.㿎.AbstractC2489;
import 㴹.K.Ԕ.㿎.AbstractC2490;
import 㴹.K.䁗.AbstractC2521;

/* renamed from: 㴹.K.Ԕ.ඓ.K.ʬ  reason: contains not printable characters */
/* compiled from: FlowableMap */
public final class C2449<T, U> extends AbstractC2453<T, U> {

    /* renamed from: 㸾  reason: contains not printable characters */
    public final AbstractC2521<? super T, ? extends U> f8397;

    /* renamed from: 㴹.K.Ԕ.ඓ.K.ʬ$ῲ  reason: contains not printable characters */
    /* compiled from: FlowableMap */
    public static final class C2450<T, U> extends AbstractC2489<T, U> {

        /* renamed from: ⁱ  reason: contains not printable characters */
        public final AbstractC2521<? super T, ? extends U> f8398;

        public C2450(AbstractC2397<? super U> r1, AbstractC2521<? super T, ? extends U> r2) {
            super(r1);
            this.f8398 = r2;
        }

        @Override // 㳳.ʬ.AbstractC2397
        public void onNext(T t) {
            if (!this.f8488) {
                if (this.f8490 != 0) {
                    this.f8489.onNext(null);
                    return;
                }
                try {
                    Object apply = this.f8398.apply(t);
                    C2456.m6500(apply, "The mapper function returned a null value.");
                    this.f8489.onNext(apply);
                } catch (Throwable th) {
                    C1252.m3329(th);
                    this.f8487.cancel();
                    onError(th);
                }
            }
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2439
        public U poll() throws Exception {
            T poll = this.f8491.poll();
            if (poll == null) {
                return null;
            }
            U u = (U) this.f8398.apply(poll);
            C2456.m6500(u, "The mapper function returned a null value.");
            return u;
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2438
        public int requestFusion(int i) {
            AbstractC2433<T> r0 = this.f8491;
            if (r0 == null || (i & 4) != 0) {
                return 0;
            }
            int requestFusion = r0.requestFusion(i);
            if (requestFusion == 0) {
                return requestFusion;
            }
            this.f8490 = requestFusion;
            return requestFusion;
        }
    }

    /* renamed from: 㴹.K.Ԕ.ඓ.K.ʬ$K  reason: contains not printable characters */
    /* compiled from: FlowableMap */
    public static final class C2451<T, U> extends AbstractC2490<T, U> {

        /* renamed from: ⁱ  reason: contains not printable characters */
        public final AbstractC2521<? super T, ? extends U> f8399;

        public C2451(AbstractC2436<? super U> k, AbstractC2521<? super T, ? extends U> r2) {
            super(k);
            this.f8399 = r2;
        }

        @Override // 㳳.ʬ.AbstractC2397
        public void onNext(T t) {
            if (!this.f8493) {
                if (this.f8495 != 0) {
                    this.f8494.onNext(null);
                    return;
                }
                try {
                    Object apply = this.f8399.apply(t);
                    C2456.m6500(apply, "The mapper function returned a null value.");
                    this.f8494.onNext(apply);
                } catch (Throwable th) {
                    C1252.m3329(th);
                    this.f8492.cancel();
                    onError(th);
                }
            }
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2439
        public U poll() throws Exception {
            T poll = this.f8496.poll();
            if (poll == null) {
                return null;
            }
            U u = (U) this.f8399.apply(poll);
            C2456.m6500(u, "The mapper function returned a null value.");
            return u;
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2438
        public int requestFusion(int i) {
            AbstractC2433<T> r0 = this.f8496;
            if (r0 == null || (i & 4) != 0) {
                return 0;
            }
            int requestFusion = r0.requestFusion(i);
            if (requestFusion == 0) {
                return requestFusion;
            }
            this.f8495 = requestFusion;
            return requestFusion;
        }

        /* JADX DEBUG: Multi-variable search result rejected for r0v5, resolved type: 㴹.K.Ԕ.ඓ.K.ʬ$K */
        /* JADX WARN: Multi-variable type inference failed */
        /* renamed from: K  reason: contains not printable characters */
        public boolean m6493(T t) {
            if (this.f8493) {
                return false;
            }
            try {
                Object apply = this.f8399.apply(t);
                C2456.m6500(apply, "The mapper function returned a null value.");
                return ((C2451) this.f8494).m6493(apply);
            } catch (Throwable th) {
                C1252.m3329(th);
                this.f8492.cancel();
                onError(th);
                return true;
            }
        }
    }

    public C2449(AbstractC2511<T> r1, AbstractC2521<? super T, ? extends U> r2) {
        super(r1);
        this.f8397 = r2;
    }

    @Override // 㴹.K.AbstractC2511
    /* renamed from: K  reason: contains not printable characters */
    public void m6492(AbstractC2397<? super U> r4) {
        if (r4 instanceof AbstractC2436) {
            this.f8401.m6562((AbstractC2431) new C2451((AbstractC2436) r4, this.f8397));
        } else {
            this.f8401.m6562((AbstractC2431) new C2450(r4, this.f8397));
        }
    }
}
