4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1

以下内容为反编译后的 ShopGoodsExchangeHelper.java 源代码,内容仅作参考


package com.m4399.gamecenter.plugin.main.manager.shop;

import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.TextUtils;
import com.android.tools.r8.annotations.SynthesizedClassMap;
import com.dialog.DialogResult;
import com.dialog.c;
import com.dialog.theme.DialogOneButtonTheme;
import com.dialog.theme.DialogTwoButtonTheme;
import com.framework.config.Config;
import com.framework.database.tables.HttpFailureTable;
import com.framework.net.ILoadPageEventListener;
import com.framework.rxbus.RxBus;
import com.m4399.gamecenter.plugin.main.R;
import com.m4399.gamecenter.plugin.main.config.BaseConfigKey;
import com.m4399.gamecenter.plugin.main.config.GameCenterConfigKey;
import com.m4399.gamecenter.plugin.main.controllers.search.SearchConstants;
import com.m4399.gamecenter.plugin.main.controllers.shop.IShopModel;
import com.m4399.gamecenter.plugin.main.controllers.shop.address.AddressInputHelper;
import com.m4399.gamecenter.plugin.main.database.tables.u;
import com.m4399.gamecenter.plugin.main.fastplay.helper.FastPlayHelper;
import com.m4399.gamecenter.plugin.main.helpers.WelfareShopHelper;
import com.m4399.gamecenter.plugin.main.helpers.t;
import com.m4399.gamecenter.plugin.main.listeners.OnDialogButtonClickListener;
import com.m4399.gamecenter.plugin.main.livedata.LiveDataBus;
import com.m4399.gamecenter.plugin.main.manager.cloudgame.CloudGameHelper;
import com.m4399.gamecenter.plugin.main.manager.router.GameCenterRouterManager;
import com.m4399.gamecenter.plugin.main.manager.shop.e;
import com.m4399.gamecenter.plugin.main.manager.stat.TraceHelper;
import com.m4399.gamecenter.plugin.main.manager.task.TaskManager;
import com.m4399.gamecenter.plugin.main.manager.user.UserCenterManager;
import com.m4399.gamecenter.plugin.main.models.game.GameModel;
import com.m4399.gamecenter.plugin.main.models.gift.GiftDetailModel;
import com.m4399.gamecenter.plugin.main.models.shop.ShopExchangeContactInfoModel;
import com.m4399.gamecenter.plugin.main.models.shop.ShopGoodsDetailModel;
import com.m4399.gamecenter.plugin.main.models.shop.ShopHeadgearModel;
import com.m4399.gamecenter.plugin.main.models.task.TaskActions;
import com.m4399.gamecenter.plugin.main.models.welfareshop.WelfareShopKind;
import com.m4399.gamecenter.plugin.main.providers.gift.GiftPreCheckDataProvider;
import com.m4399.gamecenter.plugin.main.providers.shop.GameSkinPreCheckDp;
import com.m4399.gamecenter.plugin.main.providers.shop.v;
import com.m4399.gamecenter.plugin.main.umeng.StateEventGoodsDetail;
import com.m4399.gamecenter.plugin.main.utils.ap;
import com.m4399.gamecenter.plugin.main.views.gift.GiftDetailDesignateUserDialog;
import com.m4399.gamecenter.plugin.main.views.goods.HebiNotEnoughDialog;
import com.m4399.support.utils.HttpResultTipUtils;
import com.m4399.support.utils.ToastUtils;
import com.m4399.support.widget.dialog.CommonLoadingDialog;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONObject;

