package com.ss.android.ugc.aweme.comment;

import X.7he;
import X.AnonymousClass9nC;
import X.C00329ng;
import X.C00359nj;
import X.C00369nk;
import X.Crj;
import X.Ls2;
import X.M12;
import androidx.lifecycle.LiveData;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.comment.api.CommentViewModel;
import com.ss.android.ugc.aweme.comment.model.Comment;
import java.util.Set;
import kotlin.h.b.n;

public final class CommentViewModelImpl extends CommentViewModel {
    public static final AnonymousClass9nC LIZJ = new AnonymousClass9nC((byte) 0);
    public boolean LIZ;
    public boolean LIZIZ;
    public final Crj LIZLLL = 7he.LIZ(C00369nk.LIZ);
    public final Crj LJ = 7he.LIZ(C00359nj.LIZ);

    static {
        Covode.recordClassIndex(56649);
    }

    public final Set<String> LIZ() {
        return (Set) this.LIZLLL.getValue();
    }

    public final C00329ng LIZJ() {
        return (C00329ng) this.LJ.getValue();
    }

    public final void onCleared() {
        CommentViewModelImpl.super.onCleared();
    }

    public final LiveData<Boolean> LIZIZ() {
        return LIZJ().LIZ;
    }

    public final void LIZ(Comment comment, Ls2<Boolean> ls2) {
        String cid;
        M12.LIZ(ls2);
        if (comment != null && (cid = comment.getCid()) != null && cid.length() != 0 && !LIZ().contains(comment.getCid())) {
            Set<String> LIZ2 = LIZ();
            String cid2 = comment.getCid();
            n.LIZIZ(cid2, "");
            LIZ2.add(cid2);
            ls2.invoke();
        }
    }
}
