小红书.apk(点击下载) / x0.java


package lz0;

import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
import as0.i;
import com.google.android.gms.common.GoogleApiAvailabilityLight;
import com.google.gson.Gson;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.igexin.push.core.d.c;
import com.xingin.android.xhscomm.router.RouterBuilder;
import com.xingin.android.xhscomm.router.Routers;
import com.xingin.chatbase.bean.ChatBtnBean;
import com.xingin.chatbase.bean.MsgMultiBean;
import com.xingin.chatbase.bean.MsgUIData;
import com.xingin.chatbase.bean.convert.MsgConvertUtils;
import com.xingin.entities.HashTagListBean;
import com.xingin.entities.NoteItemBean;
import com.xingin.entities.ShareInfoDetail;
import com.xingin.entities.chat.MiniCommonToChatBean;
import com.xingin.entities.chat.MsgUserBean;
import com.xingin.entities.chat.NoteToChatBean;
import com.xingin.entities.chat.ShareCenterToChatBean;
import com.xingin.entities.chat.ShareEventToChatBean;
import com.xingin.entities.chat.ShareGoodsToChatBean;
import com.xingin.entities.chat.ShareHeyToChatBean;
import com.xingin.entities.chat.ShareLiveToChatBean;
import com.xingin.entities.chat.SharePagesToChatBean;
import com.xingin.entities.chat.ShareToChatBean;
import com.xingin.entities.chat.ShareTopicToChatBean;
import com.xingin.entities.chat.ShareUserToChatBean;
import com.xingin.entities.im.ShareTargetBean;
import com.xingin.im.R$string;
import com.xingin.pages.PageExtensionsKt;
import com.xingin.pages.Pages;
import com.xingin.pages.SharedUserPage;
import com.xingin.redview.livefloatwindow.LiveWindowConfig;
import ja.b1;
import kotlin.Metadata;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import kotlin.text.Typography;
import kz0.i0;
import kz0.j0;
import org.json.JSONObject;
import wt0.e;
import wt0.g;
import y7.f;
import z60.h;

