package hp;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/* loaded from: classes3.dex */
public abstract class e1 extends k1 {

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

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

        /* renamed from: hp.e1$a$a, reason: collision with other inner class name */
        /* loaded from: classes3.dex */
        public static final class C0470a extends e1 {

            /* renamed from: d, reason: collision with root package name */
            final /* synthetic */ Map f21919d;

            /* renamed from: e, reason: collision with root package name */
            final /* synthetic */ boolean f21920e;

            C0470a(Map map, boolean z10) {
                this.f21919d = map;
                this.f21920e = z10;
            }

            @Override // hp.k1
            public boolean a() {
                return this.f21920e;
            }

            @Override // hp.k1
            public boolean f() {
                return this.f21919d.isEmpty();
            }

            @Override // hp.e1
            public h1 k(d1 key) {
                kotlin.jvm.internal.t.g(key, "key");
                return (h1) this.f21919d.get(key);
            }
        }

        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }

        public static /* synthetic */ e1 e(a aVar, Map map, boolean z10, int i10, Object obj) {
            if ((i10 & 2) != 0) {
                z10 = false;
            }
            return aVar.d(map, z10);
        }

        public final k1 a(e0 kotlinType) {
            kotlin.jvm.internal.t.g(kotlinType, "kotlinType");
            return b(kotlinType.K0(), kotlinType.I0());
        }

        /* JADX WARN: Code restructure failed: missing block: B:4:0x0021, code lost:
        
            if (r2.i0() == true) goto L8;
         */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final k1 b(d1 typeConstructor, List arguments) {
            Object q02;
            boolean z10;
            int v10;
            List b12;
            Map s10;
            kotlin.jvm.internal.t.g(typeConstructor, "typeConstructor");
            kotlin.jvm.internal.t.g(arguments, "arguments");
            List parameters = typeConstructor.getParameters();
            kotlin.jvm.internal.t.f(parameters, "getParameters(...)");
            q02 = sm.c0.q0(parameters);
            tn.e1 e1Var = (tn.e1) q02;
            if (e1Var != null) {
                z10 = true;
            }
            z10 = false;
            if (!z10) {
                return new c0(parameters, arguments);
            }
            List parameters2 = typeConstructor.getParameters();
            kotlin.jvm.internal.t.f(parameters2, "getParameters(...)");
            List list = parameters2;
            v10 = sm.v.v(list, 10);
            ArrayList arrayList = new ArrayList(v10);
            Iterator it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(((tn.e1) it.next()).j());
            }
            b12 = sm.c0.b1(arrayList, arguments);
            s10 = sm.q0.s(b12);
            return e(this, s10, false, 2, null);
        }

        public final e1 c(Map map) {
            kotlin.jvm.internal.t.g(map, "map");
            return e(this, map, false, 2, null);
        }

        public final e1 d(Map map, boolean z10) {
            kotlin.jvm.internal.t.g(map, "map");
            return new C0470a(map, z10);
        }
    }

    public static final k1 i(d1 d1Var, List list) {
        return f21918c.b(d1Var, list);
    }

    public static final e1 j(Map map) {
        return f21918c.c(map);
    }

    @Override // hp.k1
    public h1 e(e0 key) {
        kotlin.jvm.internal.t.g(key, "key");
        return k(key.K0());
    }

    public abstract h1 k(d1 d1Var);
}
