package Z;

import B4.InterfaceC0027x;
import L1.A;
import W.C0191e;
import W.InterfaceC0189c;
import W.O;
import W.T;
import W.U;
import android.content.Context;
import e4.AbstractC0566j;
import java.util.List;
import q4.l;
import r4.AbstractC0983h;
import u4.InterfaceC1071a;

/* JADX INFO: loaded from: classes.dex */
public final class a implements InterfaceC1071a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f3453a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final S.g f3454b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final l f3455c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final InterfaceC0027x f3456d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Object f3457e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public volatile a0.c f3458f;

    public a(String str, S.g gVar, l lVar, InterfaceC0027x interfaceC0027x) {
        AbstractC0983h.e("name", str);
        this.f3453a = str;
        this.f3454b = gVar;
        this.f3455c = lVar;
        this.f3456d = interfaceC0027x;
        this.f3457e = new Object();
    }

    @Override // u4.InterfaceC1071a
    public final Object a(Object obj, y4.d dVar) {
        a0.c cVar;
        Context context = (Context) obj;
        AbstractC0983h.e("thisRef", context);
        AbstractC0983h.e("property", dVar);
        a0.c cVar2 = this.f3458f;
        if (cVar2 != null) {
            return cVar2;
        }
        synchronized (this.f3457e) {
            try {
                if (this.f3458f == null) {
                    Context applicationContext = context.getApplicationContext();
                    InterfaceC0189c a5 = this.f3454b;
                    l lVar = this.f3455c;
                    AbstractC0983h.b(applicationContext);
                    List list = (List) lVar.invoke(applicationContext);
                    InterfaceC0027x interfaceC0027x = this.f3456d;
                    A4.f fVar = new A4.f(2, applicationContext, this);
                    AbstractC0983h.e("migrations", list);
                    U u5 = new U(new T(1, fVar));
                    if (a5 == null) {
                        a5 = new A(19);
                    }
                    this.f3458f = new a0.c(new a0.c(new O(u5, AbstractC0566j.r(new C0191e(list, null)), a5, interfaceC0027x)));
                }
                cVar = this.f3458f;
                AbstractC0983h.b(cVar);
            } catch (Throwable th) {
                throw th;
            }
        }
        return cVar;
    }
}
