package com.vinfast.companion.main.ui.glcomplaint.showroom;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@dagger.hilt.android.lifecycle.HiltViewModel
@kotlin.Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\b\b\u0007\u0018\u00002\u00020\u0001B\u0011\b\u0007\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0004\b\u0004\u0010\u0005J\u0019\u0010\t\u001a\u00020\b2\n\b\u0002\u0010\u0007\u001a\u0004\u0018\u00010\u0006¢\u0006\u0004\b\t\u0010\nJ\u0015\u0010\r\u001a\u00020\b2\u0006\u0010\f\u001a\u00020\u000b¢\u0006\u0004\b\r\u0010\u000eJ\u0017\u0010\u0011\u001a\u00020\b2\b\u0010\u0010\u001a\u0004\u0018\u00010\u000f¢\u0006\u0004\b\u0011\u0010\u0012J\r\u0010\u0013\u001a\u00020\b¢\u0006\u0004\b\u0013\u0010\u0014R\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0015\u0010\u0016R \u0010\u001c\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00190\u00180\u00178\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001a\u0010\u001bR\u001c\u0010\u001e\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00190\u00178\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001d\u0010\u001bR\u001c\u0010 \u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u00178\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001f\u0010\u001bR\u001d\u0010$\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00190\u00180!8F¢\u0006\u0006\u001a\u0004\b\"\u0010#R\u0019\u0010&\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00190!8F¢\u0006\u0006\u001a\u0004\b%\u0010#R\u0019\u0010(\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060!8F¢\u0006\u0006\u001a\u0004\b'\u0010#¨\u0006)"}, d2 = {"Lcom/vinfast/companion/main/ui/glcomplaint/showroom/GlShowroomProvinceViewModel;", "Lcom/vinfast/companion/core/base/BaseViewModel;", "Lcom/vinfast/companion/serviceskit/data/repository/MasterDataRepository;", "masterDataRepository", "<init>", "(Lcom/vinfast/companion/serviceskit/data/repository/MasterDataRepository;)V", "Lcom/vinfast/companion/map/model/MapLocation;", "mapLocation", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "R", "(Lcom/vinfast/companion/map/model/MapLocation;)V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "position", "T", "(I)V", "Landroid/os/Bundle;", "arguments", "N", "(Landroid/os/Bundle;)V", "M", "()V", "m", "Lcom/vinfast/companion/serviceskit/data/repository/MasterDataRepository;", "Landroidx/lifecycle/MutableLiveData;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/GlServiceCenter;", "n", "Landroidx/lifecycle/MutableLiveData;", "_serviceCenterLiveData", "o", "_selectedServiceCenterLiveData", "p", "_locationLiveData", "Landroidx/lifecycle/LiveData;", "Q", "()Landroidx/lifecycle/LiveData;", "serviceCenterLiveData", "P", "selectedServiceCenterLiveData", "O", "locationLiveData", "services_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class GlShowroomProvinceViewModel extends com.vinfast.companion.core.base.BaseViewModel {

    /* JADX INFO: renamed from: m, reason: from kotlin metadata */
    private final com.vinfast.companion.serviceskit.data.repository.MasterDataRepository masterDataRepository;

    /* JADX INFO: renamed from: n, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _serviceCenterLiveData;

    /* JADX INFO: renamed from: o, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _selectedServiceCenterLiveData;

    /* JADX INFO: renamed from: p, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _locationLiveData;

    public GlShowroomProvinceViewModel(com.vinfast.companion.serviceskit.data.repository.MasterDataRepository masterDataRepository) {
        kotlin.jvm.internal.Intrinsics.l(masterDataRepository, "masterDataRepository");
        this.masterDataRepository = masterDataRepository;
        this._serviceCenterLiveData = new androidx.lifecycle.MutableLiveData();
        this._selectedServiceCenterLiveData = new androidx.lifecycle.MutableLiveData();
        this._locationLiveData = new androidx.lifecycle.MutableLiveData();
    }

    public static /* synthetic */ void S(com.vinfast.companion.main.ui.glcomplaint.showroom.GlShowroomProvinceViewModel glShowroomProvinceViewModel, com.vinfast.companion.map.model.MapLocation mapLocation, int i, java.lang.Object obj) {
        if ((i & 1) != 0) {
            mapLocation = null;
        }
        glShowroomProvinceViewModel.R(mapLocation);
    }

    public final void M() {
        this._selectedServiceCenterLiveData.n((java.lang.Object) null);
    }

    public final void N(android.os.Bundle arguments) {
        com.vinfast.companion.serviceskit.domain.model.GlServiceCenter glServiceCenter;
        android.os.Parcelable parcelable;
        if (arguments != null) {
            if (android.os.Build.VERSION.SDK_INT >= 33) {
                parcelable = (android.os.Parcelable) com.vinfast.companion.authentication.ui.signup.termandcondition.batteryaoutopayment.a.a(arguments, "KEY_SERVICE_CENTER", com.vinfast.companion.serviceskit.domain.model.GlServiceCenter.class);
            } else {
                android.os.Parcelable parcelable2 = arguments.getParcelable("KEY_SERVICE_CENTER");
                if (!(parcelable2 instanceof com.vinfast.companion.serviceskit.domain.model.GlServiceCenter)) {
                    parcelable2 = null;
                }
                parcelable = (com.vinfast.companion.serviceskit.domain.model.GlServiceCenter) parcelable2;
            }
            glServiceCenter = (com.vinfast.companion.serviceskit.domain.model.GlServiceCenter) parcelable;
        } else {
            glServiceCenter = null;
        }
        this._selectedServiceCenterLiveData.q(glServiceCenter);
        S(this, null, 1, null);
    }

    public final androidx.lifecycle.LiveData O() {
        return this._locationLiveData;
    }

    public final androidx.lifecycle.LiveData P() {
        return this._selectedServiceCenterLiveData;
    }

    public final androidx.lifecycle.LiveData Q() {
        return this._serviceCenterLiveData;
    }

    public final void R(com.vinfast.companion.map.model.MapLocation mapLocation) {
        this._locationLiveData.n(mapLocation);
        kotlinx.coroutines.BuildersKt.d(androidx.lifecycle.ViewModelKt.a(this), kotlinx.coroutines.Dispatchers.c(), (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.main.ui.glcomplaint.showroom.GlShowroomProvinceViewModel$getServiceCenters$1(this, mapLocation, null), 2, (java.lang.Object) null);
    }

    public final void T(int position) {
        if (this._serviceCenterLiveData.f() == null) {
            return;
        }
        java.lang.Object objF = this._serviceCenterLiveData.f();
        kotlin.jvm.internal.Intrinsics.i(objF);
        java.util.List list = (java.util.List) objF;
        if (position < 0 || position >= list.size()) {
            return;
        }
        this._selectedServiceCenterLiveData.q(list.get(position));
    }
}
