package g;

import h.AbstractC2068b;
import java.util.ArrayList;
import java.util.LinkedHashMap;

/* JADX INFO: renamed from: g.h, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2054h extends AbstractC2050d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f16442a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ AbstractC2055i f16443b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ String f16444c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ AbstractC2068b f16445d;

    public /* synthetic */ C2054h(AbstractC2055i abstractC2055i, String str, AbstractC2068b abstractC2068b, int i6) {
        this.f16442a = i6;
        this.f16443b = abstractC2055i;
        this.f16444c = str;
        this.f16445d = abstractC2068b;
    }

    @Override // g.AbstractC2050d
    public final void a(Object obj) {
        switch (this.f16442a) {
            case 0:
                AbstractC2055i abstractC2055i = this.f16443b;
                LinkedHashMap linkedHashMap = abstractC2055i.f16447b;
                String str = this.f16444c;
                Object obj2 = linkedHashMap.get(str);
                AbstractC2068b abstractC2068b = this.f16445d;
                if (obj2 == null) {
                    throw new IllegalStateException(("Attempting to launch an unregistered ActivityResultLauncher with contract " + abstractC2068b + " and input " + obj + ". You must ensure the ActivityResultLauncher is registered before calling launch().").toString());
                }
                int iIntValue = ((Number) obj2).intValue();
                ArrayList arrayList = abstractC2055i.f16449d;
                arrayList.add(str);
                try {
                    abstractC2055i.b(iIntValue, abstractC2068b, obj);
                    return;
                } catch (Exception e6) {
                    arrayList.remove(str);
                    throw e6;
                }
            default:
                AbstractC2055i abstractC2055i2 = this.f16443b;
                LinkedHashMap linkedHashMap2 = abstractC2055i2.f16447b;
                String str2 = this.f16444c;
                Object obj3 = linkedHashMap2.get(str2);
                AbstractC2068b abstractC2068b2 = this.f16445d;
                if (obj3 == null) {
                    throw new IllegalStateException(("Attempting to launch an unregistered ActivityResultLauncher with contract " + abstractC2068b2 + " and input " + obj + ". You must ensure the ActivityResultLauncher is registered before calling launch().").toString());
                }
                int iIntValue2 = ((Number) obj3).intValue();
                ArrayList arrayList2 = abstractC2055i2.f16449d;
                arrayList2.add(str2);
                try {
                    abstractC2055i2.b(iIntValue2, abstractC2068b2, obj);
                    return;
                } catch (Exception e7) {
                    arrayList2.remove(str2);
                    throw e7;
                }
        }
    }

    public void b() {
        this.f16443b.f(this.f16444c);
    }
}
