package com.tencent.mm.plugin.brandservice.ui.timeline.video.a;

import a.f.b.j;
import a.l;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.google.android.gms.common.internal.ImagesContract;
import com.google.android.gms.common.util.CrashUtils.ErrorDialogData;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.af.r;
import com.tencent.mm.bp.d;
import com.tencent.mm.plugin.brandservice.ui.timeline.video.BizVideoDetailUI;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.HashMap;

@l(dWo = {1, 1, 13}, dWp = {"\u0000v\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\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\u0002\n\u0002\u0010\u0006\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J \u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u000e2\u0006\u0010\u0012\u001a\u00020\u0013H\u0007J\u0018\u0010\u0014\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0015\u001a\u00020\u000eH\u0007J\u001a\u0010\u0016\u001a\u0004\u0018\u00010\u00172\u0006\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0011\u001a\u00020\u000eH\u0007J\u001a\u0010\u0018\u001a\u0004\u0018\u00010\u00172\u0006\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0011\u001a\u00020\u000eH\u0007J\u0010\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u0007H\u0007J\u0010\u0010\u001c\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u0010H\u0007J\u0018\u0010\u001d\u001a\u00020\u00072\u0006\u0010\u001e\u001a\u00020\u001f2\u0006\u0010 \u001a\u00020\u0004H\u0007J \u0010!\u001a\u00020\"2\u0006\u0010\u001e\u001a\u00020\u001f2\u0006\u0010\u0012\u001a\u00020\u000e2\u0006\u0010#\u001a\u00020\u0007H\u0007J8\u0010$\u001a\u00020\"2\u0006\u0010\u001e\u001a\u00020\u001f2\u0006\u0010%\u001a\u00020&2\u0006\u0010'\u001a\u00020&2\u0006\u0010(\u001a\u00020\u00042\u0006\u0010)\u001a\u00020*2\u0006\u0010+\u001a\u00020,H\u0007JP\u0010$\u001a\u00020\"2\u0006\u0010\u001e\u001a\u00020\u001f2\u0006\u0010%\u001a\u00020&2\u0006\u0010'\u001a\u00020&2\u0006\u0010(\u001a\u00020\u00042\u0006\u0010-\u001a\u00020\u00042\u0006\u0010.\u001a\u00020\u00042\u0006\u0010/\u001a\u00020\u00042\u0006\u00100\u001a\u00020\u00042\u0006\u0010+\u001a\u00020,H\u0003J\u0018\u00101\u001a\u00020\"2\u0006\u0010\u001b\u001a\u00020\u00072\u0006\u00102\u001a\u00020\u001aH\u0007R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007XD¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000R*\u0010\t\u001a\u001e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u000b0\nj\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u000b`\fX\u0004¢\u0006\u0002\n\u0000¨\u00063"}, dWq = {"Lcom/tencent/mm/plugin/brandservice/ui/timeline/video/util/BizVideoUtil;", "", "()V", "REQUEST_CODE_APP_MSG", "", "REQUEST_SHARE_TO_TIME_LINE", "TAG", "", "maxVideoPlaySaveTime", "playTimeHashMap", "Ljava/util/HashMap;", "Lcom/tencent/mm/plugin/brandservice/ui/timeline/video/util/VideoPlayTime;", "Lkotlin/collections/HashMap;", "convertMsgInfo", "Lcom/tencent/mm/message/MPMsgInfo;", "intent", "Landroid/content/Intent;", "mpMsgInfo", "msgInfo", "Lcom/tencent/mm/storage/MsgInfo;", "convertOtherMsgInfo", "msg", "getBizReaderItem", "Lcom/tencent/mm/message/BizReaderItem;", "getBizReaderItemFromAppMsg", "getLastPlayTime", "", "key", "getMPMsgInfo", "getNumStr", "context", "Landroid/content/Context;", "num", "goToWebViewUI", "", "url", "onVideoMsgClick", "msgId", "", "msgSvrId", "msgIndex", "view", "Landroid/view/View;", "bundle", "Landroid/os/Bundle;", "left", "top", "width", "height", "setLastPlayTime", "time", "plugin-brandservice_release"})
public final class c {
    private static final String TAG = TAG;
    private static final HashMap<String, h> jYu = new HashMap();
    public static final c jYv = new c();