@Metadata(bv = {}, d1 = {"\u0000Œ\u0001\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0006\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\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\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\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\bÆ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b;\u0010<J\u0016\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004J(\u0010\u000e\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\t\u001a\u00020\b2\u0006\u0010\u000b\u001a\u00020\n2\b\b\u0002\u0010\r\u001a\u00020\fJ\u0016\u0010\u000f\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004J(\u0010\u0011\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\t\u001a\u0004\u0018\u00010\b2\u0006\u0010\u0010\u001a\u00020\n2\u0006\u0010\r\u001a\u00020\fJ\u0012\u0010\u0012\u001a\u0004\u0018\u00010\b2\b\u0010\t\u001a\u0004\u0018\u00010\bJ6\u0010\u001a\u001a\u00020\u00062\u0006\u0010\u0013\u001a\u00020\f2\u0006\u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0016\u001a\u00020\f2\u0006\u0010\u0017\u001a\u00020\f2\u0006\u0010\u0018\u001a\u00020\u00142\u0006\u0010\u0019\u001a\u00020\u0014J\u000e\u0010\u001e\u001a\u00020\u001d2\u0006\u0010\u001c\u001a\u00020\u001bJ\u000e\u0010!\u001a\u00020\u001d2\u0006\u0010 \u001a\u00020\u001fJ\u000e\u0010#\u001a\u00020\u001d2\u0006\u0010 \u001a\u00020\"J\"\u0010$\u001a\u00020\u00062\b\u0010\t\u001a\u0004\u0018\u00010\b2\u0006\u0010\u0010\u001a\u00020\n2\u0006\u0010\r\u001a\u00020\fH\u0002J\u0018\u0010'\u001a\u00020\u001d2\u0006\u0010%\u001a\u00020\u001d2\u0006\u0010\u001c\u001a\u00020&H\u0002J\u001a\u0010*\u001a\u00020\f2\u0006\u0010(\u001a\u00020\f2\b\u0010)\u001a\u0004\u0018\u00010\fH\u0002J\u0010\u0010,\u001a\u00020\u001d2\u0006\u0010 \u001a\u00020+H\u0002J\u0010\u0010.\u001a\u00020\u001d2\u0006\u0010 \u001a\u00020-H\u0002J\u0010\u00100\u001a\u00020\u001d2\u0006\u0010 \u001a\u00020/H\u0002J\u0010\u00102\u001a\u00020\u001d2\u0006\u0010 \u001a\u000201H\u0002J\u0010\u00104\u001a\u00020\u001d2\u0006\u0010 \u001a\u000203H\u0002J\u0010\u00106\u001a\u00020\u001d2\u0006\u0010 \u001a\u000205H\u0002J\u0010\u00108\u001a\u00020\u001d2\u0006\u0010 \u001a\u000207H\u0002J\u0010\u0010:\u001a\u00020\u001d2\u0006\u0010 \u001a\u000209H\u0002¨\u0006="}, d2 = {"Llz0/x0;", "", "Landroid/content/Context;", "context", "Landroid/os/Bundle;", "bundle", "", "r", "Landroid/os/Parcelable;", "shareData", "Lcom/xingin/entities/im/ShareTargetBean;", "targetBean", "", "businessName", "q", c.f25536c, "target", "s", "a", "targetId", "", "targetType", "textContent", RemoteMessageConst.MessageBody.MSG_CONTENT, "msgType", "source", "o", "Lcom/xingin/entities/chat/NoteToChatBean;", "note", "Lcom/xingin/chatbase/bean/MsgMultiBean;", "l", "Lcom/xingin/entities/chat/ShareGoodsToChatBean;", "data", f.f156778k, "Lcom/xingin/entities/chat/MiniCommonToChatBean;", "j", "t", "sendData", "Lcom/xingin/entities/NoteItemBean;", "k", "shareInfoLink", "noteType", "b", "Lcom/xingin/entities/chat/ShareToChatBean;", "c", "Lcom/xingin/entities/chat/ShareHeyToChatBean;", h.f160753a, "Lcom/xingin/entities/chat/SharePagesToChatBean;", "g", "Lcom/xingin/entities/chat/ShareUserToChatBean;", GoogleApiAvailabilityLight.TRACKING_SOURCE_NOTIFICATION, "Lcom/xingin/entities/chat/ShareLiveToChatBean;", "i", "Lcom/xingin/entities/chat/ShareCenterToChatBean;", "d", "Lcom/xingin/entities/chat/ShareEventToChatBean;", "e", "Lcom/xingin/entities/chat/ShareTopicToChatBean;", "m", "<init>", "()V", "im_library_release"}, k = 1, mv = {1, 6, 0})
/* compiled from: IMShareToMessage.kt */
public final class x0 {

    /* renamed from: a  reason: collision with root package name */
    public static final x0 f103576a = new x0();

