package com.ss.android.ugc.aweme.feed.assem.avatar;

import X.2Pr;
import X.4HR;
import X.4Wj;
import X.4bl;
import X.4sn;
import X.C2869Dwn;
import X.C2871Dwp;
import X.C2873Dwr;
import X.ESC;
import X.LFp;
import X.LsC;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.feed.assem.base.FeedBaseViewModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.VideoItemParams;
import com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService;
import com.ss.android.ugc.aweme.im.service.IIMService;
import com.ss.android.ugc.aweme.profile.model.ProfileBadgeStruct;
import com.ss.android.ugc.aweme.profile.model.User;
import kotlin.h.b.n;

public final class FeedAvatarDefaultVM extends FeedBaseViewModel<C2871Dwp> {
    static {
        Covode.recordClassIndex(76876);
    }

    public final /* synthetic */ 4HR defaultState() {
        return new C2871Dwp();
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.bytedance.assem.arch.viewModel.AssemViewModel, com.ss.android.ugc.aweme.feed.assem.avatar.FeedAvatarDefaultVM] */
    public final void LIZIZ() {
        setState(new C2869Dwn(this));
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.feed.assem.avatar.FeedAvatarDefaultVM, com.bytedance.ext_power_list.AssemViewModelWithItem] */
    public final String LIZJ() {
        Aweme aweme;
        User author;
        ProfileBadgeStruct profileBadge;
        VideoItemParams videoItemParams = (VideoItemParams) LIZ();
        if (!(videoItemParams == null || (aweme = videoItemParams.mAweme) == null || (author = aweme.getAuthor()) == null || (profileBadge = author.getProfileBadge()) == null)) {
            n.LIZIZ(profileBadge, "");
            if (profileBadge.getShouldShow() && profileBadge.getUrl().length() > 0) {
                return profileBadge.getUrl();
            }
        }
        return null;
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.feed.assem.avatar.FeedAvatarDefaultVM, com.bytedance.ext_power_list.AssemViewModelWithItem] */
    public final int LIZLLL() {
        Aweme aweme;
        VideoItemParams videoItemParams = (VideoItemParams) LIZ();
        if (videoItemParams == null || (aweme = videoItemParams.mAweme) == null || !aweme.isCanPlay() || aweme.isDelete() || 4sn.LJIL.LIZ(aweme) || LFp.LJJJJJL(aweme)) {
            return 8;
        }
        if (ESC.LIZ(aweme) || ESC.LJII(aweme.getAuthor()) || LFp.LJJLIIIJLLLLLLLZ(aweme) || !4Wj.LIZ.LIZIZ(aweme)) {
            return 4;
        }
        return 0;
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.bytedance.assem.arch.viewModel.AssemViewModel, com.ss.android.ugc.aweme.feed.assem.avatar.FeedAvatarDefaultVM] */
    public final void LIZ(4bl<Integer> r2) {
        M12.LIZ(r2);
        setState(new C2873Dwr(r2));
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.feed.assem.avatar.FeedAvatarDefaultVM, com.bytedance.ext_power_list.AssemViewModelWithItem] */
    public final void LIZ(LsC<? super Boolean, 2Pr> lsC) {
        Aweme aweme;
        IIMService createIIMServicebyMonsterPlugin = IMService.createIIMServicebyMonsterPlugin(false);
        n.LIZIZ(createIIMServicebyMonsterPlugin, "");
        VideoItemParams videoItemParams = (VideoItemParams) LIZ();
        if (videoItemParams == null || (aweme = videoItemParams.mAweme) == null) {
            lsC.invoke(false);
        } else {
            createIIMServicebyMonsterPlugin.shouldShowFeedDMEntrance(aweme, lsC);
        }
    }

    /* renamed from: LIZ */
    public final C2871Dwp LIZIZ(C2871Dwp dwp, VideoItemParams videoItemParams) {
        M12.LIZ(dwp, videoItemParams);
        return C2871Dwp.LIZ(dwp, LIZLLL(), LIZJ(), (4bl) null, 4);
    }
}
