package com.vinfast.vehicle.caraccess.vietnamese;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007¢\u0006\u0004\b\u0003\u0010\u0004J\u000f\u0010\u0006\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\u0006\u0010\u0007J\u000f\u0010\t\u001a\u00020\bH\u0002¢\u0006\u0004\b\t\u0010\u0004J\u000f\u0010\n\u001a\u00020\bH\u0002¢\u0006\u0004\b\n\u0010\u0004J\u000f\u0010\u000b\u001a\u00020\bH\u0002¢\u0006\u0004\b\u000b\u0010\u0004J\u0017\u0010\u000e\u001a\u00020\b2\u0006\u0010\r\u001a\u00020\fH\u0002¢\u0006\u0004\b\u000e\u0010\u000fJ\u000f\u0010\u0010\u001a\u00020\bH\u0002¢\u0006\u0004\b\u0010\u0010\u0004J\u000f\u0010\u0011\u001a\u00020\bH\u0002¢\u0006\u0004\b\u0011\u0010\u0004J\u000f\u0010\u0012\u001a\u00020\fH\u0002¢\u0006\u0004\b\u0012\u0010\u0013J\u000f\u0010\u0014\u001a\u00020\bH\u0002¢\u0006\u0004\b\u0014\u0010\u0004J\u000f\u0010\u0015\u001a\u00020\bH\u0002¢\u0006\u0004\b\u0015\u0010\u0004J\u000f\u0010\u0016\u001a\u00020\bH\u0002¢\u0006\u0004\b\u0016\u0010\u0004J\u000f\u0010\u0018\u001a\u00020\u0017H\u0016¢\u0006\u0004\b\u0018\u0010\u0019J\u000f\u0010\u001a\u001a\u00020\u0005H\u0016¢\u0006\u0004\b\u001a\u0010\u0007J!\u0010\u001f\u001a\u00020\b2\u0006\u0010\u001c\u001a\u00020\u001b2\b\u0010\u001e\u001a\u0004\u0018\u00010\u001dH\u0016¢\u0006\u0004\b\u001f\u0010 J\u0017\u0010#\u001a\u00020\b2\u0006\u0010\"\u001a\u00020!H\u0016¢\u0006\u0004\b#\u0010$J\u000f\u0010%\u001a\u00020\bH\u0016¢\u0006\u0004\b%\u0010\u0004R\u0014\u0010)\u001a\u00020&8\u0002X\u0082D¢\u0006\u0006\n\u0004\b'\u0010(R\u0014\u0010+\u001a\u00020&8\u0002X\u0082D¢\u0006\u0006\n\u0004\b*\u0010(R\u0014\u0010-\u001a\u00020&8\u0002X\u0082D¢\u0006\u0006\n\u0004\b,\u0010(R\"\u00105\u001a\u00020.8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b/\u00100\u001a\u0004\b1\u00102\"\u0004\b3\u00104R\u001b\u0010;\u001a\u0002068BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b7\u00108\u001a\u0004\b9\u0010:R\u0018\u0010?\u001a\u0004\u0018\u00010<8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b=\u0010>R\u0018\u0010A\u001a\u0004\u0018\u00010&8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b@\u0010(R\u0016\u0010D\u001a\u00020\f8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bB\u0010CR\u001b\u0010I\u001a\u00020E8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bF\u00108\u001a\u0004\bG\u0010H¨\u0006J"}, d2 = {"Lcom/vinfast/vehicle/caraccess/vietnamese/RoleManagementFragment;", "Lcom/vinfast/companion/core/base/fragment/BaseFragment;", "Lcom/vinfast/vehicle/databinding/FragmentCarMangementBinding;", "<init>", "()V", "Lcom/vinfast/companion/core/base/fragment/ToolbarConfiguration;", "x2", "()Lcom/vinfast/companion/core/base/fragment/ToolbarConfiguration;", "", "B2", "E2", "T2", "", "isRemoveYourself", "v2", "(Z)V", "t2", "R2", "u2", "()Z", "W2", "Y2", "b3", "Lcom/vinfast/companion/core/base/BaseViewModel;", "U1", "()Lcom/vinfast/companion/core/base/BaseViewModel;", "T0", "Landroid/view/View;", "view", "Landroid/os/Bundle;", "savedInstanceState", "y1", "(Landroid/view/View;Landroid/os/Bundle;)V", "Lcom/vinfast/companion/core/base/ViewModelState$Error;", "error", "I0", "(Lcom/vinfast/companion/core/base/ViewModelState$Error;)V", "onDestroy", "", "A", "Ljava/lang/String;", "TYPE_REQUEST_AUTHEN_TRANSFER_OWNERSHIP", "B", "TYPE_REQUEST_AUTHEN_REMOVE_DRIVER", "C", "TYPE_REQUEST_AUTHEN_DRIVER_LEAVE", "Lcom/vinfast/companion/core/managers/IAccountAuthenticator;", "D", "Lcom/vinfast/companion/core/managers/IAccountAuthenticator;", "y2", "()Lcom/vinfast/companion/core/managers/IAccountAuthenticator;", "setAccountAuthenticator", "(Lcom/vinfast/companion/core/managers/IAccountAuthenticator;)V", "accountAuthenticator", "Lcom/vinfast/vehicle/caraccess/vietnamese/RoleManagementViewModel;", "E", "Lkotlin/Lazy;", "A2", "()Lcom/vinfast/vehicle/caraccess/vietnamese/RoleManagementViewModel;", "viewModel", "Lcom/vinfast/vehicle/caraccess/VerifyCodeDialogFragment;", "F", "Lcom/vinfast/vehicle/caraccess/VerifyCodeDialogFragment;", "dialogVerify", "G", "typeCheckAuth", "H", "Z", "needLoadDataInRoleDetail", "Lcom/vinfast/companion/core/base/ui/adapter/ItemRoleVehicleAdapter;", "I", "z2", "()Lcom/vinfast/companion/core/base/ui/adapter/ItemRoleVehicleAdapter;", "listUserRoleAdapter", "vehicle_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
@dagger.hilt.android.AndroidEntryPoint
@kotlin.jvm.internal.SourceDebugExtension
public final class RoleManagementFragment extends com.vinfast.vehicle.caraccess.vietnamese.Hilt_RoleManagementFragment<com.vinfast.vehicle.databinding.FragmentCarMangementBinding> {