@SynthesizedClassMap({$$Lambda$b$2mHEtp3gAVRHgTZLIfPVy8iqoWk.class, $$Lambda$b$JeGD1od87S6np5YYOxMKToiL9uY.class, $$Lambda$b$W66P2Iu3dXX1zn2AToiyhhdD1U.class, $$Lambda$b$XC7LUn5D5GLOvzxQk4LT5V3o0Lo.class, $$Lambda$b$XRXtxx7jxEzgb6NbVn715hcffOY.class, $$Lambda$b$sCVUBhlTS9zPm4DsYJ31B4hdyhU.class, $$Lambda$b$w85jGMMh0dXxltANNzIJHDyMKrc.class, $$Lambda$b$zbNE7070ZEzB0GBdEXhbsJv9L6g.class})
@Metadata(d1 = {"\u0000p\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\"\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002JT\u0010\u0016\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010\u001a\u001a\u00020\u00042\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001c2\u0006\u0010\u001e\u001a\u00020\u001c2\u0006\u0010\u001f\u001a\u00020\u001c2\u0006\u0010 \u001a\u00020\u001c2\u0012\u0010!\u001a\u000e\u0012\u0004\u0012\u00020#\u0012\u0004\u0012\u00020\u00170\"J*\u0010$\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\u00170%H\u0002J8\u0010&\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\b\b\u0002\u0010'\u001a\u00020#2\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J.\u0010(\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J \u0010)\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\u00170%H\u0002J \u0010*\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\u00170%H\u0002J \u0010+\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\u00170%H\u0002J.\u0010,\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J.\u0010-\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J(\u0010.\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010\u0014\u001a\u00020\u00152\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\u00170%H\u0002J\u001a\u0010/\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00020\u00192\b\b\u0002\u00100\u001a\u00020\u0004H\u0002JC\u00101\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152%\b\u0002\u0010!\u001a\u001f\u0012\u0013\u0012\u00110\u0004¢\u0006\f\b2\u0012\b\b3\u0012\u0004\b\b(4\u0012\u0004\u0012\u00020\u0017\u0018\u00010\"H\u0002JF\u00105\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u00106\u001a\u00020\u00042\u0006\u00107\u001a\u00020#2\u0006\u00108\u001a\u00020#2\u0012\u0010!\u001a\u000e\u0012\u0004\u0012\u00020#\u0012\u0004\u0012\u00020\u00170\"J8\u00109\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\b\b\u0002\u0010'\u001a\u00020#2\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J$\u0010:\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010\u0014\u001a\u00020\u00152\b\b\u0002\u0010\r\u001a\u00020\u0004H\u0002J6\u0010;\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u0010\r\u001a\u00020\u00042\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J6\u0010<\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u0010\r\u001a\u00020\u00042\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J6\u0010=\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u0010\r\u001a\u00020\u00042\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J6\u0010>\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u0010\r\u001a\u00020\u00042\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J\u001a\u0010?\u001a\u00020#2\u0006\u0010@\u001a\u00020\u00042\b\b\u0002\u0010A\u001a\u00020#H\u0002J6\u0010B\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\b\b\u0002\u0010\r\u001a\u00020\u00042\u0010\b\u0002\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%J$\u0010C\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u0010\r\u001a\u00020\u0004H\u0002J\"\u0010D\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u000e\u0010!\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010%H\u0002J0\u0010E\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010\u0014\u001a\u00020\u00152\n\b\u0002\u0010F\u001a\u0004\u0018\u00010\u001c2\b\b\u0002\u0010G\u001a\u00020#H\u0002J\u0012\u0010H\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u0019H\u0002J\u0018\u0010I\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010\u0014\u001a\u00020\u0015J*\u0010J\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010K\u001a\u00020\u00042\u0006\u0010L\u001a\u00020\u00042\u0006\u0010M\u001a\u00020\u001cH\u0002J*\u0010N\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010K\u001a\u00020\u00042\u0006\u0010L\u001a\u00020\u00042\u0006\u0010M\u001a\u00020\u001cH\u0002J*\u0010O\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010K\u001a\u00020\u00042\u0006\u0010L\u001a\u00020\u00042\u0006\u0010M\u001a\u00020\u001cH\u0002J\u0012\u0010P\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u0019H\u0002J\u0018\u0010Q\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010\u0014\u001a\u00020\u0015J\u001a\u0010R\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u00192\u0006\u0010S\u001a\u00020\u0015H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000e\u001a\u0004\u0018\u00010\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0012\u001a\u0004\u0018\u00010\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0014\u001a\u0004\u0018\u00010\u0015X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006T"}, d2 = {"Lcom/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper;", "", "()V", "TYPE_CHECK_CONTINUE", "", "TYPE_CHECK_DONE", "TYPE_CHECK_FAIL", "bindExchangeInfoProvider", "Lcom/m4399/gamecenter/plugin/main/providers/shop/ShopExchangeInfoSettingDataProvider;", "bindExchangeInfoV2Provider", "Lcom/m4399/gamecenter/plugin/main/providers/shop/ShopExchangeInfoSettingV2DataProvider;", "buyHeadgearProvider", "Lcom/m4399/gamecenter/plugin/main/providers/shop/ShopHeadgearBuyDataProvider;", "clickCoinType", "coinsDataProvider", "Lcom/m4399/gamecenter/plugin/main/providers/mycenter/CoinsDataProvider;", "gameSkinPreCheckDp", "Lcom/m4399/gamecenter/plugin/main/providers/shop/GameSkinPreCheckDp;", "libaoPreCheckProvider", "Lcom/m4399/gamecenter/plugin/main/providers/gift/GiftPreCheckDataProvider;", "model", "Lcom/m4399/gamecenter/plugin/main/controllers/shop/IShopModel;", "bindExchangeInfo", "", com.umeng.analytics.pro.d.R, "Landroid/content/Context;", "channel", "thirdPartyAccount", "", "consigneeName", "phoneNumber", u.COLUMN_CITY, "address", "callback", "Lkotlin/Function1;", "", "checkGameInstallCallback", "Lkotlin/Function0;", "checkGiftRelatedLimit", "needCheckDownloadOrExperience", "checkInviteNewUser", "checkLoginCallback", "checkMoneyCallback", "checkNewUserBenefitsCallback", "checkRealNameAndAdult", "checkUidLimitForGameSkin", "checkVipWelfareCallback", "commitExchangeFailEvent", "defaultGoodsType", "downloadOrExperienceCheck", "Lkotlin/ParameterName;", "name", "checkType", "exchangeHeadgear", "hebiType", "isUseNow", "isShareToFeed", "exchangePreCheck", "execCloudGameDurationExchangeCheck", "execShopGameSkinAndTimeCardCheck", "execShopGiftExchangeCheck", "execShopGoodsExchangeCheck", "execShopQualifyExchangeCheck", "isHebiEnough", "price", "isHebi", "onExchangeClick", "openShopConfirmPage", "refreshHebiCallback", "showAppDownloadDialog", "dialogTitle", "isCloudGameOrFastPlay", "showCloudGameVipLimitDialog", "showHebiNotEnoughDialog", "showNotAdultDialog", "goodsType", "goodsId", "goodsName", "showNotInviteDialog", "showNotVerifiedDialog", "showSubscribeOnlyDialog", "showSuperHebiNotEnoughDialog", "showUidLimitDialog", SearchConstants.SEARCH_TYPE_SHOP, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class ShopGoodsExchangeHelper {
    public static final ShopGoodsExchangeHelper INSTANCE = new ShopGoodsExchangeHelper();
    public static final int TYPE_CHECK_CONTINUE = 2;
    public static final int TYPE_CHECK_DONE = 1;
    public static final int TYPE_CHECK_FAIL = 0;
    private static int bJO;
    private static com.m4399.gamecenter.plugin.main.providers.ad.b baY;
    private static GiftPreCheckDataProvider dcI;
    private static GameSkinPreCheckDp dcJ;
    private static com.m4399.gamecenter.plugin.main.providers.shop.o dcK;
    private static com.m4399.gamecenter.plugin.main.providers.shop.p dcL;
    private static v dcM;
    private static IShopModel model;

    private ShopGoodsExchangeHelper() {
    }

    public static void onExchangeClick$default(ShopGoodsExchangeHelper shopGoodsExchangeHelper, Context context, IShopModel iShopModel, int i2, Function0 function0, int i3, Object obj) {
        if ((i3 & 4) != 0) {
            i2 = 1;
        }
        if ((i3 & 8) != 0) {
            function0 = null;
        }
        shopGoodsExchangeHelper.onExchangeClick(context, iShopModel, i2, function0);
    }

    public final void onExchangeClick(final Context context, final IShopModel model2, final int clickCoinType, final Function0<Unit> callback) {
        if (model2 == null) {
            return;
        }
        model = model2;
        bJO = clickCoinType;
        d(context, new Function0<Unit>() {
            {
                super(0);
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.INSTANCE;
            }

            public final void invoke2() {
                int goodsType = IShopModel.this.getGoodsType();
                if (goodsType != 1) {
                    if (goodsType != 2) {
                        if (goodsType == 3) {
                            ShopGoodsExchangeHelper.INSTANCE.b(context, IShopModel.this, clickCoinType, (Function0<Unit>) callback);
                            return;
                        } else if (goodsType != 4) {
                            if (goodsType != 8) {
                                ShopGoodsExchangeHelper.INSTANCE.d(context, IShopModel.this, clickCoinType, (Function0<Unit>) callback);
                                return;
                            } else {
                                ShopGoodsExchangeHelper.INSTANCE.b(context, IShopModel.this, clickCoinType);
                                return;
                            }
                        }
                    }
                    ShopGoodsExchangeHelper.INSTANCE.c(context, IShopModel.this, clickCoinType, (Function0<Unit>) callback);
                    return;
                }
                ShopGoodsExchangeHelper.INSTANCE.a(context, IShopModel.this, clickCoinType, (Function0<Unit>) callback);
            }
        });
        Object[] objArr = new Object[8];
        objArr[0] = "things_id";
        objArr[1] = Integer.valueOf(model2.getGoodsID());
        objArr[2] = "things_price";
        objArr[3] = WelfareShopHelper.isGoodsFree(model2) ? "0" : "1";
        objArr[4] = "things_type";
        objArr[5] = WelfareShopKind.INSTANCE.getName(model2.getGoodsType());
        objArr[6] = "click_position";
        objArr[7] = "兑换";
        t.onEvent(StateEventGoodsDetail.WELFARE_THINGS_DETAIL_CLICK, objArr);
    }

    public final void a(Context context, IShopModel iShopModel, int i2) {
        Bundle bundle = new Bundle();
        bundle.putInt("click_coin_type", i2);
        bundle.putSerializable("shop_model", iShopModel);
        GameCenterRouterManager.getInstance().openShopExchangeConfirm(context, bundle);
    }

    public final void a(final Context context, final IShopModel iShopModel, int i2, final Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        model = iShopModel;
        bJO = i2;
        e(context, new Function0<Unit>() {
            {
                super(0);
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.INSTANCE;
            }

            public final void invoke2() {
                ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                final Context context2 = context;
                final IShopModel iShopModel2 = iShopModel;
                final Function0<Unit> function02 = function0;
                shopGoodsExchangeHelper.b(context2, iShopModel2, (Function0<Unit>) new Function0<Unit>() {
                    {
                        super(0);
                    }

                    @Override
                    public Unit invoke() {
                        invoke2();
                        return Unit.INSTANCE;
                    }

                    public final void invoke2() {
                        ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = ShopGoodsExchangeHelper.INSTANCE;
                        final Context context3 = context2;
                        final IShopModel iShopModel3 = iShopModel2;
                        final Function0<Unit> function03 = function02;
                        shopGoodsExchangeHelper2.a(context3, iShopModel3, (Function1<? super Integer, Unit>) new Function1<Integer, Unit>() {
                            {
                                super(1);
                            }

                            @Override
                            public Unit invoke(Integer num) {
                                invoke(num.intValue());
                                return Unit.INSTANCE;
                            }

                            public final void invoke(int i3) {
                                if (i3 != 0) {
                                    ShopGoodsExchangeHelper shopGoodsExchangeHelper3 = ShopGoodsExchangeHelper.INSTANCE;
                                    Context context4 = context3;
                                    IShopModel iShopModel4 = iShopModel3;
                                    boolean z = i3 == 2;
                                    final Context context5 = context3;
                                    final Function0<Unit> function04 = function03;
                                    shopGoodsExchangeHelper3.a(context4, iShopModel4, z, (Function0<Unit>) new Function0<Unit>() {
                                        {
                                            super(0);
                                        }

                                        @Override
                                        public Unit invoke() {
                                            invoke2();
                                            return Unit.INSTANCE;
                                        }

                                        public final void invoke2() {
                                            ShopGoodsExchangeHelper shopGoodsExchangeHelper4 = ShopGoodsExchangeHelper.INSTANCE;
                                            Context context6 = context5;
                                            final Function0<Unit> function05 = function04;
                                            shopGoodsExchangeHelper4.g(context6, new Function0<Unit>() {
                                                {
                                                    super(0);
                                                }

                                                @Override
                                                public Unit invoke() {
                                                    invoke2();
                                                    return Unit.INSTANCE;
                                                }

                                                public final void invoke2() {
                                                    Function0<Unit> function06 = function05;
                                                    if (function06 == null) {
                                                        return;
                                                    }
                                                    function06.invoke();
                                                }
                                            });
                                        }
                                    });
                                }
                            }
                        });
                    }
                });
            }
        });
    }

    public final void b(final Context context, final IShopModel iShopModel, final int i2, final Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        model = iShopModel;
        bJO = i2;
        e(context, new Function0<Unit>() {
            {
                super(0);
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.INSTANCE;
            }

            public final void invoke2() {
                ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                final Context context2 = context;
                final IShopModel iShopModel2 = iShopModel;
                final Function0<Unit> function02 = function0;
                final int i3 = i2;
                shopGoodsExchangeHelper.b(context2, iShopModel2, (Function0<Unit>) new Function0<Unit>() {
                    {
                        super(0);
                    }

                    @Override
                    public Unit invoke() {
                        invoke2();
                        return Unit.INSTANCE;
                    }

                    public final void invoke2() {
                        ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = ShopGoodsExchangeHelper.INSTANCE;
                        final Context context3 = context2;
                        final IShopModel iShopModel3 = iShopModel2;
                        final Function0<Unit> function03 = function02;
                        final int i4 = i3;
                        shopGoodsExchangeHelper2.a(context3, iShopModel3, (Function1<? super Integer, Unit>) new Function1<Integer, Unit>() {
                            {
                                super(1);
                            }

                            @Override
                            public Unit invoke(Integer num) {
                                invoke(num.intValue());
                                return Unit.INSTANCE;
                            }

                            public final void invoke(int i5) {
                                if (i5 != 0) {
                                    ShopGoodsExchangeHelper shopGoodsExchangeHelper3 = ShopGoodsExchangeHelper.INSTANCE;
                                    Context context4 = context3;
                                    IShopModel iShopModel4 = iShopModel3;
                                    boolean z = i5 == 2;
                                    final Context context5 = context3;
                                    final Function0<Unit> function04 = function03;
                                    final IShopModel iShopModel5 = iShopModel3;
                                    final int i6 = i4;
                                    shopGoodsExchangeHelper3.b(context4, iShopModel4, z, (Function0<Unit>) new Function0<Unit>() {
                                        {
                                            super(0);
                                        }

                                        @Override
                                        public Unit invoke() {
                                            invoke2();
                                            return Unit.INSTANCE;
                                        }

                                        public final void invoke2() {
                                            ShopGoodsExchangeHelper shopGoodsExchangeHelper4 = ShopGoodsExchangeHelper.INSTANCE;
                                            final Context context6 = context5;
                                            final Function0<Unit> function05 = function04;
                                            final IShopModel iShopModel6 = iShopModel5;
                                            final int i7 = i6;
                                            shopGoodsExchangeHelper4.g(context6, new Function0<Unit>() {
                                                {
                                                    super(0);
                                                }

                                                @Override
                                                public Unit invoke() {
                                                    invoke2();
                                                    return Unit.INSTANCE;
                                                }

                                                public final void invoke2() {
                                                    Function0<Unit> function06 = function05;
                                                    if (function06 == null) {
                                                        ShopGoodsExchangeHelper.INSTANCE.a(context6, iShopModel6, i7);
                                                    } else {
                                                        if (function06 == null) {
                                                            return;
                                                        }
                                                        function06.invoke();
                                                    }
                                                }
                                            });
                                        }
                                    });
                                }
                            }
                        });
                    }
                });
            }
        });
    }

    public final void c(final Context context, final IShopModel iShopModel, final int i2, final Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        model = iShopModel;
        bJO = i2;
        if (iShopModel.getGoodsType() == 2) {
            e(context, new Function0<Unit>() {
                {
                    super(0);
                }

                @Override
                public Unit invoke() {
                    invoke2();
                    return Unit.INSTANCE;
                }

                public final void invoke2() {
                    ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                    final Context context2 = context;
                    final IShopModel iShopModel2 = iShopModel;
                    final Function0<Unit> function02 = function0;
                    final int i3 = i2;
                    shopGoodsExchangeHelper.a(context2, iShopModel2, (Function1<? super Integer, Unit>) new Function1<Integer, Unit>() {
                        {
                            super(1);
                        }

                        @Override
                        public Unit invoke(Integer num) {
                            invoke(num.intValue());
                            return Unit.INSTANCE;
                        }

                        public final void invoke(int i4) {
                            if (i4 != 0) {
                                ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = ShopGoodsExchangeHelper.INSTANCE;
                                Context context3 = context2;
                                IShopModel iShopModel3 = iShopModel2;
                                boolean z = i4 == 2;
                                final Context context4 = context2;
                                final Function0<Unit> function03 = function02;
                                final IShopModel iShopModel4 = iShopModel2;
                                final int i5 = i3;
                                shopGoodsExchangeHelper2.b(context3, iShopModel3, z, (Function0<Unit>) new Function0<Unit>() {
                                    {
                                        super(0);
                                    }

                                    @Override
                                    public Unit invoke() {
                                        invoke2();
                                        return Unit.INSTANCE;
                                    }

                                    public final void invoke2() {
                                        ShopGoodsExchangeHelper shopGoodsExchangeHelper3 = ShopGoodsExchangeHelper.INSTANCE;
                                        final Context context5 = context4;
                                        final Function0<Unit> function04 = function03;
                                        final IShopModel iShopModel5 = iShopModel4;
                                        final int i6 = i5;
                                        shopGoodsExchangeHelper3.g(context5, new Function0<Unit>() {
                                            {
                                                super(0);
                                            }

                                            @Override
                                            public Unit invoke() {
                                                invoke2();
                                                return Unit.INSTANCE;
                                            }

                                            public final void invoke2() {
                                                Function0<Unit> function05 = function04;
                                                if (function05 == null) {
                                                    ShopGoodsExchangeHelper.INSTANCE.a(context5, iShopModel5, i6);
                                                } else {
                                                    if (function05 == null) {
                                                        return;
                                                    }
                                                    function05.invoke();
                                                }
                                            }
                                        });
                                    }
                                });
                            }
                        }
                    });
                }
            });
        } else {
            e(context, new Function0<Unit>() {
                {
                    super(0);
                }

                @Override
                public Unit invoke() {
                    invoke2();
                    return Unit.INSTANCE;
                }

                public final void invoke2() {
                    ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                    final Context context2 = context;
                    final IShopModel iShopModel2 = iShopModel;
                    final Function0<Unit> function02 = function0;
                    final int i3 = i2;
                    shopGoodsExchangeHelper.c(context2, iShopModel2, new Function0<Unit>() {
                        {
                            super(0);
                        }

                        @Override
                        public Unit invoke() {
                            invoke2();
                            return Unit.INSTANCE;
                        }

                        public final void invoke2() {
                            ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = ShopGoodsExchangeHelper.INSTANCE;
                            final Context context3 = context2;
                            final IShopModel iShopModel3 = iShopModel2;
                            final Function0<Unit> function03 = function02;
                            final int i4 = i3;
                            shopGoodsExchangeHelper2.d(context3, iShopModel3, new Function0<Unit>() {
                                {
                                    super(0);
                                }

                                @Override
                                public Unit invoke() {
                                    invoke2();
                                    return Unit.INSTANCE;
                                }

                                public final void invoke2() {
                                    ShopGoodsExchangeHelper shopGoodsExchangeHelper3 = ShopGoodsExchangeHelper.INSTANCE;
                                    final Context context4 = context3;
                                    final IShopModel iShopModel4 = iShopModel3;
                                    final Function0<Unit> function04 = function03;
                                    final int i5 = i4;
                                    shopGoodsExchangeHelper3.e(context4, iShopModel4, new Function0<Unit>() {
                                        {
                                            super(0);
                                        }

                                        @Override
                                        public Unit invoke() {
                                            invoke2();
                                            return Unit.INSTANCE;
                                        }

                                        public final void invoke2() {
                                            ShopGoodsExchangeHelper shopGoodsExchangeHelper4 = ShopGoodsExchangeHelper.INSTANCE;
                                            final Context context5 = context4;
                                            final IShopModel iShopModel5 = iShopModel4;
                                            final Function0<Unit> function05 = function04;
                                            final int i6 = i5;
                                            shopGoodsExchangeHelper4.a(context5, iShopModel5, (Function0<Unit>) new Function0<Unit>() {
                                                {
                                                    super(0);
                                                }

                                                @Override
                                                public Unit invoke() {
                                                    invoke2();
                                                    return Unit.INSTANCE;
                                                }

                                                public final void invoke2() {
                                                    ShopGoodsExchangeHelper shopGoodsExchangeHelper5 = ShopGoodsExchangeHelper.INSTANCE;
                                                    final Context context6 = context5;
                                                    final Function0<Unit> function06 = function05;
                                                    final IShopModel iShopModel6 = iShopModel5;
                                                    final int i7 = i6;
                                                    shopGoodsExchangeHelper5.g(context6, new Function0<Unit>() {
                                                        {
                                                            super(0);
                                                        }

                                                        @Override
                                                        public Unit invoke() {
                                                            invoke2();
                                                            return Unit.INSTANCE;
                                                        }

                                                        public final void invoke2() {
                                                            Function0<Unit> function07 = function06;
                                                            if (function07 == null) {
                                                                ShopGoodsExchangeHelper.INSTANCE.a(context6, iShopModel6, i7);
                                                            } else {
                                                                if (function07 == null) {
                                                                    return;
                                                                }
                                                                function07.invoke();
                                                            }
                                                        }
                                                    });
                                                }
                                            });
                                        }
                                    });
                                }
                            });
                        }
                    });
                }
            });
        }
    }

    public final void d(final Context context, final IShopModel iShopModel, final int i2, Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        model = iShopModel;
        bJO = i2;
        e(context, new Function0<Unit>() {
            {
                super(0);
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.INSTANCE;
            }

            public final void invoke2() {
                ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                final Context context2 = context;
                final IShopModel iShopModel2 = iShopModel;
                final int i3 = i2;
                shopGoodsExchangeHelper.g(context2, new Function0<Unit>() {
                    {
                        super(0);
                    }

                    @Override
                    public Unit invoke() {
                        invoke2();
                        return Unit.INSTANCE;
                    }

                    public final void invoke2() {
                        ShopGoodsExchangeHelper.INSTANCE.a(context2, iShopModel2, i3);
                    }
                });
            }
        });
    }

    public final void b(final Context context, final IShopModel iShopModel, final int i2) {
        g(context, new Function0<Unit>() {
            {
                super(0);
            }

            @Override
            public Unit invoke() {
                invoke2();
                return Unit.INSTANCE;
            }

            public final void invoke2() {
                ShopGoodsExchangeHelper.INSTANCE.a(context, iShopModel, i2);
            }
        });
    }

    static void a(ShopGoodsExchangeHelper shopGoodsExchangeHelper, Context context, int i2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            i2 = 1;
        }
        shopGoodsExchangeHelper.o(context, i2);
    }

    public final void o(Context context, int i2) {
        Object[] objArr = new Object[10];
        objArr[0] = "things_type";
        WelfareShopKind.Companion companion = WelfareShopKind.INSTANCE;
        IShopModel iShopModel = model;
        if (iShopModel != null) {
            i2 = iShopModel.getGoodsType();
        }
        objArr[1] = companion.getName(i2);
        objArr[2] = "things_id";
        IShopModel iShopModel2 = model;
        objArr[3] = Integer.valueOf(iShopModel2 == null ? 0 : iShopModel2.getGoodsID());
        objArr[4] = "things_name";
        IShopModel iShopModel3 = model;
        objArr[5] = iShopModel3 == null ? null : iShopModel3.getShopTitle();
        objArr[6] = "result";
        objArr[7] = false;
        objArr[8] = "trace";
        objArr[9] = TraceHelper.getTrace(context);
        t.onEvent(StateEventGoodsDetail.WElFARE_THINGS_EXCHANGE_SUCCEED, objArr);
    }

    public final void a(final Context context, IShopModel iShopModel, String str, boolean z) {
        if (context == null) {
            return;
        }
        com.m4399.gamecenter.plugin.main.views.gift.j jVar = new com.m4399.gamecenter.plugin.main.views.gift.j(context);
        String str2 = str;
        if (str2 == null || str2.length() == 0) {
            if (z) {
                str = context.getString(R.string.experience_game_hint);
            } else {
                str = context.getString(R.string.download_game_hint);
            }
        }
        jVar.setOnDialogButtonClickListener(new k(context, iShopModel));
        jVar.setCloudGameOrFastPlay(z);
        jVar.setDialogTitle(str);
        jVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ShopGoodsExchangeHelper.b(context, dialogInterface);
            }
        });
        jVar.display(iShopModel.getGameInfo(), "");
        StateEventGoodsDetail.INSTANCE.staticsDownloadGameRestrictExposure(context, iShopModel.getGoodsType(), iShopModel.getGoodsID(), iShopModel.getShopTitle());
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$showAppDownloadDialog$1", "Lcom/m4399/gamecenter/plugin/main/listeners/OnDialogButtonClickListener;", "onLeftBtnClick", "", "onRightButtonClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class k implements OnDialogButtonClickListener {
        final IShopModel dcU;
        final Context wO;

        k(Context context, IShopModel iShopModel) {
            this.wO = context;
            this.dcU = iShopModel;
        }

        @Override
        public void onLeftBtnClick() {
            StateEventGoodsDetail.INSTANCE.staticsDownloadGameRestrictClick(this.wO, this.dcU.getGoodsType(), this.dcU.getGoodsID(), this.dcU.getShopTitle(), "取消");
        }

        @Override
        public void onRightButtonClick() {
            StateEventGoodsDetail.INSTANCE.staticsDownloadGameRestrictClick(this.wO, this.dcU.getGoodsType(), this.dcU.getGoodsID(), this.dcU.getShopTitle(), "立即下载");
        }
    }

    public static final void b(Context context, DialogInterface dialogInterface) {
        a(INSTANCE, context, 0, 2, (Object) null);
    }

    public final void aP(final Context context) {
        if (context == null) {
            return;
        }
        String string = context.getString(R.string.not_satisfy_exchange_limit);
        String string2 = context.getString(R.string.dialog_btn_txt_i_know);
        String string3 = context.getString(R.string.subscribe_only_content);
        com.dialog.c cVar = new com.dialog.c(context);
        cVar.setDialogOneButtomTheme(DialogOneButtonTheme.Default);
        cVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ShopGoodsExchangeHelper.c(context, dialogInterface);
            }
        });
        cVar.showDialog(string, string3, string2);
    }

    public static final void c(Context context, DialogInterface dialogInterface) {
        a(INSTANCE, context, 0, 2, (Object) null);
    }

    public final void aQ(final Context context) {
        if (context == null) {
            return;
        }
        com.dialog.c cVar = new com.dialog.c(context);
        cVar.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
        cVar.setOnDialogTwoHorizontalBtnsClickListener(new l(context));
        cVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ShopGoodsExchangeHelper.d(context, dialogInterface);
            }
        });
        cVar.showDialog(context.getString(R.string.not_satisfy_exchange_limit), context.getString(R.string.cloud_game_vip_exclusive_gift_limit_text), context.getString(R.string.close), context.getString(R.string.buy_cloud_game_vip));
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$showCloudGameVipLimitDialog$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class l implements c.b {
        final Context wO;

        l(Context context) {
            this.wO = context;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            GameCenterRouterManager.getInstance().openCloudGameMember(this.wO, null);
            return DialogResult.OK;
        }
    }

    public static final void d(Context context, DialogInterface dialogInterface) {
        INSTANCE.o(context, 8);
    }

    public final void a(final Context context, IShopModel iShopModel) {
        if (context == null) {
            return;
        }
        int goodsType = iShopModel.getGoodsType();
        String title = iShopModel.getLimitUidTipTitle();
        String desc = iShopModel.getLimitUidTipDesc();
        GiftDetailDesignateUserDialog giftDetailDesignateUserDialog = new GiftDetailDesignateUserDialog(context);
        if (goodsType == 1) {
            desc = context.getString(R.string.undedignate_user_des_template, "游戏礼包");
        } else if (goodsType == 2) {
            desc = context.getString(R.string.undedignate_user_des_template, "点卡");
        } else if (goodsType == 3) {
            desc = context.getString(R.string.undedignate_user_des_template, "内测资格");
        } else if (TextUtils.isEmpty(desc)) {
            desc = context.getString(R.string.undedignate_user_des_goods, "商品");
        }
        if (goodsType == 1) {
            title = context.getString(R.string.undedignate_user_title_template, "游戏礼包");
        } else if (goodsType == 2) {
            title = context.getString(R.string.undedignate_user_title_template, "点卡");
        } else if (goodsType == 3) {
            title = context.getString(R.string.undedignate_user_title_template, "内测资格");
        } else if (TextUtils.isEmpty(title)) {
            title = context.getString(R.string.undedignate_user_title_template, "商品");
        }
        giftDetailDesignateUserDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ShopGoodsExchangeHelper.e(context, dialogInterface);
            }
        });
        Intrinsics.checkNotNullExpressionValue(title, "title");
        Intrinsics.checkNotNullExpressionValue(desc, "desc");
        giftDetailDesignateUserDialog.show(title, desc);
    }

    public static final void e(Context context, DialogInterface dialogInterface) {
        a(INSTANCE, context, 0, 2, (Object) null);
    }

    public final void a(final Context context, final int i2, int i3, String str) {
        if (context == null) {
            return;
        }
        String string = context.getString(R.string.not_satisfy_exchange_limit);
        String string2 = context.getString(R.string.dialog_btn_txt_i_know);
        String string3 = context.getString(R.string.invite_new_user_before_participate_activity);
        com.dialog.c cVar = new com.dialog.c(context);
        cVar.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
        cVar.setOnDialogTwoHorizontalBtnsClickListener(new n(context, i2, i3, str));
        cVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ShopGoodsExchangeHelper.a(context, i2, dialogInterface);
            }
        });
        StateEventGoodsDetail.INSTANCE.staticsInviteNewRestrictExposure(context, i2, i3, str);
        cVar.showDialog(string, string3, string2, context.getString(R.string.to_complete));
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$showNotInviteDialog$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class n implements c.b {
        final int dcX;
        final int ddc;
        final String ddd;
        final Context wO;

        n(Context context, int i, int i2, String str) {
            this.wO = context;
            this.dcX = i;
            this.ddc = i2;
            this.ddd = str;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            StateEventGoodsDetail.INSTANCE.staticsInviteNewRestrictClick(this.wO, this.dcX, this.ddc, this.ddd, "关闭弹窗");
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            StateEventGoodsDetail.INSTANCE.staticsInviteNewRestrictClick(this.wO, this.dcX, this.ddc, this.ddd, "去完成");
            Bundle bundle = new Bundle();
            bundle.putString("intent.extra.webview.url", "https://huodong.4399.cn/game/maintain/game/inviteNew/index");
            GameCenterRouterManager.getInstance().openWebViewActivity(this.wO, bundle, new int[0]);
            return DialogResult.OK;
        }
    }

    public static final void a(Context context, int i2, DialogInterface dialogInterface) {
        INSTANCE.o(context, i2);
    }

    public final void b(final Context context, final int i2, final int i3, final String str) {
        if (context == null) {
            return;
        }
        String string = context.getString(R.string.not_satisfy_exchange_limit);
        String string2 = context.getString(R.string.dialog_btn_txt_i_know);
        String string3 = context.getString(R.string.account_realname_info_not_adult);
        com.dialog.c cVar = new com.dialog.c(context);
        cVar.setDialogOneButtomTheme(DialogOneButtonTheme.Default);
        cVar.setOnDialogOneButtonClickListener(new c.a() {
            @Override
            public final DialogResult onButtonClick() {
                DialogResult d2;
                d2 = ShopGoodsExchangeHelper.d(context, i2, i3, str);
                return d2;
            }
        });
        cVar.showDialog(string, string3, string2);
        t.onEvent(StateEventGoodsDetail.THINGS_DETAIL_ADULT_RESTRICTIONS_EXPOURSE, "things_type", WelfareShopKind.INSTANCE.getName(i2), "things_id", Integer.valueOf(i3), "things_name", str, "trace", TraceHelper.getTrace(context));
    }

    public static final DialogResult d(Context context, int i2, int i3, String goodsName) {
        Intrinsics.checkNotNullParameter(goodsName, "$goodsName");
        INSTANCE.o(context, i2);
        t.onEvent(StateEventGoodsDetail.THINGS_DETAIL_ADULT_RESTRICTIONS_CLICK, "things_type", WelfareShopKind.INSTANCE.getName(i2), "things_id", Integer.valueOf(i3), "things_name", goodsName, "trace", TraceHelper.getTrace(context));
        return DialogResult.OK;
    }

    public final void c(final Context context, final int i2, int i3, String str) {
        if (context == null) {
            return;
        }
        String string = context.getString(R.string.not_satisfy_exchange_limit);
        String string2 = context.getString(R.string.dialog_btn_txt_i_know);
        String string3 = context.getString(R.string.account_realname_info_not_adult);
        com.dialog.c cVar = new com.dialog.c(context);
        cVar.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
        cVar.setOnDialogTwoHorizontalBtnsClickListener(new o(i2, i3, str, context));
        cVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ShopGoodsExchangeHelper.b(context, i2, dialogInterface);
            }
        });
        cVar.showDialog(string, string3, string2, context.getString(R.string.to_complete));
        t.onEvent(StateEventGoodsDetail.THINGS_DETAIL_ADULT_RESTRICTIONS_EXPOURSE, "things_type", WelfareShopKind.INSTANCE.getName(i2), "things_id", Integer.valueOf(i3), "things_name", str, "trace", TraceHelper.getTrace(context));
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$showNotVerifiedDialog$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class o implements c.b {
        final int dcX;
        final int ddc;
        final String ddd;
        final Context wO;

        o(int i, int i2, String str, Context context) {
            this.dcX = i;
            this.ddc = i2;
            this.ddd = str;
            this.wO = context;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            t.onEvent(StateEventGoodsDetail.THINGS_DETAIL_ADULT_RESTRICTIONS_CLICK, "things_type", WelfareShopKind.INSTANCE.getName(this.dcX), "things_id", Integer.valueOf(this.ddc), "things_name", this.ddd, "choice", "关闭", "trace", TraceHelper.getTrace(this.wO));
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            t.onEvent(StateEventGoodsDetail.THINGS_DETAIL_ADULT_RESTRICTIONS_CLICK, "things_type", WelfareShopKind.INSTANCE.getName(this.dcX), "things_id", Integer.valueOf(this.ddc), "things_name", this.ddd, "choice", "去认证", "trace", TraceHelper.getTrace(this.wO));
            Bundle bundle = new Bundle();
            bundle.putString("intent.extra.webview.url", (String) Config.getValue(BaseConfigKey.URLS_REAL_NAME));
            GameCenterRouterManager.getInstance().openWebViewActivity(this.wO, bundle, new int[0]);
            return DialogResult.OK;
        }
    }

    public static final void b(Context context, int i2, DialogInterface dialogInterface) {
        INSTANCE.o(context, i2);
    }

    public final void showHebiNotEnoughDialog(Context context, IShopModel model2) {
        Intrinsics.checkNotNullParameter(model2, "model");
        if (context == null) {
            return;
        }
        if (model == null) {
            model = model2;
        }
        HebiNotEnoughDialog hebiNotEnoughDialog = new HebiNotEnoughDialog(context);
        hebiNotEnoughDialog.setCancelable(true);
        hebiNotEnoughDialog.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
        hebiNotEnoughDialog.setOnDialogTwoHorizontalBtnsClickListener(new m(context, model2));
        StateEventGoodsDetail.INSTANCE.staticsMoneyShortageExposure(context, "盒币", model2.getGoodsType(), model2.getGoodsID(), model2.getShopTitle());
        String string = context.getString(R.string.hebi_recharge);
        Intrinsics.checkNotNullExpressionValue(string, "context.getString(R.string.hebi_recharge)");
        hebiNotEnoughDialog.showDialog(string, context.getString(R.string.surplus_hebi, UserCenterManager.getHebiNum()), R.string.cancel, R.string.get_hebi_by_finish_task);
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$showHebiNotEnoughDialog$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class m implements c.b {
        final IShopModel dcU;
        final Context wO;

        m(Context context, IShopModel iShopModel) {
            this.wO = context;
            this.dcU = iShopModel;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            ShopGoodsExchangeHelper.a(ShopGoodsExchangeHelper.INSTANCE, this.wO, 0, 2, (Object) null);
            StateEventGoodsDetail.INSTANCE.staticsMoneyShortageClick(this.wO, "取消", "盒币", this.dcU);
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            ShopGoodsExchangeHelper.a(ShopGoodsExchangeHelper.INSTANCE, this.wO, 0, 2, (Object) null);
            StateEventGoodsDetail.INSTANCE.staticsMoneyShortageClick(this.wO, "做任务赚盒币", "盒币", this.dcU);
            GameCenterRouterManager.getInstance().openEverydayTask(this.wO, new int[0]);
            return DialogResult.OK;
        }
    }

    public final void showSuperHebiNotEnoughDialog(Context context, IShopModel model2) {
        Intrinsics.checkNotNullParameter(model2, "model");
        if (context == null) {
            return;
        }
        if (model == null) {
            model = model2;
        }
        HebiNotEnoughDialog hebiNotEnoughDialog = new HebiNotEnoughDialog(context);
        hebiNotEnoughDialog.setCancelable(true);
        hebiNotEnoughDialog.setHebiType(2);
        hebiNotEnoughDialog.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
        hebiNotEnoughDialog.setOnDialogTwoHorizontalBtnsClickListener(new p(context, model2));
        StateEventGoodsDetail.INSTANCE.staticsMoneyShortageExposure(context, "超级盒币", model2.getGoodsType(), model2.getGoodsID(), model2.getShopTitle());
        String string = context.getString(R.string.super_hebi_not_enough);
        Intrinsics.checkNotNullExpressionValue(string, "context.getString(R.string.super_hebi_not_enough)");
        hebiNotEnoughDialog.showDialog(string, context.getString(R.string.surplus_super_hebi, UserCenterManager.getSuperHebiNum()), R.string.cancel, R.string.get_super_hebi);
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$showSuperHebiNotEnoughDialog$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class p implements c.b {
        final IShopModel dcU;
        final Context wO;

        p(Context context, IShopModel iShopModel) {
            this.wO = context;
            this.dcU = iShopModel;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            ShopGoodsExchangeHelper.a(ShopGoodsExchangeHelper.INSTANCE, this.wO, 0, 2, (Object) null);
            StateEventGoodsDetail.INSTANCE.staticsMoneyShortageClick(this.wO, "取消", "超级盒币", this.dcU);
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            ShopGoodsExchangeHelper.a(ShopGoodsExchangeHelper.INSTANCE, this.wO, 0, 2, (Object) null);
            StateEventGoodsDetail.INSTANCE.staticsMoneyShortageClick(this.wO, "赚超级盒币", "超级盒币", this.dcU);
            Integer activityId = (Integer) Config.getValue(GameCenterConfigKey.SUPER_HEBI_ACTIVITY_ID);
            String str = (String) Config.getValue(GameCenterConfigKey.SUPER_HEBI_ACTIVITY_URL);
            Bundle bundle = new Bundle();
            Intrinsics.checkNotNullExpressionValue(activityId, "activityId");
            bundle.putInt("intent.extra.activity.id", activityId.intValue());
            bundle.putString("intent.extra.activity.url", str);
            GameCenterRouterManager.getInstance().openActivityDetail(this.wO, bundle);
            return DialogResult.OK;
        }
    }

    public final void a(Context context, IShopModel iShopModel, Function1<? super Integer, Unit> function1) {
        if (context == null || iShopModel == null) {
            return;
        }
        if (iShopModel.getGameInfo() != null) {
            GameModel gameInfo = iShopModel.getGameInfo();
            if (!(gameInfo != null && gameInfo.isEmpty())) {
                boolean z = iShopModel instanceof GiftDetailModel;
                if (z) {
                    GiftDetailModel giftDetailModel = (GiftDetailModel) iShopModel;
                    if (giftDetailModel.getKind() == 3) {
                    }
                }
                GameModel gameInfo2 = iShopModel.getGameInfo();
                Intrinsics.checkNotNull(gameInfo2);
                if ((gameInfo2.getPackageName().length() == 0) || com.m4399.gamecenter.plugin.main.utils.e.isInstallApp(context, gameInfo2.getPackageName()) || (z && ((GiftDetailModel) iShopModel).getChannelModel().getPackageList().size() > 0)) {
                    if (function1 == null) {
                        return;
                    }
                    function1.invoke(1);
                    return;
                } else if (CloudGameHelper.isSupportCloudGame(gameInfo2) || FastPlayHelper.isGameSupportFastPlay(gameInfo2)) {
                    if (function1 == null) {
                        return;
                    }
                    function1.invoke(2);
                    return;
                } else {
                    a(context, iShopModel, "", false);
                    if (function1 == null) {
                        return;
                    }
                    function1.invoke(0);
                    return;
                }
            }
        }
        if (function1 == null) {
            return;
        }
        function1.invoke(1);
    }

    public final void a(Context context, IShopModel iShopModel, boolean z, Function0<Unit> function0) {
        if (context == null || iShopModel == null || !(iShopModel instanceof GiftDetailModel)) {
            return;
        }
        GiftDetailModel giftDetailModel = (GiftDetailModel) iShopModel;
        if (!giftDetailModel.isOpenUidLimit() && !giftDetailModel.getSubscribeOnly() && !giftDetailModel.getIsCloudGameVipLimit() && !z) {
            if (function0 == null) {
                return;
            }
            function0.invoke();
            return;
        }
        if (dcI == null) {
            dcI = new GiftPreCheckDataProvider();
        }
        GiftPreCheckDataProvider giftPreCheckDataProvider = dcI;
        Intrinsics.checkNotNull(giftPreCheckDataProvider);
        giftPreCheckDataProvider.clearAllData();
        giftPreCheckDataProvider.setId(giftDetailModel.getGoodsID());
        giftPreCheckDataProvider.setCostHebi(0);
        giftPreCheckDataProvider.setUidLimit(giftDetailModel.isOpenUidLimit());
        giftPreCheckDataProvider.setSubscribeOnlyLimit(giftDetailModel.getSubscribeOnly());
        giftPreCheckDataProvider.setCloudGameVipLimit(giftDetailModel.getIsCloudGameVipLimit());
        giftPreCheckDataProvider.setNeedCheckGameDownload(z);
        giftPreCheckDataProvider.setGameId(giftDetailModel.getGame().getId());
        giftPreCheckDataProvider.loadData(new i(giftPreCheckDataProvider, z, function0, context, iShopModel));
    }

    @Metadata(d1 = {"\u0000/\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$exchangePreCheck$1$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class i implements ILoadPageEventListener {
        final Function0<Unit> adO;
        final IShopModel dcU;
        final GiftPreCheckDataProvider dcV;
        final boolean dcW;
        final Context wO;

        @Override
        public void onBefore() {
        }

        i(GiftPreCheckDataProvider giftPreCheckDataProvider, boolean z, Function0<Unit> function0, Context context, IShopModel iShopModel) {
            this.dcV = giftPreCheckDataProvider;
            this.dcW = z;
            this.adO = function0;
            this.wO = context;
            this.dcU = iShopModel;
        }

        @Override
        public void onSuccess() {
            JSONObject parseJSONObjectFromString = ap.parseJSONObjectFromString(this.dcV.getInfo());
            if (!ap.getBoolean("check", ap.getJSONObject("subscribe_only", parseJSONObjectFromString), true)) {
                ShopGoodsExchangeHelper.INSTANCE.aP(this.wO);
                return;
            }
            if (!ap.getBoolean("check", ap.getJSONObject("uid_limit", parseJSONObjectFromString), true)) {
                ShopGoodsExchangeHelper.INSTANCE.a(this.wO, this.dcU);
                return;
            }
            if (!ap.getBoolean("check", ap.getJSONObject("yungame_vip_limit", parseJSONObjectFromString), true)) {
                ShopGoodsExchangeHelper.INSTANCE.aQ(this.wO);
                return;
            }
            if (!this.dcW) {
                Function0<Unit> function0 = this.adO;
                if (function0 == null) {
                    return;
                }
                function0.invoke();
                return;
            }
            JSONObject jSONObject = ap.getJSONObject("game_id", parseJSONObjectFromString);
            if (ap.getBoolean("check", jSONObject, true)) {
                Function0<Unit> function02 = this.adO;
                if (function02 == null) {
                    return;
                }
                function02.invoke();
                return;
            }
            ShopGoodsExchangeHelper.INSTANCE.a(this.wO, this.dcU, ap.getString("error_msg", jSONObject), true);
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            Context context = this.wO;
            ToastUtils.showToast(context, HttpResultTipUtils.getFailureTip(context, error, code, content));
        }
    }

    public final void a(Context context, IShopModel iShopModel, Function0<Unit> function0) {
        ShopGoodsDetailModel shopGoodsDetailModel;
        GameModel gameInfo;
        if (context == null || iShopModel == null || !(iShopModel instanceof ShopGoodsDetailModel) || (gameInfo = (shopGoodsDetailModel = (ShopGoodsDetailModel) iShopModel).getGameInfo()) == null) {
            return;
        }
        if ((gameInfo.getPackageName().length() == 0) || com.m4399.gamecenter.plugin.main.utils.e.isInstallApp(context, gameInfo.getPackageName())) {
            function0.invoke();
            return;
        }
        if (CloudGameHelper.isSupportCloudGame(gameInfo) || FastPlayHelper.isGameSupportFastPlay(gameInfo)) {
            if (dcJ == null) {
                dcJ = new GameSkinPreCheckDp();
            }
            GameSkinPreCheckDp gameSkinPreCheckDp = dcJ;
            Intrinsics.checkNotNull(gameSkinPreCheckDp);
            gameSkinPreCheckDp.setGoodsId(shopGoodsDetailModel.getGoodsID());
            gameSkinPreCheckDp.setRelatedGameId(gameInfo.getId());
            gameSkinPreCheckDp.loadData(new c(gameSkinPreCheckDp, function0, context, iShopModel));
            return;
        }
        a(context, iShopModel, "", false);
    }

    @Metadata(d1 = {"\u0000/\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$checkGameInstallCallback$1$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class c implements ILoadPageEventListener {
        final Function0<Unit> adO;
        final GameSkinPreCheckDp dcT;
        final IShopModel dcU;
        final Context wO;

        @Override
        public void onBefore() {
        }

        c(GameSkinPreCheckDp gameSkinPreCheckDp, Function0<Unit> function0, Context context, IShopModel iShopModel) {
            this.dcT = gameSkinPreCheckDp;
            this.adO = function0;
            this.wO = context;
            this.dcU = iShopModel;
        }

        @Override
        public void onSuccess() {
            JSONObject jSONObject = ap.getJSONObject("game_id", ap.parseJSONObjectFromString(this.dcT.getInfo()));
            if (ap.getBoolean("check", jSONObject, true)) {
                this.adO.invoke();
            } else {
                ShopGoodsExchangeHelper.INSTANCE.a(this.wO, this.dcU, ap.getString("error_msg", jSONObject, ""), true);
            }
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            Context context = this.wO;
            ToastUtils.showToast(context, HttpResultTipUtils.getFailureTip(context, error, code, content));
        }
    }

    @Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u0000\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J-\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00022\u0016\u0010\u0006\u001a\f\u0012\b\b\u0001\u0012\u0004\u0018\u00010\b0\u0007\"\u0004\u0018\u00010\bH\u0016¢\u0006\u0002\u0010\tJ\b\u0010\n\u001a\u00020\u0004H\u0016¨\u0006\u000b"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$checkLoginCallback$1", "Lcom/m4399/gamecenter/plugin/main/listeners/OnCheckResultListener;", "", "onCheckFinish", "", "login", HttpFailureTable.COLUMN_PARAMS, "", "", "(Z[Ljava/lang/Object;)V", "onChecking", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class e implements com.m4399.gamecenter.plugin.main.listeners.f<Boolean> {
        final Function0<Unit> adO;

        @Override
        public void onChecking() {
        }

        e(Function0<Unit> function0) {
            this.adO = function0;
        }

        @Override
        public void onCheckFinish(Boolean bool, Object[] objArr) {
            onCheckFinish(bool.booleanValue(), objArr);
        }

        public void onCheckFinish(boolean login, Object... params) {
            Intrinsics.checkNotNullParameter(params, "params");
            if (login) {
                this.adO.invoke();
            }
        }
    }

    private final void d(Context context, Function0<Unit> function0) {
        if (context == null) {
            return;
        }
        UserCenterManager.checkIsLogin(context, new e(function0));
    }

    private final void e(Context context, Function0<Unit> function0) {
        IShopModel iShopModel;
        if (context == null || (iShopModel = model) == null) {
            return;
        }
        Intrinsics.checkNotNull(iShopModel);
        if (iShopModel.getDiscountType() == 4) {
            com.dialog.c cVar = new com.dialog.c(context);
            cVar.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
            cVar.setOnDialogTwoHorizontalBtnsClickListener(new f(context, function0));
            cVar.showDialog(context.getString(R.string.confirm_exchange_new_user_welare), context.getString(R.string.confirm_exchange_new_user_hint), context.getString(R.string.cancel), context.getString(R.string.confirm_to_exchange));
            return;
        }
        function0.invoke();
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$checkNewUserBenefitsCallback$1$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class f implements c.b {
        final Function0<Unit> adO;
        final Context wO;

        f(Context context, Function0<Unit> function0) {
            this.wO = context;
            this.adO = function0;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            ShopGoodsExchangeHelper.a(ShopGoodsExchangeHelper.INSTANCE, this.wO, 0, 2, (Object) null);
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            ShopGoodsExchangeHelper.a(ShopGoodsExchangeHelper.INSTANCE, this.wO, 0, 2, (Object) null);
            this.adO.invoke();
            return DialogResult.OK;
        }
    }

    public final void b(Context context, IShopModel iShopModel, Function0<Unit> function0) {
        if (context == null) {
            return;
        }
        int goodsType = iShopModel.getGoodsType();
        if (1 <= goodsType && goodsType < 4) {
            GiftDetailModel giftDetailModel = (GiftDetailModel) iShopModel;
            int vipLevel = giftDetailModel.getVipLevel();
            if (giftDetailModel.getIsVipAvailable()) {
                if (giftDetailModel.getCurrentUserVipLevel() >= vipLevel) {
                    function0.invoke();
                    return;
                }
                com.dialog.c cVar = new com.dialog.c(context);
                cVar.setDialogTwoButtomTheme(DialogTwoButtonTheme.Horizontal_Default);
                cVar.setOnDialogTwoHorizontalBtnsClickListener(new g(context, goodsType, iShopModel));
                StateEventGoodsDetail.INSTANCE.staticsVipLevelRestrictExposure(context, iShopModel.getGoodsID(), iShopModel.getShopTitle(), giftDetailModel.getCurrentUserVipLevel());
                cVar.showDialog(context.getString(R.string.not_satisfy_exchange_limit), context.getString(R.string.vip_level_exchange_limit, Integer.valueOf(vipLevel)), context.getString(R.string.close), context.getString(R.string.check_vip_level));
                return;
            }
            function0.invoke();
            return;
        }
        function0.invoke();
    }

    @Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$checkVipWelfareCallback$1", "Lcom/dialog/DialogWithButtons$OnDialogTwoHorizontalBtnsClickListener;", "onLeftBtnClick", "Lcom/dialog/DialogResult;", "onRightBtnClick", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class g implements c.b {
        final IShopModel dcU;
        final int dcX;
        final Context wO;

        g(Context context, int i, IShopModel iShopModel) {
            this.wO = context;
            this.dcX = i;
            this.dcU = iShopModel;
        }

        @Override
        public DialogResult onLeftBtnClick() {
            ShopGoodsExchangeHelper.INSTANCE.o(this.wO, this.dcX);
            StateEventGoodsDetail.INSTANCE.staticsVipLevelRestrictClick(this.wO, this.dcU.getGoodsID(), this.dcU.getShopTitle(), "关闭弹窗", ((GiftDetailModel) this.dcU).getCurrentUserVipLevel());
            return DialogResult.Cancel;
        }

        @Override
        public DialogResult onRightBtnClick() {
            ShopGoodsExchangeHelper.INSTANCE.o(this.wO, this.dcX);
            StateEventGoodsDetail.INSTANCE.staticsVipLevelRestrictClick(this.wO, this.dcU.getGoodsID(), this.dcU.getShopTitle(), "查看VIP等级", ((GiftDetailModel) this.dcU).getCurrentUserVipLevel());
            GameCenterRouterManager.getInstance().openBoxVip(this.wO);
            return DialogResult.OK;
        }
    }

    public final void b(Context context, IShopModel iShopModel, boolean z, Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        GiftDetailModel giftDetailModel = (GiftDetailModel) iShopModel;
        if (!giftDetailModel.isOpenUidLimit() && !giftDetailModel.isAdultLimit() && !giftDetailModel.isInviteLimit() && !z) {
            if (function0 == null) {
                return;
            }
            function0.invoke();
            return;
        }
        if (dcI == null) {
            dcI = new GiftPreCheckDataProvider();
        }
        GiftPreCheckDataProvider giftPreCheckDataProvider = dcI;
        Intrinsics.checkNotNull(giftPreCheckDataProvider);
        giftPreCheckDataProvider.setId(giftDetailModel.getGoodsID());
        giftPreCheckDataProvider.setCostHebi(0);
        giftPreCheckDataProvider.setUidLimit(giftDetailModel.isOpenUidLimit());
        giftPreCheckDataProvider.setAdultLimit(giftDetailModel.isAdultLimit());
        giftPreCheckDataProvider.setInviteLimit(giftDetailModel.isInviteLimit());
        giftPreCheckDataProvider.setNeedCheckGameDownload(z);
        giftPreCheckDataProvider.setGameId(giftDetailModel.getGame().getId());
        giftPreCheckDataProvider.loadData(new d(giftPreCheckDataProvider, iShopModel, context, z, function0));
    }

    @Metadata(d1 = {"\u0000/\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$checkGiftRelatedLimit$1$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class d implements ILoadPageEventListener {
        final Function0<Unit> adO;
        final IShopModel dcU;
        final GiftPreCheckDataProvider dcV;
        final boolean dcW;
        final Context wO;

        @Override
        public void onBefore() {
        }

        d(GiftPreCheckDataProvider giftPreCheckDataProvider, IShopModel iShopModel, Context context, boolean z, Function0<Unit> function0) {
            this.dcV = giftPreCheckDataProvider;
            this.dcU = iShopModel;
            this.wO = context;
            this.dcW = z;
            this.adO = function0;
        }

        @Override
        public void onSuccess() {
            JSONObject parseJSONObjectFromString = ap.parseJSONObjectFromString(this.dcV.getInfo());
            boolean z = ap.getBoolean("check", ap.getJSONObject("uid_limit", parseJSONObjectFromString), true);
            if (((GiftDetailModel) this.dcU).isOpenUidLimit() && !z) {
                ShopGoodsExchangeHelper.INSTANCE.a(this.wO, this.dcU);
                return;
            }
            boolean z2 = ap.getBoolean("check", ap.getJSONObject("invite_limit", parseJSONObjectFromString), true);
            if (((GiftDetailModel) this.dcU).isInviteLimit() && !z2) {
                ShopGoodsExchangeHelper.INSTANCE.a(this.wO, ((GiftDetailModel) this.dcU).getGoodsType(), ((GiftDetailModel) this.dcU).getGoodsID(), ((GiftDetailModel) this.dcU).getShopTitle());
                return;
            }
            boolean z3 = ap.getBoolean("check", ap.getJSONObject("adult_limit", parseJSONObjectFromString), true);
            if (((GiftDetailModel) this.dcU).isAdultLimit() && !z3) {
                if (UserCenterManager.isVerified()) {
                    ShopGoodsExchangeHelper.INSTANCE.b(this.wO, ((GiftDetailModel) this.dcU).getGoodsType(), ((GiftDetailModel) this.dcU).getGoodsID(), ((GiftDetailModel) this.dcU).getShopTitle());
                    return;
                } else {
                    ShopGoodsExchangeHelper.INSTANCE.c(this.wO, ((GiftDetailModel) this.dcU).getGoodsType(), ((GiftDetailModel) this.dcU).getGoodsID(), ((GiftDetailModel) this.dcU).getShopTitle());
                    return;
                }
            }
            if (!this.dcW) {
                Function0<Unit> function0 = this.adO;
                if (function0 == null) {
                    return;
                }
                function0.invoke();
                return;
            }
            JSONObject jSONObject = ap.getJSONObject("game_id", parseJSONObjectFromString);
            if (ap.getBoolean("check", jSONObject, true)) {
                Function0<Unit> function02 = this.adO;
                if (function02 == null) {
                    return;
                }
                function02.invoke();
                return;
            }
            ShopGoodsExchangeHelper.INSTANCE.a(this.wO, this.dcU, ap.getString("error_msg", jSONObject), true);
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            Context context = this.wO;
            ToastUtils.showToast(context, HttpResultTipUtils.getFailureTip(context, error, code, content));
        }
    }

    public final void c(Context context, IShopModel iShopModel, Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        if (iShopModel.isOpenUidLimit() && !iShopModel.isUidLimitCheck()) {
            a(context, iShopModel);
        } else {
            if (function0 == null) {
                return;
            }
            function0.invoke();
        }
    }

    public final void d(Context context, IShopModel iShopModel, Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        if (iShopModel.isInviteLimit() && !iShopModel.checkInviteLimit()) {
            a(context, iShopModel.getGoodsType(), iShopModel.getGoodsID(), iShopModel.getShopTitle());
        } else {
            if (function0 == null) {
                return;
            }
            function0.invoke();
        }
    }

    public final void e(Context context, IShopModel iShopModel, Function0<Unit> function0) {
        if (context == null || iShopModel == null) {
            return;
        }
        if (!iShopModel.isAdultLimit()) {
            if (function0 == null) {
                return;
            }
            function0.invoke();
        } else {
            if (UserCenterManager.isVerified()) {
                if (!iShopModel.checkAdultLimit()) {
                    b(context, iShopModel.getGoodsType(), iShopModel.getGoodsID(), iShopModel.getShopTitle());
                    return;
                } else {
                    if (function0 == null) {
                        return;
                    }
                    function0.invoke();
                    return;
                }
            }
            c(context, iShopModel.getGoodsType(), iShopModel.getGoodsID(), iShopModel.getShopTitle());
        }
    }

    private final void f(Context context, Function0<Unit> function0) {
        if (context == null) {
            return;
        }
        if (baY == null) {
            baY = new com.m4399.gamecenter.plugin.main.providers.ad.b();
        }
        com.m4399.gamecenter.plugin.main.providers.ad.b bVar = baY;
        Intrinsics.checkNotNull(bVar);
        bVar.loadData(new j(new CommonLoadingDialog(context), function0));
    }

    @Metadata(d1 = {"\u0000/\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$refreshHebiCallback$1$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class j implements ILoadPageEventListener {
        final Function0<Unit> adO;
        final CommonLoadingDialog bsj;

        j(CommonLoadingDialog commonLoadingDialog, Function0<Unit> function0) {
            this.bsj = commonLoadingDialog;
            this.adO = function0;
        }

        @Override
        public void onBefore() {
            this.bsj.show();
        }

        @Override
        public void onSuccess() {
            this.bsj.dismiss();
            Function0<Unit> function0 = this.adO;
            if (function0 == null) {
                return;
            }
            function0.invoke();
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            this.bsj.dismiss();
            Function0<Unit> function0 = this.adO;
            if (function0 == null) {
                return;
            }
            function0.invoke();
        }
    }

    public final void g(final Context context, final Function0<Unit> function0) {
        IShopModel iShopModel;
        if (context == null || (iShopModel = model) == null) {
            return;
        }
        int i2 = bJO;
        if (i2 > 2) {
            function0.invoke();
            return;
        }
        if (i2 == 1) {
            Intrinsics.checkNotNull(iShopModel);
            if (a(this, iShopModel.getPriceInHebi(), false, 2, (Object) null)) {
                function0.invoke();
                return;
            } else {
                f(context, new Function0<Unit>() {
                    {
                        super(0);
                    }

                    @Override
                    public Unit invoke() {
                        invoke2();
                        return Unit.INSTANCE;
                    }

                    public final void invoke2() {
                        IShopModel iShopModel2;
                        IShopModel iShopModel3;
                        ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                        iShopModel2 = ShopGoodsExchangeHelper.model;
                        Intrinsics.checkNotNull(iShopModel2);
                        if (ShopGoodsExchangeHelper.a(shopGoodsExchangeHelper, iShopModel2.getPriceInHebi(), false, 2, (Object) null)) {
                            function0.invoke();
                            return;
                        }
                        ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = ShopGoodsExchangeHelper.INSTANCE;
                        Context context2 = context;
                        iShopModel3 = ShopGoodsExchangeHelper.model;
                        Intrinsics.checkNotNull(iShopModel3);
                        shopGoodsExchangeHelper2.showHebiNotEnoughDialog(context2, iShopModel3);
                    }
                });
                return;
            }
        }
        Intrinsics.checkNotNull(iShopModel);
        if (I(iShopModel.getPriceInSuperH(), false)) {
            function0.invoke();
        } else {
            f(context, new Function0<Unit>() {
                {
                    super(0);
                }

                @Override
                public Unit invoke() {
                    invoke2();
                    return Unit.INSTANCE;
                }

                public final void invoke2() {
                    IShopModel iShopModel2;
                    boolean I;
                    IShopModel iShopModel3;
                    ShopGoodsExchangeHelper shopGoodsExchangeHelper = ShopGoodsExchangeHelper.INSTANCE;
                    iShopModel2 = ShopGoodsExchangeHelper.model;
                    Intrinsics.checkNotNull(iShopModel2);
                    I = shopGoodsExchangeHelper.I(iShopModel2.getPriceInSuperH(), false);
                    if (I) {
                        function0.invoke();
                        return;
                    }
                    ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = ShopGoodsExchangeHelper.INSTANCE;
                    Context context2 = context;
                    iShopModel3 = ShopGoodsExchangeHelper.model;
                    Intrinsics.checkNotNull(iShopModel3);
                    shopGoodsExchangeHelper2.showSuperHebiNotEnoughDialog(context2, iShopModel3);
                }
            });
        }
    }

    public static boolean a(ShopGoodsExchangeHelper shopGoodsExchangeHelper, int i2, boolean z, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z = true;
        }
        return shopGoodsExchangeHelper.I(i2, z);
    }

    public final boolean I(int i2, boolean z) {
        if (z) {
            Integer hebiNum = UserCenterManager.getHebiNum();
            Intrinsics.checkNotNullExpressionValue(hebiNum, "getHebiNum()");
            if (hebiNum.intValue() >= i2) {
                return true;
            }
        } else {
            Integer superHebiNum = UserCenterManager.getSuperHebiNum();
            Intrinsics.checkNotNullExpressionValue(superHebiNum, "getSuperHebiNum()");
            if (superHebiNum.intValue() >= i2) {
                return true;
            }
        }
        return false;
    }

    public final void bindExchangeInfo(final Context context, final int channel, final String thirdPartyAccount, final String consigneeName, final String phoneNumber, final String city, final String address, final Function1<? super Boolean, Unit> callback) {
        Intrinsics.checkNotNullParameter(thirdPartyAccount, "thirdPartyAccount");
        Intrinsics.checkNotNullParameter(consigneeName, "consigneeName");
        Intrinsics.checkNotNullParameter(phoneNumber, "phoneNumber");
        Intrinsics.checkNotNullParameter(city, "city");
        Intrinsics.checkNotNullParameter(address, "address");
        Intrinsics.checkNotNullParameter(callback, "callback");
        if (context == null) {
            callback.invoke(false);
        } else {
            com.m4399.gamecenter.plugin.main.manager.shop.e.getInstance().getUserBindAccounts(context, channel, new e.a() {
                @Override
                public final void getAccounts() {
                    ShopGoodsExchangeHelper.a(channel, address, context, callback, phoneNumber, thirdPartyAccount, city, consigneeName);
                }
            });
        }
    }

    public static final void a(int i2, String address, Context context, Function1 callback, String phoneNumber, String thirdPartyAccount, String city, String consigneeName) {
        Intrinsics.checkNotNullParameter(address, "$address");
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Intrinsics.checkNotNullParameter(phoneNumber, "$phoneNumber");
        Intrinsics.checkNotNullParameter(thirdPartyAccount, "$thirdPartyAccount");
        Intrinsics.checkNotNullParameter(city, "$city");
        Intrinsics.checkNotNullParameter(consigneeName, "$consigneeName");
        int i3 = 5;
        if (i2 != 22) {
            if (i2 != 23) {
                if (i2 != 10000) {
                    if (i2 != 10001) {
                        if (i2 != 10003) {
                            switch (i2) {
                                case 2:
                                    break;
                                case 3:
                                    break;
                                case 4:
                                    if (address.length() < 5 || address.length() > 60) {
                                        ToastUtils.showToast(context, context.getString(R.string.hebi_exchange_setting_address_error));
                                        callback.invoke(true);
                                        return;
                                    }
                                    if (!Intrinsics.areEqual(UserCenterManager.getContractCity(), "") && UserCenterManager.getContractAddress() != null) {
                                        callback.invoke(true);
                                        return;
                                    }
                                    i3 = 2;
                                    if (i3 != -1) {
                                        callback.invoke(true);
                                        return;
                                    }
                                    if (i3 == 6) {
                                        if (dcL == null) {
                                            ShopGoodsExchangeHelper shopGoodsExchangeHelper = INSTANCE;
                                            dcL = new com.m4399.gamecenter.plugin.main.providers.shop.p();
                                        }
                                        com.m4399.gamecenter.plugin.main.providers.shop.p pVar = dcL;
                                        Intrinsics.checkNotNull(pVar);
                                        pVar.setQQNum(thirdPartyAccount);
                                        com.m4399.gamecenter.plugin.main.providers.shop.p pVar2 = dcL;
                                        Intrinsics.checkNotNull(pVar2);
                                        pVar2.setPhoneNum(phoneNumber);
                                        com.m4399.gamecenter.plugin.main.providers.shop.p pVar3 = dcL;
                                        Intrinsics.checkNotNull(pVar3);
                                        pVar3.loadData(new a(thirdPartyAccount, phoneNumber, callback, context));
                                        return;
                                    }
                                    if (dcK == null) {
                                        ShopGoodsExchangeHelper shopGoodsExchangeHelper2 = INSTANCE;
                                        dcK = new com.m4399.gamecenter.plugin.main.providers.shop.o();
                                    }
                                    com.m4399.gamecenter.plugin.main.providers.shop.o oVar = dcK;
                                    Intrinsics.checkNotNull(oVar);
                                    oVar.setHebiExchangeSetType(i3);
                                    if (i3 == 0) {
                                        oVar.setNum(phoneNumber);
                                    } else {
                                        oVar.setNum(thirdPartyAccount);
                                    }
                                    ShopExchangeContactInfoModel shopExchangeContactInfoModel = new ShopExchangeContactInfoModel();
                                    shopExchangeContactInfoModel.setAddress(address);
                                    shopExchangeContactInfoModel.setCity(city);
                                    shopExchangeContactInfoModel.setPhone(phoneNumber);
                                    shopExchangeContactInfoModel.setConsigneeName(consigneeName);
                                    oVar.setContactParams(shopExchangeContactInfoModel);
                                    oVar.loadData(new b(i2, thirdPartyAccount, phoneNumber, city, address, oVar, callback, context));
                                    return;
                                case 5:
                                    break;
                                case 6:
                                    if (!Intrinsics.areEqual(UserCenterManager.getHebiBindMiNum(), "")) {
                                        callback.invoke(true);
                                        return;
                                    } else {
                                        i3 = 4;
                                        if (i3 != -1) {
                                        }
                                    }
                                    break;
                                case 7:
                                    if (!Intrinsics.areEqual(UserCenterManager.getHebiBindAoNum(), "")) {
                                        callback.invoke(true);
                                        return;
                                    }
                                    if (i3 != -1) {
                                    }
                                    break;
                                default:
                                    switch (i2) {
                                        case 12:
                                            break;
                                        case 13:
                                        case 14:
                                            break;
                                        default:
                                            i3 = -1;
                                            break;
                                    }
                                    if (i3 != -1) {
                                    }
                                    break;
                            }
                        }
                        if (!Intrinsics.areEqual(UserCenterManager.getAliPayAccount(), "")) {
                            callback.invoke(true);
                            return;
                        } else {
                            i3 = 3;
                            if (i3 != -1) {
                            }
                        }
                    }
                    if (!AddressInputHelper.verifyQQ(thirdPartyAccount, context)) {
                        callback.invoke(false);
                        return;
                    } else if (!Intrinsics.areEqual(UserCenterManager.getHebiBindQQNum(), "")) {
                        callback.invoke(true);
                        return;
                    } else {
                        i3 = 1;
                        if (i3 != -1) {
                        }
                    }
                }
                if (!AddressInputHelper.verifyPhone(phoneNumber, context)) {
                    callback.invoke(false);
                    return;
                } else if (!Intrinsics.areEqual(UserCenterManager.getHebiBindPhoneNum(), "")) {
                    callback.invoke(true);
                    return;
                } else {
                    i3 = 0;
                    if (i3 != -1) {
                    }
                }
            } else if (!AddressInputHelper.verifyQQ(thirdPartyAccount, context)) {
                callback.invoke(false);
                return;
            }
        } else if (!AddressInputHelper.verifyQQ(thirdPartyAccount, context) || !AddressInputHelper.verifyPhone(phoneNumber, context)) {
            callback.invoke(false);
            return;
        }
        i3 = 6;
        if (i3 != -1) {
        }
    }

    @Metadata(d1 = {"\u0000/\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$bindExchangeInfo$1$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class a implements ILoadPageEventListener {
        final Function1<Boolean, Unit> cUD;
        final String dcN;
        final String dcO;
        final Context wO;

        @Override
        public void onBefore() {
        }

        a(String str, String str2, Function1<? super Boolean, Unit> function1, Context context) {
            this.dcN = str;
            this.dcO = str2;
            this.cUD = function1;
            this.wO = context;
        }

        @Override
        public void onSuccess() {
            if (this.dcN.length() > 0) {
                UserCenterManager.setHebiBindQQNumV2(this.dcN);
            }
            if (this.dcO.length() > 0) {
                UserCenterManager.setHebiBindPhoneNumV2(this.dcO);
            }
            this.cUD.invoke(true);
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            Context context = this.wO;
            ToastUtils.showToast(context, HttpResultTipUtils.getFailureTip(context, error, code, content));
            this.cUD.invoke(false);
        }
    }

    @Metadata(d1 = {"\u0000/\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$bindExchangeInfo$1$2$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class b implements ILoadPageEventListener {
        final Function1<Boolean, Unit> cUD;
        final String dcN;
        final String dcO;
        final int dcP;
        final String dcQ;
        final String dcR;
        final com.m4399.gamecenter.plugin.main.providers.shop.o dcS;
        final Context wO;

        @Override
        public void onBefore() {
        }

        b(int i, String str, String str2, String str3, String str4, com.m4399.gamecenter.plugin.main.providers.shop.o oVar, Function1<? super Boolean, Unit> function1, Context context) {
            this.dcP = i;
            this.dcN = str;
            this.dcO = str2;
            this.dcQ = str3;
            this.dcR = str4;
            this.dcS = oVar;
            this.cUD = function1;
            this.wO = context;
        }

        @Override
        public void onSuccess() {
            int i = this.dcP;
            switch (i) {
                case 2:
                    UserCenterManager.setHebiBindPhoneNum(this.dcO);
                    break;
                case 3:
                    UserCenterManager.setHebiBindQQNum(this.dcN);
                    break;
                case 4:
                    UserCenterManager.setContractCity(this.dcQ);
                    UserCenterManager.setContractAddress(this.dcR);
                    UserCenterManager.setContractPhone(this.dcO);
                    UserCenterManager.setContractId(this.dcS.getContractId());
                    break;
                case 5:
                    UserCenterManager.setAliPayAccount(this.dcN);
                    break;
                case 6:
                    UserCenterManager.setHebiBindMiNum(this.dcN);
                    break;
                case 7:
                    UserCenterManager.setHebiBindAoNum(this.dcN);
                    break;
                default:
                    switch (i) {
                        case 12:
                            break;
                        case 13:
                        case 14:
                            break;
                        default:
                            switch (i) {
                            }
                    }
            }
            this.cUD.invoke(true);
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            Context context = this.wO;
            ToastUtils.showToast(context, HttpResultTipUtils.getFailureTip(context, error, code, content));
            this.cUD.invoke(false);
        }
    }

    public final void exchangeHeadgear(Context context, IShopModel model2, int hebiType, boolean isUseNow, boolean isShareToFeed, Function1<? super Boolean, Unit> callback) {
        Intrinsics.checkNotNullParameter(callback, "callback");
        if (model2 == null || !(model2 instanceof ShopHeadgearModel)) {
            callback.invoke(false);
            return;
        }
        if (dcM == null) {
            dcM = new v();
        }
        v vVar = dcM;
        Intrinsics.checkNotNull(vVar);
        ShopHeadgearModel shopHeadgearModel = (ShopHeadgearModel) model2;
        vVar.setHeadgearId(shopHeadgearModel.getId());
        vVar.setIsShareToFeed(isShareToFeed);
        vVar.setIsUseNow(isUseNow);
        vVar.setCurrHebi(shopHeadgearModel.getPriceInHebi());
        vVar.setCurrSuperHebi(shopHeadgearModel.getPriceInSuperH());
        vVar.setCurrDiscountType(shopHeadgearModel.getDiscountType());
        vVar.setHebiType(hebiType);
        vVar.loadData(new h(vVar, model2, hebiType, isUseNow, callback, context));
    }

    @Metadata(d1 = {"\u00005\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J6\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016J\u0010\u0010\u000f\u001a\u00020\u00032\u0006\u0010\u0010\u001a\u00020\u0011H\u0002¨\u0006\u0012"}, d2 = {"com/m4399/gamecenter/plugin/main/manager/shop/ShopGoodsExchangeHelper$exchangeHeadgear$1$1", "Lcom/framework/net/ILoadPageEventListener;", "onBefore", "", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_FAILURE, "error", "", "code", "", "content", "", "failureType", "result", "Lorg/json/JSONObject;", com.m4399.gamecenter.plugin.main.helpers.l.ACTION_STATE_SUCCESS, "updateHebiNum", "isHebi", "", "plugin_main_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class h implements ILoadPageEventListener {
        final Function1<Boolean, Unit> cUD;
        final IShopModel dcU;
        final v dcY;
        final int dcZ;
        final boolean dda;
        final Context wO;

        @Override
        public void onBefore() {
        }

        h(v vVar, IShopModel iShopModel, int i, boolean z, Function1<? super Boolean, Unit> function1, Context context) {
            this.dcY = vVar;
            this.dcU = iShopModel;
            this.dcZ = i;
            this.dda = z;
            this.cUD = function1;
            this.wO = context;
        }

        private final void cN(boolean z) {
            JSONObject jSONObject = new JSONObject();
            ap.putObject(z ? "hebi" : "super_hebi", Integer.valueOf(this.dcY.getCoinsCount()), jSONObject);
            RxBus.get().post("tag.refresh.hebi", jSONObject);
        }

        @Override
        public void onSuccess() {
            LiveDataBus.get$default(LiveDataBus.INSTANCE, "headgear_exchange_success", null, 2, null).postValue(this.dcU);
            if (this.dcZ == 1 && ((ShopHeadgearModel) this.dcU).getPriceInHebi() > 0) {
                UserCenterManager.setHebiNum(Integer.valueOf(this.dcY.getCoinsCount()));
                cN(true);
            } else if (this.dcZ == 2 && ((ShopHeadgearModel) this.dcU).getPriceInSuperH() > 0) {
                UserCenterManager.setSuperHebiNum(Integer.valueOf(this.dcY.getCoinsCount()));
                cN(false);
            }
            if (this.dda) {
                UserCenterManager.setHeadGearId(((ShopHeadgearModel) this.dcU).getId());
            }
            this.cUD.invoke(true);
            TaskManager.getInstance().checkTask(TaskActions.PURCHASE_WELFARE_ITEM);
        }

        @Override
        public void onFailure(Throwable error, int code, String content, int failureType, JSONObject result) {
            if (code != 10004) {
                if (code != 500601) {
                    Context context = this.wO;
                    ToastUtils.showToast(context, HttpResultTipUtils.getFailureTip(context, error, code, content));
                }
                this.cUD.invoke(false);
                return;
            }
            UserCenterManager.openThirdPartBindAuth(this.wO, "虚拟商品兑换");
            this.cUD.invoke(false);
        }
    }
}