    @Metadata(bv = {}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0006\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"lz0/x0$a", "Lkz0/j0;", "", "content", "", "confirm", "a", "im_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: IMShareToMessage.kt */
    public static final class a implements j0 {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ Parcelable f103577a;

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ String f103578b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ ShareTargetBean f103579c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ Context f103580d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ i0 f103581e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ String f103582f;

        public a(Parcelable parcelable, String str, ShareTargetBean shareTargetBean, Context context, i0 i0Var, String str2) {
            this.f103577a = parcelable;
            this.f103578b = str;
            this.f103579c = shareTargetBean;
            this.f103580d = context;
            this.f103581e = i0Var;
            this.f103582f = str2;
        }

        @Override // kz0.j0
        public void a(String str) {
            Intrinsics.checkNotNullParameter(str, "content");
            ej2.a.f72257b.a(new e(this.f103578b, wt0.f.CANCEL, new g(CollectionsKt__CollectionsJVMKt.listOf(this.f103579c.getId()))));
            nz0.c.f111943a.a(this.f103579c.getId(), this.f103582f, str);
        }

        @Override // kz0.j0
        public void confirm(String str) {
            Intrinsics.checkNotNullParameter(str, "content");
            x0 x0Var = x0.f103576a;
            Parcelable a14 = x0Var.a(this.f103577a);
            if (a14 == null) {
                ej2.a.f72257b.a(new e(this.f103578b, wt0.f.FAILURE, new g(CollectionsKt__CollectionsJVMKt.listOf(this.f103579c.getId()))));
                al2.e.f(R$string.cbx);
                return;
            }
            ShareTargetBean shareTargetBean = this.f103579c;
            if (a14 instanceof MsgMultiBean) {
                String id3 = shareTargetBean.getId();
                int type = shareTargetBean.getType();
                String json = new Gson().toJson(a14);
                Intrinsics.checkNotNullExpressionValue(json, "Gson().toJson(it)");
                x0Var.o(id3, type, str, json, 3, 2);
            } else if (a14 instanceof MsgUIData) {
                MsgUIData msgUIData = (MsgUIData) a14;
                x0Var.o(shareTargetBean.getId(), shareTargetBean.getType(), str, MsgConvertUtils.INSTANCE.getOriginContentFromMsgUiData(msgUIData), msgUIData.getMsgType(), 2);
            }
            al2.e.p(this.f103580d.getString(R$string.cbv));
            this.f103581e.dismiss();
            ej2.a.f72257b.a(new e(this.f103578b, wt0.f.SUCCESS, new g(CollectionsKt__CollectionsJVMKt.listOf(this.f103579c.getId()))));
        }
    }

    public final Parcelable a(Parcelable parcelable) {
        if (parcelable instanceof NoteItemBean) {
            return k(new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null), (NoteItemBean) parcelable);
        }
        if (parcelable instanceof ShareToChatBean) {
            ShareToChatBean shareToChatBean = (ShareToChatBean) parcelable;
            if (as0.a.f4901a.a().contains(shareToChatBean.getType())) {
                return c(shareToChatBean);
            }
            return null;
        } else if (parcelable instanceof ShareUserToChatBean) {
            return n((ShareUserToChatBean) parcelable);
        } else {
            if (parcelable instanceof SharePagesToChatBean) {
                return g((SharePagesToChatBean) parcelable);
            }
            if (parcelable instanceof ShareGoodsToChatBean) {
                return f((ShareGoodsToChatBean) parcelable);
            }
            if (parcelable instanceof ShareHeyToChatBean) {
                return h((ShareHeyToChatBean) parcelable);
            }
            if (parcelable instanceof ShareLiveToChatBean) {
                return i((ShareLiveToChatBean) parcelable);
            }
            if (parcelable instanceof ShareCenterToChatBean) {
                return d((ShareCenterToChatBean) parcelable);
            }
            if (parcelable instanceof ShareEventToChatBean) {
                return e((ShareEventToChatBean) parcelable);
            }
            if (parcelable instanceof ShareTopicToChatBean) {
                return m((ShareTopicToChatBean) parcelable);
            }
            if (parcelable instanceof MiniCommonToChatBean) {
                return j((MiniCommonToChatBean) parcelable);
            }
            if (parcelable instanceof MsgUIData) {
                return parcelable;
            }
            return null;
        }
    }

    public final String b(String str, String str2) {
        if (str.length() == 0) {
            return "";
        }
        String str3 = StringsKt__StringsJVMKt.replace$default(str, "https://www.xiaohongshu.com/discovery/", "xhsdiscover://", false, 4, (Object) null) + "&type=" + str2 + "&sourceId=message&feedType=single";
        return !(StringsKt__StringsKt.contains$default(str3, '?', false, 2, null)) ? StringsKt__StringsJVMKt.replaceFirst$default(str3, (char) Typography.amp, '?', false, 4, (Object) null) : str3;
    }

