package com.bykv.vk.openvk.preload.a;

import com.bykv.vk.openvk.preload.a.i;
import com.bykv.vk.openvk.preload.a.l;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public abstract class j<IN, OUT> extends l<IN, OUT> {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private String f5965d;

    /* JADX WARN: Multi-variable type inference failed */
    @Override // com.bykv.vk.openvk.preload.a.d
    public final Object a(b<OUT> bVar, IN in) throws Throwable {
        new m(bVar);
        this.f5965d = a(in);
        l.a aVar = a().get(this.f5965d);
        while (aVar != null) {
            List<h> list = aVar.f5968a;
            try {
                Object objA = c.a(list, bVar.f5961a, this).a(in);
                return !l.a(list) ? objA : bVar.a(objA);
            } catch (i.a e10) {
                Throwable cause = e10.getCause();
                new m(bVar);
                this.f5965d = a(in, cause, this.f5965d);
                aVar = a().get(this.f5965d);
            } catch (Throwable th) {
                new m(bVar);
                this.f5965d = a(in, th, this.f5965d);
                aVar = a().get(this.f5965d);
            }
        }
        throw new IllegalArgumentException("can not found branch，branch name is：" + this.f5965d);
    }

    public abstract String a(IN in);

    public abstract String a(IN in, Throwable th, String str);
}
