package com.strmr.ps.ui.mobile.usercollection;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.o;
import androidx.lifecycle.as;
import androidx.lifecycle.at;
import androidx.lifecycle.n;
import androidx.lifecycle.s;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.upstream.CmcdData;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.view.fragment.d;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.button.MaterialButton;
import com.strmr.ps.R;
import com.strmr.ps.data.local.entity.PlaybackProgress;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.repository.TraktStatusProvider;
import com.strmr.ps.ui.contextmenu.ContextMenuActionHandler;
import com.strmr.ps.ui.contextmenu.h;
import com.strmr.ps.ui.mobile.usercollection.MobileUserCollectionContentFragment;
import com.strmr.ps.ui.mobile.usercollection.b;
import com.strmr.ps.ui.usercollection.UserCollectionContentViewModel;
import com.strmr.ps.ui.util.DimensionScaler;
import dagger.hilt.android.AndroidEntryPoint;
import defpackage.C0597ki6;
import defpackage.af1;
import defpackage.ah;
import defpackage.cr4;
import defpackage.d36;
import defpackage.d75;
import defpackage.e6a;
import defpackage.hn2;
import defpackage.i64;
import defpackage.i85;
import defpackage.ika;
import defpackage.io6;
import defpackage.iw7;
import defpackage.j65;
import defpackage.jka;
import defpackage.jn2;
import defpackage.kw7;
import defpackage.lr3;
import defpackage.mb1;
import defpackage.mia;
import defpackage.n89;
import defpackage.qq3;
import defpackage.r76;
import defpackage.s16;
import defpackage.sm3;
import defpackage.sq3;
import defpackage.sr3;
import defpackage.u55;
import defpackage.v65;
import defpackage.vh6;
import defpackage.vx8;
import defpackage.wm1;
import defpackage.y41;
import defpackage.zd;
import defpackage.zr7;
import defpackage.zs6;
import defpackage.zw8;
import java.util.List;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0007\u0018\u00002\u00020\u0001:\u0001\u0004B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0005"}, d2 = {"Lcom/strmr/ps/ui/mobile/usercollection/MobileUserCollectionContentFragment;", "Landroidx/fragment/app/o;", "<init>", "()V", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@AndroidEntryPoint
@vx8
public final class MobileUserCollectionContentFragment extends i64 {
    public sm3 f;
    public final vh6 i;
    public final as j;
    public DimensionScaler k;
    public ContextMenuActionHandler l;
    public TraktStatusProvider m;
    public com.strmr.ps.ui.contextmenu.h n;
    public d36 o;
    public s16 p;
    public final RecyclerView.v q;
    public a r;

    /* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
    /* JADX WARN: Unknown enum class pattern. Please report as an issue! */
    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0000\b\u0082\u0081\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001¨\u0006\u0002"}, d2 = {"Lcom/strmr/ps/ui/mobile/usercollection/MobileUserCollectionContentFragment$a;", "", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class a {
        public static final a a;
        public static final a b;
        public static final a c;
        public static final /* synthetic */ a[] d;
        public static final /* synthetic */ hn2 e;

        static {
            a aVar = new a("UNDETERMINED", 0);
            a = aVar;
            a aVar2 = new a("GRID", 1);
            b = aVar2;
            a aVar3 = new a("ROWS", 2);
            c = aVar3;
            a[] aVarArr = {aVar, aVar2, aVar3};
            d = aVarArr;
            e = jn2.a(aVarArr);
        }

        public static a valueOf(String str) {
            return (a) Enum.valueOf(a.class, str);
        }

