package o;

import java.util.HashMap;
import java.util.List;
import java.util.concurrent.Callable;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Gw0 extends Yn0 {
    public final C0559Vo n;

    /* renamed from: o, reason: collision with root package name */
    public final HashMap f139o;

    public Gw0(C0559Vo c0559Vo) {
        super("require");
        this.f139o = new HashMap();
        this.n = c0559Vo;
    }

    @Override // o.Yn0
    public final InterfaceC1991no0 g(C2062oc0 c2062oc0, List list) {
        InterfaceC1991no0 interfaceC1991no0;
        AbstractC2378rs0.o0("require", 1, list);
        String strZzc = ((C3031ym0) c2062oc0.b).h(c2062oc0, (InterfaceC1991no0) list.get(0)).zzc();
        HashMap map = this.f139o;
        if (map.containsKey(strZzc)) {
            return (InterfaceC1991no0) map.get(strZzc);
        }
        HashMap map2 = this.n.a;
        if (map2.containsKey(strZzc)) {
            try {
                interfaceC1991no0 = (InterfaceC1991no0) ((Callable) map2.get(strZzc)).call();
            } catch (Exception unused) {
                throw new IllegalStateException("Failed to create API implementation: ".concat(String.valueOf(strZzc)));
            }
        } else {
            interfaceC1991no0 = InterfaceC1991no0.d;
        }
        if (interfaceC1991no0 instanceof Yn0) {
            map.put(strZzc, (Yn0) interfaceC1991no0);
        }
        return interfaceC1991no0;
    }
}
