package fo;

import bo.b0;
import hp.e0;
import hp.m0;
import hp.o1;
import hp.t1;
import io.o;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import rm.c0;
import sm.q0;
import tn.i1;
import tn.x;
import vo.p;
import vo.r;

/* loaded from: classes3.dex */
public final class e implements kotlin.reflect.jvm.internal.impl.descriptors.annotations.c, p002do.g {

    /* renamed from: i, reason: collision with root package name */
    static final /* synthetic */ kn.l[] f18631i = {p0.h(new g0(p0.b(e.class), "fqName", "getFqName()Lorg/jetbrains/kotlin/name/FqName;")), p0.h(new g0(p0.b(e.class), "type", "getType()Lorg/jetbrains/kotlin/types/SimpleType;")), p0.h(new g0(p0.b(e.class), "allValueArguments", "getAllValueArguments()Ljava/util/Map;"))};

    /* renamed from: a, reason: collision with root package name */
    private final eo.g f18632a;

    /* renamed from: b, reason: collision with root package name */
    private final io.a f18633b;

    /* renamed from: c, reason: collision with root package name */
    private final gp.j f18634c;

    /* renamed from: d, reason: collision with root package name */
    private final gp.i f18635d;

    /* renamed from: e, reason: collision with root package name */
    private final ho.a f18636e;

    /* renamed from: f, reason: collision with root package name */
    private final gp.i f18637f;

    /* renamed from: g, reason: collision with root package name */
    private final boolean f18638g;

    /* renamed from: h, reason: collision with root package name */
    private final boolean f18639h;

    /* loaded from: classes3.dex */
    static final class a extends v implements dn.a {
        a() {
            super(0);
        }

        @Override // dn.a
        public final Map invoke() {
            Map s10;
            Collection<io.b> b10 = e.this.f18633b.b();
            e eVar = e.this;
            ArrayList arrayList = new ArrayList();
            for (io.b bVar : b10) {
                ro.f name = bVar.getName();
                if (name == null) {
                    name = b0.f7057c;
                }
                vo.g l10 = eVar.l(bVar);
                rm.v a10 = l10 != null ? c0.a(name, l10) : null;
                if (a10 != null) {
                    arrayList.add(a10);
                }
            }
            s10 = q0.s(arrayList);
            return s10;
        }
    }

    /* loaded from: classes3.dex */
    static final class b extends v implements dn.a {
        b() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final ro.c invoke() {
            ro.b e10 = e.this.f18633b.e();
            if (e10 != null) {
                return e10.b();
            }
            return null;
        }
    }

    /* loaded from: classes3.dex */
    static final class c extends v implements dn.a {
        c() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final m0 invoke() {
            ro.c d10 = e.this.d();
            if (d10 == null) {
                return kotlin.reflect.jvm.internal.impl.types.error.k.d(kotlin.reflect.jvm.internal.impl.types.error.j.NOT_FOUND_FQNAME_FOR_JAVA_ANNOTATION, e.this.f18633b.toString());
            }
            tn.e f10 = sn.d.f(sn.d.f35901a, d10, e.this.f18632a.d().m(), null, 4, null);
            if (f10 == null) {
                io.g x10 = e.this.f18633b.x();
                f10 = x10 != null ? e.this.f18632a.a().n().a(x10) : null;
                if (f10 == null) {
                    f10 = e.this.h(d10);
                }
            }
            return f10.q();
        }
    }