        public static a[] values() {
            return (a[]) d.clone();
        }
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public /* synthetic */ class b {
        static {
            int[] iArr = new int[a.values().length];
            try {
                iArr[1] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a aVar = a.a;
                iArr[2] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a aVar2 = a.a;
                iArr[0] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class c implements zs6, sr3 {
        public final /* synthetic */ sq3 a;

        public c(sq3 sq3Var) {
            this.a = sq3Var;
        }

        @Override // defpackage.zs6
        public final /* synthetic */ void a(Object obj) {
            this.a.invoke(obj);
        }

        @Override // defpackage.sr3
        public final lr3 b() {
            return this.a;
        }

        public final boolean equals(Object obj) {
            if (!(obj instanceof zs6) || !(obj instanceof sr3)) {
                return false;
            }
            return this.a.equals(((sr3) obj).b());
        }

        public final int hashCode() {
            return this.a.hashCode();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Luh6;", "Args", "Landroid/os/Bundle;", "invoke", "()Landroid/os/Bundle;", "um3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class d extends u55 implements qq3<Bundle> {
        public d() {
            super(0);
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            MobileUserCollectionContentFragment mobileUserCollectionContentFragment = MobileUserCollectionContentFragment.this;
            Bundle arguments = mobileUserCollectionContentFragment.getArguments();
            if (arguments != null) {
                return arguments;
            }
            throw new IllegalStateException("Fragment " + mobileUserCollectionContentFragment + " has null arguments");
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Landroidx/fragment/app/o;", "invoke", "()Landroidx/fragment/app/o;", "cp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class e extends u55 implements qq3<o> {
        public e() {
            super(0);
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            return MobileUserCollectionContentFragment.this;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Ljka;", "invoke", "()Ljka;", "hp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class f extends u55 implements qq3<jka> {
        public final /* synthetic */ e a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public f(e eVar) {
            super(0);
            this.a = eVar;
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            return (jka) this.a.invoke();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Lika;", "invoke", "()Lika;", "dp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class g extends u55 implements qq3<ika> {
        public final /* synthetic */ Object a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public g(j65 j65Var) {
            super(0);
            this.a = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            return ((jka) this.a.getValue()).getViewModelStore();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Lwm1;", "invoke", "()Lwm1;", "ep3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class h extends u55 implements qq3<wm1> {
        public final /* synthetic */ Object a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public h(j65 j65Var) {
            super(0);
            this.a = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            jka jkaVar = (jka) this.a.getValue();
            androidx.lifecycle.h hVar = jkaVar instanceof androidx.lifecycle.h ? (androidx.lifecycle.h) jkaVar : null;
            return hVar != null ? hVar.getDefaultViewModelCreationExtras() : wm1.a.b;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Landroidx/lifecycle/at$c;", "invoke", "()Landroidx/lifecycle/at$c;", "fp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class i extends u55 implements qq3<at.c> {
        public final /* synthetic */ Object b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public i(j65 j65Var) {
            super(0);
            this.b = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            at.c defaultViewModelProviderFactory;
            jka jkaVar = (jka) this.b.getValue();
            androidx.lifecycle.h hVar = jkaVar instanceof androidx.lifecycle.h ? (androidx.lifecycle.h) jkaVar : null;
            return (hVar == null || (defaultViewModelProviderFactory = hVar.getDefaultViewModelProviderFactory()) == null) ? MobileUserCollectionContentFragment.this.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    public MobileUserCollectionContentFragment() {
        kw7 kw7Var = iw7.a;
        this.i = new vh6(kw7Var.getOrCreateKotlinClass(r76.class), new d());
        j65 j65VarB = v65.b(d75.b, new f(new e()));
        this.j = new as(kw7Var.getOrCreateKotlinClass(UserCollectionContentViewModel.class), new g(j65VarB), new i(j65VarB), new h(j65VarB));
        this.q = new RecyclerView.v();
        this.r = a.a;
    }

    public final int l() {
        DimensionScaler dimensionScaler = this.k;
        if (dimensionScaler != null) {
            return zr7.c(getResources().getDisplayMetrics().widthPixels / (dimensionScaler.d() + ((int) (8 * getResources().getDisplayMetrics().density))), 2, 8);
        }
        cr4.n("dimensionScaler");
        throw null;
    }

    public final UserCollectionContentViewModel m() {
        return (UserCollectionContentViewModel) this.j.getValue();
    }

    public final void n(ContentItem contentItem) {
        if (contentItem.getTmdbId() <= 0) {
            return;
        }
        C0597ki6.a(this, new b.a(contentItem, contentItem.getItemType() == ContentItem.ItemType.MOVIE ? PlaybackProgress.TYPE_MOVIE : "tv", contentItem.getTmdbId()));
    }

    @Override // androidx.fragment.app.o, android.content.ComponentCallbacks
    public final void onConfigurationChanged(Configuration configuration) {
        cr4.g(configuration, "newConfig");
        super.onConfigurationChanged(configuration);
        sm3 sm3Var = this.f;
        cr4.d(sm3Var);
        RecyclerView.o layoutManager = sm3Var.c.getLayoutManager();
        GridLayoutManager gridLayoutManager = layoutManager instanceof GridLayoutManager ? (GridLayoutManager) layoutManager : null;
        if (gridLayoutManager != null) {
            gridLayoutManager.ag(l());
        }
    }

    @Override // androidx.fragment.app.o
    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        cr4.g(layoutInflater, "inflater");
        View viewInflate = layoutInflater.inflate(R.layout.fragment_mobile_user_collection_content, viewGroup, false);
        int i2 = R.id.empty_state;
        LinearLayout linearLayout = (LinearLayout) mia.a(R.id.empty_state, viewInflate);
        if (linearLayout != null) {
            i2 = R.id.empty_state_text;
            TextView textView = (TextView) mia.a(R.id.empty_state_text, viewInflate);
            if (textView != null) {
                i2 = R.id.grid_recycler_view;
                RecyclerView recyclerView = (RecyclerView) mia.a(R.id.grid_recycler_view, viewInflate);
                if (recyclerView != null) {
                    i2 = R.id.progress_bar;
                    ProgressBar progressBar = (ProgressBar) mia.a(R.id.progress_bar, viewInflate);
                    if (progressBar != null) {
                        i2 = R.id.progress_bar_more;
                        ProgressBar progressBar2 = (ProgressBar) mia.a(R.id.progress_bar_more, viewInflate);
                        if (progressBar2 != null) {
                            i2 = R.id.retry_button;
                            MaterialButton materialButton = (MaterialButton) mia.a(R.id.retry_button, viewInflate);
                            if (materialButton != null) {
                                i2 = R.id.rows_recycler_view;
                                RecyclerView recyclerView2 = (RecyclerView) mia.a(R.id.rows_recycler_view, viewInflate);
                                if (recyclerView2 != null) {
                                    i2 = R.id.toolbar;
                                    MaterialToolbar materialToolbar = (MaterialToolbar) mia.a(R.id.toolbar, viewInflate);
                                    if (materialToolbar != null) {
                                        ConstraintLayout constraintLayout = (ConstraintLayout) viewInflate;
                                        this.f = new sm3(constraintLayout, linearLayout, textView, recyclerView, progressBar, progressBar2, materialButton, recyclerView2, materialToolbar);
                                        cr4.f(constraintLayout, "getRoot(...)");
                                        return constraintLayout;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(viewInflate.getResources().getResourceName(i2)));
    }

    @Override // androidx.fragment.app.o
    public final void onDestroyView() {
        super.onDestroyView();
        this.f = null;
    }

    @Override // androidx.fragment.app.o
    public final void onViewCreated(View view, Bundle bundle) {
        cr4.g(view, "view");
        super.onViewCreated(view, bundle);
        Context contextRequireContext = requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        i85 viewLifecycleOwner = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        n nVarA = s.a(viewLifecycleOwner);
        ContextMenuActionHandler contextMenuActionHandler = this.l;
        if (contextMenuActionHandler == null) {
            cr4.n("contextMenuActionHandler");
            throw null;
        }
        TraktStatusProvider traktStatusProvider = this.m;
        if (traktStatusProvider == null) {
            cr4.n("traktStatusProvider");
            throw null;
        }
        final int i2 = 4;
        this.n = new com.strmr.ps.ui.contextmenu.h(contextRequireContext, nVarA, contextMenuActionHandler, traktStatusProvider, null, null, new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i2) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str = af1Var.d;
                        if (str != null) {
                            List<zw8.b> listC = zw8.c(str);
                            if (!listC.isEmpty()) {
                                String str2 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str2 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str2, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str2 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str2 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str2, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var);
                            sm3Var.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var2 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var2);
                            sm3Var2.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var3 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var3);
                            sm3Var3.a.setVisibility(8);
                        } else {
                            sm3 sm3Var4 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var4);
                            sm3Var4.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        }, null, null, null, null, null, 4000);
        sm3 sm3Var = this.f;
        cr4.d(sm3Var);
        MaterialToolbar materialToolbar = sm3Var.h;
        String str = ((r76) this.i.getValue()).b;
        if (n89.ab(str)) {
            str = m().g;
        }
        materialToolbar.setTitle(str);
        sm3 sm3Var2 = this.f;
        cr4.d(sm3Var2);
        final int i3 = 1;
        sm3Var2.h.setNavigationOnClickListener(new View.OnClickListener(this) { // from class: p76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                switch (i3) {
                    case 0:
                        this.b.m().r();
                        break;
                    default:
                        d.a(this.b).n();
                        break;
                }
            }
        });
        final int i4 = 5;
        final int i5 = 6;
        this.o = new d36(new ah(this, 21), new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i4) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var3 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var3);
                            sm3Var3.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var32 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var32);
                            sm3Var32.a.setVisibility(8);
                        } else {
                            sm3 sm3Var4 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var4);
                            sm3Var4.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        }, new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i5) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var3 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var3);
                            sm3Var3.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var32 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var32);
                            sm3Var32.a.setVisibility(8);
                        } else {
                            sm3 sm3Var4 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var4);
                            sm3Var4.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        });
        sm3 sm3Var3 = this.f;
        cr4.d(sm3Var3);
        RecyclerView recyclerView = sm3Var3.c;
        requireContext();
        recyclerView.setLayoutManager(new GridLayoutManager(l()));
        d36 d36Var = this.o;
        if (d36Var == null) {
            cr4.n("gridAdapter");
            throw null;
        }
        recyclerView.setAdapter(d36Var);
        final int i6 = 7;
        sq3 sq3Var = new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i6) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var32 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var32);
                            sm3Var32.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var322 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var322);
                            sm3Var322.a.setVisibility(8);
                        } else {
                            sm3 sm3Var4 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var4);
                            sm3Var4.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        };
        zd zdVar = new zd(this, 10);
        mb1 mb1Var = new mb1(16);
        final int i7 = 0;
        sq3 sq3Var2 = new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i7) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var32 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var32);
                            sm3Var32.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var322 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var322);
                            sm3Var322.a.setVisibility(8);
                        } else {
                            sm3 sm3Var4 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var4);
                            sm3Var4.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        };
        DimensionScaler dimensionScaler = this.k;
        if (dimensionScaler == null) {
            cr4.n("dimensionScaler");
            throw null;
        }
        final int i8 = 1;
        this.p = new s16(sq3Var, zdVar, mb1Var, sq3Var2, this.q, dimensionScaler, new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i8) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var32 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var32);
                            sm3Var32.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var322 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var322);
                            sm3Var322.a.setVisibility(8);
                        } else {
                            sm3 sm3Var4 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var4);
                            sm3Var4.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        });
        sm3 sm3Var4 = this.f;
        cr4.d(sm3Var4);
        RecyclerView recyclerView2 = sm3Var4.g;
        requireContext();
        recyclerView2.setLayoutManager(new LinearLayoutManager());
        s16 s16Var = this.p;
        if (s16Var == null) {
            cr4.n("rowsAdapter");
            throw null;
        }
        recyclerView2.setAdapter(s16Var);
        recyclerView2.setHasFixedSize(false);
        recyclerView2.setItemViewCacheSize(8);
        m().j.f(getViewLifecycleOwner(), new c(new sq3() { // from class: com.strmr.ps.ui.mobile.usercollection.a
            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                List list = (List) obj;
                cr4.d(list);
                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.a;
                mobileUserCollectionContentFragment.getClass();
                if (list.isEmpty()) {
                    sm3 sm3Var5 = mobileUserCollectionContentFragment.f;
                    cr4.d(sm3Var5);
                    sm3Var5.c.setVisibility(8);
                    sm3 sm3Var6 = mobileUserCollectionContentFragment.f;
                    cr4.d(sm3Var6);
                    sm3Var6.g.setVisibility(8);
                } else {
                    MobileUserCollectionContentFragment.a aVar = list.size() == 1 ? MobileUserCollectionContentFragment.a.b : MobileUserCollectionContentFragment.a.c;
                    if (aVar != mobileUserCollectionContentFragment.r) {
                        mobileUserCollectionContentFragment.r = aVar;
                        sm3 sm3Var7 = mobileUserCollectionContentFragment.f;
                        cr4.d(sm3Var7);
                        sm3Var7.c.setVisibility(aVar == MobileUserCollectionContentFragment.a.b ? 0 : 8);
                        sm3 sm3Var8 = mobileUserCollectionContentFragment.f;
                        cr4.d(sm3Var8);
                        sm3Var8.g.setVisibility(aVar != MobileUserCollectionContentFragment.a.c ? 8 : 0);
                    }
                    int iOrdinal = aVar.ordinal();
                    if (iOrdinal != 0) {
                        if (iOrdinal == 1) {
                            d36 d36Var2 = mobileUserCollectionContentFragment.o;
                            if (d36Var2 == null) {
                                cr4.n("gridAdapter");
                                throw null;
                            }
                            d36Var2.e(y41.bo(((af1) y41.z(list)).b));
                        } else {
                            if (iOrdinal != 2) {
                                throw new io6();
                            }
                            s16 s16Var2 = mobileUserCollectionContentFragment.p;
                            if (s16Var2 == null) {
                                cr4.n("rowsAdapter");
                                throw null;
                            }
                            s16Var2.e(list);
                        }
                    }
                    if (!list.isEmpty()) {
                        sm3 sm3Var9 = mobileUserCollectionContentFragment.f;
                        cr4.d(sm3Var9);
                        sm3Var9.a.setVisibility(8);
                    }
                }
                return e6a.a;
            }
        }));
        final int i9 = 2;
        m().l.f(getViewLifecycleOwner(), new c(new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i9) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var32 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var32);
                            sm3Var32.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var322 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var322);
                            sm3Var322.a.setVisibility(8);
                        } else {
                            sm3 sm3Var42 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var42);
                            sm3Var42.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        }));
        final int i10 = 3;
        m().n.f(getViewLifecycleOwner(), new c(new sq3(this) { // from class: q76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            /* JADX WARN: Removed duplicated region for block: B:37:0x00d9  */
            /* JADX WARN: Removed duplicated region for block: B:71:0x01d5  */
            @Override // defpackage.sq3
            /*
                Code decompiled incorrectly, please refer to instructions dump.
            */
            public final Object invoke(Object obj) {
                boolean z;
                zw8.a aVar;
                boolean z2;
                String strAb;
                String string;
                switch (i10) {
                    case 0:
                        ((Integer) obj).getClass();
                        this.b.m().l();
                        break;
                    case 1:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        String str2 = af1Var.d;
                        if (str2 != null) {
                            List<zw8.b> listC = zw8.c(str2);
                            if (!listC.isEmpty()) {
                                String str22 = af1Var.h;
                                String str3 = af1Var.i;
                                zw8.a aVarB = zw8.b(str2);
                                MobileUserCollectionContentFragment mobileUserCollectionContentFragment = this.b;
                                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mobileUserCollectionContentFragment.requireContext());
                                View viewInflate = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.bottom_sheet_sort, (ViewGroup) null);
                                ((TextView) viewInflate.findViewById(R.id.sort_sheet_title)).setText(mobileUserCollectionContentFragment.getString(R.string.sort_dialog_title, af1Var.a));
                                LinearLayout linearLayout = (LinearLayout) viewInflate.findViewById(R.id.sort_options_container);
                                boolean z3 = false;
                                if (str22 != null) {
                                    View viewInflate2 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, (ViewGroup) linearLayout, false);
                                    TextView textView = (TextView) viewInflate2.findViewById(R.id.sort_option_label);
                                    ImageView imageView = (ImageView) viewInflate2.findViewById(R.id.sort_option_check);
                                    textView.setText(mobileUserCollectionContentFragment.getString(R.string.sort_reset_default));
                                    imageView.setVisibility(8);
                                    viewInflate2.setOnClickListener(new s36(mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate2);
                                }
                                for (zw8.b bVar : listC) {
                                    if (cr4.b(str22, bVar.a)) {
                                        z = true;
                                    } else {
                                        if (str22 == null) {
                                            if (cr4.b(aVarB != null ? aVarB.a : null, bVar.a)) {
                                            }
                                        }
                                        z = z3;
                                    }
                                    View viewInflate3 = LayoutInflater.from(mobileUserCollectionContentFragment.requireContext()).inflate(R.layout.item_sort_option, linearLayout, z3);
                                    TextView textView2 = (TextView) viewInflate3.findViewById(R.id.sort_option_label);
                                    ImageView imageView2 = (ImageView) viewInflate3.findViewById(R.id.sort_option_check);
                                    if (!z || str22 == null) {
                                        aVar = aVarB;
                                        z2 = z;
                                        strAb = "";
                                    } else {
                                        aVar = aVarB;
                                        if ((str3 == null ? bVar.c : str3).equals("asc")) {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_ascending);
                                        } else {
                                            z2 = z;
                                            string = mobileUserCollectionContentFragment.getString(R.string.sort_descending);
                                        }
                                        strAb = vw2.ab("  (", string, ")");
                                    }
                                    textView2.setText(bVar.b + strAb);
                                    imageView2.setVisibility(z2 ? 0 : 8);
                                    viewInflate3.setOnClickListener(new t36(z2, str22, str3, bVar, mobileUserCollectionContentFragment, af1Var, bottomSheetDialog));
                                    linearLayout.addView(viewInflate3);
                                    z3 = false;
                                    aVarB = aVar;
                                }
                                bottomSheetDialog.setContentView(viewInflate);
                                bottomSheetDialog.show();
                            }
                        }
                        return e6a.a;
                    case 2:
                        Boolean bool = (Boolean) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment2 = this.b;
                        List list = (List) mobileUserCollectionContentFragment2.m().j.e();
                        if (list != null) {
                            boolean z4 = list.isEmpty() ^ true;
                            sm3 sm3Var32 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var32);
                            sm3Var32.d.setVisibility((!bool.booleanValue() || z4) ? 8 : 0);
                            sm3 sm3Var22 = mobileUserCollectionContentFragment2.f;
                            cr4.d(sm3Var22);
                            sm3Var22.e.setVisibility((bool.booleanValue() && z4) ? 0 : 8);
                            break;
                        }
                        break;
                    case 3:
                        String str4 = (String) obj;
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment3 = this.b;
                        List list2 = (List) mobileUserCollectionContentFragment3.m().j.e();
                        boolean z5 = list2 == null || list2.isEmpty();
                        if (str4 == null || !z5) {
                            sm3 sm3Var322 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var322);
                            sm3Var322.a.setVisibility(8);
                        } else {
                            sm3 sm3Var42 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var42);
                            sm3Var42.a.setVisibility(0);
                            sm3 sm3Var5 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var5);
                            sm3Var5.b.setText(str4);
                            sm3 sm3Var6 = mobileUserCollectionContentFragment3.f;
                            cr4.d(sm3Var6);
                            sm3Var6.f.setVisibility(0);
                        }
                        return e6a.a;
                    case 4:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        MobileUserCollectionContentFragment mobileUserCollectionContentFragment4 = this.b;
                        Context contextRequireContext2 = mobileUserCollectionContentFragment4.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem, d.a(mobileUserCollectionContentFragment4));
                        break;
                    case 5:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        this.b.n(contentItem2);
                        break;
                    case 6:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        if (C0622mg1.a(contentItem3)) {
                            h hVar = this.b.n;
                            if (hVar == null) {
                                cr4.n("contextMenuHelper");
                                throw null;
                            }
                            hVar.b(contentItem3, null);
                        }
                        return e6a.a;
                    default:
                        ContentItem contentItem4 = (ContentItem) obj;
                        cr4.g(contentItem4, "item");
                        this.b.n(contentItem4);
                        break;
                }
                return e6a.a;
            }
        }));
        sm3 sm3Var5 = this.f;
        cr4.d(sm3Var5);
        final int i11 = 0;
        sm3Var5.f.setOnClickListener(new View.OnClickListener(this) { // from class: p76
            public final /* synthetic */ MobileUserCollectionContentFragment b;

            {
                this.b = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                switch (i11) {
                    case 0:
                        this.b.m().r();
                        break;
                    default:
                        d.a(this.b).n();
                        break;
                }
            }
        });
    }
}