    /* JADX INFO: renamed from: A, reason: from kotlin metadata */
    private final java.lang.String TYPE_REQUEST_AUTHEN_TRANSFER_OWNERSHIP;

    /* JADX INFO: renamed from: B, reason: from kotlin metadata */
    private final java.lang.String TYPE_REQUEST_AUTHEN_REMOVE_DRIVER;

    /* JADX INFO: renamed from: C, reason: from kotlin metadata */
    private final java.lang.String TYPE_REQUEST_AUTHEN_DRIVER_LEAVE;

    /* JADX INFO: renamed from: D, reason: from kotlin metadata */
    public com.vinfast.companion.core.managers.IAccountAuthenticator accountAuthenticator;

    /* JADX INFO: renamed from: E, reason: from kotlin metadata */
    private final kotlin.Lazy viewModel;

    /* JADX INFO: renamed from: F, reason: from kotlin metadata */
    private com.vinfast.vehicle.caraccess.VerifyCodeDialogFragment dialogVerify;

    /* JADX INFO: renamed from: G, reason: from kotlin metadata */
    private java.lang.String typeCheckAuth;

    /* JADX INFO: renamed from: H, reason: from kotlin metadata */
    private boolean needLoadDataInRoleDetail;

    /* JADX INFO: renamed from: I, reason: from kotlin metadata */
    private final kotlin.Lazy listUserRoleAdapter;

    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(k = 3, mv = {2, 2, 0}, xi = 48)
    public static final /* synthetic */ class WhenMappings {
        public static final /* synthetic */ int[] a;

        static {
            int[] iArr = new int[com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.values().length];
            try {
                iArr[com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.OwnerRemoveSecondDriver.ordinal()] = 1;
            } catch (java.lang.NoSuchFieldError unused) {
            }
            try {
                iArr[com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.SecondDriverRemoveYourSelf.ordinal()] = 2;
            } catch (java.lang.NoSuchFieldError unused2) {
            }
            try {
                iArr[com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.OwnerCancelRequest.ordinal()] = 3;
            } catch (java.lang.NoSuchFieldError unused3) {
            }
            try {
                iArr[com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.SecondDriverAcceptRequest.ordinal()] = 4;
            } catch (java.lang.NoSuchFieldError unused4) {
            }
            a = iArr;
        }
    }