    public e(eo.g c10, io.a javaAnnotation, boolean z10) {
        t.g(c10, "c");
        t.g(javaAnnotation, "javaAnnotation");
        this.f18632a = c10;
        this.f18633b = javaAnnotation;
        this.f18634c = c10.e().d(new b());
        this.f18635d = c10.e().b(new c());
        this.f18636e = c10.a().t().a(javaAnnotation);
        this.f18637f = c10.e().b(new a());
        this.f18638g = javaAnnotation.f();
        this.f18639h = javaAnnotation.t() || z10;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final tn.e h(ro.c cVar) {
        tn.g0 d10 = this.f18632a.d();
        ro.b m10 = ro.b.m(cVar);
        t.f(m10, "topLevel(...)");
        return x.c(d10, m10, this.f18632a.a().b().d().r());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final vo.g l(io.b bVar) {
        if (bVar instanceof o) {
            return vo.h.d(vo.h.f40379a, ((o) bVar).getValue(), null, 2, null);
        }
        if (bVar instanceof io.m) {
            io.m mVar = (io.m) bVar;
            return o(mVar.b(), mVar.d());
        }
        if (!(bVar instanceof io.e)) {
            if (bVar instanceof io.c) {
                return m(((io.c) bVar).a());
            }
            if (bVar instanceof io.h) {
                return p(((io.h) bVar).c());
            }
            return null;
        }
        io.e eVar = (io.e) bVar;
        ro.f name = eVar.getName();
        if (name == null) {
            name = b0.f7057c;
        }
        t.d(name);
        return n(name, eVar.e());
    }

    private final vo.g m(io.a aVar) {
        return new vo.a(new e(this.f18632a, aVar, false, 4, null));
    }

    private final vo.g n(ro.f fVar, List list) {
        e0 l10;
        int v10;
        m0 type = getType();
        t.f(type, "<get-type>(...)");
        if (hp.g0.a(type)) {
            return null;
        }
        tn.e i10 = xo.c.i(this);
        t.d(i10);
        i1 b10 = co.a.b(fVar, i10);
        if (b10 == null || (l10 = b10.getType()) == null) {
            l10 = this.f18632a.a().m().m().l(t1.INVARIANT, kotlin.reflect.jvm.internal.impl.types.error.k.d(kotlin.reflect.jvm.internal.impl.types.error.j.UNKNOWN_ARRAY_ELEMENT_TYPE_OF_ANNOTATION_ARGUMENT, new String[0]));
        }
        t.d(l10);
        List list2 = list;
        v10 = sm.v.v(list2, 10);
        ArrayList arrayList = new ArrayList(v10);
        Iterator it = list2.iterator();
        while (it.hasNext()) {
            vo.g l11 = l((io.b) it.next());
            if (l11 == null) {
                l11 = new r();
            }
            arrayList.add(l11);
        }
        return vo.h.f40379a.a(arrayList, l10);
    }

    private final vo.g o(ro.b bVar, ro.f fVar) {
        if (bVar == null || fVar == null) {
            return null;
        }
        return new vo.j(bVar, fVar);
    }

    private final vo.g p(io.x xVar) {
        return p.f40394b.a(this.f18632a.g().o(xVar, go.b.b(o1.COMMON, false, false, null, 7, null)));
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.c
    public Map a() {
        return (Map) gp.m.a(this.f18637f, this, f18631i[2]);
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.c
    public ro.c d() {
        return (ro.c) gp.m.b(this.f18634c, this, f18631i[0]);
    }

    @Override // p002do.g
    public boolean f() {
        return this.f18638g;
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.c
    /* renamed from: i, reason: merged with bridge method [inline-methods] */
    public ho.a getSource() {
        return this.f18636e;
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.c
    /* renamed from: j, reason: merged with bridge method [inline-methods] */
    public m0 getType() {
        return (m0) gp.m.a(this.f18635d, this, f18631i[1]);
    }

    public final boolean k() {
        return this.f18639h;
    }

    public String toString() {
        return kotlin.reflect.jvm.internal.impl.renderer.c.s(kotlin.reflect.jvm.internal.impl.renderer.c.f26358g, this, null, 2, null);
    }

    public /* synthetic */ e(eo.g gVar, io.a aVar, boolean z10, int i10, kotlin.jvm.internal.k kVar) {
        this(gVar, aVar, (i10 & 4) != 0 ? false : z10);
    }
}