    static {
        AppMethodBeat.i(15324);
        AppMethodBeat.o(15324);
    }

    private c() {
    }

    public static final void a(Context context, long j, long j2, int i, View view, Bundle bundle) {
        AppMethodBeat.i(15318);
        j.p(context, "context");
        j.p(view, "view");
        j.p(bundle, "bundle");
        int[] iArr = new int[2];
        view.getLocationInWindow(iArr);
        int i2 = iArr[0];
        int i3 = iArr[1];
        int width = view.getWidth();
        int height = view.getHeight();
        Intent intent = new Intent(context, BizVideoDetailUI.class);
        intent.putExtra("img_gallery_width", width);
        intent.putExtra("img_gallery_height", height);
        intent.putExtra("img_gallery_left", i2);
        intent.putExtra("img_gallery_top", i3);
        ab.d(TAG, "onVideoMsgClick left %d, top %d, w %d, h %d", new Object[]{Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(width), Integer.valueOf(height)});
        intent.putExtra("biz_video_msg_id", j);
        intent.putExtra("biz_video_msg_svr_index", j2);
        intent.putExtra("KPublisherId", "msg_".concat(String.valueOf(j2)));
        intent.putExtra("biz_video_msg_index", i);
        intent.putExtras(bundle);
        intent.addFlags(ErrorDialogData.BINDER_CRASH);
        context.startActivity(intent);
        AppMethodBeat.o(15318);
    }