    public final MsgMultiBean c(ShareToChatBean shareToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setTitle(shareToChatBean.getTitle());
        String content = shareToChatBean.getContent();
        String str = "";
        if (content == null) {
            content = str;
        }
        msgMultiBean.setContent(content);
        String content2 = shareToChatBean.getContent();
        if (content2 != null) {
            str = content2;
        }
        msgMultiBean.setDesc(str);
        msgMultiBean.setType(shareToChatBean.getType());
        msgMultiBean.setLink(shareToChatBean.getLink());
        msgMultiBean.setUser(shareToChatBean.getSendUser());
        msgMultiBean.setImage(shareToChatBean.getImage());
        msgMultiBean.setCover(shareToChatBean.getCover());
        return msgMultiBean;
    }

    public final MsgMultiBean d(ShareCenterToChatBean shareCenterToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setDesc(shareCenterToChatBean.getDesc());
        msgMultiBean.setTitle(shareCenterToChatBean.getTitle());
        msgMultiBean.setType("center");
        msgMultiBean.setAvatar(shareCenterToChatBean.getAvatar());
        msgMultiBean.setButton(new ChatBtnBean(null, shareCenterToChatBean.getBtn(), 1, null));
        msgMultiBean.setLink(shareCenterToChatBean.getLink());
        return msgMultiBean;
    }

    public final MsgMultiBean e(ShareEventToChatBean shareEventToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setDesc(shareEventToChatBean.getDesc());
        msgMultiBean.setTitle(shareEventToChatBean.getTitle());
        msgMultiBean.setType("event");
        msgMultiBean.setImage(shareEventToChatBean.getImage());
        msgMultiBean.setButton(new ChatBtnBean(null, shareEventToChatBean.getButton(), 1, null));
        msgMultiBean.setLink(shareEventToChatBean.getLink());
        return msgMultiBean;
    }

    public final MsgMultiBean f(ShareGoodsToChatBean shareGoodsToChatBean) {
        Intrinsics.checkNotNullParameter(shareGoodsToChatBean, "data");
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setTitle(shareGoodsToChatBean.getDesc());
        msgMultiBean.setContent("");
        msgMultiBean.setDesc(shareGoodsToChatBean.getBrandName());
        msgMultiBean.setType(shareGoodsToChatBean.getType());
        msgMultiBean.setLink(shareGoodsToChatBean.getLink());
        msgMultiBean.setImage(shareGoodsToChatBean.getImage());
        msgMultiBean.setCover(shareGoodsToChatBean.getImage());
        msgMultiBean.setAvatar(shareGoodsToChatBean.getAvatar());
        msgMultiBean.setBrandName(shareGoodsToChatBean.getBrandName());
        msgMultiBean.setOfficialVerifyType(Integer.valueOf(shareGoodsToChatBean.getOfficialVerifyType()));
        msgMultiBean.setPrice(shareGoodsToChatBean.getPrice());
        msgMultiBean.setId(shareGoodsToChatBean.getId());
        return msgMultiBean;
    }

    public final MsgMultiBean g(SharePagesToChatBean sharePagesToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        String brandName = sharePagesToChatBean.getBrandName();
        String desc = sharePagesToChatBean.getDesc();
        msgMultiBean.setTitle(brandName + desc);
        String noteNum = sharePagesToChatBean.getNoteNum();
        msgMultiBean.setContent(noteNum + "篇笔记");
        String noteNum2 = sharePagesToChatBean.getNoteNum();
        msgMultiBean.setDesc(noteNum2 + "篇笔记");
        msgMultiBean.setType(sharePagesToChatBean.getType());
        msgMultiBean.setImage(sharePagesToChatBean.getImage());
        msgMultiBean.setCover(sharePagesToChatBean.getImage());
        msgMultiBean.setBrandName(sharePagesToChatBean.getBrandName());
        msgMultiBean.setNoteNum(sharePagesToChatBean.getNoteNum());
        msgMultiBean.setRankTitle(sharePagesToChatBean.getRankTitle());
        msgMultiBean.setRankType(sharePagesToChatBean.getRankType());
        msgMultiBean.setRanking(sharePagesToChatBean.getRanking());
        msgMultiBean.setLink(sharePagesToChatBean.getLink());
        msgMultiBean.setId(sharePagesToChatBean.getId());
        return msgMultiBean;
    }

