package com.bytedance.android.livesdk.share;

import X.0CH;
import X.0cm;
import X.0yx;
import X.14E;
import X.14F;
import X.154;
import X.1c5;
import X.1hK;
import X.C1856GIv;
import X.C2704GgT;
import X.C6455Hzs;
import X.GBH;
import X.GRE;
import X.GSA;
import X.GYU;
import X.GYX;
import X.J7M;
import X.JRW;
import X.PgU;
import android.content.Context;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.live.share.IShareService;
import com.bytedance.android.live.share.ShareApi;
import com.bytedance.android.livesdk.LiveDialogFragment;
import com.bytedance.android.livesdk.chatroom.model.ShareReportResult;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.android.livesdkapi.host.IHostShare;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import com.bytedance.ies.sdk.widgets.LiveWidget;
import java.util.List;

public class ShareService implements IShareService {
    public 14E shareCenter;

    static {
        Covode.recordClassIndex(20766);
    }

    public String getShareUrl(User user) {
        return null;
    }

    public void onInit() {
    }

    public LiveWidget getShareWidget() {
        return new LiveShareWidget();
    }

    public 14F provideShareCountManager() {
        return new GSA();
    }

    public 14E share() {
        if (this.shareCenter == null) {
            this.shareCenter = new GYX(0cm.LIZ(IHostShare.class));
        }
        return this.shareCenter;
    }

    public boolean shareable(Room room) {
        if (room == null || room.getOwner() == null || room.getOwner().getSecret() == 1) {
            return false;
        }
        if (room.getRoomAuthStatus() == null || room.getRoomAuthStatus().isEnableShare()) {
            return true;
        }
        return false;
    }

    public LiveDialogFragment getLiveShareDialog(C2704GgT ggT, J7M j7m) {
        return LiveShareDialog.LIZ(ggT, j7m);
    }

    public 154 getShareBehavior(1hK r2, Context context, C1856GIv gIv, 0CH r5) {
        return new GYU(r2, context, gIv, r5);
    }

    public List<JRW> provideLiveSheetActions(C1856GIv gIv, Room room, DataChannel dataChannel, boolean z) {
        return GBH.LIZ.LIZ(gIv, room, dataChannel, z);
    }

    public PgU<1c5<ShareReportResult>> sendShare(long j, String str, int i, String str2, String str3, String str4) {
        if (str3 == null) {
            str3 = "";
        }
        GRE gre = new GRE();
        gre.LIZ("target_id", "-1");
        gre.LIZ("share_type", String.valueOf(i));
        gre.LIZ("common_label_list", String.valueOf(str2));
        gre.LIZ("to_user_ids", str3.replaceAll(" ", ""));
        gre.LIZ("enter_from", str4);
        return ((ShareApi) 0yx.LIZ().LIZ(ShareApi.class)).sendShare(j, gre.LIZ).LIZ(new C6455Hzs());
    }
}
