package com.revenuecat.purchases.ui.revenuecatui.customercenter.viewmodel;

import A4.d;
import B4.a;
import C4.e;
import C4.j;
import V4.C;
import android.content.Context;
import com.revenuecat.purchases.customercenter.CustomerCenterConfigData;
import com.revenuecat.purchases.models.StoreProduct;
import com.revenuecat.purchases.ui.revenuecatui.customercenter.data.PurchaseInformation;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes3.dex */
@e(c = "com.revenuecat.purchases.ui.revenuecatui.customercenter.viewmodel.CustomerCenterViewModelImpl$pathButtonPressed$1$1$1$1", f = "CustomerCenterViewModel.kt", l = {246}, m = "invokeSuspend")
public final class CustomerCenterViewModelImpl$pathButtonPressed$1$1$1$1 extends j implements J4.e {
    final /* synthetic */ Context $context;
    final /* synthetic */ CustomerCenterConfigData.HelpPath.PathDetail.FeedbackSurvey.Option $it;
    final /* synthetic */ CustomerCenterConfigData.HelpPath $path;
    final /* synthetic */ PurchaseInformation $purchaseInformation;
    int label;
    final /* synthetic */ CustomerCenterViewModelImpl this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public CustomerCenterViewModelImpl$pathButtonPressed$1$1$1$1(CustomerCenterViewModelImpl customerCenterViewModelImpl, Context context, PurchaseInformation purchaseInformation, CustomerCenterConfigData.HelpPath.PathDetail.FeedbackSurvey.Option option, CustomerCenterConfigData.HelpPath helpPath, d dVar) {
        super(2, dVar);
        this.this$0 = customerCenterViewModelImpl;
        this.$context = context;
        this.$purchaseInformation = purchaseInformation;
        this.$it = option;
        this.$path = helpPath;
    }

    @Override // C4.a
    public final d create(Object obj, d dVar) {
        return new CustomerCenterViewModelImpl$pathButtonPressed$1$1$1$1(this.this$0, this.$context, this.$purchaseInformation, this.$it, this.$path, dVar);
    }

    @Override // J4.e
    public final Object invoke(C c6, d dVar) {
        return ((CustomerCenterViewModelImpl$pathButtonPressed$1$1$1$1) create(c6, dVar)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        CustomerCenterViewModelImpl$pathButtonPressed$1$1$1$1 customerCenterViewModelImpl$pathButtonPressed$1$1$1$1;
        a aVar = a.f492a;
        int i6 = this.label;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            CustomerCenterViewModelImpl customerCenterViewModelImpl = this.this$0;
            Context context = this.$context;
            PurchaseInformation purchaseInformation = this.$purchaseInformation;
            StoreProduct product = purchaseInformation != null ? purchaseInformation.getProduct() : null;
            CustomerCenterConfigData.HelpPath.PathDetail.PromotionalOffer promotionalOffer = this.$it.getPromotionalOffer();
            CustomerCenterConfigData.HelpPath helpPath = this.$path;
            PurchaseInformation purchaseInformation2 = this.$purchaseInformation;
            this.label = 1;
            customerCenterViewModelImpl$pathButtonPressed$1$1$1$1 = this;
            obj = customerCenterViewModelImpl.handlePromotionalOffer(context, product, promotionalOffer, helpPath, purchaseInformation2, customerCenterViewModelImpl$pathButtonPressed$1$1$1$1);
            if (obj == aVar) {
                return aVar;
            }
        } else {
            if (i6 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            customerCenterViewModelImpl$pathButtonPressed$1$1$1$1 = this;
        }
        if (!((Boolean) obj).booleanValue()) {
            customerCenterViewModelImpl$pathButtonPressed$1$1$1$1.this$0.goBackToMain();
            customerCenterViewModelImpl$pathButtonPressed$1$1$1$1.this$0.mainPathAction(customerCenterViewModelImpl$pathButtonPressed$1$1$1$1.$path, customerCenterViewModelImpl$pathButtonPressed$1$1$1$1.$context, customerCenterViewModelImpl$pathButtonPressed$1$1$1$1.$purchaseInformation);
        }
        return C3137A.f25453a;
    }
}