    public final MsgMultiBean h(ShareHeyToChatBean shareHeyToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setContent("");
        msgMultiBean.setType(shareHeyToChatBean.getType());
        msgMultiBean.setCover(shareHeyToChatBean.getCover());
        msgMultiBean.setImage(shareHeyToChatBean.getCover());
        msgMultiBean.setId(shareHeyToChatBean.getId());
        msgMultiBean.setHeyType(shareHeyToChatBean.getHeyType());
        msgMultiBean.setLink(shareHeyToChatBean.getLink());
        msgMultiBean.setUser(new MsgUserBean(false, false, shareHeyToChatBean.getNickname(), null, 0, shareHeyToChatBean.getUserId(), shareHeyToChatBean.getAvatar(), null, null, false, false, false, false, 0, 16283, null));
        return msgMultiBean;
    }

    public final MsgMultiBean i(ShareLiveToChatBean shareLiveToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setTitle(shareLiveToChatBean.getTitle());
        msgMultiBean.setImage(shareLiveToChatBean.getImage());
        msgMultiBean.setType(shareLiveToChatBean.getType());
        msgMultiBean.setLink(shareLiveToChatBean.getLink());
        msgMultiBean.setTagName(shareLiveToChatBean.getTagName());
        msgMultiBean.setShowLabel(shareLiveToChatBean.getTagName());
        msgMultiBean.setUser(new MsgUserBean(false, false, shareLiveToChatBean.getUsername(), shareLiveToChatBean.getAvatar(), shareLiveToChatBean.getOfficialVerifyType(), shareLiveToChatBean.getUserId(), null, null, null, false, false, false, false, 0, 16323, null));
        return msgMultiBean;
    }

    public final MsgMultiBean j(MiniCommonToChatBean miniCommonToChatBean) {
        Intrinsics.checkNotNullParameter(miniCommonToChatBean, "data");
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setDesc(miniCommonToChatBean.getDesc());
        msgMultiBean.setTitle(miniCommonToChatBean.getTitle());
        msgMultiBean.setType(miniCommonToChatBean.getType());
        msgMultiBean.setImage(miniCommonToChatBean.getImage());
        msgMultiBean.setLink(miniCommonToChatBean.getLink());
        msgMultiBean.setId(miniCommonToChatBean.getId());
        return msgMultiBean;
    }

    public final MsgMultiBean k(MsgMultiBean msgMultiBean, NoteItemBean noteItemBean) {
        String str;
        String str2;
        String str3;
        String link;
        ShareInfoDetail shareInfoDetail = noteItemBean.shareInfo;
        String str4 = "";
        if (shareInfoDetail == null || (str = shareInfoDetail.getTitle()) == null) {
            str = str4;
        }
        msgMultiBean.setTitle(str);
        msgMultiBean.setNoteType(noteItemBean.getType());
        ShareInfoDetail shareInfoDetail2 = noteItemBean.shareInfo;
        if (shareInfoDetail2 == null || (str2 = shareInfoDetail2.getImage()) == null) {
            str2 = str4;
        }
        msgMultiBean.setCover(str2);
        ShareInfoDetail shareInfoDetail3 = noteItemBean.shareInfo;
        if (shareInfoDetail3 == null || (str3 = shareInfoDetail3.getImage()) == null) {
            str3 = str4;
        }
        msgMultiBean.setImage(str3);
        x0 x0Var = f103576a;
        ShareInfoDetail shareInfoDetail4 = noteItemBean.shareInfo;
        if (!(shareInfoDetail4 == null || (link = shareInfoDetail4.getLink()) == null)) {
            str4 = link;
        }
        msgMultiBean.setLink(x0Var.b(str4, msgMultiBean.getNoteType()));
        String id3 = noteItemBean.getId();
        Intrinsics.checkNotNullExpressionValue(id3, "note.id");
        msgMultiBean.setId(id3);
        msgMultiBean.setType("note");
        MsgUserBean msgUserBean = new MsgUserBean(false, false, null, null, 0, null, null, null, null, false, false, false, false, 0, 16383, null);
        msgUserBean.setNickname(noteItemBean.getUser().getNickname());
        msgUserBean.setAvatar(noteItemBean.getUser().getImage());
        msgUserBean.setOfficalVerifyType(noteItemBean.getUser().getRedOfficialVerifyType());
        msgUserBean.setId(noteItemBean.getUser().getId());
        msgUserBean.setImage(noteItemBean.getUser().getImage());
        msgMultiBean.setUser(msgUserBean);
        return msgMultiBean;
    }