    /* JADX WARNING: Removed duplicated region for block: B:15:0x00cd  */
    public static final com.tencent.mm.af.r R(android.content.Intent r14) {
        /*
        r12 = 0;
        r10 = -1;
        r8 = 15319; // 0x3bd7 float:2.1466E-41 double:7.5686E-320;
        r1 = 0;
        r3 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r8);
        r0 = "intent";
        a.f.b.j.p(r14, r0);
        r4 = new com.tencent.mm.af.r;
        r4.<init>();
        r0 = "KPublisherId";
        r0 = r14.getStringExtra(r0);
        r4.fjS = r0;
        r0 = "sns_local_id";
        r0 = r14.getStringExtra(r0);
        r4.cwT = r0;
        r0 = "biz_video_msg_id";
        r6 = r14.getLongExtra(r0, r10);
        r4.cvx = r6;
        r6 = r4.cvx;
        r0 = (r6 > r10 ? 1 : (r6 == r10 ? 0 : -1));
        if (r0 <= 0) goto L_0x0204;
    L_0x0037:
        r0 = com.tencent.mm.plugin.messenger.foundation.a.j.class;
        r0 = com.tencent.mm.kernel.g.K(r0);
        r2 = "MMKernel.service<IMessen…engerStorage::class.java)";
        a.f.b.j.o(r0, r2);
        r0 = (com.tencent.mm.plugin.messenger.foundation.a.j) r0;
        r0 = r0.bOr();
        r6 = r4.cvx;
        r5 = r0.jf(r6);
        r0 = "msgInfo";
        a.f.b.j.o(r5, r0);
        r0 = r5.drC();
        if (r0 != 0) goto L_0x0061;
    L_0x005b:
        r0 = r5.bAA();
        if (r0 == 0) goto L_0x0204;
    L_0x0061:
        r0 = "intent";
        a.f.b.j.p(r14, r0);
        r0 = "mpMsgInfo";
        a.f.b.j.p(r4, r0);
        r0 = "msgInfo";
        a.f.b.j.p(r5, r0);
        r0 = "biz_video_msg_svr_index";
        r6 = r14.getLongExtra(r0, r12);
        r4.cKK = r6;
        r0 = "biz_video_msg_index";
        r0 = r14.getIntExtra(r0, r3);
        r4.fjQ = r0;
        r0 = r5.HE();
        r4.userName = r0;
        r0 = "msgInfo";
        a.f.b.j.p(r5, r0);
        r0 = "mpMsgInfo";
        a.f.b.j.p(r4, r0);
        r0 = r5.drC();
        if (r0 != 0) goto L_0x01b9;
    L_0x009d:
        r0 = r5.bAA();
        if (r0 == 0) goto L_0x01b9;
    L_0x00a3:
        r0 = "msgInfo";
        a.f.b.j.p(r5, r0);
        r0 = "mpMsgInfo";
        a.f.b.j.p(r4, r0);
        r0 = r5.getContent();
        r0 = com.tencent.mm.af.j.b.me(r0);
        if (r0 != 0) goto L_0x0167;
    L_0x00b9:
        r0 = TAG;
        r2 = "parse content fail";
        com.tencent.mm.sdk.platformtools.ab.w(r0, r2);
        r0 = r1;
    L_0x00c2:
        r4.fjT = r0;
        r0 = r5.getType();
        r4.type = r0;
        r0 = 1;
    L_0x00cb:
        if (r0 != 0) goto L_0x0163;
    L_0x00cd:
        r0 = "intent";
        a.f.b.j.p(r14, r0);
        r0 = "msg";
        a.f.b.j.p(r4, r0);
        r0 = "srcUsername";
        r0 = r14.getStringExtra(r0);
        r4.cwG = r0;
        r0 = "srcDisplayname";
        r0 = r14.getStringExtra(r0);
        r4.fjR = r0;
        r0 = r4.fjT;
        r1 = "rawUrl";
        r1 = r14.getStringExtra(r1);
        r0.url = r1;
        r0 = r4.fjT;
        r1 = "biz_video_title";
        r1 = r14.getStringExtra(r1);
        r0.title = r1;
        r0 = r4.fjT;
        r1 = "biz_video_desc";
        r1 = r14.getStringExtra(r1);
        r0.fjz = r1;
        r0 = r4.fjT;
        r1 = "biz_video_icon_url";
        r1 = r14.getStringExtra(r1);
        r0.fjx = r1;
        r0 = r4.fjT;
        r1 = "biz_video_item_show_type";
        r2 = -1;
        r1 = r14.getIntExtra(r1, r2);
        r0.type = r1;
        r0 = r4.fjT;
        r1 = "biz_video_pub_time";
        r6 = r14.getLongExtra(r1, r12);
        r0.time = r6;
        r0 = r4.fjT;
        r1 = "biz_video_duration";
        r1 = r14.getIntExtra(r1, r3);
        r0.fjB = r1;
        r0 = r4.fjT;
        r1 = "biz_video_width";
        r1 = r14.getIntExtra(r1, r3);
        r0.videoWidth = r1;
        r0 = r4.fjT;
        r1 = "biz_video_height";
        r1 = r14.getIntExtra(r1, r3);
        r0.videoHeight = r1;
        r0 = r4.fjT;
        r1 = "biz_video_vid";
        r1 = r14.getStringExtra(r1);
        r0.fgd = r1;
        r0 = "biz_video_func_flag";
        r0 = r14.getIntExtra(r0, r3);
        r4.fgc = r0;
    L_0x0163:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        return r4;
    L_0x0167:
        r2 = new com.tencent.mm.af.p;
        r2.<init>();
        r6 = r0.cMg;
        r4.cwG = r6;
        r6 = r0.cMh;
        r4.fjR = r6;
        r6 = r0.url;
        r2.url = r6;
        r6 = r0.title;
        r2.title = r6;
        r6 = r0.description;
        r2.fjz = r6;
        r6 = r0.thumburl;
        r2.fjx = r6;
        r6 = com.tencent.mm.af.e.class;
        r0 = r0.X(r6);
        r0 = (com.tencent.mm.af.e) r0;
        if (r0 != 0) goto L_0x0199;
    L_0x018e:
        r0 = TAG;
        r2 = "piece content fail";
        com.tencent.mm.sdk.platformtools.ab.w(r0, r2);
        r0 = r1;
        goto L_0x00c2;
    L_0x0199:
        r1 = r0.fgd;
        r2.fgd = r1;
        r1 = r0.fga;
        r6 = (long) r1;
        r2.time = r6;
        r1 = r0.ffZ;
        r2.type = r1;
        r1 = r0.duration;
        r2.fjB = r1;
        r1 = r0.videoWidth;
        r2.videoWidth = r1;
        r1 = r0.videoHeight;
        r2.videoHeight = r1;
        r0 = r0.fgc;
        r4.fgc = r0;
        r0 = r2;
        goto L_0x00c2;
    L_0x01b9:
        r0 = com.tencent.mm.plugin.biz.a.a.class;
        r0 = com.tencent.mm.kernel.g.K(r0);
        r0 = (com.tencent.mm.plugin.biz.a.a) r0;
        r6 = r5.HA();
        r2 = r5.getContent();
        r2 = r0.b(r6, r2);
        if (r2 == 0) goto L_0x01d9;
    L_0x01cf:
        r0 = r2.fjr;
        r0 = (java.util.List) r0;
        r0 = com.tencent.mm.sdk.platformtools.bo.ek(r0);
        if (r0 == 0) goto L_0x01e4;
    L_0x01d9:
        r0 = TAG;
        r2 = "getBizReaderItem reader is null";
        com.tencent.mm.sdk.platformtools.ab.w(r0, r2);
        r0 = r1;
        goto L_0x00c2;
    L_0x01e4:
        r0 = r4.fjQ;
        r1 = r2.fjr;
        r1 = r1.size();
        if (r0 < r1) goto L_0x01f8;
    L_0x01ee:
        r0 = r2.fjr;
        r0 = r0.get(r3);
        r0 = (com.tencent.mm.af.p) r0;
        goto L_0x00c2;
    L_0x01f8:
        r0 = r2.fjr;
        r1 = r4.fjQ;
        r0 = r0.get(r1);
        r0 = (com.tencent.mm.af.p) r0;
        goto L_0x00c2;
    L_0x0204:
        r0 = r3;
        goto L_0x00cb;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.brandservice.ui.timeline.video.a.c.R(android.content.Intent):com.tencent.mm.af.r");
    }

    /* JADX WARNING: Missing block: B:10:0x0038, code skipped:
            if (r0.equals("zh_CN") != false) goto L_0x003a;
     */
    /* JADX WARNING: Missing block: B:11:0x003a, code skipped:
            r0 = r4.getString(2131305919);
     */
    /* JADX WARNING: Missing block: B:12:0x0041, code skipped:
            if (r5 < 100000) goto L_0x0071;
     */
    /* JADX WARNING: Missing block: B:13:0x0043, code skipped:
            r0 = "10" + r0 + '+';
            com.tencent.matrix.trace.core.AppMethodBeat.o(15320);
     */
    /* JADX WARNING: Missing block: B:15:0x0064, code skipped:
            if (r0.equals("zh_TW") != false) goto L_0x003a;
     */
    /* JADX WARNING: Missing block: B:17:0x006e, code skipped:
            if (r0.equals("zh_HK") != false) goto L_0x003a;
     */
    /* JADX WARNING: Missing block: B:18:0x0071, code skipped:
            r0 = (r5 / 10000) + '.' + ((r5 % 10000) / org.xwalk.core.XWalkFeature.INTERFACE_GEO_LOCATION_PERMISSION) + r0;
            com.tencent.matrix.trace.core.AppMethodBeat.o(15320);
     */
    /* JADX WARNING: Missing block: B:22:?, code skipped:
            return r0;
     */
    /* JADX WARNING: Missing block: B:23:?, code skipped:
            return r0;
     */
    public static final java.lang.String G(android.content.Context r4, int r5) {
        /*
        r2 = 100000; // 0x186a0 float:1.4013E-40 double:4.94066E-319;
        r3 = 15320; // 0x3bd8 float:2.1468E-41 double:7.569E-320;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r3);
        r0 = "context";
        a.f.b.j.p(r4, r0);
        r0 = 10000; // 0x2710 float:1.4013E-41 double:4.9407E-320;
        if (r5 >= r0) goto L_0x001a;
    L_0x0012:
        r0 = java.lang.String.valueOf(r5);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
    L_0x0019:
        return r0;
    L_0x001a:
        r0 = com.tencent.mm.sdk.platformtools.aa.dor();
        if (r0 != 0) goto L_0x0029;
    L_0x0020:
        if (r5 < r2) goto L_0x0096;
    L_0x0022:
        r0 = "100k+";
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
        goto L_0x0019;
    L_0x0029:
        r1 = r0.hashCode();
        switch(r1) {
            case 115861276: goto L_0x0031;
            case 115861428: goto L_0x0067;
            case 115861812: goto L_0x005d;
            default: goto L_0x0030;
        };
    L_0x0030:
        goto L_0x0020;
    L_0x0031:
        r1 = "zh_CN";
        r0 = r0.equals(r1);
        if (r0 == 0) goto L_0x0020;
    L_0x003a:
        r0 = 2131305919; // 0x7f0925bf float:1.8230022E38 double:1.0530050354E-314;
        r0 = r4.getString(r0);
        if (r5 < r2) goto L_0x0071;
    L_0x0043:
        r1 = new java.lang.StringBuilder;
        r2 = "10";
        r1.<init>(r2);
        r0 = r1.append(r0);
        r1 = 43;
        r0 = r0.append(r1);
        r0 = r0.toString();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
        goto L_0x0019;
    L_0x005d:
        r1 = "zh_TW";
        r0 = r0.equals(r1);
        if (r0 == 0) goto L_0x0020;
    L_0x0066:
        goto L_0x003a;
    L_0x0067:
        r1 = "zh_HK";
        r0 = r0.equals(r1);
        if (r0 == 0) goto L_0x0020;
    L_0x0070:
        goto L_0x003a;
    L_0x0071:
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r2 = r5 / 10000;
        r1 = r1.append(r2);
        r2 = 46;
        r1 = r1.append(r2);
        r2 = r5 % 10000;
        r2 = r2 / 1000;
        r1 = r1.append(r2);
        r0 = r1.append(r0);
        r0 = r0.toString();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
        goto L_0x0019;
    L_0x0096:
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = r5 / 1000;
        r0 = r0.append(r1);
        r1 = 107; // 0x6b float:1.5E-43 double:5.3E-322;
        r0 = r0.append(r1);
        r0 = r0.toString();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r3);
        goto L_0x0019;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.brandservice.ui.timeline.video.a.c.G(android.content.Context, int):java.lang.String");
    }

    public static final void a(Context context, r rVar, String str) {
        AppMethodBeat.i(15321);
        j.p(context, "context");
        j.p(rVar, "msgInfo");
        j.p(str, ImagesContract.URL);
        Intent intent = new Intent();
        intent.putExtra("KPublisherId", rVar.fjS);
        intent.putExtra("pre_username", rVar.HE());
        intent.putExtra("preUsername", rVar.HE());
        intent.putExtra("preChatName", rVar.HE());
        intent.putExtra("rawUrl", str);
        intent.putExtra("geta8key_username", rVar.HE());
        d.b(context, "webview", ".ui.tools.WebViewUI", intent);
        AppMethodBeat.o(15321);
    }

    public static final double Gg(String str) {
        AppMethodBeat.i(15322);
        j.p(str, "key");
        h hVar = (h) jYu.get(str);
        if (hVar == null) {
            AppMethodBeat.o(15322);
            return 0.0d;
        } else if (System.currentTimeMillis() - hVar.jYX > 180000) {
            AppMethodBeat.o(15322);
            return 0.0d;
        } else {
            double d = hVar.jYY;
            AppMethodBeat.o(15322);
            return d;
        }
    }

    public static final void e(String str, double d) {
        AppMethodBeat.i(15323);
        j.p(str, "key");
        jYu.put(str, new h(System.currentTimeMillis(), d));
        AppMethodBeat.o(15323);
    }
}
