package com.ss.android.ugc.aweme.poi.collect;

import X.4HR;
import X.4r1;
import X.7XQ;
import X.BC8;
import X.BCS;
import X.BCW;
import X.C0479A4l;
import X.DWM;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.bytedance.ext_power_list.AssemListViewModel;

public final class PoiCollectListViewModel extends AssemListViewModel<BCS, BC8, 7XQ> {
    static {
        Covode.recordClassIndex(97370);
    }

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

    public final void newState(DWM<BC8> dwm) {
        M12.LIZ(dwm);
        setState(new BCW(dwm));
    }

    public final Object onRefresh(4r1<? super C0479A4l<7XQ>> r3) {
        return onLoadMore(new 7XQ(0), r3);
    }

    /* JADX WARNING: Removed duplicated region for block: B:11:0x002d  */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x0061 A[Catch:{ Exception -> 0x00bc }] */
    /* JADX WARNING: Removed duplicated region for block: B:33:0x00ae A[Catch:{ Exception -> 0x00bc }] */
    /* JADX WARNING: Removed duplicated region for block: B:7:0x001c  */
    /* renamed from: LIZ */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final java.lang.Object onLoadMore(X.7XQ r9, X.4r1<? super X.C0479A4l<X.7XQ>> r10) {
        /*
            r8 = this;
            boolean r0 = r10 instanceof X.BCZ
            if (r0 == 0) goto L_0x001f
            r3 = r10
            X.BCZ r3 = (X.BCZ) r3
            int r0 = r3.label
            r1 = -2147483648(0xffffffff80000000, float:-0.0)
            r0 = r0 & r1
            if (r0 == 0) goto L_0x001f
            int r0 = r3.label
            int r0 = r0 - r1
            r3.label = r0
        L_0x0013:
            java.lang.Object r7 = r3.result
            X.Cof r4 = X.Cof.COROUTINE_SUSPENDED
            int r0 = r3.label
            r6 = 1
            if (r0 == 0) goto L_0x002d
            if (r0 != r6) goto L_0x0025
            goto L_0x0058
        L_0x001f:
            X.BCZ r3 = new X.BCZ
            r3.<init>(r8, r10)
            goto L_0x0013
        L_0x0025:
            java.lang.IllegalStateException r1 = new java.lang.IllegalStateException
            java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
            r1.<init>(r0)
            throw r1
        L_0x002d:
            X.2th.LIZ(r7)
            java.lang.String r1 = com.ss.android.ugc.aweme.app.api.Api.LIZLLL     // Catch:{ Exception -> 0x00bc }
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)     // Catch:{ Exception -> 0x00bc }
            com.bytedance.ies.ugc.aweme.network.IRetrofitFactory r0 = X.2b0.LIZ()     // Catch:{ Exception -> 0x00bc }
            X.2XC r1 = r0.LIZ(r1)     // Catch:{ Exception -> 0x00bc }
            java.lang.Class<com.ss.android.ugc.aweme.poi.collect.PoiCollectApi> r0 = com.ss.android.ugc.aweme.poi.collect.PoiCollectApi.class
            java.lang.Object r2 = r1.LIZ(r0)     // Catch:{ Exception -> 0x00bc }
            com.ss.android.ugc.aweme.poi.collect.PoiCollectApi r2 = (com.ss.android.ugc.aweme.poi.collect.PoiCollectApi) r2     // Catch:{ Exception -> 0x00bc }
            int r1 = r9.LIZ     // Catch:{ Exception -> 0x00bc }
            r0 = 20
            X.PgU r0 = r2.getPoiCollectList(r1, r0)     // Catch:{ Exception -> 0x00bc }
            r3.label = r6     // Catch:{ Exception -> 0x00bc }
            java.lang.Object r7 = X.F3Z.LIZ(r0, r3)     // Catch:{ Exception -> 0x00bc }
            if (r7 != r4) goto L_0x005b
            return r4
        L_0x0058:
            X.2th.LIZ(r7)     // Catch:{ Exception -> 0x00bc }
        L_0x005b:
            X.BCX r7 = (X.BCX) r7     // Catch:{ Exception -> 0x00bc }
            int r0 = r7.status_code     // Catch:{ Exception -> 0x00bc }
            if (r0 != 0) goto L_0x00ae
            java.util.List<X.BCY> r1 = r7.LIZIZ     // Catch:{ Exception -> 0x00bc }
            if (r1 == 0) goto L_0x008f
            java.util.ArrayList r5 = new java.util.ArrayList     // Catch:{ Exception -> 0x00bc }
            r0 = 10
            int r0 = X.9HM.LIZ(r1, r0)     // Catch:{ Exception -> 0x00bc }
            r5.<init>(r0)     // Catch:{ Exception -> 0x00bc }
            java.util.Iterator r4 = r1.iterator()     // Catch:{ Exception -> 0x00bc }
        L_0x0074:
            boolean r0 = r4.hasNext()     // Catch:{ Exception -> 0x00bc }
            if (r0 == 0) goto L_0x0092
            java.lang.Object r0 = r4.next()     // Catch:{ Exception -> 0x00bc }
            X.BCY r0 = (X.BCY) r0     // Catch:{ Exception -> 0x00bc }
            X.BC8 r3 = new X.BC8     // Catch:{ Exception -> 0x00bc }
            java.lang.String r2 = r0.LIZ     // Catch:{ Exception -> 0x00bc }
            java.lang.String r1 = r0.LIZIZ     // Catch:{ Exception -> 0x00bc }
            java.lang.String r0 = r0.LIZJ     // Catch:{ Exception -> 0x00bc }
            r3.<init>(r2, r1, r0)     // Catch:{ Exception -> 0x00bc }
            r5.add(r3)     // Catch:{ Exception -> 0x00bc }
            goto L_0x0074
        L_0x008f:
            X.Lel r5 = X.Lel.INSTANCE     // Catch:{ Exception -> 0x00bc }
            goto L_0x0094
        L_0x0092:
            java.util.List r5 = (java.util.List) r5     // Catch:{ Exception -> 0x00bc }
        L_0x0094:
            int r0 = r7.LIZJ     // Catch:{ Exception -> 0x00bc }
            if (r0 != r6) goto L_0x00a7
            X.A4n r3 = X.C0479A4l.LIZ     // Catch:{ Exception -> 0x00bc }
            r2 = 0
            X.7XQ r1 = new X.7XQ     // Catch:{ Exception -> 0x00bc }
            int r0 = r7.LIZ     // Catch:{ Exception -> 0x00bc }
            r1.<init>(r0)     // Catch:{ Exception -> 0x00bc }
            X.A4p r0 = X.C0481A4n.LIZ(r3, r2, r1, r5, r6)     // Catch:{ Exception -> 0x00bc }
            return r0
        L_0x00a7:
            X.A4n r0 = X.C0479A4l.LIZ     // Catch:{ Exception -> 0x00bc }
            X.A4o r0 = r0.LIZ((java.util.List<? extends X.DaP>) r5)     // Catch:{ Exception -> 0x00bc }
            return r0
        L_0x00ae:
            X.A4n r2 = X.C0479A4l.LIZ     // Catch:{ Exception -> 0x00bc }
            java.lang.Exception r1 = new java.lang.Exception     // Catch:{ Exception -> 0x00bc }
            java.lang.String r0 = "something is error"
            r1.<init>(r0)     // Catch:{ Exception -> 0x00bc }
            X.A4m r0 = r2.LIZ((java.lang.Exception) r1)     // Catch:{ Exception -> 0x00bc }
            return r0
        L_0x00bc:
            r1 = move-exception
            X.A4n r0 = X.C0479A4l.LIZ
            X.A4m r0 = r0.LIZ((java.lang.Exception) r1)
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.poi.collect.PoiCollectListViewModel.onLoadMore(X.7XQ, X.4r1):java.lang.Object");
    }
}