    public final MsgMultiBean l(NoteToChatBean noteToChatBean) {
        Intrinsics.checkNotNullParameter(noteToChatBean, "note");
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setTitle(noteToChatBean.getTitle());
        msgMultiBean.setNoteType(noteToChatBean.getType());
        msgMultiBean.setCover(noteToChatBean.getImage());
        msgMultiBean.setImage(noteToChatBean.getImage());
        msgMultiBean.setId(noteToChatBean.getId());
        msgMultiBean.setType("note");
        MsgUserBean msgUserBean = new MsgUserBean(false, false, null, null, 0, null, null, null, null, false, false, false, false, 0, 16383, null);
        msgUserBean.setNickname(noteToChatBean.getUserName());
        msgUserBean.setAvatar(noteToChatBean.getUserAvatar());
        msgUserBean.setOfficalVerifyType(noteToChatBean.getRedOfficialVerifyType());
        msgUserBean.setId(noteToChatBean.getUserId());
        msgUserBean.setImage(noteToChatBean.getUserAvatar());
        msgMultiBean.setUser(msgUserBean);
        return msgMultiBean;
    }

    public final MsgMultiBean m(ShareTopicToChatBean shareTopicToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setDesc(shareTopicToChatBean.getDesc());
        msgMultiBean.setTitle(shareTopicToChatBean.getTitle());
        msgMultiBean.setType(HashTagListBean.HashTag.TYPE_TOPIC);
        msgMultiBean.setImage(shareTopicToChatBean.getImage());
        msgMultiBean.setLink(shareTopicToChatBean.getLink());
        return msgMultiBean;
    }

    public final MsgMultiBean n(ShareUserToChatBean shareUserToChatBean) {
        MsgMultiBean msgMultiBean = new MsgMultiBean(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 0, null, 0, null, null, null, null, null, 0, null, null, null, false, null, null, null, null, null, null, null, null, null, -1, 65535, null);
        msgMultiBean.setTitle(shareUserToChatBean.getUserName());
        msgMultiBean.setContent(shareUserToChatBean.getDesc());
        msgMultiBean.setDesc(shareUserToChatBean.getDesc());
        msgMultiBean.setType(shareUserToChatBean.getType());
        msgMultiBean.setImage(shareUserToChatBean.getAvatar());
        msgMultiBean.setCover(shareUserToChatBean.getAvatar());
        msgMultiBean.setAvatar(shareUserToChatBean.getAvatar());
        msgMultiBean.setOfficialVerifyType(Integer.valueOf(shareUserToChatBean.getOfficialVerifyType()));
        msgMultiBean.setRedOfficialVerifyShowIcon(shareUserToChatBean.getRedOfficialVerifyShowIcon());
        msgMultiBean.setOfficialVerifyContent(shareUserToChatBean.getOfficialVerifyContent());
        msgMultiBean.setNotes(shareUserToChatBean.getNotes());
        msgMultiBean.setFans(shareUserToChatBean.getFans());
        msgMultiBean.setBackground(shareUserToChatBean.getBackground());
        msgMultiBean.setRedNumber(shareUserToChatBean.getRedNumber());
        msgMultiBean.setId(shareUserToChatBean.getUserId());
        String userId = shareUserToChatBean.getUserId();
        msgMultiBean.setLink("xhsdiscover://user/" + userId);
        return msgMultiBean;
    }

