package jo;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import ko.a0;
import kotlin.jvm.internal.t;
import rm.c0;
import rm.v;
import sm.h0;
import sm.p0;

/* loaded from: classes3.dex */
final class m {

    /* renamed from: a, reason: collision with root package name */
    private final Map f25172a = new LinkedHashMap();

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

        /* renamed from: a, reason: collision with root package name */
        private final String f25173a;

        /* renamed from: b, reason: collision with root package name */
        final /* synthetic */ m f25174b;

        /* renamed from: jo.m$a$a, reason: collision with other inner class name */
        /* loaded from: classes3.dex */
        public final class C0523a {

            /* renamed from: a, reason: collision with root package name */
            private final String f25175a;

            /* renamed from: b, reason: collision with root package name */
            private final List f25176b;

            /* renamed from: c, reason: collision with root package name */
            private v f25177c;

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

            public C0523a(a aVar, String functionName) {
                t.g(functionName, "functionName");
                this.f25178d = aVar;
                this.f25175a = functionName;
                this.f25176b = new ArrayList();
                this.f25177c = c0.a("V", null);
            }

            public final v a() {
                int v10;
                int v11;
                a0 a0Var = a0.f26060a;
                String b10 = this.f25178d.b();
                String str = this.f25175a;
                List list = this.f25176b;
                v10 = sm.v.v(list, 10);
                ArrayList arrayList = new ArrayList(v10);
                Iterator it = list.iterator();
                while (it.hasNext()) {
                    arrayList.add((String) ((v) it.next()).c());
                }
                String k10 = a0Var.k(b10, a0Var.j(str, arrayList, (String) this.f25177c.c()));
                q qVar = (q) this.f25177c.d();
                List list2 = this.f25176b;
                v11 = sm.v.v(list2, 10);
                ArrayList arrayList2 = new ArrayList(v11);
                Iterator it2 = list2.iterator();
                while (it2.hasNext()) {
                    arrayList2.add((q) ((v) it2.next()).d());
                }
                return c0.a(k10, new k(qVar, arrayList2));
            }

            public final void b(String type, e... qualifiers) {
                Iterable<h0> W0;
                int v10;
                int d10;
                int d11;
                q qVar;
                t.g(type, "type");
                t.g(qualifiers, "qualifiers");
                List list = this.f25176b;
                if (qualifiers.length == 0) {
                    qVar = null;
                } else {
                    W0 = sm.p.W0(qualifiers);
                    v10 = sm.v.v(W0, 10);
                    d10 = p0.d(v10);
                    d11 = jn.o.d(d10, 16);
                    LinkedHashMap linkedHashMap = new LinkedHashMap(d11);
                    for (h0 h0Var : W0) {
                        linkedHashMap.put(Integer.valueOf(h0Var.c()), (e) h0Var.d());
                    }
                    qVar = new q(linkedHashMap);
                }
                list.add(c0.a(type, qVar));
            }

            public final void c(String type, e... qualifiers) {
                Iterable<h0> W0;
                int v10;
                int d10;
                int d11;
                t.g(type, "type");
                t.g(qualifiers, "qualifiers");
                W0 = sm.p.W0(qualifiers);
                v10 = sm.v.v(W0, 10);
                d10 = p0.d(v10);
                d11 = jn.o.d(d10, 16);
                LinkedHashMap linkedHashMap = new LinkedHashMap(d11);
                for (h0 h0Var : W0) {
                    linkedHashMap.put(Integer.valueOf(h0Var.c()), (e) h0Var.d());
                }
                this.f25177c = c0.a(type, new q(linkedHashMap));
            }

            public final void d(yo.e type) {
                t.g(type, "type");
                String desc = type.getDesc();
                t.f(desc, "getDesc(...)");
                this.f25177c = c0.a(desc, null);
            }
        }

        public a(m mVar, String className) {
            t.g(className, "className");
            this.f25174b = mVar;
            this.f25173a = className;
        }

        public final void a(String name, dn.l block) {
            t.g(name, "name");
            t.g(block, "block");
            Map map = this.f25174b.f25172a;
            C0523a c0523a = new C0523a(this, name);
            block.invoke(c0523a);
            v a10 = c0523a.a();
            map.put(a10.c(), a10.d());
        }

        public final String b() {
            return this.f25173a;
        }
    }

    public final Map b() {
        return this.f25172a;
    }
}
