package com.ss.android.ugc.aweme.commercialize.views.cards;

import X.0CB;
import X.0CH;
import X.2GO;
import X.6Is;
import X.C3376LIx;
import X.C3475LMs;
import X.ISm;
import X.LJ0;
import X.LQ8;
import X.M12;
import X.Rc9;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.commercialize.model.ChooseLogAdExtraData;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import java.util.Map;
import kotlin.h.b.n;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONObject;

public final class SelectAdCardActionV2 extends AbsAdCardActionV2 implements 6Is, 2GO {
    public ChooseLogAdExtraData LJIIIIZZ;

    static {
        Covode.recordClassIndex(60003);
    }

    public final Map<Integer, Object> getSubscriberEventTypes() {
        Map<Integer, Object> subscriberEventTypes = super.getSubscriberEventTypes();
        subscriberEventTypes.put(321, new Rc9(SelectAdCardActionV2.class, "userChooseEvent", ChooseLogAdExtraData.class, ThreadMode.POSTING, 0, false));
        return subscriberEventTypes;
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final void LIZLLL() {
        long j;
        String LIZLLL;
        LJIIIZ();
        C3376LIx lIx = new C3376LIx();
        lIx.LIZ("othershow");
        lIx.LIZIZ("card");
        lIx.LIZLLL("choose");
        Aweme aweme = this.LIZJ;
        String str = "";
        n.LIZIZ(aweme, str);
        lIx.LIZ(aweme);
        C3475LMs LIZ = LQ8.LIZIZ.LIZ();
        boolean z = true;
        if (LIZ == null || !LIZ.LJI(this.LIZJ)) {
            z = false;
        }
        lIx.LIZ(z);
        C3475LMs LIZ2 = LQ8.LIZIZ.LIZ();
        if (!(LIZ2 == null || (LIZLLL = LIZ2.LIZLLL(this.LIZJ)) == null)) {
            str = LIZLLL;
        }
        lIx.LJFF(str);
        C3475LMs LIZ3 = LQ8.LIZIZ.LIZ();
        if (LIZ3 != null) {
            j = LIZ3.LJ(this.LIZJ);
        } else {
            j = 0;
        }
        lIx.LIZ(j);
        LIZ(lIx.LIZ());
    }

    public final void LJFF() {
        long j;
        String LIZLLL;
        JSONObject adExtraData;
        String optString;
        LJIIIZ();
        C3376LIx lIx = new C3376LIx();
        Aweme aweme = this.LIZJ;
        String str = "";
        n.LIZIZ(aweme, str);
        lIx.LIZ(aweme);
        lIx.LIZ("close");
        lIx.LIZIZ("card");
        ChooseLogAdExtraData chooseLogAdExtraData = this.LJIIIIZZ;
        String str2 = "choose";
        if (!(chooseLogAdExtraData == null || (adExtraData = chooseLogAdExtraData.getAdExtraData()) == null || (optString = adExtraData.optString("card_type", str2)) == null)) {
            str2 = optString;
        }
        lIx.LIZLLL(str2);
        C3475LMs LIZ = LQ8.LIZIZ.LIZ();
        if (!(LIZ == null || (LIZLLL = LIZ.LIZLLL(this.LIZJ)) == null)) {
            str = LIZLLL;
        }
        lIx.LJFF(str);
        C3475LMs LIZ2 = LQ8.LIZIZ.LIZ();
        if (LIZ2 != null) {
            j = LIZ2.LJ(this.LIZJ);
        } else {
            j = 0;
        }
        lIx.LIZ(j);
        LIZ(lIx.LIZ());
    }

    @ISm
    public final void userChooseEvent(ChooseLogAdExtraData chooseLogAdExtraData) {
        M12.LIZ((Object) chooseLogAdExtraData);
        this.LJIIIIZZ = chooseLogAdExtraData;
    }

    public final void LIZ(String str) {
        long j;
        String LIZLLL;
        LJIIIZ();
        C3376LIx lIx = new C3376LIx();
        lIx.LIZ("othershow_fail");
        lIx.LIZIZ("card");
        lIx.LIZJ(String.valueOf(str));
        lIx.LIZLLL("choose");
        Aweme aweme = this.LIZJ;
        String str2 = "";
        n.LIZIZ(aweme, str2);
        lIx.LIZ(aweme);
        C3475LMs LIZ = LQ8.LIZIZ.LIZ();
        boolean z = true;
        if (LIZ == null || !LIZ.LJI(this.LIZJ)) {
            z = false;
        }
        lIx.LIZ(z);
        C3475LMs LIZ2 = LQ8.LIZIZ.LIZ();
        if (!(LIZ2 == null || (LIZLLL = LIZ2.LIZLLL(this.LIZJ)) == null)) {
            str2 = LIZLLL;
        }
        lIx.LJFF(str2);
        C3475LMs LIZ3 = LQ8.LIZIZ.LIZ();
        if (LIZ3 != null) {
            j = LIZ3.LJ(this.LIZJ);
        } else {
            j = 0;
        }
        lIx.LIZ(j);
        LIZ(lIx.LIZ());
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public SelectAdCardActionV2(Context context, Aweme aweme, LJ0 lj0) {
        super(context, aweme, lj0);
        M12.LIZ((Object) lj0);
        this.LIZ = 2131232743;
    }
}