    public final void o(String str, int i10, String str2, String str3, int i14, int i15) {
        Intrinsics.checkNotNullParameter(str, "targetId");
        Intrinsics.checkNotNullParameter(str2, "textContent");
        Intrinsics.checkNotNullParameter(str3, RemoteMessageConst.MessageBody.MSG_CONTENT);
        boolean z14 = false;
        if (i10 == 1) {
            i.a aVar = i.f5001a;
            b1 b1Var = b1.f94179a;
            aVar.i(b1Var.S0().getUserid(), str, str3, i14, i15);
            if (str2.length() > 0) {
                z14 = true;
            }
            if (z14) {
                aVar.i(b1Var.S0().getUserid(), str, str2, 1, i15);
            }
        } else if (i10 == 2) {
            i.a aVar2 = i.f5001a;
            b1 b1Var2 = b1.f94179a;
            aVar2.h(b1Var2.S0().getUserid(), str, str3, i14, i15);
            if (str2.length() > 0) {
                z14 = true;
            }
            if (z14) {
                aVar2.h(b1Var2.S0().getUserid(), str, str2, 1, i15);
            }
        }
    }

    public final void p(Context context, Bundle bundle) {
        Parcelable parcelable;
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(bundle, "bundle");
        JSONObject jSONObject = new JSONObject(bundle.getString("data"));
        String string = bundle.getString("data");
        if (string != null) {
            String string2 = jSONObject.getString("type");
            if (Intrinsics.areEqual(string2, LiveWindowConfig.KEY_GOODS_DETAIL)) {
                parcelable = (Parcelable) new Gson().fromJson(string, ShareGoodsToChatBean.class);
            } else if (ArraysKt___ArraysKt.contains(new String[]{"general", "common"}, string2)) {
                parcelable = (Parcelable) new Gson().fromJson(string, ShareToChatBean.class);
            } else if (Intrinsics.areEqual(string2, "center")) {
                parcelable = (Parcelable) new Gson().fromJson(string, ShareCenterToChatBean.class);
            } else if (Intrinsics.areEqual(string2, "event")) {
                parcelable = (Parcelable) new Gson().fromJson(string, ShareEventToChatBean.class);
            } else if (Intrinsics.areEqual(string2, HashTagListBean.HashTag.TYPE_TOPIC)) {
                parcelable = (Parcelable) new Gson().fromJson(string, ShareTopicToChatBean.class);
            } else {
                parcelable = Intrinsics.areEqual(string2, "miniCommon") ? (Parcelable) new Gson().fromJson(string, MiniCommonToChatBean.class) : null;
            }
            Gson gson = new Gson();
            String string3 = bundle.getString("target");
            if (string3 != null) {
                ShareTargetBean shareTargetBean = (ShareTargetBean) gson.fromJson(string3, ShareTargetBean.class);
                String string4 = bundle.getString("business_name", "");
                if (shareTargetBean.getType() != 3 || parcelable == null) {
                    Intrinsics.checkNotNullExpressionValue(shareTargetBean, "targetBean");
                    Intrinsics.checkNotNullExpressionValue(string4, "businessName");
                    s(context, parcelable, shareTargetBean, string4);
                    return;
                }
                RouterBuilder build = Routers.build(Pages.PAGE_SHARE_USER);
                Intrinsics.checkNotNullExpressionValue(string4, "businessName");
                build.with(PageExtensionsKt.toBundle(new SharedUserPage(parcelable, false, string4, 2, null))).open(context);
            }
        }
    }

    public final void q(Context context, Parcelable parcelable, ShareTargetBean shareTargetBean, String str) {
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(parcelable, "shareData");
        Intrinsics.checkNotNullParameter(shareTargetBean, "targetBean");
        Intrinsics.checkNotNullParameter(str, "businessName");
        if (shareTargetBean.getType() == 3) {
            Routers.build(Pages.PAGE_SHARE_USER).with(PageExtensionsKt.toBundle(new SharedUserPage(parcelable, false, str, 2, null))).open(context);
        } else {
            t(parcelable, shareTargetBean, str);
        }
    }

