package rp;

import java.util.Iterator;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public abstract class n extends m {

    /* loaded from: classes3.dex */
    public static final class a implements h {

        /* renamed from: a, reason: collision with root package name */
        final /* synthetic */ Iterator f35066a;

        public a(Iterator it) {
            this.f35066a = it;
        }

        @Override // rp.h
        public Iterator iterator() {
            return this.f35066a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class b extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        public static final b f35067p = new b();

        b() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Iterator invoke(h it) {
            t.g(it, "it");
            return it.iterator();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class c extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        public static final c f35068p = new c();

        c() {
            super(1);
        }

        @Override // dn.l
        public final Object invoke(Object obj) {
            return obj;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class d extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f35069p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        d(dn.a aVar) {
            super(1);
            this.f35069p = aVar;
        }

        @Override // dn.l
        public final Object invoke(Object it) {
            t.g(it, "it");
            return this.f35069p.invoke();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class e extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ Object f35070p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        e(Object obj) {
            super(0);
            this.f35070p = obj;
        }

        @Override // dn.a
        public final Object invoke() {
            return this.f35070p;
        }
    }

    public static h c(Iterator it) {
        t.g(it, "<this>");
        return d(new a(it));
    }

    public static final h d(h hVar) {
        t.g(hVar, "<this>");
        return hVar instanceof rp.a ? hVar : new rp.a(hVar);
    }

    public static h e() {
        return rp.d.f35042a;
    }

    public static final h f(h hVar) {
        t.g(hVar, "<this>");
        return g(hVar, b.f35067p);
    }

    private static final h g(h hVar, dn.l lVar) {
        return hVar instanceof r ? ((r) hVar).d(lVar) : new f(hVar, c.f35068p, lVar);
    }

    public static h h(dn.a nextFunction) {
        t.g(nextFunction, "nextFunction");
        return d(new g(nextFunction, new d(nextFunction)));
    }

    public static h i(Object obj, dn.l nextFunction) {
        t.g(nextFunction, "nextFunction");
        return obj == null ? rp.d.f35042a : new g(new e(obj), nextFunction);
    }

    public static final h j(Object... elements) {
        h I;
        h e10;
        t.g(elements, "elements");
        if (elements.length == 0) {
            e10 = e();
            return e10;
        }
        I = sm.p.I(elements);
        return I;
    }
}
