package tp;

import com.fasterxml.jackson.core.JsonFactory;

/* loaded from: classes3.dex */
public abstract class a extends c2 implements vm.d, m0 {

    /* renamed from: r, reason: collision with root package name */
    private final vm.g f36482r;

    public a(vm.g gVar, boolean z10, boolean z11) {
        super(z11);
        if (z10) {
            q0((u1) gVar.d(u1.f36592j));
        }
        this.f36482r = gVar.h(this);
    }

    @Override // tp.c2
    protected final void D0(Object obj) {
        if (!(obj instanceof c0)) {
            V0(obj);
        } else {
            c0 c0Var = (c0) obj;
            U0(c0Var.f36494a, c0Var.a());
        }
    }

    protected void T0(Object obj) {
        F(obj);
    }

    protected void U0(Throwable th2, boolean z10) {
    }

    protected void V0(Object obj) {
    }

    public final void W0(o0 o0Var, Object obj, dn.p pVar) {
        o0Var.invoke(pVar, obj, this);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // tp.c2
    public String Z() {
        return q0.a(this) + " was cancelled";
    }

    @Override // tp.c2, tp.u1
    public boolean b() {
        return super.b();
    }

    @Override // vm.d
    public final vm.g getContext() {
        return this.f36482r;
    }

    @Override // tp.m0
    public vm.g getCoroutineContext() {
        return this.f36482r;
    }

    @Override // tp.c2
    public final void p0(Throwable th2) {
        k0.a(this.f36482r, th2);
    }

    @Override // vm.d
    public final void resumeWith(Object obj) {
        Object w02 = w0(g0.d(obj, null, 1, null));
        if (w02 == d2.f36519b) {
            return;
        }
        T0(w02);
    }

    @Override // tp.c2
    public String y0() {
        String b10 = h0.b(this.f36482r);
        if (b10 == null) {
            return super.y0();
        }
        return JsonFactory.DEFAULT_QUOTE_CHAR + b10 + "\":" + super.y0();
    }
}