    public final void r(Context context, Bundle bundle) {
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(bundle, "bundle");
        Parcelable parcelable = bundle.getParcelable("data");
        ShareTargetBean shareTargetBean = (ShareTargetBean) bundle.getParcelable("target");
        if (shareTargetBean != null) {
            String string = bundle.getString("business_name", "");
            if (shareTargetBean.getType() != 3 || parcelable == null) {
                Intrinsics.checkNotNullExpressionValue(string, "businessName");
                s(context, parcelable, shareTargetBean, string);
                return;
            }
            Routers.build(Pages.PAGE_SHARE_USER).with(PageExtensionsKt.toBundle(new SharedUserPage(parcelable, false, null, 6, null))).open(context);
        }
    }

    public final void s(Context context, Parcelable parcelable, ShareTargetBean shareTargetBean, String str) {
        String msgId;
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(shareTargetBean, "target");
        Intrinsics.checkNotNullParameter(str, "businessName");
        if (parcelable != null) {
            if (parcelable instanceof NoteItemBean) {
                msgId = ((NoteItemBean) parcelable).getId();
            } else if (parcelable instanceof ShareUserToChatBean) {
                msgId = ((ShareUserToChatBean) parcelable).getUserId();
            } else if (parcelable instanceof SharePagesToChatBean) {
                msgId = ((SharePagesToChatBean) parcelable).getId();
            } else if (parcelable instanceof ShareGoodsToChatBean) {
                msgId = ((ShareGoodsToChatBean) parcelable).getId();
            } else if (parcelable instanceof ShareHeyToChatBean) {
                msgId = ((ShareHeyToChatBean) parcelable).getId();
            } else if (parcelable instanceof MiniCommonToChatBean) {
                msgId = ((MiniCommonToChatBean) parcelable).getId();
            } else {
                msgId = parcelable instanceof MsgUIData ? ((MsgUIData) parcelable).getMsgId() : "";
            }
            Intrinsics.checkNotNullExpressionValue(msgId, "when (shareData) {\n     …     else -> \"\"\n        }");
            nz0.c.f111943a.b(shareTargetBean.getId(), msgId);
            i0 i0Var = new i0(context, parcelable, shareTargetBean);
            i0Var.setCanceledOnTouchOutside(true);
            i0Var.S(new a(parcelable, str, shareTargetBean, context, i0Var, msgId));
            i0Var.show();
        }
    }

    public final void t(Parcelable parcelable, ShareTargetBean shareTargetBean, String str) {
        if (parcelable != null) {
            Parcelable a14 = a(parcelable);
            if (a14 == null) {
                ej2.a.f72257b.a(new e(str, wt0.f.FAILURE, new g(CollectionsKt__CollectionsJVMKt.listOf(shareTargetBean.getId()))));
                return;
            }
            if (a14 instanceof MsgMultiBean) {
                x0 x0Var = f103576a;
                String id3 = shareTargetBean.getId();
                int type = shareTargetBean.getType();
                String json = new Gson().toJson(a14);
                Intrinsics.checkNotNullExpressionValue(json, "Gson().toJson(it)");
                x0Var.o(id3, type, "", json, 3, 2);
            } else if (a14 instanceof MsgUIData) {
                MsgUIData msgUIData = (MsgUIData) a14;
                f103576a.o(shareTargetBean.getId(), shareTargetBean.getType(), "", MsgConvertUtils.INSTANCE.getOriginContentFromMsgUiData(msgUIData), msgUIData.getMsgType(), 2);
            }
            ej2.a.f72257b.a(new e(str, wt0.f.SUCCESS, new g(CollectionsKt__CollectionsJVMKt.listOf(shareTargetBean.getId()))));
        }
    }
}