    public RoleManagementFragment() {
        super(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.a
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.s2((android.view.LayoutInflater) obj);
            }
        });
        this.TYPE_REQUEST_AUTHEN_TRANSFER_OWNERSHIP = "type_transfer_ownership";
        this.TYPE_REQUEST_AUTHEN_REMOVE_DRIVER = "type_remove_driver";
        this.TYPE_REQUEST_AUTHEN_DRIVER_LEAVE = "type_driver_leave";
        final kotlin.jvm.functions.Function0<androidx.fragment.app.Fragment> function0 = new kotlin.jvm.functions.Function0<androidx.fragment.app.Fragment>() { // from class: com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$special$$inlined$viewModels$default$1
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.fragment.app.Fragment invoke() {
                return this;
            }
        };
        final kotlin.Lazy lazyA = kotlin.LazyKt.a(kotlin.LazyThreadSafetyMode.NONE, new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelStoreOwner>() { // from class: com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$special$$inlined$viewModels$default$2
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelStoreOwner invoke() {
                return (androidx.lifecycle.ViewModelStoreOwner) function0.invoke();
            }
        });
        final kotlin.jvm.functions.Function0 function1 = null;
        this.viewModel = androidx.fragment.app.FragmentViewModelLazyKt.c(this, kotlin.jvm.internal.Reflection.b(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementViewModel.class), new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelStore>() { // from class: com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$special$$inlined$viewModels$default$3
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelStore invoke() {
                return androidx.fragment.app.FragmentViewModelLazyKt.b(lazyA).getViewModelStore();
            }
        }, new kotlin.jvm.functions.Function0<androidx.lifecycle.viewmodel.CreationExtras>() { // from class: com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$special$$inlined$viewModels$default$4
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.viewmodel.CreationExtras invoke() {
                androidx.lifecycle.viewmodel.CreationExtras creationExtras;
                kotlin.jvm.functions.Function0 function2 = function1;
                if (function2 != null && (creationExtras = (androidx.lifecycle.viewmodel.CreationExtras) function2.invoke()) != null) {
                    return creationExtras;
                }
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactoryB = androidx.fragment.app.FragmentViewModelLazyKt.b(lazyA);
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = hasDefaultViewModelProviderFactoryB instanceof androidx.lifecycle.HasDefaultViewModelProviderFactory ? hasDefaultViewModelProviderFactoryB : null;
                return hasDefaultViewModelProviderFactory != null ? hasDefaultViewModelProviderFactory.getDefaultViewModelCreationExtras() : androidx.lifecycle.viewmodel.CreationExtras.Empty.c;
            }
        }, new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelProvider.Factory>() { // from class: com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$special$$inlined$viewModels$default$5
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelProvider.Factory invoke() {
                androidx.lifecycle.ViewModelProvider.Factory defaultViewModelProviderFactory;
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactoryB = androidx.fragment.app.FragmentViewModelLazyKt.b(lazyA);
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = hasDefaultViewModelProviderFactoryB instanceof androidx.lifecycle.HasDefaultViewModelProviderFactory ? hasDefaultViewModelProviderFactoryB : null;
                return (hasDefaultViewModelProviderFactory == null || (defaultViewModelProviderFactory = hasDefaultViewModelProviderFactory.getDefaultViewModelProviderFactory()) == null) ? this.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
            }
        });
        this.listUserRoleAdapter = kotlin.LazyKt.b(new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.caraccess.vietnamese.l
            public final java.lang.Object invoke() {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.C2(this.a);
            }
        });
    }

    private final com.vinfast.vehicle.caraccess.vietnamese.RoleManagementViewModel A2() {
        return (com.vinfast.vehicle.caraccess.vietnamese.RoleManagementViewModel) this.viewModel.getValue();
    }

    private final void B2() {
        android.os.Bundle extras;
        android.os.Bundle extras2;
        android.os.Bundle extras3;
        android.content.Intent intent = requireActivity().getIntent();
        java.lang.Boolean boolValueOf = null;
        java.lang.String string = (intent == null || (extras3 = intent.getExtras()) == null) ? null : extras3.getString("key_vincode");
        android.content.Intent intent2 = requireActivity().getIntent();
        java.lang.Object obj = (intent2 == null || (extras2 = intent2.getExtras()) == null) ? null : extras2.get("list_user_role");
        java.util.List list = obj instanceof java.util.List ? (java.util.List) obj : null;
        android.content.Intent intent3 = requireActivity().getIntent();
        if (intent3 != null && (extras = intent3.getExtras()) != null) {
            boolValueOf = java.lang.Boolean.valueOf(extras.getBoolean("flag_remove_account"));
        }
        android.content.Intent intent4 = requireActivity().getIntent();
        if (intent4 != null) {
            intent4.removeExtra("key_vincode");
        }
        android.content.Intent intent5 = requireActivity().getIntent();
        if (intent5 != null) {
            intent5.removeExtra("list_user_role");
        }
        android.content.Intent intent6 = requireActivity().getIntent();
        if (intent6 != null) {
            intent6.removeExtra("flag_remove_account");
        }
        A2().R0(string, list);
        if (kotlin.jvm.internal.Intrinsics.g(boolValueOf, java.lang.Boolean.TRUE)) {
            A2().N0();
        }
        E2();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final com.vinfast.companion.core.base.ui.adapter.ItemRoleVehicleAdapter C2(final com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment) {
        return new com.vinfast.companion.core.base.ui.adapter.ItemRoleVehicleAdapter(false, new kotlin.jvm.functions.Function2() { // from class: com.vinfast.vehicle.caraccess.vietnamese.p
            public final java.lang.Object invoke(java.lang.Object obj, java.lang.Object obj2) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.D2(this.a, ((java.lang.Integer) obj).intValue(), (com.vinfast.companion.core.base.ui.model.ItemRoleVehicle) obj2);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit D2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, int i, com.vinfast.companion.core.base.ui.model.ItemRoleVehicle itemRoleVehicle) {
        if (itemRoleVehicle != null) {
            java.lang.String itemTag = itemRoleVehicle.getItemTag();
            int iHashCode = itemTag.hashCode();
            if (iHashCode != -1662212020) {
                if (iHashCode != 1207460462) {
                    if (iHashCode == 1400531018 && itemTag.equals("tag_primary_driver")) {
                        if (roleManagementFragment.u2()) {
                            roleManagementFragment.W2();
                        } else {
                            roleManagementFragment.A2().J0(311);
                        }
                    }
                } else if (itemTag.equals("tag_second_driver")) {
                    if (i == 250) {
                        java.lang.Object noteAction = itemRoleVehicle.getNoteAction();
                        if (kotlin.jvm.internal.Intrinsics.g(noteAction, 260)) {
                            com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.AddDriver.b, null, 2, null);
                            androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).L(com.vinfast.vehicle.R.id.addDriverFragment);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction, 261)) {
                            com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.CancelAddDriver.b, null, 2, null);
                            roleManagementFragment.b3();
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction, 262)) {
                            roleManagementFragment.v2(true);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction, 266)) {
                            com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.RemoveDriver.b, null, 2, null);
                            roleManagementFragment.v2(false);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction, 263)) {
                            com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.AcceptDriverRequest.b, null, 2, null);
                            roleManagementFragment.Y2();
                        }
                    } else if (i == 251) {
                        java.lang.Object noteAction2 = itemRoleVehicle.getNoteAction();
                        if (kotlin.jvm.internal.Intrinsics.g(noteAction2, 260)) {
                            com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.AddDriver.b, null, 2, null);
                            androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).L(com.vinfast.vehicle.R.id.addDriverFragment);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction2, 261)) {
                            roleManagementFragment.A2().J0(313);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction2, 262)) {
                            roleManagementFragment.A2().J0(312);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction2, 266)) {
                            roleManagementFragment.A2().J0(315);
                        } else if (kotlin.jvm.internal.Intrinsics.g(noteAction2, 263)) {
                            roleManagementFragment.needLoadDataInRoleDetail = true;
                            roleManagementFragment.A2().J0(314);
                        }
                    }
                }
            } else if (itemTag.equals("tag_item_owner")) {
                if (i == 250) {
                    java.lang.Object noteAction3 = itemRoleVehicle.getNoteAction();
                    if (kotlin.jvm.internal.Intrinsics.g(noteAction3, 265)) {
                        com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.TransferOwnership.b, null, 2, null);
                        roleManagementFragment.typeCheckAuth = roleManagementFragment.TYPE_REQUEST_AUTHEN_TRANSFER_OWNERSHIP;
                        roleManagementFragment.R2();
                    } else if (kotlin.jvm.internal.Intrinsics.g(noteAction3, 264)) {
                        androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).M(com.vinfast.vehicle.R.id.transferInProgressFragment, androidx.core.os.BundleKt.b(new kotlin.Pair[]{kotlin.TuplesKt.a("key_vincode_transfer", itemRoleVehicle.getVinCode()), kotlin.TuplesKt.a("key_role", com.vinfast.companion.core.uiPrototype.base.UserRole.OwnerTransferring.getValue())}));
                    }
                } else if (i == 251 && !kotlin.jvm.internal.Intrinsics.g(itemRoleVehicle.getNoteAction(), 264)) {
                    if (roleManagementFragment.u2()) {
                        roleManagementFragment.W2();
                    } else if (itemRoleVehicle.getNoteAction() == null) {
                        roleManagementFragment.A2().J0(309);
                    } else {
                        roleManagementFragment.A2().J0(310);
                    }
                }
            }
        }
        return kotlin.Unit.a;
    }

    private final void E2() {
        com.vinfast.companion.core.extensions.SingleLiveData resultSwitchCar = A2().getResultSwitchCar();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        resultSwitchCar.j(viewLifecycleOwner, new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.q
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.F2(this.a, (kotlin.Pair) obj);
            }
        }));
        A2().getListUserInfo().j(getViewLifecycleOwner(), new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.s
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.G2(this.a, (java.util.List) obj);
            }
        }));
        A2().getListItemRoleVehicle().j(getViewLifecycleOwner(), new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.t
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.I2(this.a, (java.util.List) obj);
            }
        }));
        com.vinfast.companion.core.extensions.SingleLiveData responseSuccess = A2().getResponseSuccess();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner2 = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner2, "getViewLifecycleOwner(...)");
        responseSuccess.j(viewLifecycleOwner2, new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.u
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.J2(this.a, (com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData) obj);
            }
        }));
        com.vinfast.companion.core.extensions.SingleLiveData responseFailure = A2().getResponseFailure();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner3 = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner3, "getViewLifecycleOwner(...)");
        responseFailure.j(viewLifecycleOwner3, new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.v
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.L2(this.a, (com.vinfast.vehicle.caraccess.global.roleinfo.ResponseError) obj);
            }
        }));
        com.vinfast.companion.core.extensions.SingleLiveData vehicleRemoved = A2().getVehicleRemoved();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner4 = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner4, "getViewLifecycleOwner(...)");
        vehicleRemoved.j(viewLifecycleOwner4, new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.w
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.M2(this.a, (java.lang.Boolean) obj);
            }
        }));
        A2().getVehicleSelect().j(getViewLifecycleOwner(), new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.b
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.N2(this.a, (com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle) obj);
            }
        }));
        com.vinfast.companion.core.extensions.SingleLiveData isLoading = A2().getIsLoading();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner5 = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner5, "getViewLifecycleOwner(...)");
        com.vinfast.companion.core.extensions.LiveDataExtensionsKt.c(isLoading, viewLifecycleOwner5, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.c
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.O2(this.a, (java.lang.Boolean) obj);
            }
        });
        com.vinfast.companion.core.extensions.SingleLiveData roleInfo = A2().getRoleInfo();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner6 = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner6, "getViewLifecycleOwner(...)");
        com.vinfast.companion.core.extensions.LiveDataExtensionsKt.c(roleInfo, viewLifecycleOwner6, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.d
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.P2(this.a, (com.vinfast.companion.vehiclekit.model.RoleInfo) obj);
            }
        });
        com.vinfast.companion.core.extensions.LiveDataExtensionsKt.c(A2().getOnRemoveVehicle(), this, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.e
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.Q2(this.a, (java.lang.Boolean) obj);
            }
        });
        A2().getListUserRole().j(this, new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.r
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.H2(this.a, (java.util.List) obj);
            }
        }));
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.UninitializedPropertyAccessException */
    public static final kotlin.Unit F2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, kotlin.Pair pair) throws kotlin.UninitializedPropertyAccessException {
        if (pair == null) {
            return kotlin.Unit.a;
        }
        if (((java.lang.Boolean) pair.e()).booleanValue()) {
            java.lang.String str = (java.lang.String) pair.f();
            if (str != null) {
                java.lang.String string = roleManagementFragment.getString(com.vinfast.vehicle.R.string.common_switched_vehicle, new java.lang.Object[]{str});
                kotlin.jvm.internal.Intrinsics.k(string, "getString(...)");
                com.vinfast.companion.core.base.ui.widget.VFSnackBarKt.k(roleManagementFragment, string, com.vinfast.companion.core.base.ui.widget.SnackbarType.Success);
            }
        } else {
            com.vinfast.companion.core.base.fragment.BaseFragment.t1(roleManagementFragment, false, 1, null);
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit G2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.util.List list) {
        com.vinfast.vehicle.caraccess.vietnamese.RoleManagementViewModel roleManagementViewModelA2 = roleManagementFragment.A2();
        android.content.Context contextRequireContext = roleManagementFragment.requireContext();
        kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
        roleManagementViewModelA2.k0(contextRequireContext);
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit H2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.util.List list) {
        if (roleManagementFragment.u2()) {
            roleManagementFragment.H0(false);
        } else {
            com.vinfast.companion.core.base.ui.widget.CommonToolbar commonToolbarS0 = com.vinfast.companion.core.base.fragment.BaseFragment.S0(roleManagementFragment, null, 1, null);
            if (commonToolbarS0 != null) {
                commonToolbarS0.setTitleText(roleManagementFragment.getString(com.vinfast.vehicle.R.string.feature_name_role_management));
            }
            roleManagementFragment.H0(true);
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit I2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.util.List list) {
        if (list != null) {
            roleManagementFragment.z2().j(kotlin.collections.CollectionsKt.n1(list));
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit J2(final com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData typeChangeData) {
        java.lang.String strG;
        androidx.lifecycle.SavedStateHandle savedStateHandleJ;
        if (typeChangeData != null) {
            int i = com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.WhenMappings.a[typeChangeData.ordinal()];
            if (i == 1) {
                android.content.Context contextRequireContext = roleManagementFragment.requireContext();
                kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
                com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext, com.vinfast.vehicle.R.string.CA10602_driver_account_removed, com.vinfast.companion.core.base.ui.widget.ToastType.BottomSuccess, false, 4, null);
            } else if (i == 2) {
                roleManagementFragment.t2();
                com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle vehicle = (com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle) roleManagementFragment.A2().getVehicleSelect().f();
                java.lang.String strH = vehicle != null ? vehicle.h() : null;
                if (strH == null || strH.length() == 0) {
                    android.content.Context contextRequireContext2 = roleManagementFragment.requireContext();
                    kotlin.jvm.internal.Intrinsics.k(contextRequireContext2, "requireContext(...)");
                    com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle vehicle2 = (com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle) roleManagementFragment.A2().getVehicleSelect().f();
                    strG = com.vinfast.companion.core.extensions.ContextExtensionKt.g(contextRequireContext2, vehicle2 != null ? vehicle2.x() : null, java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_value_unknown));
                } else {
                    com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle vehicle3 = (com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle) roleManagementFragment.A2().getVehicleSelect().f();
                    if (vehicle3 == null || (strG = vehicle3.h()) == null) {
                        strG = roleManagementFragment.getString(com.vinfast.vehicle.R.string.common_value_unknown);
                        kotlin.jvm.internal.Intrinsics.k(strG, "getString(...)");
                    }
                }
                com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
                androidx.fragment.app.FragmentManager childFragmentManager = roleManagementFragment.getChildFragmentManager();
                kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
                companion.a(childFragmentManager, (6290294 & 2) != 0 ? false : true, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20800_removed_successfully), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : roleManagementFragment.getString(com.vinfast.vehicle.R.string.CA20800_you_successfully_removed, new java.lang.Object[]{strG}), (6290294 & 128) != 0 ? null : null, (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_btn_close), (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : null, (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : null, (6290294 & 32768) != 0 ? null : null, (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : null, (6290294 & 524288) != 0 ? null : null, (6290294 & 1048576) != 0 ? null : null, (6290294 & 2097152) != 0 ? null : new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.caraccess.vietnamese.i
                    public final java.lang.Object invoke() {
                        return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.K2(this.a);
                    }
                }, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
            } else if (i == 3) {
                android.content.Context contextRequireContext3 = roleManagementFragment.requireContext();
                kotlin.jvm.internal.Intrinsics.k(contextRequireContext3, "requireContext(...)");
                com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext3, com.vinfast.vehicle.R.string.CA20800_driver_account_request, com.vinfast.companion.core.base.ui.widget.ToastType.BottomSuccess, false, 4, null);
            } else if (i == 4) {
                com.vinfast.vehicle.caraccess.VerifyCodeDialogFragment verifyCodeDialogFragment = roleManagementFragment.dialogVerify;
                if (verifyCodeDialogFragment != null) {
                    verifyCodeDialogFragment.dismiss();
                }
                android.content.Context contextRequireContext4 = roleManagementFragment.requireContext();
                kotlin.jvm.internal.Intrinsics.k(contextRequireContext4, "requireContext(...)");
                com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext4, com.vinfast.vehicle.R.string.CA20803_driver_account_added, com.vinfast.companion.core.base.ui.widget.ToastType.BottomSuccess, false, 4, null);
                androidx.navigation.NavBackStackEntry navBackStackEntryC = androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).C();
                if (navBackStackEntryC != null && (savedStateHandleJ = navBackStackEntryC.j()) != null) {
                    savedStateHandleJ.i("flag_refresh_data", java.lang.Boolean.TRUE);
                }
                roleManagementFragment.needLoadDataInRoleDetail = true;
                roleManagementFragment.A2().J0(312);
            }
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit K2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment) {
        roleManagementFragment.requireActivity().finish();
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit L2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, com.vinfast.vehicle.caraccess.global.roleinfo.ResponseError responseError) {
        com.vinfast.vehicle.caraccess.VerifyCodeDialogFragment verifyCodeDialogFragment;
        if (responseError != null) {
            int i = com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.WhenMappings.a[responseError.getTypeChangeData().ordinal()];
            if (i == 1 || i == 2) {
                com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
                androidx.fragment.app.FragmentManager childFragmentManager = roleManagementFragment.getChildFragmentManager();
                kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
                companion.a(childFragmentManager, (6290294 & 2) != 0 ? false : false, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_error), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : null, (6290294 & 128) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20800_failed_to_remove), (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_btn_ok), (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : null, (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : null, (6290294 & 32768) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.drawable.ic_close_red), (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : null, (6290294 & 524288) != 0 ? null : null, (6290294 & 1048576) != 0 ? null : null, (6290294 & 2097152) != 0 ? null : null, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
            } else if (i == 3) {
                android.content.Context contextRequireContext = roleManagementFragment.requireContext();
                kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
                com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext, com.vinfast.vehicle.R.string.CA20800_failed_cancel_request, com.vinfast.companion.core.base.ui.widget.ToastType.BottomFailed, false, 4, null);
            } else if (i == 4 && (verifyCodeDialogFragment = roleManagementFragment.dialogVerify) != null) {
                verifyCodeDialogFragment.a1();
            }
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit M2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.lang.Boolean bool) {
        if (kotlin.jvm.internal.Intrinsics.g(bool, java.lang.Boolean.TRUE)) {
            roleManagementFragment.requireActivity().finish();
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit N2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle vehicle) {
        java.lang.String strH;
        if (vehicle != null) {
            boolean zM = vehicle.M(new com.vinfast.companion.core.uiPrototype.base.UserRole[]{com.vinfast.companion.core.uiPrototype.base.UserRole.OwnerTransferring});
            androidx.appcompat.widget.AppCompatTextView appCompatTextView = ((com.vinfast.vehicle.databinding.FragmentCarMangementBinding) roleManagementFragment.T1()).g;
            kotlin.jvm.internal.Intrinsics.k(appCompatTextView, "tvNoteTransferPending");
            appCompatTextView.setVisibility(zM ? 0 : 8);
            ((com.vinfast.vehicle.databinding.FragmentCarMangementBinding) roleManagementFragment.T1()).i.setText(roleManagementFragment.getString(com.vinfast.vehicle.R.string.common_vin_number_value, new java.lang.Object[]{vehicle.J()}));
            androidx.appcompat.widget.AppCompatTextView appCompatTextView2 = ((com.vinfast.vehicle.databinding.FragmentCarMangementBinding) roleManagementFragment.T1()).h;
            java.lang.String strH2 = vehicle.h();
            if (strH2 == null || strH2.length() == 0) {
                android.content.Context contextRequireContext = roleManagementFragment.requireContext();
                kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
                strH = com.vinfast.companion.core.extensions.ContextExtensionKt.h(contextRequireContext, vehicle.x(), null, 2, null);
            } else {
                strH = vehicle.h();
            }
            appCompatTextView2.setText(strH);
            java.lang.String strN = vehicle.n();
            if (strN != null) {
                com.vinfast.companion.core.utils.imageUtis.ImageUtils imageUtils = com.vinfast.companion.core.utils.imageUtis.ImageUtils.a;
                android.widget.ImageView imageView = ((com.vinfast.vehicle.databinding.FragmentCarMangementBinding) roleManagementFragment.T1()).d;
                kotlin.jvm.internal.Intrinsics.k(imageView, "imageVehicle");
                imageUtils.h(imageView, strN, com.vinfast.vehicle.R.drawable.bg_car_not_button_add);
            }
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit O2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.lang.Boolean bool) {
        com.vinfast.vehicle.databinding.FragmentCarMangementBinding fragmentCarMangementBinding = (com.vinfast.vehicle.databinding.FragmentCarMangementBinding) roleManagementFragment.T1();
        if (kotlin.jvm.internal.Intrinsics.g(bool, java.lang.Boolean.TRUE)) {
            com.facebook.shimmer.ShimmerFrameLayout shimmerFrameLayout = fragmentCarMangementBinding.f;
            kotlin.jvm.internal.Intrinsics.k(shimmerFrameLayout, "shimmerView");
            shimmerFrameLayout.setVisibility(0);
            fragmentCarMangementBinding.f.d();
            android.widget.RelativeLayout relativeLayout = fragmentCarMangementBinding.j;
            kotlin.jvm.internal.Intrinsics.k(relativeLayout, "viewRoleInfo");
            com.vinfast.companion.core.extensions.ViewExtensionKt.m(relativeLayout);
            androidx.constraintlayout.widget.ConstraintLayout constraintLayout = fragmentCarMangementBinding.k;
            kotlin.jvm.internal.Intrinsics.k(constraintLayout, "viewVehicle");
            com.vinfast.companion.core.extensions.ViewExtensionKt.m(constraintLayout);
        } else {
            com.facebook.shimmer.ShimmerFrameLayout shimmerFrameLayout2 = fragmentCarMangementBinding.f;
            kotlin.jvm.internal.Intrinsics.k(shimmerFrameLayout2, "shimmerView");
            shimmerFrameLayout2.setVisibility(8);
            fragmentCarMangementBinding.f.e();
            android.widget.RelativeLayout relativeLayout2 = fragmentCarMangementBinding.j;
            kotlin.jvm.internal.Intrinsics.k(relativeLayout2, "viewRoleInfo");
            com.vinfast.companion.core.extensions.ViewExtensionKt.S(relativeLayout2);
            androidx.constraintlayout.widget.ConstraintLayout constraintLayout2 = fragmentCarMangementBinding.k;
            kotlin.jvm.internal.Intrinsics.k(constraintLayout2, "viewVehicle");
            com.vinfast.companion.core.extensions.ViewExtensionKt.S(constraintLayout2);
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit P2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, com.vinfast.companion.vehiclekit.model.RoleInfo roleInfo) {
        if (roleInfo != null) {
            android.os.Bundle bundleB = androidx.core.os.BundleKt.b(new kotlin.Pair[]{kotlin.TuplesKt.a("key_role_data", roleInfo), kotlin.TuplesKt.a("key_load_driver_info", java.lang.Boolean.valueOf(roleManagementFragment.needLoadDataInRoleDetail))});
            roleManagementFragment.needLoadDataInRoleDetail = false;
            androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).M(com.vinfast.vehicle.R.id.roleDataInfoFragment, bundleB);
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit Q2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.lang.Boolean bool) {
        if (kotlin.jvm.internal.Intrinsics.g(bool, java.lang.Boolean.TRUE)) {
            roleManagementFragment.requireActivity().finish();
        }
        return kotlin.Unit.a;
    }

    private final void R2() {
        com.vinfast.companion.core.managers.IAccountAuthenticator.b(y2(), this, null, null, new com.vinfast.companion.core.managers.IAccountAuthenticator.BiometricDialogType.RequestAuthentication(com.vinfast.companion.core.managers.IAccountAuthenticator.AuthenticationMode.VerifyAccount), null, false, false, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.o
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.S2(this.a, (com.vinfast.companion.core.managers.IAccountAuthenticator.VFAuthenticationResult) obj);
            }
        }, null, null, null, null, false, 8054, null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit S2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, com.vinfast.companion.core.managers.IAccountAuthenticator.VFAuthenticationResult vFAuthenticationResult) {
        kotlin.jvm.internal.Intrinsics.l(vFAuthenticationResult, "result");
        if (vFAuthenticationResult instanceof com.vinfast.companion.core.managers.IAccountAuthenticator.VFAuthenticationResult.AuthSuccess) {
            java.lang.String str = roleManagementFragment.typeCheckAuth;
            if (kotlin.jvm.internal.Intrinsics.g(str, roleManagementFragment.TYPE_REQUEST_AUTHEN_TRANSFER_OWNERSHIP)) {
                androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).L(com.vinfast.vehicle.R.id.transferOwnerShipFragment);
            } else if (kotlin.jvm.internal.Intrinsics.g(str, roleManagementFragment.TYPE_REQUEST_AUTHEN_REMOVE_DRIVER)) {
                roleManagementFragment.A2().O0(com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.OwnerRemoveSecondDriver);
            } else if (kotlin.jvm.internal.Intrinsics.g(str, roleManagementFragment.TYPE_REQUEST_AUTHEN_DRIVER_LEAVE)) {
                roleManagementFragment.A2().O0(com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.SecondDriverRemoveYourSelf);
            }
            roleManagementFragment.typeCheckAuth = null;
        }
        return kotlin.Unit.a;
    }

    private final void T2() {
        androidx.lifecycle.SavedStateHandle savedStateHandleJ;
        androidx.lifecycle.MutableLiveData mutableLiveDataD;
        androidx.navigation.NavBackStackEntry navBackStackEntryU = androidx.navigation.fragment.FragmentKt.a(this).u();
        if (navBackStackEntryU != null && (savedStateHandleJ = navBackStackEntryU.j()) != null && (mutableLiveDataD = savedStateHandleJ.d("flag_refresh_data")) != null) {
            mutableLiveDataD.j(this, new com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment$sam$androidx_lifecycle_Observer$0(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.f
                public final java.lang.Object invoke(java.lang.Object obj) {
                    return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.U2(this.a, (java.lang.Boolean) obj);
                }
            }));
        }
        com.vinfast.vehicle.databinding.FragmentCarMangementBinding fragmentCarMangementBinding = (com.vinfast.vehicle.databinding.FragmentCarMangementBinding) T1();
        fragmentCarMangementBinding.e.setAdapter(z2());
        androidx.appcompat.widget.AppCompatTextView appCompatTextView = fragmentCarMangementBinding.b;
        kotlin.jvm.internal.Intrinsics.k(appCompatTextView, "btnLearMore");
        com.vinfast.companion.core.extensions.ViewExtensionKt.G(appCompatTextView, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.g
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.V2(this.a, (android.view.View) obj);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit U2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.lang.Boolean bool) {
        androidx.lifecycle.SavedStateHandle savedStateHandleJ;
        timber.log.Timber.a.a("result add driver " + bool, new java.lang.Object[0]);
        if (bool != null) {
            boolean zBooleanValue = bool.booleanValue();
            androidx.navigation.NavBackStackEntry navBackStackEntryU = androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).u();
            if (navBackStackEntryU != null && (savedStateHandleJ = navBackStackEntryU.j()) != null) {
            }
            if (zBooleanValue) {
                roleManagementFragment.A2().r0(true);
            }
        }
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit V2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, android.view.View view) {
        kotlin.jvm.internal.Intrinsics.l(view, "it");
        com.vinfast.companion.core.logger.firebase.FLog.c(roleManagementFragment.j0(), com.vinfast.companion.core.logger.firebase.FLogKey.RoleDetails.b, null, 2, null);
        androidx.navigation.fragment.FragmentKt.a(roleManagementFragment).L(com.vinfast.vehicle.R.id.learMoreRoleManagementFragment);
        return kotlin.Unit.a;
    }

    private final void W2() {
        com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
        androidx.fragment.app.FragmentManager childFragmentManager = getChildFragmentManager();
        kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
        companion.a(childFragmentManager, (6290294 & 2) != 0 ? false : false, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20800_pending_driver_request), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : null, (6290294 & 128) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20800_please_accept_driver), (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : null, (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20800_not_now), (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20800_accept), (6290294 & 32768) != 0 ? null : null, (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : null, (6290294 & 524288) != 0 ? null : null, (6290294 & 1048576) != 0 ? null : new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.caraccess.vietnamese.h
            public final java.lang.Object invoke() {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.X2(this.a);
            }
        }, (6290294 & 2097152) != 0 ? null : null, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit X2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment) {
        roleManagementFragment.Y2();
        return kotlin.Unit.a;
    }

    private final void Y2() {
        com.vinfast.vehicle.caraccess.VerifyCodeDialogFragment.Companion companion = com.vinfast.vehicle.caraccess.VerifyCodeDialogFragment.INSTANCE;
        androidx.fragment.app.FragmentManager childFragmentManager = getChildFragmentManager();
        kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
        this.dialogVerify = companion.a(childFragmentManager, true, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.caraccess.vietnamese.j
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.Z2(this.a, (java.lang.String) obj);
            }
        }, new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.caraccess.vietnamese.k
            public final java.lang.Object invoke() {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.a3(this.a);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit Z2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment, java.lang.String str) {
        kotlin.jvm.internal.Intrinsics.l(str, "it");
        roleManagementFragment.A2().h0(str);
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit a3(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment) {
        roleManagementFragment.dialogVerify = null;
        return kotlin.Unit.a;
    }

    private final void b3() {
        com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
        androidx.fragment.app.FragmentManager childFragmentManager = getChildFragmentManager();
        kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
        companion.a(childFragmentManager, (6290294 & 2) != 0 ? false : false, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_confirm_cancellation), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : null, (6290294 & 128) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20803_are_you_sure_cancel_driver), (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : null, (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20803_yes_cancel_it), (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_btn_no), (6290294 & 32768) != 0 ? null : null, (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : null, (6290294 & 524288) != 0 ? null : new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.caraccess.vietnamese.m
            public final java.lang.Object invoke() {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.c3(this.a);
            }
        }, (6290294 & 1048576) != 0 ? null : null, (6290294 & 2097152) != 0 ? null : null, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit c3(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment) {
        roleManagementFragment.A2().O0(com.vinfast.vehicle.caraccess.global.roleinfo.TypeChangeData.OwnerCancelRequest);
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final com.vinfast.vehicle.databinding.FragmentCarMangementBinding s2(android.view.LayoutInflater layoutInflater) {
        kotlin.jvm.internal.Intrinsics.l(layoutInflater, "it");
        com.vinfast.vehicle.databinding.FragmentCarMangementBinding fragmentCarMangementBindingC = com.vinfast.vehicle.databinding.FragmentCarMangementBinding.c(layoutInflater);
        kotlin.jvm.internal.Intrinsics.k(fragmentCarMangementBindingC, "inflate(...)");
        return fragmentCarMangementBindingC;
    }

    private final void t2() {
        android.content.Intent intent = new android.content.Intent();
        intent.putExtra("key_reload_data_notification", true);
        requireActivity().setResult(-1, intent);
    }

    private final boolean u2() {
        java.util.List list = (java.util.List) A2().getListUserRole().f();
        return list != null && list.contains(com.vinfast.companion.core.uiPrototype.base.UserRole.SecondaryDriverPending);
    }

    private final void v2(boolean isRemoveYourself) {
        this.typeCheckAuth = isRemoveYourself ? this.TYPE_REQUEST_AUTHEN_DRIVER_LEAVE : this.TYPE_REQUEST_AUTHEN_REMOVE_DRIVER;
        com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
        androidx.fragment.app.FragmentManager childFragmentManager = getChildFragmentManager();
        kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
        companion.a(childFragmentManager, (6290294 & 2) != 0 ? false : false, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(isRemoveYourself ? com.vinfast.vehicle.R.string.CA20800_remove_yourself_as : com.vinfast.vehicle.R.string.CA20803_remove_driver), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : null, (6290294 & 128) != 0 ? null : java.lang.Integer.valueOf(isRemoveYourself ? com.vinfast.vehicle.R.string.CA20800_this_will_totally : com.vinfast.vehicle.R.string.CA20807_this_will_totally), (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : null, (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : java.lang.Integer.valueOf(isRemoveYourself ? com.vinfast.vehicle.R.string.common_btn_remove : com.vinfast.vehicle.R.string.CA20803_remove_driver), (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_btn_cancel), (6290294 & 32768) != 0 ? null : null, (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : null, (6290294 & 524288) != 0 ? null : new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.caraccess.vietnamese.n
            public final java.lang.Object invoke() {
                return com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment.w2(this.a);
            }
        }, (6290294 & 1048576) != 0 ? null : null, (6290294 & 2097152) != 0 ? null : null, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit w2(com.vinfast.vehicle.caraccess.vietnamese.RoleManagementFragment roleManagementFragment) {
        roleManagementFragment.R2();
        return kotlin.Unit.a;
    }

    private final com.vinfast.companion.core.base.fragment.ToolbarConfiguration x2() {
        android.os.Bundle extras;
        android.content.Intent intent = requireActivity().getIntent();
        java.lang.Object obj = (intent == null || (extras = intent.getExtras()) == null) ? null : extras.get("list_user_role");
        java.util.List list = obj instanceof java.util.List ? (java.util.List) obj : null;
        return com.vinfast.companion.core.base.fragment.ToolbarConfiguration.Builder.z(new com.vinfast.companion.core.base.fragment.ToolbarConfiguration.Builder().r(true).t(false).A(com.vinfast.vehicle.R.string.feature_name_role_management), (list == null || list.contains(com.vinfast.companion.core.uiPrototype.base.UserRole.SecondaryDriverPending)) ? false : true, 0, 2, null).a();
    }

    private final com.vinfast.companion.core.base.ui.adapter.ItemRoleVehicleAdapter z2() {
        return (com.vinfast.companion.core.base.ui.adapter.ItemRoleVehicleAdapter) this.listUserRoleAdapter.getValue();
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.UninitializedPropertyAccessException */
    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public void I0(com.vinfast.companion.core.base.ViewModelState.Error error) throws kotlin.UninitializedPropertyAccessException {
        kotlin.jvm.internal.Intrinsics.l(error, "error");
        if (kotlin.jvm.internal.Intrinsics.g(error.getCode(), "400522")) {
            return;
        }
        com.vinfast.vehicle.caraccess.VerifyCodeDialogFragment verifyCodeDialogFragment = this.dialogVerify;
        if (verifyCodeDialogFragment == null || !verifyCodeDialogFragment.isVisible()) {
            super.I0(error);
            return;
        }
        java.lang.String string = kotlin.jvm.internal.Intrinsics.g(error.getCode(), "offline") ? getString(com.vinfast.vehicle.R.string.CA20803_failed_to_accept) : error.getError();
        kotlin.jvm.internal.Intrinsics.i(string);
        android.content.Context contextRequireContext = requireContext();
        kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
        com.vinfast.companion.core.base.ui.widget.VFToastKt.d(contextRequireContext, string, com.vinfast.companion.core.base.ui.widget.ToastType.BottomFailed, false, 4, null);
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public com.vinfast.companion.core.base.fragment.ToolbarConfiguration T0() {
        return x2();
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public com.vinfast.companion.core.base.BaseViewModel U1() {
        return A2();
    }

    @Override // com.vinfast.companion.core.base.fragment.HiltFragment
    public void onDestroy() {
        super.onDestroy();
        this.dialogVerify = null;
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public void y1(android.view.View view, android.os.Bundle savedInstanceState) {
        kotlin.jvm.internal.Intrinsics.l(view, "view");
        T2();
        B2();
    }

    public final com.vinfast.companion.core.managers.IAccountAuthenticator y2() {
        com.vinfast.companion.core.managers.IAccountAuthenticator iAccountAuthenticator = this.accountAuthenticator;
        if (iAccountAuthenticator != null) {
            return iAccountAuthenticator;
        }
        kotlin.jvm.internal.Intrinsics.C("accountAuthenticator");
        return null;
    }
}
