Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 HomeActivityViewModel.java 源代码,内容仅作参考
package in.swiggy.android.mvvm.home.viewmodel;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.ArrayMap;
import androidx.databinding.ObservableBoolean;
import androidx.databinding.ObservableField;
import androidx.databinding.ObservableFloat;
import androidx.databinding.ObservableInt;
import androidx.databinding.j;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.l0;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.newrelic.agent.android.instrumentation.GsonInstrumentation;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.instrumentation.JSONObjectInstrumentation;
import com.rudderstack.android.sdk.core.ecomm.ECommerceParamNames;
import com.swiggy.gandalf.widgets.v2.Card;
import com.swiggy.presentation.food.v2.TrackCrouton;
import com.swiggy.presentation.food.v2.TrackCroutonWidget;
import com.swiggy.sf.foundation.gateway.v1.OverlayResponse;
import in.juspay.hypersdk.core.PaymentConstants;
import in.swiggy.android.R;
import in.swiggy.android.activities.DeepLinkActivity;
import in.swiggy.android.activities.LoginLimitErrorActivity;
import in.swiggy.android.analytics.perf.SwiggyPerfMonitor;
import in.swiggy.android.apputils.MediaPlatformUtil;
import in.swiggy.android.chat.polling.ChatPollingViewModel;
import in.swiggy.android.commons.extension.KotlinExtensionsKt;
import in.swiggy.android.commons.utils.DispatchProviderKt;
import in.swiggy.android.commons.utils.f0;
import in.swiggy.android.commons.utils.imageutil.ImageUrlBuilder;
import in.swiggy.android.compass.defaulting.AppDefaultingContext;
import in.swiggy.android.compass.defaulting.DefaultingConfigUtils;
import in.swiggy.android.crosspollination.feature.bottommediasheet.BottomMediaSheetProvider;
import in.swiggy.android.detectapktamper.l;
import in.swiggy.android.discovery.pageviewmodels.HomeActivityViewModelHelper2Kt;
import in.swiggy.android.discovery.pageviewmodels.LandingCartViewModelHelperKt;
import in.swiggy.android.discovery.shortcuts.InstamartAppShortcutUseCase;
import in.swiggy.android.discovery.utils.cache.FoodDiscoveryCacheManager;
import in.swiggy.android.discovery.utils.cache.HomeDiscoveryCacheManager;
import in.swiggy.android.eventMigration.EventPauseResumeUseCase;
import in.swiggy.android.feature.appUpdate.AppUpdatePopupState;
import in.swiggy.android.feature.cnr.UserCommHelper;
import in.swiggy.android.feature.dbbpopup.datamanager.BottomBarPopupDataManager;
import in.swiggy.android.feature.dbbpopup.provider.BottomBarPopupProvider;
import in.swiggy.android.feature.home.HomeActivityViewModelExtensionsKt;
import in.swiggy.android.feature.home.helpers.IdHelper;
import in.swiggy.android.feature.landing.viewmodel.LandingViewCartViewModel;
import in.swiggy.android.feature.rating.RatingLauncherUtility;
import in.swiggy.android.launchApi.aggregated.AggregateLaunchManager;
import in.swiggy.android.mvvm.home.ThirdPartySDKUtils;
import in.swiggy.android.mvvm.home.c;
import in.swiggy.android.mvvm.viewmodels.BadFoodOrderCroutonViewModel;
import in.swiggy.android.mvvm.viewmodels.PaymentCroutonViewModel;
import in.swiggy.android.mvvm.viewmodels.nux.PreLaunchViewModel;
import in.swiggy.android.mvvm.viewmodels.splash.SwiggySplashViewModel;
import in.swiggy.android.network.interceptors.p;
import in.swiggy.android.nudgeFramework.NudgesManager;
import in.swiggy.android.overlay.data.OverlayRemovalState;
import in.swiggy.android.overlay.data.OverlayType;
import in.swiggy.android.overlay.data.c;
import in.swiggy.android.overlay.handler.OverlayUseCase;
import in.swiggy.android.overlays.i;
import in.swiggy.android.overlays.network.b;
import in.swiggy.android.overlays.trackCrouton.TrackCroutonViewModel;
import in.swiggy.android.payment.utility.UserPaymentMethodObject;
import in.swiggy.android.payment.utility.eligibility.b;
import in.swiggy.android.payment.utility.eligibility.c;
import in.swiggy.android.payment.utility.placeorder.PlaceOrderUtility;
import in.swiggy.android.services.ChatBubbleService;
import in.swiggy.android.swiggylynx.plugins.payment.paymentcoreplugin.paymentpending.PaymentPendingRequestPayload;
import in.swiggy.android.swiggylynx.plugins.payment.paymentcoreplugin.paymentpending.PendingPaymentRequestParams;
import in.swiggy.android.tejas.api.models.SwiggyApiResponse;
import in.swiggy.android.tejas.api.models.SwiggyBaseResponse;
import in.swiggy.android.tejas.feature.chathead.OrderTypes;
import in.swiggy.android.tejas.feature.crosspollination.usecase.UpdateEngagementUseCase;
import in.swiggy.android.tejas.feature.discovery.pageskeleton.usecase.PageSkeletonUseCase;
import in.swiggy.android.tejas.feature.edm.model.EdmPostableRating;
import in.swiggy.android.tejas.feature.edm.model.EdmRatingType;
import in.swiggy.android.tejas.feature.edm.model.RatingSource;
import in.swiggy.android.tejas.feature.feedback.DashRatingsManager;
import in.swiggy.android.tejas.feature.home.launchconfig.LaunchConfigUseCase;
import in.swiggy.android.tejas.feature.home.launchconfig.model.LaunchConfigRequestParams;
import in.swiggy.android.tejas.feature.home.launchconfig.model.LaunchConfigRequestParamsKt;
import in.swiggy.android.tejas.feature.home.model.pageconfig.bottommediasheet.BottomMediaSheet;
import in.swiggy.android.tejas.feature.home.model.pageconfig.dbbpopup.BottomBarPopup;
import in.swiggy.android.tejas.feature.launch.LaunchDataTransformer;
import in.swiggy.android.tejas.feature.launch.model.consumable.FeedbackLaunchItem;
import in.swiggy.android.tejas.feature.launch.model.network.LaunchHeaders;
import in.swiggy.android.tejas.feature.moneta.MonetaOrderManager;
import in.swiggy.android.tejas.feature.order.legacy.model.Order;
import in.swiggy.android.tejas.feature.timeline.model.Destination;
import in.swiggy.android.tejas.oldapi.SwiggyBaseResponseHandler;
import in.swiggy.android.tejas.oldapi.SwiggyDataHandler;
import in.swiggy.android.tejas.oldapi.models.cart.CartType;
import in.swiggy.android.tejas.oldapi.models.usercomms.UserComm;
import in.swiggy.android.tejas.oldapi.network.requests.PostableAggregatedLaunchRequest;
import in.swiggy.android.tejas.oldapi.network.requests.PostableLaunchRequest;
import in.swiggy.android.tejas.oldapi.network.responses.FeedbackOrder;
import in.swiggy.android.tejas.oldapi.network.responses.LaunchCroutonData;
import in.swiggy.android.tejas.oldapi.network.responses.LaunchData;
import in.swiggy.android.tejas.oldapi.network.responses.UserLaunchData;
import in.swiggy.android.tejas.oldapi.network.responses.handlers.LaunchResponseHandler;
import in.swiggy.android.tejas.oldapi.network.responses.handlers.UserResponseHandler;
import in.swiggy.android.tejas.oldapi.network.responses.orderhistory.ServiceLineTypes;
import in.swiggy.android.tejas.payment.model.placeorder.PlaceAndConfirmOrderResponseDataModel;
import in.swiggy.android.utils.croutons.HudDebugTracking;
import in.swiggy.android.utils.q0;
import in.swiggy.android.utils.t1;
import in.swiggy.guidedshopping.network.store.GuidedDiscoveryStore;
import io.reactivex.processors.BehaviorProcessor;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlinx.coroutines.h0;
import kotlinx.coroutines.i0;
import kotlinx.coroutines.j0;
import kotlinx.coroutines.q1;
import kotlinx.coroutines.v0;
import org.apache.pdfbox.pdmodel.documentinterchange.taggedpdf.PDLayoutAttributeObject;
import org.json.JSONException;
import org.json.JSONObject;
@Instrumented
public final class HomeActivityViewModel extends in.swiggy.android.commonsui.ui.base.a implements in.swiggy.android.repositories.cart.interfaces.a, in.swiggy.android.commoninterfaces.g, in.swiggy.android.crosspollination.feature.bottommediasheet.c, in.swiggy.android.crosspollination.feature.bottommediasheet.datamodel.c, in.swiggy.android.crosspollination.feature.bottommediasheet.b {
public static final a J2 = new a(null);
public static final int K2 = 8;
private static boolean L2;
public SharedPreferences A;
private boolean A0;
private androidx.lifecycle.y<Drawable> A1;
private final kotlin.j A2;
private androidx.lifecycle.y<AppUpdatePopupState> B;
private boolean B0;
private final LaunchDataTransformer B1;
private io.reactivex.disposables.b B2;
public dagger.a<MonetaOrderManager> C;
private final ObservableField<in.swiggy.android.crosspollination.feature.bottommediasheet.datamodel.b> C0;
private final androidx.lifecycle.y<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.c>> C1;
private io.reactivex.disposables.b C2;
public dagger.a<DashRatingsManager> D;
public dagger.a<in.swiggy.android.feature.launch.a> D0;
private final LiveData<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.c>> D1;
private final i0 D2;
public BehaviorProcessor<in.swiggy.android.activities.c> E;
public dagger.a<in.swiggy.android.payment.services.interfaces.b> E0;
private final androidx.lifecycle.y<in.swiggy.koordinates.core.f> E1;
private LaunchResponseHandler E2;
public dagger.a<in.swiggy.android.feature.fingerprint.g> F;
public dagger.a<in.swiggy.android.payment.services.interfaces.c> F0;
private final LiveData<in.swiggy.koordinates.core.f> F1;
private UserResponseHandler F2;
public dagger.a<in.swiggy.android.ratingkit.a> G;
public in.swiggy.android.payment.services.interfaces.d G0;
private final androidx.lifecycle.y<LaunchConfigRequestParams> G1;
private boolean G2;
public dagger.a<RatingLauncherUtility> H;
public dagger.a<BottomBarPopupDataManager> H0;
private final LiveData<LaunchConfigRequestParams> H1;
private final j.a H2;
public dagger.a<ChatPollingViewModel> I;
public OverlayUseCase I0;
private final androidx.lifecycle.y<Bundle> I1;
private final in.swiggy.android.payment.utility.placeorder.b I2;
public dagger.a<in.swiggy.android.swiggylynx.headers.a> J;
public dagger.a<in.swiggy.android.feature.address.dormantNudges.a> J0;
private final LiveData<Bundle> J1;
public dagger.a<in.swiggy.android.mxn.relevance.h> K;
public dagger.a<UpdateEngagementUseCase> K0;
private final androidx.lifecycle.y<Bundle> K1;
public in.swiggy.android.apputils.d L;
public in.swiggy.android.apputils.bottombar.a L0;
private final LiveData<Bundle> L1;
public dagger.a<in.swiggy.android.discovery.dynamicbottombar.a> M;
public dagger.a<NudgesManager> M0;
private final androidx.lifecycle.y<in.swiggy.android.mvvm.home.models.a> M1;
public dagger.a<in.swiggy.android.commons.ozone.b> N;
public dagger.a<PlaceOrderUtility> N0;
private final LiveData<in.swiggy.android.mvvm.home.models.a> N1;
public dagger.b<LandingViewCartViewModel> O;
public dagger.a<in.swiggy.android.commonsui.utils.dls.i> O0;
private final androidx.lifecycle.y<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.h>> O1;
public dagger.b<PreLaunchViewModel> P;
public dagger.a<in.swiggy.android.commonsui.utils.dls.f> P0;
private final LiveData<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.h>> P1;
public dagger.b<PaymentCroutonViewModel> Q;
public in.swiggy.android.analytics.newrelic.a Q0;
private final kotlin.j Q1;
public dagger.b<BadFoodOrderCroutonViewModel> R;
public in.swiggy.android.discovery.contextualtrigger.triggers.l R0;
private final Function2<String, Boolean, Unit> R1;
public dagger.a<in.swiggy.android.apputils.f> S;
private final kotlin.j S0;
private final Function0<Unit> S1;
public dagger.a<PageSkeletonUseCase> T;
public in.swiggy.android.detectapktamper.f T0;
private final kotlin.j T1;
public dagger.a<LaunchConfigUseCase> U;
public io.reactivex.subjects.a<in.swiggy.android.detectapktamper.l> U0;
private final kotlin.j U1;
public dagger.a<AggregateLaunchManager> V;
private final ObservableInt V0;
private final kotlin.j V1;
public in.swiggy.android.apputils.bottombar.d W;
private final ObservableBoolean W0;
private boolean W1;
public in.swiggy.android.analytics.newrelic.a X;
private final ObservableBoolean X0;
private boolean X1;
public in.swiggy.android.launchApi.consumers.a Y;
private final ObservableBoolean Y0;
private q1 Y1;
private q1 Z;
private final ObservableBoolean Z0;
private q1 Z1;
private final ObservableBoolean a1;
public dagger.a<UserCommHelper> a2;
private final ObservableBoolean b1;
public dagger.a<in.swiggy.android.discovery.dynamicbottombar.e> b2;
private q1 c0;
private final ObservableBoolean c1;
public dagger.a<in.swiggy.android.repositories.cart.services.i> c2;
private final ObservableBoolean d1;
public dagger.a<q0> d2;
private final ObservableBoolean e1;
public in.swiggy.android.config.c e2;
private final androidx.lifecycle.y<Boolean> f1;
public SharedPreferences f2;
private final ObservableFloat g1;
public in.swiggy.android.repositories.interfaces.e g2;
private final ThirdPartySDKUtils h;
private final kotlin.j h1;
public in.swiggy.android.analytics.generated.e h2;
private final in.swiggy.android.mvvm.home.f i;
private final kotlin.j i1;
public in.swiggy.android.commons.utils.contextservice.h i2;
private final in.swiggy.android.mvvm.home.j j;
private final ObservableInt j1;
public in.swiggy.koordinates.compass.core.b j2;
private final dagger.a<in.swiggy.android.overlays.trackCrouton.store.a> k;
private final ObservableInt k1;
public in.swiggy.android.repositories.interfaces.d k2;
private final dagger.a<in.swiggy.android.overlays.b> l;
private final ObservableInt l1;
public dagger.a<in.swiggy.android.listingkit.interfaces.i> l2;
private volatile boolean m;
private final ObservableInt m1;
public dagger.a<HomeDiscoveryCacheManager> m2;
private boolean n;
private final ObservableInt n1;
public in.swiggy.android.mndutils.h n2;
private boolean o;
private final ObservableInt o1;
public in.swiggy.android.mvvm.services.s o2;
public dagger.a<in.swiggy.android.repositories.interfaces.b> p;
private q1 p0;
private io.reactivex.disposables.a p1;
public in.swiggy.android.commons.featureFlags.d p2;
public dagger.a<in.swiggy.android.networkutils.n> q;
private final ObservableField<in.swiggy.android.commonsui.ui.view.bottombar.b> q1;
public in.swiggy.android.mxn.swiggyats.a q2;
public AppDefaultingContext r;
private final ObservableField<List<in.swiggy.android.utils.d>> r1;
public dagger.a<in.swiggy.android.feature.landing.viewmodel.g> r2;
public dagger.a<in.swiggy.android.discovery.pageskeleton.datamanager.b> s;
private final ObservableInt s1;
public dagger.a<in.swiggy.android.commonsFeature.orderIdStore.liveOrder.a> s2;
public dagger.a<in.swiggy.android.analytics.interfaces.c> t;
private String t1;
public dagger.a<EventPauseResumeUseCase> t2;
public dagger.a<HudDebugTracking> u;
private androidx.lifecycle.y<Boolean> u1;
public dagger.a<GuidedDiscoveryStore> u2;
public in.swiggy.android.overlays.trackCrouton.logs.a v;
private ObservableField<in.swiggy.android.feature.dbbpopup.datamodel.b> v1;
public dagger.a<in.swiggy.android.mxn.launch.a> v2;
public dagger.a<in.swiggy.android.commoninterfaces.d> w;
private io.reactivex.disposables.b w1;
private final kotlin.j w2;
public in.swiggy.android.discovery.utils.cache.c x;
private int x1;
private final kotlin.j x2;
public dagger.a<FoodDiscoveryCacheManager> y;
private q1 y0;
private boolean y1;
private final Function0<Unit> y2;
public dagger.a<InstamartAppShortcutUseCase> z;
private Boolean z0;
private boolean z1;
private final kotlin.j z2;
public abstract class LaunchResponseHandlerV1 extends LaunchResponseHandler {
public LaunchResponseHandlerV1() {
}
@Override
public void handleOnSuccess(SwiggyApiResponse<LaunchData> response) {
LaunchData data;
kotlin.jvm.internal.o.k(response, "response");
if (response.getData() != null && (data = response.getData()) != null) {
HomeActivityViewModel homeActivityViewModel = HomeActivityViewModel.this;
kotlinx.coroutines.i.d(l0.a(homeActivityViewModel), DispatchProviderKt.c().Q(DispatchProviderKt.b().n1()), null, new HomeActivityViewModel$LaunchResponseHandlerV1$handleOnSuccess$$inlined$ioScope$1(null, homeActivityViewModel, data), 2, null);
HomeActivityViewModel.this.jc();
HomeActivityViewModelHelper2Kt.a(HomeActivityViewModel.this, data);
HomeActivityViewModel.this.oa().edit().putBoolean("fire_launch_api_after_order_placed", false).apply();
HomeActivityViewModel.this.e3().y(data.xpConfigMap);
if (in.swiggy.android.commonsFeature.utils.c.a.b(HomeActivityViewModel.this.oa())) {
String e = MediaPlatformUtil.e(HomeActivityViewModel.this.e3(), HomeActivityViewModel.this.oa());
if (e != null) {
ImageUrlBuilder.D(e, HomeActivityViewModel.this.oa());
}
} else {
ImageUrlBuilder.C(HomeActivityViewModel.this.oa());
}
MediaPlatformUtil mediaPlatformUtil = MediaPlatformUtil.a;
String g = mediaPlatformUtil.g(HomeActivityViewModel.this.e3(), HomeActivityViewModel.this.oa());
ImageUrlBuilder imageUrlBuilder = ImageUrlBuilder.a;
imageUrlBuilder.E(g);
HomeActivityViewModel.this.G().C(g);
imageUrlBuilder.F(mediaPlatformUtil.h(HomeActivityViewModel.this.e3(), HomeActivityViewModel.this.oa()));
HomeActivityViewModel.this.z8();
HomeActivityViewModel.this.Y9().a(c.v0.a);
}
}
@Override
public void handleUserComms(List<UserComm> commsData) {
kotlin.jvm.internal.o.k(commsData, "commsData");
HomeActivityViewModelHelper2Kt.b(HomeActivityViewModel.this, commsData);
}
@Override
public boolean launchPaymentCrouton(LaunchCroutonData croutonData) {
kotlin.jvm.internal.o.k(croutonData, "croutonData");
HomeActivityViewModelHelper2Kt.e(HomeActivityViewModel.this, croutonData);
return true;
}
@Override
public boolean launchRefunds(LaunchCroutonData croutonData) {
kotlin.jvm.internal.o.k(croutonData, "croutonData");
HomeActivityViewModelHelper2Kt.f(HomeActivityViewModel.this, croutonData);
return true;
}
@Override
public void logLaunchApiResponse(SwiggyApiResponse<LaunchData> response) {
kotlin.jvm.internal.o.k(response, "response");
HomeActivityViewModel.this.la().get().b(response);
}
}
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final boolean a() {
return HomeActivityViewModel.L2;
}
public final void b(boolean z) {
HomeActivityViewModel.L2 = z;
}
private a() {
}
}
public static final class b extends in.swiggy.android.payment.utility.eligibility.d {
b() {
}
@Override
public void b(in.swiggy.android.payment.utility.eligibility.c type) {
kotlin.jvm.internal.o.k(type, "type");
if (HomeActivityViewModel.this.y9() == null) {
HomeActivityViewModel.this.dd();
}
if (HomeActivityViewModel.this.Ea() == null) {
HomeActivityViewModel.this.ad();
}
}
}
public static final class c extends LaunchResponseHandlerV1 {
c() {
super();
}
@Override
public void handleOnSuccess(SwiggyApiResponse<LaunchData> response) {
Boolean bool;
int i;
boolean z;
boolean z2;
int i2;
boolean z3;
Boolean bool2;
boolean z4;
int i3;
boolean z5;
kotlin.jvm.internal.o.k(response, "response");
String str = null;
if (response.getSid() != null) {
String sid = response.getSid();
if (sid != null) {
int length = sid.length() - 1;
int i4 = 0;
boolean z6 = false;
while (i4 <= length) {
if (!z6) {
i3 = i4;
} else {
i3 = length;
}
if (kotlin.jvm.internal.o.m(sid.charAt(i3), 32) <= 0) {
z5 = true;
} else {
z5 = false;
}
if (!z6) {
if (!z5) {
z6 = true;
} else {
i4++;
}
} else if (!z5) {
break;
} else {
length--;
}
}
String obj = sid.subSequence(i4, length + 1).toString();
if (obj != null) {
if (obj.length() == 0) {
z4 = true;
} else {
z4 = false;
}
bool2 = Boolean.valueOf(z4);
if (!KotlinExtensionsKt.h(bool2)) {
HomeActivityViewModel.this.ra().setSessionId(response.getSid());
}
}
}
bool2 = null;
if (!KotlinExtensionsKt.h(bool2)) {
}
}
if (response.getTid() != null) {
String tid = response.getTid();
if (tid != null) {
int length2 = tid.length() - 1;
int i5 = 0;
boolean z7 = false;
while (i5 <= length2) {
if (!z7) {
i2 = i5;
} else {
i2 = length2;
}
if (kotlin.jvm.internal.o.m(tid.charAt(i2), 32) <= 0) {
z3 = true;
} else {
z3 = false;
}
if (!z7) {
if (!z3) {
z7 = true;
} else {
i5++;
}
} else if (!z3) {
break;
} else {
length2--;
}
}
String obj2 = tid.subSequence(i5, length2 + 1).toString();
if (obj2 != null) {
if (obj2.length() == 0) {
z2 = true;
} else {
z2 = false;
}
bool = Boolean.valueOf(z2);
if (!KotlinExtensionsKt.h(bool)) {
p.a aVar = in.swiggy.android.network.interceptors.p.e;
String tid2 = response.getTid();
if (tid2 != null) {
int length3 = tid2.length() - 1;
int i6 = 0;
boolean z8 = false;
while (i6 <= length3) {
if (!z8) {
i = i6;
} else {
i = length3;
}
if (kotlin.jvm.internal.o.m(tid2.charAt(i), 32) <= 0) {
z = true;
} else {
z = false;
}
if (!z8) {
if (!z) {
z8 = true;
} else {
i6++;
}
} else if (!z) {
break;
} else {
length3--;
}
}
str = tid2.subSequence(i6, length3 + 1).toString();
}
aVar.c(str, "https://disc.swiggy.comapi/v2/launch", HomeActivityViewModel.this.ra());
}
}
}
bool = null;
if (!KotlinExtensionsKt.h(bool)) {
}
}
super.handleOnSuccess(response);
}
@Override
public boolean launchFeedback() {
return HomeActivityViewModel.this.ob();
}
@Override
public void onNothingHandled(SwiggyApiResponse<LaunchData> response) {
kotlin.jvm.internal.o.k(response, "response");
}
@Override
public void onOtherErrors(SwiggyApiResponse<LaunchData> response) {
kotlin.jvm.internal.o.k(response, "response");
}
}
public static final class d extends j.a {
d() {
}
@Override
public void d(androidx.databinding.j sender, int i) {
String str;
kotlin.jvm.internal.o.k(sender, "sender");
if (HomeActivityViewModel.this.ka().g() > BitmapDescriptorFactory.HUE_RED) {
FeedbackOrder f = HomeActivityViewModel.this.O9().f();
FeedbackLaunchItem c = HomeActivityViewModel.this.O9().c();
if (c != null) {
HomeActivityViewModel.this.Y9().a(new c.o(c, (int) HomeActivityViewModel.this.ka().g()));
str = String.valueOf(c.getOrderJobId());
} else if (f != null) {
HomeActivityViewModel.this.Y9().a(new c.x(f, (int) HomeActivityViewModel.this.ka().g()));
str = f.mOrderId;
} else {
str = "";
}
HomeActivityViewModel.this.Ya().h(false);
HomeActivityViewModel.this.O9().i();
in.swiggy.android.analytics.gtm.g h = HomeActivityViewModel.this.pa().get().h("restaurant-listing", "click-rating-scale", str, (int) HomeActivityViewModel.this.ka().g());
kotlin.jvm.internal.o.j(h, "getGtmEventData(...)");
HomeActivityViewModel.this.pa().get().b(h);
}
}
}
public static final class e extends in.swiggy.android.feature.home.a {
e() {
}
@Override
public void a(PlaceAndConfirmOrderResponseDataModel placeAndConfirmOrderResponseDataModel, UserPaymentMethodObject userPaymentMethodObject) {
Order order;
if (placeAndConfirmOrderResponseDataModel != null) {
order = placeAndConfirmOrderResponseDataModel.getOrder();
} else {
order = null;
}
if (order != null) {
HomeActivityViewModel.this.Y9().a(new c.i0(order.toJson(), "HomeActivityViewModel"));
}
}
}
public static final class f extends TypeToken<List<? extends in.swiggy.android.apputils.i>> {
f() {
}
}
public static final class g extends UserResponseHandler {
g() {
}
@Override
public void handleOnSuccess(SwiggyApiResponse<UserLaunchData> swiggyApiResponse) {
UserLaunchData userLaunchData;
Boolean bool;
String str = null;
if (swiggyApiResponse != null) {
userLaunchData = swiggyApiResponse.getData();
} else {
userLaunchData = null;
}
boolean f = kotlin.jvm.internal.o.f(HomeActivityViewModel.this.oa().getString("android_enable_abuse_breach_feature", "true"), "true");
if (HomeActivityViewModel.this.r8() && f) {
if (userLaunchData != null) {
bool = Boolean.valueOf(userLaunchData.getMSwiggyOneAbuseBreach());
} else {
bool = null;
}
if (KotlinExtensionsKt.h(bool) && HomeActivityViewModel.this.ra().F() && !HomeActivityViewModel.this.Jb()) {
in.swiggy.android.mvvm.home.d Y9 = HomeActivityViewModel.this.Y9();
if (userLaunchData != null) {
str = userLaunchData.getMSwiggyOneDeviceLimit();
}
Y9.a(new c.u(str));
}
}
}
}
public HomeActivityViewModel(ThirdPartySDKUtils thirdPartySDKUtils, in.swiggy.android.mvvm.home.f packageUtils, in.swiggy.android.mvvm.home.j shortcutUtils, dagger.a<in.swiggy.android.overlays.trackCrouton.store.a> trackCroutonStore, dagger.a<in.swiggy.android.overlays.b> overlayAPIStore) {
kotlin.j b2;
kotlin.j b3;
kotlin.j b4;
List n;
kotlin.j b5;
kotlin.j b6;
kotlin.j b7;
kotlin.j b8;
kotlin.j b9;
kotlin.j b10;
kotlin.j b11;
kotlin.j b12;
kotlin.jvm.internal.o.k(thirdPartySDKUtils, "thirdPartySDKUtils");
kotlin.jvm.internal.o.k(packageUtils, "packageUtils");
kotlin.jvm.internal.o.k(shortcutUtils, "shortcutUtils");
kotlin.jvm.internal.o.k(trackCroutonStore, "trackCroutonStore");
kotlin.jvm.internal.o.k(overlayAPIStore, "overlayAPIStore");
this.h = thirdPartySDKUtils;
this.i = packageUtils;
this.j = shortcutUtils;
this.k = trackCroutonStore;
this.l = overlayAPIStore;
this.B = new androidx.lifecycle.y<>(AppUpdatePopupState.UNINITIALISED);
this.C0 = new ObservableField<>();
b2 = kotlin.l.b(new Function0<TrackCroutonViewModel>() {
public static final class a implements in.swiggy.android.overlays.h {
final HomeActivityViewModel a;
a(HomeActivityViewModel homeActivityViewModel) {
this.a = homeActivityViewModel;
}
@Override
public String getString(int i) {
return this.a.r0().getString(i);
}
}
{
super(0);
}
@Override
public final TrackCroutonViewModel invoke() {
dagger.a aVar;
aVar = HomeActivityViewModel.this.k;
Object obj = aVar.get();
kotlin.jvm.internal.o.j(obj, "get(...)");
return new TrackCroutonViewModel((in.swiggy.android.overlays.trackCrouton.store.a) obj, new a(HomeActivityViewModel.this), null, null, 12, null);
}
});
this.S0 = b2;
this.V0 = new ObservableInt(-1);
this.W0 = new ObservableBoolean(false);
this.X0 = new ObservableBoolean(false);
this.Y0 = new ObservableBoolean(false);
this.Z0 = new ObservableBoolean(true);
this.a1 = new ObservableBoolean(true);
this.b1 = new ObservableBoolean(true);
this.c1 = new ObservableBoolean(false);
this.d1 = new ObservableBoolean(false);
this.e1 = new ObservableBoolean(false);
this.f1 = new androidx.lifecycle.y<>();
this.g1 = new ObservableFloat();
b3 = kotlin.l.b(new Function0<SwiggySplashViewModel>() {
{
super(0);
}
@Override
public final SwiggySplashViewModel invoke() {
return new SwiggySplashViewModel(false, KotlinExtensionsKt.u(HomeActivityViewModel.this.N9().a("splash_animation_duration_multiplier"), 1.0f), null, 4, null);
}
});
this.h1 = b3;
b4 = kotlin.l.b(new Function0<in.swiggy.android.repositories.cart.interfaces.cart.a>() {
{
super(0);
}
@Override
public final in.swiggy.android.repositories.cart.interfaces.cart.a invoke() {
return HomeActivityViewModel.this.r9().get().r();
}
});
this.i1 = b4;
this.j1 = new ObservableInt(0);
this.k1 = new ObservableInt(8);
this.l1 = new ObservableInt(8);
this.m1 = new ObservableInt(0);
this.n1 = new ObservableInt(8);
this.o1 = new ObservableInt(8);
this.p1 = new io.reactivex.disposables.a();
n = kotlin.collections.r.n();
this.q1 = new ObservableField<>(new in.swiggy.android.commonsui.ui.view.bottombar.b(n, 0, null, null));
this.r1 = new ObservableField<>(new ArrayList());
this.s1 = new ObservableInt();
this.u1 = new androidx.lifecycle.y<>(Boolean.FALSE);
this.v1 = new ObservableField<>();
this.x1 = 1202;
this.A1 = new androidx.lifecycle.y<>();
this.B1 = new LaunchDataTransformer();
androidx.lifecycle.y<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.c>> yVar = new androidx.lifecycle.y<>();
this.C1 = yVar;
this.D1 = yVar;
androidx.lifecycle.y<in.swiggy.koordinates.core.f> yVar2 = new androidx.lifecycle.y<>();
this.E1 = yVar2;
this.F1 = yVar2;
androidx.lifecycle.y<LaunchConfigRequestParams> yVar3 = new androidx.lifecycle.y<>();
this.G1 = yVar3;
this.H1 = yVar3;
androidx.lifecycle.y<Bundle> yVar4 = new androidx.lifecycle.y<>();
this.I1 = yVar4;
this.J1 = yVar4;
androidx.lifecycle.y<Bundle> yVar5 = new androidx.lifecycle.y<>();
this.K1 = yVar5;
this.L1 = yVar5;
androidx.lifecycle.y<in.swiggy.android.mvvm.home.models.a> yVar6 = new androidx.lifecycle.y<>();
this.M1 = yVar6;
this.N1 = yVar6;
androidx.lifecycle.y<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.h>> yVar7 = new androidx.lifecycle.y<>();
this.O1 = yVar7;
this.P1 = yVar7;
b5 = kotlin.l.b(new Function0<in.swiggy.android.mvvm.home.d>() {
{
super(0);
}
@Override
public final in.swiggy.android.mvvm.home.d invoke() {
androidx.lifecycle.y yVar8;
yVar8 = HomeActivityViewModel.this.C1;
return new in.swiggy.android.mvvm.home.d(yVar8);
}
});
this.Q1 = b5;
this.R1 = new Function2<String, Boolean, Unit>() {
{
super(2);
}
public final void a(String restaurantId, boolean z) {
kotlin.jvm.internal.o.k(restaurantId, "restaurantId");
HomeActivityViewModel.this.Y9().a(new c.w(restaurantId, null, z, "ux4-home-page", null, null));
}
@Override
public Unit invoke(String str, Boolean bool) {
a(str, bool.booleanValue());
return Unit.a;
}
};
this.S1 = new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
HomeActivityViewModel.this.Y9().a(c.x0.a);
}
};
b6 = kotlin.l.b(new Function0<LandingViewCartViewModel>() {
{
super(0);
}
@Override
public final LandingViewCartViewModel invoke() {
LandingViewCartViewModel landingViewCartViewModel = new LandingViewCartViewModel(true, "ux4-home-page", true, HomeActivityViewModel.this.p9(), HomeActivityViewModel.this.bb(), true);
HomeActivityViewModel.this.jb().injectMembers(landingViewCartViewModel);
landingViewCartViewModel.k().h(true);
return landingViewCartViewModel;
}
});
this.T1 = b6;
b7 = kotlin.l.b(new Function0<PaymentCroutonViewModel>() {
{
super(0);
}
@Override
public final PaymentCroutonViewModel invoke() {
HomeActivityViewModel homeActivityViewModel = HomeActivityViewModel.this;
PaymentCroutonViewModel paymentCroutonViewModel = new PaymentCroutonViewModel(homeActivityViewModel, homeActivityViewModel.Y9(), HomeActivityViewModel.this.A0());
HomeActivityViewModel.this.Pa().injectMembers(paymentCroutonViewModel);
return paymentCroutonViewModel;
}
});
this.U1 = b7;
b8 = kotlin.l.b(new Function0<BadFoodOrderCroutonViewModel>() {
{
super(0);
}
@Override
public final BadFoodOrderCroutonViewModel invoke() {
HomeActivityViewModel homeActivityViewModel = HomeActivityViewModel.this;
BadFoodOrderCroutonViewModel badFoodOrderCroutonViewModel = new BadFoodOrderCroutonViewModel(homeActivityViewModel, homeActivityViewModel.Y9());
HomeActivityViewModel.this.c9().injectMembers(badFoodOrderCroutonViewModel);
badFoodOrderCroutonViewModel.b().h(true);
return badFoodOrderCroutonViewModel;
}
});
this.V1 = b8;
b9 = kotlin.l.b(new Function0<in.swiggy.android.mvvm.home.e>() {
{
super(0);
}
@Override
public final in.swiggy.android.mvvm.home.e invoke() {
return new in.swiggy.android.mvvm.home.e(l0.a(HomeActivityViewModel.this), HomeActivityViewModel.this.ra(), HomeActivityViewModel.this.oa(), HomeActivityViewModel.this.s9(), HomeActivityViewModel.this.Y9());
}
});
this.w2 = b9;
b10 = kotlin.l.b(new Function0<PreLaunchViewModel>() {
{
super(0);
}
@Override
public final PreLaunchViewModel invoke() {
Function0 function0;
function0 = HomeActivityViewModel.this.y2;
PreLaunchViewModel preLaunchViewModel = new PreLaunchViewModel(function0);
HomeActivityViewModel.this.Sa().injectMembers(preLaunchViewModel);
return preLaunchViewModel;
}
});
this.x2 = b10;
this.y2 = new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.a;
}
public final void invoke2() {
HomeActivityViewModel.this.X8().t();
HomeActivityViewModel.this.B0 = false;
HomeActivityViewModel.this.Y9().a(c.k.a);
HomeActivityViewModel.this.Y9().a(c.y.a);
}
};
b11 = kotlin.l.b(new Function0<BottomBarPopupProvider>() {
{
super(0);
}
@Override
public final BottomBarPopupProvider invoke() {
ObservableField<in.swiggy.android.commonsui.ui.view.bottombar.b> e9 = HomeActivityViewModel.this.e9();
in.swiggy.android.mvvm.home.d Y9 = HomeActivityViewModel.this.Y9();
in.swiggy.android.mvvm.services.s r0 = HomeActivityViewModel.this.r0();
dagger.a<in.swiggy.android.listingkit.interfaces.i> t9 = HomeActivityViewModel.this.t9();
in.swiggy.android.analytics.interfaces.c cVar = HomeActivityViewModel.this.pa().get();
kotlin.jvm.internal.o.j(cVar, "get(...)");
return new BottomBarPopupProvider(e9, Y9, r0, t9, cVar, HomeActivityViewModel.this.f9(), HomeActivityViewModel.this.G9(), HomeActivityViewModel.this.F9(), HomeActivityViewModel.this.h9(), HomeActivityViewModel.this.Ha());
}
});
this.z2 = b11;
b12 = kotlin.l.b(new Function0<BottomMediaSheetProvider>() {
{
super(0);
}
@Override
public final BottomMediaSheetProvider invoke() {
return HomeActivityViewModelHelperKt.k(HomeActivityViewModel.this);
}
});
this.A2 = b12;
this.D2 = j0.a(new h0("launch_headers"));
this.E2 = new c();
this.F2 = new g();
this.H2 = new d();
this.I2 = new e();
}
private final boolean A8() {
?? r0 = "1104";
try {
String string = oa().getString("v2_android_consumer_force_update", "1104");
if (string != null) {
r0 = Integer.parseInt(string);
} else {
r0 = Integer.parseInt("1104");
}
} catch (Exception unused) {
r0 = Integer.parseInt(r0);
}
if (1202 < r0) {
return true;
}
return false;
}
private final boolean B8() {
Object fromJson;
if (oa().getBoolean("android_consumer_force_version_update_flag", false)) {
String string = oa().getString("android_consumer_force_version_update_data", null);
if (f0.g(string)) {
try {
in.swiggy.android.apputils.i iVar = new in.swiggy.android.apputils.i("1202", Build.VERSION.RELEASE, Build.MANUFACTURER, Build.MODEL);
Gson g2 = in.swiggy.android.commons.utils.i0.g();
if (!(g2 instanceof Gson)) {
fromJson = g2.fromJson(string, (Class<Object>) in.swiggy.android.apputils.i.class);
} else {
fromJson = GsonInstrumentation.fromJson(g2, string, (Class<Object>) in.swiggy.android.apputils.i.class);
}
kotlin.jvm.internal.o.j(fromJson, "fromJson(...)");
boolean equals = iVar.equals((in.swiggy.android.apputils.i) fromJson);
oa().edit().putBoolean("android_consumer_force_version_update_flag", equals).apply();
return equals;
} catch (Exception e2) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", e2);
}
}
}
return false;
}
public final void Bb() {
kotlinx.coroutines.i.d(l0.a(this), DispatchProviderKt.b().getDefault(), null, new HomeActivityViewModel$initOverlayApiLogs$1(this, null), 2, null);
}
public final void Cb() {
q1 d2;
q1 q1Var = this.c0;
if (q1Var != null) {
q1.a.a(q1Var, null, 1, null);
}
d2 = kotlinx.coroutines.i.d(l0.a(this), DispatchProviderKt.b().n1(), null, new HomeActivityViewModel$initOverlaysApiPolling$1(this, null), 2, null);
this.c0 = d2;
}
private final void D8() {
String str;
if (b9().a()) {
in.swiggy.android.mxn.swiggyats.b c2 = b9().c();
if (c2 != null) {
str = c2.c();
} else {
str = null;
}
Nb(str);
}
if (!in.swiggy.android.commonsui.feature.irctc.a.a.c()) {
if (HomeActivityViewModelHelperKt.s(this)) {
Y9().a(new c.e0("nux"));
this.B0 = true;
Ra().n7();
} else if (!X8().n()) {
hc();
}
}
}
private final boolean E8() {
boolean z;
int i;
?? r0 = "1104";
try {
String string = oa().getString("v2_android_consumer_optional_update", "1104");
if (string != null) {
r0 = Integer.parseInt(string);
} else {
r0 = Integer.parseInt("1104");
}
} catch (Exception unused) {
r0 = Integer.parseInt(r0);
}
if (1202 < r0) {
z = true;
} else {
z = false;
}
if (z && oa().contains("update_type_optional_day") && (i = oa().getInt("update_type_optional_day", -1)) != -1 && i == Calendar.getInstance().get(5)) {
return false;
}
if (!z && oa().contains("update_type_optional_day")) {
oa().edit().remove("update_type_optional_day").apply();
}
return z;
}
public final void F8() {
K9().get().terminate();
w9().get().a();
io.reactivex.disposables.b bVar = this.B2;
if (bVar != null) {
bVar.dispose();
}
}
private final Pair<String, OverlayType> Ga() {
String str;
FeedbackLaunchItem c2;
String str2 = "";
if (this.W0.g()) {
String str3 = (O9().c() == null || (c2 = O9().c()) == null || (str3 = Long.valueOf(c2.getOrderJobId()).toString()) == null) ? "" : "";
FeedbackOrder f2 = O9().f();
String str4 = null;
if (f2 != null) {
str = f2.mOrderId;
} else {
str = null;
}
if (str != null) {
FeedbackOrder f3 = O9().f();
if (f3 != null) {
str4 = f3.mOrderId;
}
if (str4 != null) {
str2 = str4;
}
str3 = str2;
}
return new Pair<>(str3, OverlayType.FEEDBACK_OVERLAY);
}
in.swiggy.android.overlays.trackCrouton.dataSource.a i = fb().i();
if (i != null) {
str2 = i.d();
}
return new Pair<>(str2, OverlayType.TRACK_OVERLAY);
}
public final void H8(ArrayMap<String, String> arrayMap, ArrayMap<String, String> arrayMap2) {
String str;
boolean C;
String str2 = "";
if (arrayMap != null) {
if (arrayMap.containsKey("android_non_config_event_properties") && (str = arrayMap.get("android_non_config_event_properties")) != null) {
C = kotlin.text.q.C(str);
if (!C) {
in.swiggy.android.commons.utils.contextservice.h G = G();
String str3 = arrayMap.get("android_non_config_event_properties");
if (str3 == null) {
str3 = "";
}
kotlin.jvm.internal.o.h(str3);
G.B("android_non_config_event_properties", str3);
}
}
if (arrayMap.containsKey("swiggylytics_migration_experiment")) {
in.swiggy.android.commons.utils.contextservice.h G2 = G();
String str4 = arrayMap.get("swiggylytics_migration_experiment");
if (str4 == null) {
str4 = "";
}
kotlin.jvm.internal.o.h(str4);
G2.B("swiggylytics_migration_experiment", str4);
}
}
if (arrayMap2 != null && arrayMap2.containsKey("swiggylytics_migration_experiment")) {
in.swiggy.android.commons.utils.contextservice.h G3 = G();
String str5 = arrayMap2.get("swiggylytics_migration_experiment");
if (str5 != null) {
str2 = str5;
}
kotlin.jvm.internal.o.h(str2);
G3.B("swiggylytics_migration_experiment", str2);
}
}
public final void I8() {
if (r9().get().h() == CartType.REGULAR) {
za().get().flushCart(new SwiggyBaseResponseHandler<>(new SwiggyDataHandler() {
@Override
public final void handle(Object obj) {
HomeActivityViewModel.J8((SwiggyBaseResponse) obj);
}
}, new SwiggyDataHandler() {
@Override
public final void handle(Object obj) {
HomeActivityViewModel.K8(HomeActivityViewModel.this, (SwiggyBaseResponse) obj);
}
}), new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.L8(HomeActivityViewModel.this, (Throwable) obj);
}
}, null);
}
}
public static final void Ic(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public static final void J8(SwiggyBaseResponse swiggyBaseResponse) {
}
public final boolean Jb() {
return oa().getBoolean("nuxLocationSetupInProgress", false);
}
public static final void Jc(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public static final void K8(HomeActivityViewModel this$0, SwiggyBaseResponse swiggyBaseResponse) {
kotlin.jvm.internal.o.k(this$0, "this$0");
this$0.bc();
}
public static final void L8(HomeActivityViewModel this$0, Throwable th) {
kotlin.jvm.internal.o.k(this$0, "this$0");
this$0.bc();
}
private final boolean Lb() {
return kotlin.jvm.internal.o.f("true", e3().H("web_payment_interface", "true"));
}
private final void Lc() {
this.g1.f3(this.H2);
this.g1.Y(this.H2);
}
private final void Mb() {
if (oa().getBoolean("fire_launch_api_after_order_placed", false)) {
Cb();
sb();
}
}
private final void Mc() {
this.o = true;
in.swiggy.koordinates.core.f a2 = ma().getLocation().getValue().a();
if (!in.swiggy.koordinates.compass.utils.c.a.d(a2)) {
tb(a2);
} else {
tb(DefaultingConfigUtils.a.c(oa()).a());
}
this.y1 = true;
Y9().a(c.k.a);
}
private final void O8() {
q1 q1Var = this.Z;
if (q1Var == null || !q1Var.b()) {
sb();
}
}
private final boolean P8() {
String a2 = N9().a("enable_new_app_update_popup_flow");
if (a2 != null && Boolean.parseBoolean(a2)) {
return true;
}
return false;
}
private final q1 Rb() {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$listenViewModelObservableCroutons$1(this, null), 2, null);
return d2;
}
public final void Sc() {
io.reactivex.disposables.a aVar = this.p1;
io.reactivex.d<Boolean> m = ra().T().P(io.reactivex.android.schedulers.a.a()).m(200L, TimeUnit.MILLISECONDS);
final Function1<Boolean, Unit> function1 = new Function1<Boolean, Unit>() {
@kotlin.coroutines.jvm.internal.d(c = "in.swiggy.android.mvvm.home.viewmodel.HomeActivityViewModel$subscribeAndSendLoginEvent$1$1", f = "HomeActivityViewModel.kt", l = {1241}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements Function2<i0, kotlin.coroutines.c<? super Unit>, Object> {
int a;
final HomeActivityViewModel b;
AnonymousClass1(HomeActivityViewModel homeActivityViewModel, kotlin.coroutines.c<? super AnonymousClass1> cVar) {
super(2, cVar);
this.b = homeActivityViewModel;
}
@Override
public final kotlin.coroutines.c<Unit> create(Object obj, kotlin.coroutines.c<?> cVar) {
return new AnonymousClass1(this.b, cVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object f;
f = kotlin.coroutines.intrinsics.b.f();
int i = this.a;
if (i != 0) {
if (i == 1) {
kotlin.n.b(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
kotlin.n.b(obj);
this.a = 1;
if (this.b.U9().get().deleteAllResponse(this) == f) {
return f;
}
}
return Unit.a;
}
@Override
public final Object invoke(i0 i0Var, kotlin.coroutines.c<? super Unit> cVar) {
return ((AnonymousClass1) create(i0Var, cVar)).invokeSuspend(Unit.a);
}
}
{
super(1);
}
public final void a(Boolean bool) {
dagger.a aVar2;
q1 q1Var;
q1 q1Var2;
if (HomeActivityViewModel.this.ra().F()) {
HomeActivityViewModel.this.qa().c(HomeActivityViewModel.this.L9().a());
HomeActivityViewModel.this.mc();
HomeActivityViewModel.this.M8();
HomeActivityViewModel.this.Y9().a(new c.z0(true));
HomeActivityViewModel.this.Cb();
HomeActivityViewModel.this.sb();
} else {
HomeActivityViewModel.this.ub();
HomeActivityViewModel.this.Oa().S();
HomeActivityViewModel.this.d9().u();
aVar2 = HomeActivityViewModel.this.k;
((in.swiggy.android.overlays.trackCrouton.store.a) aVar2.get()).a();
q1Var = HomeActivityViewModel.this.c0;
if (q1Var != null) {
q1.a.a(q1Var, null, 1, null);
}
q1Var2 = HomeActivityViewModel.this.Z;
if (q1Var2 != null) {
q1.a.a(q1Var2, null, 1, null);
}
}
kotlinx.coroutines.i.d(l0.a(HomeActivityViewModel.this), v0.b(), null, new AnonymousClass1(HomeActivityViewModel.this, null), 2, null);
}
@Override
public Unit invoke(Boolean bool) {
a(bool);
return Unit.a;
}
};
io.reactivex.functions.d<? super Boolean> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.Tc(Function1.this, obj);
}
};
final HomeActivityViewModel$subscribeAndSendLoginEvent$2 homeActivityViewModel$subscribeAndSendLoginEvent$2 = new Function1<Throwable, Unit>() {
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
public final void invoke2(Throwable th) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", th);
}
};
aVar.c(m.g0(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.Uc(Function1.this, obj);
}
}));
kotlinx.coroutines.i.d(l0.a(this), v0.c(), null, new HomeActivityViewModel$subscribeAndSendLoginEvent$3(this, null), 2, null);
}
private final void Tb(String str, Map<String, String> map) {
HashMap hashMap = new HashMap();
if (map != null) {
hashMap.putAll(map);
}
if (kotlin.jvm.internal.o.f(str, "web")) {
Aa().b("web-payments-confirm-order-api-call-for-app-suspended-case", hashMap);
} else if (kotlin.jvm.internal.o.f(str, "native")) {
Aa().b("confirm-order-api-call-for-app-suspended-case", hashMap);
}
}
public static final void Tc(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public static final void Uc(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
private final q1 Vc() {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$subscribeFirstItemAdded$1(this, null), 2, null);
return d2;
}
private final Map<String, String> Wa() {
ArrayMap arrayMap = new ArrayMap();
arrayMap.putAll(in.swiggy.android.apputils.r.n());
arrayMap.putAll(in.swiggy.android.feature.featureFlags.a.a.a().c());
arrayMap.putAll(in.swiggy.android.apputils.r.t());
arrayMap.putAll(in.swiggy.android.feature.featureFlags.b.a.a().c());
return arrayMap;
}
public final void Wb(boolean z) {
HashMap k;
in.swiggy.android.analytics.newrelic.a Aa = Aa();
k = kotlin.collections.j0.k(kotlin.o.a("SHIELD_COHORTING_FLAG_VALUE", String.valueOf(z)));
Aa.c("SHIELD_COHORTING_FLAG_EVENT", k);
}
private final q1 Wc() {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$subscribeForCartChanges$1(this, null), 2, null);
return d2;
}
private final void Xc() {
io.reactivex.disposables.a aVar = this.p1;
io.reactivex.d<Boolean> P = ra().h().P(io.reactivex.android.schedulers.a.a());
final Function1<Boolean, Unit> function1 = new Function1<Boolean, Unit>() {
{
super(1);
}
public final void a(boolean z) {
androidx.lifecycle.y yVar;
if (z) {
yVar = HomeActivityViewModel.this.M1;
yVar.r(new in.swiggy.android.mvvm.home.models.a(HomeActivityViewModel.this.ra().u(), in.swiggy.koordinates.compass.core.c.b(HomeActivityViewModel.this.ma()), in.swiggy.koordinates.compass.core.c.c(HomeActivityViewModel.this.ma())));
}
}
@Override
public Unit invoke(Boolean bool) {
a(bool.booleanValue());
return Unit.a;
}
};
io.reactivex.functions.d<? super Boolean> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.Yc(Function1.this, obj);
}
};
final HomeActivityViewModel$subscribeForUserBlockedEvent$2 homeActivityViewModel$subscribeForUserBlockedEvent$2 = new Function1<Throwable, Unit>() {
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
public final void invoke2(Throwable th) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", th);
}
};
aVar.c(P.g0(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.Zc(Function1.this, obj);
}
}));
}
public static final void Yc(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public static final void Zc(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public final void ad() {
io.reactivex.d<in.swiggy.android.payment.utility.eligibility.b> k0 = Da().b().P(io.reactivex.android.schedulers.a.a()).k0(io.reactivex.schedulers.a.c());
final Function1<in.swiggy.android.payment.utility.eligibility.b, Unit> function1 = new Function1<in.swiggy.android.payment.utility.eligibility.b, Unit>() {
{
super(1);
}
public final void a(in.swiggy.android.payment.utility.eligibility.b bVar) {
if (HomeActivityViewModel.this.ra().F()) {
kotlin.jvm.internal.o.h(bVar);
HomeActivityViewModel.this.K9().get().c(bVar, c.b.b, null);
}
}
@Override
public Unit invoke(in.swiggy.android.payment.utility.eligibility.b bVar) {
a(bVar);
return Unit.a;
}
};
io.reactivex.functions.d<? super in.swiggy.android.payment.utility.eligibility.b> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.bd(Function1.this, obj);
}
};
final HomeActivityViewModel$subscribeOneClickEligibilityService$2 homeActivityViewModel$subscribeOneClickEligibilityService$2 = new Function1<Throwable, Unit>() {
public final void invoke2(Throwable th) {
}
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
};
io.reactivex.disposables.b g0 = k0.g0(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.cd(Function1.this, obj);
}
});
this.C2 = g0;
if (g0 != null) {
this.p1.c(g0);
}
}
private final void bc() {
}
public static final void bd(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public static final void cd(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public final long db() {
return u9().b("android_detect_tamper_delay", 1000L);
}
public static final void dc(HomeActivityViewModel this$0) {
String str;
kotlin.jvm.internal.o.k(this$0, "this$0");
this$0.W0.h(false);
FeedbackOrder f2 = this$0.O9().f();
FeedbackLaunchItem c2 = this$0.O9().c();
if (c2 != null) {
HashMap hashMap = new HashMap();
hashMap.put("order_job_id", Long.valueOf(c2.getOrderJobId()));
this$0.p1.c(this$0.B9().get().dismissDashRating(hashMap).z(io.reactivex.schedulers.a.c()).q(io.reactivex.android.schedulers.a.a()).v());
} else if (f2 != null && (str = f2.mOrderId) != null) {
this$0.Y9().a(new c.k0(new EdmPostableRating.Builder().ratingType(EdmRatingType.Companion.withSource(EdmRatingType.restaurant, RatingSource.HOME_CROUTON)).orderId(str).toSkip(true).build()));
in.swiggy.android.analytics.gtm.g q = this$0.pa().get().q("restaurant-listing", "click-dismiss-scale ", f2.mOrderId, 9999, f2.orderType);
kotlin.jvm.internal.o.j(q, "getGtmEventData(...)");
this$0.pa().get().b(q);
}
this$0.ub();
}
public final void dd() {
io.reactivex.d<Integer> k0 = x9().get().a().P(io.reactivex.android.schedulers.a.a()).k0(io.reactivex.schedulers.a.c());
final Function1<Integer, Unit> function1 = new Function1<Integer, Unit>() {
{
super(1);
}
public final void a(int i) {
if (i == 1 && HomeActivityViewModel.this.Qa().get() != null && HomeActivityViewModel.this.ra().F()) {
HomeActivityViewModel.this.K9().get().b(c.a.b);
}
}
@Override
public Unit invoke(Integer num) {
a(num.intValue());
return Unit.a;
}
};
io.reactivex.functions.d<? super Integer> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.ed(Function1.this, obj);
}
};
final HomeActivityViewModel$subscribeToCredEligibilityCallService$2 homeActivityViewModel$subscribeToCredEligibilityCallService$2 = new Function1<Throwable, Unit>() {
public final void invoke2(Throwable th) {
}
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
};
io.reactivex.disposables.b g0 = k0.g0(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.fd(Function1.this, obj);
}
});
this.B2 = g0;
if (g0 != null) {
this.p1.c(g0);
}
}
private final io.reactivex.functions.a ec() {
return new io.reactivex.functions.a() {
@Override
public final void run() {
HomeActivityViewModel.fc(HomeActivityViewModel.this);
}
};
}
public static final void ed(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public static final void fc(HomeActivityViewModel this$0) {
kotlin.jvm.internal.o.k(this$0, "this$0");
if (Boolean.parseBoolean(this$0.oa().getString("cache_experiment_enabled", "true"))) {
this$0.Y9().a(c.n.a);
} else {
this$0.oa().edit().putString("cached_current_allotment", "").apply();
this$0.xc();
}
this$0.Y9().a(new c.d0(this$0.G().y()));
this$0.P9().get().f();
this$0.Y9().a(c.h0.a);
this$0.Y9().a(c.u0.a);
this$0.Y9().a(c.r.a);
if (in.swiggy.android.utils.i0.k()) {
this$0.Y9().a(c.a1.a);
}
in.swiggy.android.analytics.newrelic.newrelichelper.a.a.h();
this$0.Ca().get().u();
this$0.H9().get().l();
this$0.z3();
}
public static final void fd(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
private final void gd() {
io.reactivex.disposables.a aVar = this.p1;
io.reactivex.d<String> P = ra().j().k0(io.reactivex.schedulers.a.c()).P(io.reactivex.android.schedulers.a.a());
final Function1<String, Unit> function1 = new Function1<String, Unit>() {
{
super(1);
}
@Override
public Unit invoke(String str) {
invoke2(str);
return Unit.a;
}
public final void invoke2(String apiUrl) {
kotlin.jvm.internal.o.k(apiUrl, "apiUrl");
HomeActivityViewModel.this.sc(apiUrl);
}
};
io.reactivex.functions.d<? super String> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.hd(Function1.this, obj);
}
};
final HomeActivityViewModel$subscribeToSessionExpiredEvent$2 homeActivityViewModel$subscribeToSessionExpiredEvent$2 = new Function1<Throwable, Unit>() {
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
public final void invoke2(Throwable th) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", th);
}
};
aVar.c(P.g0(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.id(Function1.this, obj);
}
}));
}
private final void hc() {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), null, null, new HomeActivityViewModel$performDefaulting$1(this, null), 3, null);
this.y0 = d2;
}
public static final void hd(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
private final PostableLaunchRequest ia() {
PostableLaunchRequest postableLaunchRequest = new PostableLaunchRequest(Wa());
postableLaunchRequest.setXpExperimentList(kb());
return postableLaunchRequest;
}
public final Object ic(kotlin.coroutines.c<? super Unit> cVar) {
if (ra().F()) {
in.swiggy.android.mxn.utils.b bVar = in.swiggy.android.mxn.utils.b.a;
if (!bVar.e()) {
bVar.f(G(), r0());
}
}
return Unit.a;
}
public static final void id(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
private final BottomBarPopupProvider j9() {
return (BottomBarPopupProvider) this.z2.getValue();
}
public final void jc() {
Y9().a(c.l0.a);
}
private final List<String> kb() {
ArrayMap arrayMap = new ArrayMap();
arrayMap.putAll(in.swiggy.android.apputils.r.j());
arrayMap.putAll(in.swiggy.android.feature.featureFlags.a.a.a().d());
return new ArrayList(arrayMap.keySet());
}
private final void kc() {
Object fromJson;
int indexOf;
String json;
try {
in.swiggy.android.apputils.i iVar = new in.swiggy.android.apputils.i("1202", Build.VERSION.RELEASE, Build.MANUFACTURER, Build.MODEL);
String string = oa().getString("v2_android_consumer_force_version_update", in.swiggy.android.apputils.i.e.a());
if (f0.g(string)) {
Type type = new f().getType();
Gson g2 = in.swiggy.android.commons.utils.i0.g();
if (!(g2 instanceof Gson)) {
fromJson = g2.fromJson(string, type);
} else {
fromJson = GsonInstrumentation.fromJson(g2, string, type);
}
List list = (List) fromJson;
List list2 = list;
if (list2 != null && !list2.isEmpty() && (indexOf = list.indexOf(iVar)) >= 0) {
in.swiggy.android.apputils.i iVar2 = (in.swiggy.android.apputils.i) list.get(indexOf);
SharedPreferences.Editor edit = oa().edit();
Gson g3 = in.swiggy.android.commons.utils.i0.g();
if (!(g3 instanceof Gson)) {
json = g3.toJson(iVar2, in.swiggy.android.apputils.i.class);
} else {
json = GsonInstrumentation.toJson(g3, iVar2, in.swiggy.android.apputils.i.class);
}
edit.putString("android_consumer_force_version_update_data", json);
edit.putBoolean("android_consumer_force_version_update_flag", true);
edit.apply();
}
}
} catch (Exception e2) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", e2);
}
}
private final boolean kd() {
String d2 = xa().get().d();
boolean f2 = f9().f();
boolean f3 = kotlin.jvm.internal.o.f(d2, "swiggy://home");
if (!f2) {
return kotlin.jvm.internal.o.f(d2, "swiggy://restaurantList");
}
return f3;
}
private final BottomMediaSheetProvider l9() {
return (BottomMediaSheetProvider) this.A2.getValue();
}
public final void lb(in.swiggy.koordinates.compass.core.dataModels.d dVar) {
in.swiggy.koordinates.core.f fVar;
Boolean c2 = in.swiggy.android.compass.defaulting.d.c(X8());
if (!in.swiggy.koordinates.compass.utils.c.a.d(dVar.a())) {
if (kotlin.jvm.internal.o.f(c2, Boolean.TRUE) && !X8().n()) {
if (!this.o) {
aa().i(false);
S9().k(false);
this.z1 = true;
tb(dVar.a());
Y9().a(c.s0.a);
}
this.y1 = true;
Y9().a(c.k.a);
} else {
Mc();
}
in.swiggy.koordinates.core.f a2 = dVar.a();
in.swiggy.koordinates.compass.core.dataModels.a value = ma().i().getValue();
if (value == null || (fVar = value.b()) == null) {
fVar = new in.swiggy.koordinates.core.f(0.0d, 0.0d);
}
qb(a2, fVar);
Aa().l("screen-splash", "extra-splash-time");
}
}
private final boolean ld() {
boolean z;
String d2 = xa().get().d();
boolean f2 = f9().f();
if (d2 != null) {
z = kotlin.jvm.internal.o.f(d2, "swiggy://home");
} else {
z = false;
}
if (f2) {
if (!z && O9().c() != null) {
return false;
}
if ((!z || O9().c() == null) && !z && this.t1 != null) {
return false;
}
}
return true;
}
public final void mc() {
ub();
}
private final q1 n8() {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$addloggedinShortcuts$1(this, null), 2, null);
return d2;
}
public final void nb() {
in.swiggy.koordinates.core.f fVar;
in.swiggy.koordinates.core.f fVar2;
in.swiggy.koordinates.core.f fVar3 = null;
String string = oa().getString("last_selected_address_location", null);
if (string != null) {
fVar = in.swiggy.koordinates.compass.utils.c.a.c(string);
} else {
fVar = null;
}
if (fVar != null) {
ma().h(fVar);
X8().s(fVar, false, false);
return;
}
String string2 = oa().getString("last_selected_custom_location", null);
if (string2 != null) {
fVar2 = in.swiggy.koordinates.compass.utils.c.a.c(string2);
} else {
fVar2 = null;
}
if (fVar2 != null) {
ma().h(fVar2);
X8().s(fVar2, false, true);
return;
}
String string3 = oa().getString("last_known_gps_location", null);
if (string3 != null) {
fVar3 = in.swiggy.koordinates.compass.utils.c.a.c(string3);
}
if (fVar3 != null) {
ma().h(fVar3);
X8().s(fVar3, false, false);
return;
}
in.swiggy.koordinates.core.f fVar4 = new in.swiggy.koordinates.core.f(12.928393d, 77.693136d);
ma().h(fVar4);
X8().s(fVar4, false, false);
}
public final boolean ob() {
int i;
Integer m;
boolean z;
this.W0.h(false);
FeedbackOrder f2 = O9().f();
FeedbackLaunchItem c2 = O9().c();
if (f2 != null) {
String str = f2.iconType;
if (str != null) {
z = kotlin.text.q.z(str, "BOLT", true);
if (z) {
this.A1.r(r0().c(R.drawable.ic_bolt_rating_crouton));
}
}
O9().j();
this.W0.h(true);
ub();
in.swiggy.android.analytics.interfaces.c cVar = pa().get();
in.swiggy.android.analytics.interfaces.c cVar2 = pa().get();
String str2 = f2.mOrderId;
String str3 = f2.mRestaurantId;
if (str3 != null && m != null) {
i = m.intValue();
} else {
i = -1;
}
cVar.j(cVar2.h("restaurant-listing", "Impression-rating-crouton ", str2, i));
T8().get().b();
} else if (c2 == null) {
return false;
} else {
O9().j();
this.W0.h(true);
ub();
}
return true;
}
public final Object pc(Map<String, String> map, kotlin.coroutines.c<? super Unit> cVar) {
HomeActivityViewModel$saveToFeatureFlags$1 homeActivityViewModel$saveToFeatureFlags$1;
Object f2;
int i;
Iterator<Map.Entry<String, String>> it;
HomeActivityViewModel homeActivityViewModel;
int i2;
boolean z;
if (cVar instanceof HomeActivityViewModel$saveToFeatureFlags$1) {
homeActivityViewModel$saveToFeatureFlags$1 = (HomeActivityViewModel$saveToFeatureFlags$1) cVar;
int i3 = homeActivityViewModel$saveToFeatureFlags$1.e;
if ((i3 & Integer.MIN_VALUE) != 0) {
homeActivityViewModel$saveToFeatureFlags$1.e = i3 - Integer.MIN_VALUE;
Object obj = homeActivityViewModel$saveToFeatureFlags$1.c;
f2 = kotlin.coroutines.intrinsics.b.f();
i = homeActivityViewModel$saveToFeatureFlags$1.e;
if (i == 0) {
if (i == 1) {
it = (Iterator) homeActivityViewModel$saveToFeatureFlags$1.b;
homeActivityViewModel = (HomeActivityViewModel) homeActivityViewModel$saveToFeatureFlags$1.a;
kotlin.n.b(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
kotlin.n.b(obj);
if (map != null && (!map.isEmpty())) {
it = map.entrySet().iterator();
homeActivityViewModel = this;
}
return Unit.a;
}
while (it.hasNext()) {
Map.Entry<String, String> next = it.next();
String key = next.getKey();
String value = next.getValue();
if (value != null) {
int length = value.length() - 1;
int i4 = 0;
boolean z2 = false;
while (i4 <= length) {
if (!z2) {
i2 = i4;
} else {
i2 = length;
}
if (kotlin.jvm.internal.o.m(value.charAt(i2), 32) <= 0) {
z = true;
} else {
z = false;
}
if (!z2) {
if (!z) {
z2 = true;
} else {
i4++;
}
} else if (!z) {
break;
} else {
length--;
}
}
if (value.subSequence(i4, length + 1).toString().length() > 0) {
in.swiggy.android.commons.featureFlags.d N9 = homeActivityViewModel.N9();
homeActivityViewModel$saveToFeatureFlags$1.a = homeActivityViewModel;
homeActivityViewModel$saveToFeatureFlags$1.b = it;
homeActivityViewModel$saveToFeatureFlags$1.e = 1;
if (N9.b(key, value, homeActivityViewModel$saveToFeatureFlags$1) == f2) {
return f2;
}
} else {
continue;
}
}
}
return Unit.a;
}
}
homeActivityViewModel$saveToFeatureFlags$1 = new HomeActivityViewModel$saveToFeatureFlags$1(this, cVar);
Object obj2 = homeActivityViewModel$saveToFeatureFlags$1.c;
f2 = kotlin.coroutines.intrinsics.b.f();
i = homeActivityViewModel$saveToFeatureFlags$1.e;
if (i == 0) {
}
while (it.hasNext()) {
}
return Unit.a;
}
private final q1 qc() {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$sendDefaultAppLanguageEvent$1(this, null), 2, null);
return d2;
}
public final boolean r8() {
return oa().contains("check_fup_breach_at_launch_api");
}
private final void rb(Bundle bundle) {
String str;
in.swiggy.koordinates.core.f fVar;
in.swiggy.koordinates.core.f s = La().get().s();
if (s != null && !in.swiggy.koordinates.compass.utils.c.a.d(s)) {
return;
}
if (bundle != null) {
str = bundle.getString("landingActivity");
} else {
str = null;
}
if (kotlin.jvm.internal.o.f(str, "restaurantList")) {
xa().get().c("swiggy://restaurantList");
} else if (kotlin.jvm.internal.o.f(str, Destination.CUSTOMER_HOME)) {
xa().get().c("swiggy://home");
} else {
xa().get().c(null);
}
tb(ma().getLocation().getValue().a());
in.swiggy.koordinates.core.f a2 = ma().getLocation().getValue().a();
in.swiggy.koordinates.compass.core.dataModels.a value = ma().i().getValue();
if (value == null || (fVar = value.b()) == null) {
fVar = new in.swiggy.koordinates.core.f(0.0d, 0.0d);
}
qb(a2, fVar);
}
public final void rc() {
Y9().a(c.w0.a);
}
private final void s8() {
if (oa().getBoolean("is_first_run", true)) {
oa().edit().putBoolean("is_first_run", false).apply();
}
}
public final void sb() {
q1 d2;
q1 q1Var = this.Z;
if (q1Var != null) {
q1.a.a(q1Var, null, 1, null);
}
d2 = kotlinx.coroutines.i.d(l0.a(this), null, null, new HomeActivityViewModel$handleOverlaysApi$1(this, null), 3, null);
this.Z = d2;
}
public final q1 sc(String str) {
q1 d2;
d2 = kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$sendSessionExpiredEvent$1(str, this, null), 2, null);
return d2;
}
public final void t8() {
long j;
long currentTimeMillis = System.currentTimeMillis();
long j2 = oa().getLong("item_added_to_cart", currentTimeMillis);
try {
String string = oa().getString("android_view_cart_expiry", "7200000");
if (string != null) {
j = Long.parseLong(string);
} else {
j = 0;
}
if (currentTimeMillis - j2 < j) {
this.W1 = true;
}
} catch (NumberFormatException e2) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", e2);
}
}
public final void u8(in.swiggy.android.overlays.network.b bVar) {
if (bVar instanceof b.C0822b) {
ArrayList arrayList = new ArrayList();
for (OverlayResponse.PageOverlay pageOverlay : ((b.C0822b) bVar).a()) {
List<OverlayResponse.Overlay> overlaysList = pageOverlay.getOverlaysList();
kotlin.jvm.internal.o.j(overlaysList, "getOverlaysList(...)");
kotlin.collections.w.C(arrayList, overlaysList);
}
ArrayList<OverlayResponse.Overlay> arrayList2 = new ArrayList();
for (Object obj : arrayList) {
if (((OverlayResponse.Overlay) obj).getName() == OverlayResponse.OverlayName.OVERLAY_NAME_TRACK) {
arrayList2.add(obj);
}
}
ArrayList arrayList3 = new ArrayList();
for (OverlayResponse.Overlay overlay : arrayList2) {
List<Card> cardsList = overlay.getCardsList();
kotlin.jvm.internal.o.j(cardsList, "getCardsList(...)");
kotlin.collections.w.C(arrayList3, cardsList);
}
ArrayList<Card> arrayList4 = new ArrayList();
for (Object obj2 : arrayList3) {
if (((Card) obj2).getCard().is(TrackCroutonWidget.class)) {
arrayList4.add(obj2);
}
}
ArrayList<List> arrayList5 = new ArrayList();
for (Card card : arrayList4) {
List<TrackCrouton> trackList = ((TrackCroutonWidget) card.getCard().unpack(TrackCroutonWidget.class)).getTrackList();
if (trackList != null) {
arrayList5.add(trackList);
}
}
ArrayList arrayList6 = new ArrayList();
for (List list : arrayList5) {
kotlin.collections.w.C(arrayList6, list);
}
ArrayList arrayList7 = new ArrayList();
for (Object obj3 : arrayList6) {
if (kotlin.jvm.internal.o.f(((TrackCrouton) obj3).getBusinessLine().getId(), ServiceLineTypes.TYPE_FOOD)) {
arrayList7.add(obj3);
}
}
W9().c(!arrayList7.isEmpty());
} else if (bVar instanceof b.a) {
W9().c(false);
}
}
private final void v8() {
if (!z8()) {
s8();
if (ra().n()) {
this.M1.r(new in.swiggy.android.mvvm.home.models.a(ra().u(), in.swiggy.koordinates.compass.core.c.b(ma()), in.swiggy.koordinates.compass.core.c.c(ma())));
}
Xc();
Sc();
D8();
Lc();
Wc();
Vc();
n8();
gd();
}
}
private final void vb(boolean z) {
if (z) {
if (this.W0.g()) {
HomeActivityViewModelHelper2Kt.g(this, OverlayType.FEEDBACK_OVERLAY);
return;
}
return;
}
HomeActivityViewModelHelper2Kt.i(this, OverlayType.FEEDBACK_OVERLAY);
}
public static final void x8(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public final void xc() {
in.swiggy.android.commonsui.glide.c.A.a(oa().getString("cached_current_allotment", ""));
}
public static final void y8(Function1 tmp0, Object obj) {
kotlin.jvm.internal.o.k(tmp0, "$tmp0");
tmp0.invoke(obj);
}
public final boolean z8() {
kc();
boolean P8 = P8();
if (B8()) {
HomeActivityViewModelHelper2Kt.d(this, P8, true);
return !P8;
} else if (C8()) {
Y9().a(c.d.a);
return false;
} else {
boolean A8 = A8();
boolean E8 = E8();
if (!A8 && !E8) {
return false;
}
HomeActivityViewModelHelper2Kt.d(this, P8, A8);
return !P8;
}
}
public final io.reactivex.disposables.a A0() {
return this.p1;
}
public final ObservableBoolean A9() {
return this.c1;
}
public final in.swiggy.android.analytics.newrelic.a Aa() {
in.swiggy.android.analytics.newrelic.a aVar = this.Q0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("newrelicPerformanceUtils");
return null;
}
public final void Ab() {
Y9().a(c.j.a);
}
public final void Ac(int i) {
boolean z = false;
if (i == 0 && !oa().getBoolean("app_update_cancelled", false) && Ib() && this.m && !fb().r()) {
z = true;
}
this.u1.o(Boolean.valueOf(z));
if (z) {
if (!this.d1.g()) {
Qc();
}
} else if (this.d1.g()) {
this.a1.h(true ^ this.m);
HomeActivityViewModelHelper2Kt.h(this);
}
}
public final dagger.a<DashRatingsManager> B9() {
dagger.a<DashRatingsManager> aVar = this.D;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("dashRatingsManager");
return null;
}
public final dagger.a<NudgesManager> Ba() {
dagger.a<NudgesManager> aVar = this.M0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("nudgesManager");
return null;
}
public final void Bc(boolean z) {
this.e1.h(z);
}
public final boolean C8() {
boolean c2 = u9().c("android_in_app_update", false);
in.swiggy.android.commons.utils.x.b("HomeActivityViewModel", "APP_UPDATE_KEY" + c2);
return c2;
}
public final dagger.a<in.swiggy.android.swiggylynx.headers.a> C9() {
dagger.a<in.swiggy.android.swiggylynx.headers.a> aVar = this.J;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("defaultHeaders");
return null;
}
public final dagger.a<q0> Ca() {
dagger.a<q0> aVar = this.d2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("ofoUtil");
return null;
}
public final void Cc(q1 q1Var) {
this.Z1 = q1Var;
}
public final in.swiggy.android.detectapktamper.f D9() {
in.swiggy.android.detectapktamper.f fVar = this.T0;
if (fVar != null) {
return fVar;
}
kotlin.jvm.internal.o.C("detectTamper");
return null;
}
public final in.swiggy.android.payment.services.interfaces.d Da() {
in.swiggy.android.payment.services.interfaces.d dVar = this.G0;
if (dVar != null) {
return dVar;
}
kotlin.jvm.internal.o.C("oneClickEligibilityCallService");
return null;
}
public final void Db(Intent intent) {
kotlin.jvm.internal.o.k(intent, "intent");
qa().p();
}
public final void Dc(boolean z) {
oa().edit().putBoolean("launched_from_deeplink", z).apply();
}
@Override
public void E6(int i, int i2, Intent intent) {
boolean z;
String str;
String str2;
String str3;
in.swiggy.android.tejas.oldapi.models.order.Order order;
super.E6(i, i2, intent);
LoginLimitErrorActivity.a aVar = LoginLimitErrorActivity.E;
if (i == aVar.d() && i2 == 0 && intent != null && intent.hasExtra(aVar.e()) && intent.getBooleanExtra(aVar.e(), false)) {
Y9().a(c.j0.a);
}
String str4 = null;
if (i2 == -1 && i == 307) {
if (intent != null) {
str3 = intent.getStringExtra("trackOrderJson");
} else {
str3 = null;
}
if (str3 != null && f0.g(str3)) {
order = t1.a(str3);
} else {
order = null;
}
if (order != null) {
Y9().a(new c.b0(order));
}
}
if (i2 == -1 && i == 22) {
if (intent == null || kotlin.jvm.internal.o.f("true", intent.getStringExtra("shouldRefresh"))) {
this.W0.h(false);
}
if (intent != null) {
str = intent.getStringExtra(ECommerceParamNames.RATING);
} else {
str = null;
}
String str5 = "";
if (str != null) {
Ua().get().b(intent);
RatingLauncherUtility ratingLauncherUtility = Ta().get();
String stringExtra = intent.getStringExtra(ECommerceParamNames.RATING);
if (stringExtra == null) {
stringExtra = "";
}
ratingLauncherUtility.m(stringExtra);
Y9().a(new c.C0779c(intent.getStringExtra(ECommerceParamNames.RATING)));
}
if (intent != null) {
str2 = intent.getStringExtra("ratingDE");
} else {
str2 = null;
}
if (str2 != null) {
RatingLauncherUtility ratingLauncherUtility2 = Ta().get();
String stringExtra2 = intent.getStringExtra("ratingDE");
if (stringExtra2 != null) {
str5 = stringExtra2;
}
ratingLauncherUtility2.l(str5);
}
}
if (i2 == -1 && i == 1201) {
if (intent != null) {
str4 = intent.getStringExtra("movetoAccount");
}
if (str4 != null) {
z = kotlin.text.q.z(str4, "true", true);
if (z) {
Y9().a(c.m.a);
}
}
}
}
public final ObservableInt E9() {
return this.k1;
}
public final io.reactivex.disposables.b Ea() {
return this.C2;
}
public final void Eb(boolean z) {
K9().get().a(new b.C0833b(z), new b());
}
public final void Ec(q1 q1Var) {
this.p0 = q1Var;
}
public final dagger.a<in.swiggy.android.commonsui.utils.dls.f> F9() {
dagger.a<in.swiggy.android.commonsui.utils.dls.f> aVar = this.P0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("dlsImageLoader");
return null;
}
public final Object Fa(kotlin.coroutines.c<? super LaunchHeaders> cVar) {
LaunchHeaders c2 = IdHelper.a.c(oa());
if (c2 == null) {
kotlinx.coroutines.i.d(this.D2, v0.b(), null, new HomeActivityViewModel$getOrStoreLaunchHeaders$2(this, null), 2, null);
return null;
} else if (c2.getFirebaseId().length() == 0) {
kotlinx.coroutines.i.d(this.D2, v0.b(), null, new HomeActivityViewModel$getOrStoreLaunchHeaders$3(this, null), 2, null);
return c2;
} else {
return c2;
}
}
public final boolean Fb() {
return this.z1;
}
public final void Fc(boolean z) {
this.n = z;
}
public final in.swiggy.android.commons.utils.contextservice.h G() {
in.swiggy.android.commons.utils.contextservice.h hVar = this.i2;
if (hVar != null) {
return hVar;
}
kotlin.jvm.internal.o.C("contextService");
return null;
}
public final void G8(boolean z) {
Y9().a(new c.e(z));
if (z) {
this.B.o(AppUpdatePopupState.DISMISSED);
}
}
public final dagger.a<in.swiggy.android.commonsui.utils.dls.i> G9() {
dagger.a<in.swiggy.android.commonsui.utils.dls.i> aVar = this.O0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("dlsImageUrlBuilder");
return null;
}
public final ObservableBoolean Gb() {
return this.e1;
}
public final void Gc(q1 q1Var) {
this.Y1 = q1Var;
}
@Override
public ObservableField<in.swiggy.android.crosspollination.feature.bottommediasheet.datamodel.b> H4() {
return this.C0;
}
public final dagger.a<in.swiggy.android.feature.address.dormantNudges.a> H9() {
dagger.a<in.swiggy.android.feature.address.dormantNudges.a> aVar = this.J0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("dormantAddressHalfCardManager");
return null;
}
public final OverlayUseCase Ha() {
OverlayUseCase overlayUseCase = this.I0;
if (overlayUseCase != null) {
return overlayUseCase;
}
kotlin.jvm.internal.o.C("overlayUseCase");
return null;
}
public final boolean Hb() {
return this.W1;
}
public final void Hc(PlaceOrderUtility placeOrderUtility) {
if (placeOrderUtility != null) {
io.reactivex.disposables.a aVar = this.p1;
io.reactivex.d<Boolean> T = ra().T();
final Function1<Boolean, Unit> function1 = new Function1<Boolean, Unit>() {
{
super(1);
}
public final void a(Boolean bool) {
if (HomeActivityViewModel.this.ra().F()) {
HomeActivityViewModel.this.Eb(true);
HomeActivityViewModel.this.ra().v();
} else if (HomeActivityViewModel.this.w9().get().isEnabled()) {
HomeActivityViewModel.this.F8();
}
HomeActivityViewModel.this.Sc();
}
@Override
public Unit invoke(Boolean bool) {
a(bool);
return Unit.a;
}
};
io.reactivex.functions.d<? super Boolean> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.Ic(Function1.this, obj);
}
};
final HomeActivityViewModel$setPlaceOrderUtility$2 homeActivityViewModel$setPlaceOrderUtility$2 = new Function1<Throwable, Unit>() {
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
public final void invoke2(Throwable th) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", th);
}
};
aVar.c(T.g0(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.Jc(Function1.this, obj);
}
}));
if (ra().F()) {
Eb(ra().m());
ra().v();
}
}
}
@Override
public void I1() {
Y9().a(c.m0.a);
}
@Override
public void I6() {
Y9().a(c.n0.a);
}
public final int I9() {
return this.x1;
}
public final in.swiggy.android.overlays.trackCrouton.logs.a Ia() {
in.swiggy.android.overlays.trackCrouton.logs.a aVar = this.v;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("overlaysLogger");
return null;
}
public final boolean Ib() {
String d2 = xa().get().d();
if (d2 == null) {
return false;
}
if (!kotlin.jvm.internal.o.f(d2, "swiggy://home") && !kotlin.jvm.internal.o.f(d2, "swiggy://restaurantList")) {
return false;
}
return true;
}
@Override
@SuppressLint({"MissingSuperCall"})
public void J6() {
ab().get().d();
ChatBubbleService.C.e();
z9().get().a();
K9().get().terminate();
this.W1 = false;
ib().w0();
LandingCartViewModelHelperKt.a(ib(), true, true);
Ha().h();
r9().get().j(this);
La().get().k(false);
}
public final ObservableInt J9() {
return this.n1;
}
public final dagger.a<in.swiggy.android.commons.ozone.b> Ja() {
dagger.a<in.swiggy.android.commons.ozone.b> aVar = this.N;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("ozoneTokenFetchAndRefreshManager");
return null;
}
public final in.swiggy.android.analytics.newrelic.a K0() {
in.swiggy.android.analytics.newrelic.a aVar = this.X;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("newRelicPerformanceUtils");
return null;
}
public final dagger.a<in.swiggy.android.payment.services.interfaces.c> K9() {
dagger.a<in.swiggy.android.payment.services.interfaces.c> aVar = this.F0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("eligibilityService");
return null;
}
public final in.swiggy.android.mvvm.home.f Ka() {
return this.i;
}
public final boolean Kb() {
return this.X1;
}
public final void Kc(boolean z) {
this.G2 = z;
}
public final in.swiggy.android.apputils.d L9() {
in.swiggy.android.apputils.d dVar = this.L;
if (dVar != null) {
return dVar;
}
kotlin.jvm.internal.o.C("eventLoggerSingleton");
return null;
}
public final dagger.a<in.swiggy.android.discovery.pageskeleton.datamanager.b> La() {
dagger.a<in.swiggy.android.discovery.pageskeleton.datamanager.b> aVar = this.s;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("pageSkeletonDataManager");
return null;
}
@Override
public int M() {
if (f9().a().size() > 1) {
return r0().m(R.dimen.dimen_56dp);
}
return 0;
}
public final void M8() {
boolean z;
if (this.B0) {
return;
}
this.E2.setOverlayFlowEnabled(Boolean.valueOf(Ha().A()));
PostableAggregatedLaunchRequest postableAggregatedLaunchRequest = new PostableAggregatedLaunchRequest(ia(), null);
if (r8() && ra().F() && !Jb()) {
z = true;
} else {
z = false;
}
boolean z2 = z;
LaunchResponseHandler launchResponseHandler = this.E2;
UserResponseHandler userResponseHandler = this.F2;
io.reactivex.functions.a ec = ec();
NudgesManager nudgesManager = Ba().get();
kotlin.jvm.internal.o.j(nudgesManager, "get(...)");
HomeActivityViewModelExtensionsKt.a(this, launchResponseHandler, userResponseHandler, postableAggregatedLaunchRequest, z2, ec, nudgesManager);
}
public final dagger.a<EventPauseResumeUseCase> M9() {
dagger.a<EventPauseResumeUseCase> aVar = this.t2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("eventPauseResumeUseCase");
return null;
}
public final LiveData<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.h>> Ma() {
return this.P1;
}
public final void N8(boolean z) {
va().b(z);
}
public final in.swiggy.android.commons.featureFlags.d N9() {
in.swiggy.android.commons.featureFlags.d dVar = this.p2;
if (dVar != null) {
return dVar;
}
kotlin.jvm.internal.o.C("featureFlags");
return null;
}
public final dagger.a<PageSkeletonUseCase> Na() {
dagger.a<PageSkeletonUseCase> aVar = this.T;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("pageSkeletonUseCase");
return null;
}
public final void Nb(String str) {
Y9().a(new c.h(str));
}
public final void Nc(List<UserComm> commsData) {
kotlin.jvm.internal.o.k(commsData, "commsData");
hb().get().f(commsData);
}
public final in.swiggy.android.launchApi.consumers.a O9() {
in.swiggy.android.launchApi.consumers.a aVar = this.Y;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("feedbackViewModel");
return null;
}
public final PaymentCroutonViewModel Oa() {
return (PaymentCroutonViewModel) this.U1.getValue();
}
public final void Ob() {
String str;
if (G().j()) {
FeedbackOrder f2 = O9().f();
FeedbackLaunchItem c2 = O9().c();
if (c2 != null) {
Y9().a(new c.o(O9().c(), 0));
str = String.valueOf(c2.getOrderJobId());
} else if (f2 != null) {
Y9().a(new c.x(f2, 0));
str = f2.mOrderId;
} else {
str = "";
}
this.W0.h(false);
O9().i();
in.swiggy.android.analytics.gtm.g h = pa().get().h("restaurant-listing", "click-rating-scale", str, (int) this.g1.g());
kotlin.jvm.internal.o.j(h, "getGtmEventData(...)");
pa().get().b(h);
}
}
public final void Oc(boolean z) {
this.X1 = z;
x4();
}
public final dagger.a<in.swiggy.android.feature.fingerprint.g> P9() {
dagger.a<in.swiggy.android.feature.fingerprint.g> aVar = this.F;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("fingerprintHeaderHelper");
return null;
}
public final dagger.b<PaymentCroutonViewModel> Pa() {
dagger.b<PaymentCroutonViewModel> bVar = this.Q;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("paymentCroutonViewModelInjector");
return null;
}
public final void Pb(LaunchCroutonData launchCroutonData) {
Oa().M(launchCroutonData);
}
public final void Pc(boolean z, boolean z2) {
boolean z3;
in.swiggy.android.mvvm.home.d Y9 = Y9();
if (z && f9().a().size() >= 2) {
z3 = true;
} else {
z3 = false;
}
Y9.a(new c.q0(z3, z2));
}
@Override
public void Q6() {
super.Q6();
Y9().a(new c.p0(false));
if (!L2) {
Y9().a(c.t0.a);
}
Mb();
O8();
}
public final void Q8() {
if (oa().getInt("newrelic_random_number", 0) == 0) {
oa().edit().putInt("newrelic_random_number", (int) ((Math.random() * 100) + 1)).apply();
}
}
public final dagger.a<in.swiggy.android.apputils.f> Q9() {
dagger.a<in.swiggy.android.apputils.f> aVar = this.S;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("flowUtil");
return null;
}
public final dagger.a<PlaceOrderUtility> Qa() {
dagger.a<PlaceOrderUtility> aVar = this.N0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("placeOrderUtility");
return null;
}
public final void Qb(LaunchCroutonData launchCroutonData) {
Oa().N(launchCroutonData);
}
public final void Qc() {
this.d1.h(true);
if (this.d1.g()) {
in.swiggy.android.analytics.gtm.g h = pa().get().h("ux4-home-page", "impression-in-app-update-available", "1202", 9999);
kotlin.jvm.internal.o.j(h, "getGtmEventData(...)");
pa().get().j(h);
}
}
@Override
public void R6() {
super.R6();
}
public final LiveData<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.c>> R8() {
return this.D1;
}
public final dagger.a<FoodDiscoveryCacheManager> R9() {
dagger.a<FoodDiscoveryCacheManager> aVar = this.y;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("foodDiscoveryCacheManager");
return null;
}
public final PreLaunchViewModel Ra() {
return (PreLaunchViewModel) this.x2.getValue();
}
public final void Rc() {
Pair<String, OverlayType> Ga = Ga();
String a2 = Ga.a();
OverlayType b2 = Ga.b();
ObservableBoolean observableBoolean = this.Z0;
in.swiggy.android.feature.landing.viewmodel.g gVar = z9().get();
kotlin.jvm.internal.o.j(gVar, "get(...)");
observableBoolean.h(in.swiggy.android.feature.landing.viewmodel.g.g(gVar, true, b2, a2, true, false, 16, null));
this.Y0.h(true);
}
@Override
public void S6() {
super.S6();
Y9().a(c.k.a);
va().g();
q1 q1Var = this.Z;
if (q1Var != null) {
q1.a.a(q1Var, null, 1, null);
}
}
public final dagger.a<AggregateLaunchManager> S8() {
dagger.a<AggregateLaunchManager> aVar = this.V;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("aggregateLaunchManager");
return null;
}
public final in.swiggy.android.discovery.utils.cache.c S9() {
in.swiggy.android.discovery.utils.cache.c cVar = this.x;
if (cVar != null) {
return cVar;
}
kotlin.jvm.internal.o.C("foodDiscoveryCacheUtils");
return null;
}
public final dagger.b<PreLaunchViewModel> Sa() {
dagger.b<PreLaunchViewModel> bVar = this.P;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("preLaunchViewModelInjector");
return null;
}
public final void Sb(Bundle bundle) {
boolean z;
boolean z2;
if (bundle != null) {
z = kotlin.text.q.z("support", bundle.getString("conversationType"), true);
if (!z) {
z2 = kotlin.text.q.z("decx", bundle.getString("conversationType"), true);
if (!z2) {
L2 = false;
return;
}
}
L2 = bundle.getBoolean("from_notification");
}
}
public final dagger.a<in.swiggy.android.feature.launch.a> T8() {
dagger.a<in.swiggy.android.feature.launch.a> aVar = this.D0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("aggregatedLaunchLogger");
return null;
}
public final androidx.lifecycle.y<Boolean> T9() {
return this.u1;
}
public final dagger.a<RatingLauncherUtility> Ta() {
dagger.a<RatingLauncherUtility> aVar = this.H;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("ratingLauncherUtility");
return null;
}
public final ObservableBoolean U8() {
return this.a1;
}
public final dagger.a<GuidedDiscoveryStore> U9() {
dagger.a<GuidedDiscoveryStore> aVar = this.u2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("guidedDiscoveryStore");
return null;
}
public final dagger.a<in.swiggy.android.ratingkit.a> Ua() {
dagger.a<in.swiggy.android.ratingkit.a> aVar = this.G;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("ratingLessThanFourUtility");
return null;
}
public final void Ub(String str) {
in.swiggy.android.analytics.gtm.g h = pa().get().h("notification", str, "", 9999);
kotlin.jvm.internal.o.j(h, "getGtmEventData(...)");
pa().get().b(h);
}
public final void V3() {
ja().edit().remove("upi_payment_vpa_flow_started_time_v2").apply();
PlaceOrderUtility placeOrderUtility = Qa().get();
kotlin.jvm.internal.o.j(placeOrderUtility, "get(...)");
HomeActivityViewModelHelperKt.r(placeOrderUtility, this.I2);
Tb("native", null);
}
public final ObservableBoolean V8() {
return this.b1;
}
public final LiveData<in.swiggy.android.mvvm.home.models.a> V9() {
return this.N1;
}
public final ObservableInt Va() {
return this.V0;
}
public final void Vb() {
int i = oa().getInt("newrelic_random_number", 0);
if (i != 0) {
HashMap hashMap = new HashMap();
hashMap.put("number", Integer.valueOf(i));
Aa().b("random_number_generation", hashMap);
}
}
@Override
public void W2(in.swiggy.android.crosspollination.feature.bottommediasheet.datamodel.b bVar) {
this.C0.h(bVar);
}
public final ObservableBoolean W8() {
return this.Z0;
}
public final in.swiggy.android.discovery.contextualtrigger.triggers.l W9() {
in.swiggy.android.discovery.contextualtrigger.triggers.l lVar = this.R0;
if (lVar != null) {
return lVar;
}
kotlin.jvm.internal.o.C("hasFoodOrder");
return null;
}
@Override
public void X5() {
oa().edit().putLong("item_added_to_cart", System.currentTimeMillis()).apply();
this.W1 = true;
}
public final AppDefaultingContext X8() {
AppDefaultingContext appDefaultingContext = this.r;
if (appDefaultingContext != null) {
return appDefaultingContext;
}
kotlin.jvm.internal.o.C("appDefaultingContext");
return null;
}
public final boolean X9() {
return this.o;
}
public final ObservableBoolean Xa() {
return this.X0;
}
public final void Xb(String url, Map<String, String> updatedHeaders, PaymentPendingRequestPayload payload) {
kotlin.jvm.internal.o.k(url, "url");
kotlin.jvm.internal.o.k(updatedHeaders, "updatedHeaders");
kotlin.jvm.internal.o.k(payload, "payload");
PendingPaymentRequestParams e2 = payload.e();
Map<String, String> l = HomeActivityViewModelHelperKt.l(payload);
Qa().get().W(this.I2, url, e2.g(), updatedHeaders, e2.b(), e2.f(), l);
Tb("web", l);
}
public final androidx.lifecycle.y<Boolean> Y8() {
return this.f1;
}
public final in.swiggy.android.mvvm.home.d Y9() {
return (in.swiggy.android.mvvm.home.d) this.Q1.getValue();
}
public final ObservableBoolean Ya() {
return this.W0;
}
public final void Yb(Map<String, String> extraParams) {
kotlin.jvm.internal.o.k(extraParams, "extraParams");
ib().m0(extraParams);
}
public final androidx.lifecycle.y<AppUpdatePopupState> Z8() {
return this.B;
}
public final dagger.a<HomeDiscoveryCacheManager> Z9() {
dagger.a<HomeDiscoveryCacheManager> aVar = this.m2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("homeDiscoveryCacheManager");
return null;
}
public final ObservableBoolean Za() {
return this.Y0;
}
public final void Zb() {
oa().edit().putLong("app_update_cancelled_time_v2", System.currentTimeMillis()).putBoolean("app_update_cancelled", true).apply();
}
public final ObservableBoolean a9() {
return this.d1;
}
public final in.swiggy.android.mndutils.h aa() {
in.swiggy.android.mndutils.h hVar = this.n2;
if (hVar != null) {
return hVar;
}
kotlin.jvm.internal.o.C("homeDiscoveryCacheUtils");
return null;
}
public final dagger.a<in.swiggy.android.mxn.relevance.h> ab() {
dagger.a<in.swiggy.android.mxn.relevance.h> aVar = this.K;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("similarRestaurantsDriver");
return null;
}
public final void ac() {
Mb();
Ac(0);
}
public final in.swiggy.android.mxn.swiggyats.a b9() {
in.swiggy.android.mxn.swiggyats.a aVar = this.q2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("atsService");
return null;
}
public final dagger.a<InstamartAppShortcutUseCase> ba() {
dagger.a<InstamartAppShortcutUseCase> aVar = this.z;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("instamartAppShortcutUseCase");
return null;
}
public final Function0<Unit> bb() {
return this.S1;
}
public final dagger.b<BadFoodOrderCroutonViewModel> c9() {
dagger.b<BadFoodOrderCroutonViewModel> bVar = this.R;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("badFoodCroutonViewModelInjector");
return null;
}
public final dagger.a<LaunchConfigUseCase> ca() {
dagger.a<LaunchConfigUseCase> aVar = this.U;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("launchConfigUseCase");
return null;
}
public final SwiggySplashViewModel cb() {
return (SwiggySplashViewModel) this.h1.getValue();
}
public final io.reactivex.functions.a cc() {
return new io.reactivex.functions.a() {
@Override
public final void run() {
HomeActivityViewModel.dc(HomeActivityViewModel.this);
}
};
}
public final BadFoodOrderCroutonViewModel d9() {
return (BadFoodOrderCroutonViewModel) this.V1.getValue();
}
public final String da() {
try {
String jSONObjectInstrumentation = JSONObjectInstrumentation.toString(new JSONObject(this.i.a()));
kotlin.jvm.internal.o.j(jSONObjectInstrumentation, "toString(...)");
return jSONObjectInstrumentation;
} catch (Exception e2) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", e2);
return "";
}
}
public final in.swiggy.android.repositories.interfaces.e e3() {
in.swiggy.android.repositories.interfaces.e eVar = this.g2;
if (eVar != null) {
return eVar;
}
kotlin.jvm.internal.o.C("xpExperimentContext");
return null;
}
public final ObservableField<in.swiggy.android.commonsui.ui.view.bottombar.b> e9() {
return this.q1;
}
public final dagger.a<in.swiggy.android.mxn.launch.a> ea() {
dagger.a<in.swiggy.android.mxn.launch.a> aVar = this.v2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("launchIntentHandler");
return null;
}
public final io.reactivex.subjects.a<in.swiggy.android.detectapktamper.l> eb() {
io.reactivex.subjects.a<in.swiggy.android.detectapktamper.l> aVar = this.U0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("tamperPublisher");
return null;
}
public final in.swiggy.android.apputils.bottombar.d f9() {
in.swiggy.android.apputils.bottombar.d dVar = this.W;
if (dVar != null) {
return dVar;
}
kotlin.jvm.internal.o.C("bottomBarHelper");
return null;
}
public final LiveData<Bundle> fa() {
return this.J1;
}
public final TrackCroutonViewModel fb() {
return (TrackCroutonViewModel) this.S0.getValue();
}
public final ObservableInt g9() {
return this.o1;
}
public final LiveData<Bundle> ga() {
return this.L1;
}
public final dagger.a<UpdateEngagementUseCase> gb() {
dagger.a<UpdateEngagementUseCase> aVar = this.K0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("updateEngagementUseCase");
return null;
}
public final void gc() {
boolean z;
boolean z2;
in.swiggy.android.overlays.trackCrouton.dataSource.a i = fb().i();
if (i == null) {
return;
}
String id = i.a().getId();
if (!kotlin.jvm.internal.o.f(id, ServiceLineTypes.TYPE_FOOD)) {
z = kotlin.text.q.z(id, OrderTypes.TYPE_INSTAMAX, true);
if (!z) {
z2 = kotlin.text.q.z(id, OrderTypes.TYPE_INSANELYGOOD, true);
if (z2) {
Y9().a(new c.s(i.d(), id));
return;
} else {
Y9().a(new c.p(i.d(), id));
return;
}
}
Y9().a(new c.t(i.d(), id));
return;
}
Y9().a(new c.c0(i.d(), null, null));
in.swiggy.android.analytics.gtm.g h = pa().get().h("ux4-home-page", "click-tracking-crouton", i.d(), 9999);
kotlin.jvm.internal.o.j(h, "getGtmEventData(...)");
pa().get().b(h);
}
public final dagger.a<BottomBarPopupDataManager> h9() {
dagger.a<BottomBarPopupDataManager> aVar = this.H0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("bottomBarPopupDataManager");
return null;
}
public final q1 ha() {
return this.p0;
}
public final dagger.a<UserCommHelper> hb() {
dagger.a<UserCommHelper> aVar = this.a2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("userCommHelper");
return null;
}
public final ObservableField<in.swiggy.android.feature.dbbpopup.datamodel.b> i9() {
return this.v1;
}
public final LandingViewCartViewModel ib() {
return (LandingViewCartViewModel) this.T1.getValue();
}
@Override
public void init() {
Sb(B6());
Bundle B6 = B6();
if (B6 != null) {
ea().get().a(B6);
}
this.o = false;
this.o1.h(8);
this.k1.h(8);
kotlinx.coroutines.i.d(l0.a(this), v0.b(), null, new HomeActivityViewModel$init$2(this, null), 2, null);
L9().o(true);
v8();
qc();
Rb();
}
public final SharedPreferences ja() {
SharedPreferences sharedPreferences = this.A;
if (sharedPreferences != null) {
return sharedPreferences;
}
kotlin.jvm.internal.o.C("lynxSharedPreferences");
return null;
}
public final dagger.b<LandingViewCartViewModel> jb() {
dagger.b<LandingViewCartViewModel> bVar = this.O;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("viewCartViewModelInjector");
return null;
}
public final void jd(String str, long j) {
j9().r(str, j);
}
public final ObservableInt k9() {
return this.l1;
}
public final ObservableFloat ka() {
return this.g1;
}
@Override
public boolean l6() {
boolean z;
if (!in.swiggy.android.constants.b.e("BAD_FOOD_ORDER_CROUTON_ENABLED", "true", oa())) {
return false;
}
if (!this.Y0.g() && !fb().r() && !this.d1.g() && this.c1.g() && !ib().c0() && !this.X1 && !Oa().T() && !Oa().U()) {
z = false;
} else {
z = true;
}
if (!this.o || !Ib() || !ra().F() || !HomeActivityViewModelHelper2Kt.j(this, !z)) {
return false;
}
return true;
}
public final dagger.a<HudDebugTracking> la() {
dagger.a<HudDebugTracking> aVar = this.u;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("mHudDebugTracking");
return null;
}
public final void lc(long j) {
pa().get().i("source_attribution", new in.swiggy.android.analytics.attribution.b(null, null, String.valueOf(j), "push_notification", null, null, 32, null));
}
@Override
public boolean m6() {
boolean z;
if (!this.Y0.g() && !fb().r() && !this.d1.g() && this.c1.g() && !this.X1 && !ib().c0()) {
z = false;
} else {
z = true;
}
if (!this.o || !Ib() || !HomeActivityViewModelHelper2Kt.l(this, !z)) {
return false;
}
return true;
}
public final void m8() {
SwiggyPerfMonitor.b(SwiggyPerfMonitor.a, new in.swiggy.android.analytics.perf.sinks.b(Aa()), false, 2, null);
}
public final ObservableInt m9() {
return this.m1;
}
public final in.swiggy.koordinates.compass.core.b ma() {
in.swiggy.koordinates.compass.core.b bVar = this.j2;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.o.C("mLocationContext");
return null;
}
public final void mb(boolean z) {
Y9().a(new c.g0(z));
}
@Override
public in.swiggy.android.crosspollination.feature.bottommediasheet.datamodel.b n0(BottomMediaSheet bottomMediaSheet) {
kotlin.jvm.internal.o.k(bottomMediaSheet, "bottomMediaSheet");
return l9().d(bottomMediaSheet);
}
public final LiveData<LaunchConfigRequestParams> n9() {
return this.H1;
}
public final dagger.a<in.swiggy.android.repositories.interfaces.b> na() {
dagger.a<in.swiggy.android.repositories.interfaces.b> aVar = this.p;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("mRestaurantsContext");
return null;
}
public final void nc() {
if (G().j()) {
this.f1.o(Boolean.valueOf(this.e1.g()));
}
}
public final boolean o8() {
if (!this.Y0.g() && !fb().r() && !this.d1.g() && !this.X1 && !q0.f.h() && !this.G2 && !this.A0) {
return true;
}
return false;
}
public final LiveData<in.swiggy.koordinates.core.f> o9() {
return this.F1;
}
public final SharedPreferences oa() {
SharedPreferences sharedPreferences = this.f2;
if (sharedPreferences != null) {
return sharedPreferences;
}
kotlin.jvm.internal.o.C("mSharedPreferences");
return null;
}
public final void oc(boolean z) {
this.m = z;
}
@Override
public void onCleared() {
super.onCleared();
this.p1.dispose();
}
public final boolean p8() {
if (!this.Y0.g() && !fb().r() && !this.d1.g() && !this.X1 && !q0.f.h() && !this.G2) {
return true;
}
return false;
}
public final Function2<String, Boolean, Unit> p9() {
return this.R1;
}
public final dagger.a<in.swiggy.android.analytics.interfaces.c> pa() {
dagger.a<in.swiggy.android.analytics.interfaces.c> aVar = this.t;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("mSwiggyEventHandler");
return null;
}
public final void pb() {
if (in.swiggy.android.commonsui.feature.irctc.a.a.c()) {
if (!ra().F()) {
this.K1.r(B6());
} else {
this.I1.r(B6());
}
}
}
public final void q8(PlaceOrderUtility placeOrderUtility) {
long j;
Object fromJson;
kotlin.jvm.internal.o.k(placeOrderUtility, "placeOrderUtility");
if (Lb() && oa().contains("payment_pending")) {
String string = oa().getString("payment_pending", "");
if (string != null && string.length() != 0) {
Gson g2 = in.swiggy.android.commons.utils.i0.g();
if (!(g2 instanceof Gson)) {
fromJson = g2.fromJson(string, (Class<Object>) PaymentPendingRequestPayload.class);
} else {
fromJson = GsonInstrumentation.fromJson(g2, string, (Class<Object>) PaymentPendingRequestPayload.class);
}
kotlin.jvm.internal.o.j(fromJson, "fromJson(...)");
PaymentPendingRequestPayload paymentPendingRequestPayload = (PaymentPendingRequestPayload) fromJson;
HashMap<String, String> a2 = C9().get().a();
a2.putAll(paymentPendingRequestPayload.e().d());
kotlinx.coroutines.i.d(l0.a(this), null, null, new HomeActivityViewModel$checkAndCallConfirmOrderForUPIFlow$1(this, paymentPendingRequestPayload.e().e() + "/" + paymentPendingRequestPayload.e().c(), a2, paymentPendingRequestPayload, null), 3, null);
}
if (oa().contains("payment_pending")) {
oa().edit().remove("payment_pending").apply();
}
} else if (!Lb() && ja().contains("upi_payment_vpa_flow_started_time_v2")) {
int a3 = in.swiggy.android.constants.b.a("upi_vpa_payment_call_confirm_order_fallback_time", 5, oa());
String string2 = ja().getString("upi_payment_vpa_flow_started_time_v2", PDLayoutAttributeObject.GLYPH_ORIENTATION_VERTICAL_ZERO_DEGREES);
if (string2 != null) {
j = Long.parseLong(string2);
} else {
j = 0;
}
if (System.currentTimeMillis() - j < a3 * 60 * 1000) {
kotlinx.coroutines.i.d(l0.a(this), null, null, new HomeActivityViewModel$checkAndCallConfirmOrderForUPIFlow$2(this, null), 3, null);
} else {
ja().edit().remove("upi_payment_vpa_flow_started_time_v2").apply();
}
}
}
public final ObservableInt q9() {
return this.s1;
}
public final in.swiggy.android.analytics.generated.e qa() {
in.swiggy.android.analytics.generated.e eVar = this.h2;
if (eVar != null) {
return eVar;
}
kotlin.jvm.internal.o.C("mSwiggyEventLogger");
return null;
}
public final void qb(in.swiggy.koordinates.core.f location, in.swiggy.koordinates.core.f gpsLocation) {
kotlin.jvm.internal.o.k(location, "location");
kotlin.jvm.internal.o.k(gpsLocation, "gpsLocation");
if (KotlinExtensionsKt.r(N9().a("shield_cohorting_enabled"), false, 1, null)) {
this.G1.r(new LaunchConfigRequestParams(LaunchConfigRequestParamsKt.toSerializedLatLng(gpsLocation), LaunchConfigRequestParamsKt.toSerializedLatLng(location)));
}
}
public final in.swiggy.android.mvvm.services.s r0() {
in.swiggy.android.mvvm.services.s sVar = this.o2;
if (sVar != null) {
return sVar;
}
kotlin.jvm.internal.o.C("resourcesService");
return null;
}
public final dagger.a<in.swiggy.android.repositories.cart.services.i> r9() {
dagger.a<in.swiggy.android.repositories.cart.services.i> aVar = this.c2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("cartService");
return null;
}
public final in.swiggy.android.repositories.interfaces.d ra() {
in.swiggy.android.repositories.interfaces.d dVar = this.k2;
if (dVar != null) {
return dVar;
}
kotlin.jvm.internal.o.C("mUser");
return null;
}
public final dagger.a<ChatPollingViewModel> s9() {
dagger.a<ChatPollingViewModel> aVar = this.I;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("chatV3PollingViewModel");
return null;
}
public final dagger.a<in.swiggy.android.discovery.dynamicbottombar.e> sa() {
dagger.a<in.swiggy.android.discovery.dynamicbottombar.e> aVar = this.b2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("mapper");
return null;
}
public final boolean t5() {
return HomeActivityViewModelHelper2Kt.c(this);
}
public final dagger.a<in.swiggy.android.listingkit.interfaces.i> t9() {
dagger.a<in.swiggy.android.listingkit.interfaces.i> aVar = this.l2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("clickActionDelegate");
return null;
}
public final ObservableField<List<in.swiggy.android.utils.d>> ta() {
return this.r1;
}
public final void tb(in.swiggy.koordinates.core.f loc) {
kotlin.jvm.internal.o.k(loc, "loc");
HomeActivityViewModelHelperKt.h(this);
if (DeepLinkActivity.C.a()) {
return;
}
this.E1.r(loc);
}
public final void tc(boolean z) {
this.z1 = z;
}
@Override
public in.swiggy.android.crosspollination.feature.bottommediasheet.datamodel.b u4() {
return this.C0.g();
}
public final in.swiggy.android.config.c u9() {
in.swiggy.android.config.c cVar = this.e2;
if (cVar != null) {
return cVar;
}
kotlin.jvm.internal.o.C(PaymentConstants.Category.CONFIG);
return null;
}
public final dagger.a<MonetaOrderManager> ua() {
dagger.a<MonetaOrderManager> aVar = this.C;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("monetaOrderManager");
return null;
}
public final void ub() {
boolean z;
String str;
boolean z2;
boolean z3;
String str2;
boolean ld = ld();
la().get().d(ld);
boolean F = ra().F();
boolean z4 = true;
if (!this.X0.g() && !this.W0.g()) {
z = false;
} else {
z = true;
}
String d2 = xa().get().d();
if (d2 == null) {
d2 = "";
}
int d3 = sa().get().d(d2);
if (d3 != -1) {
str = f9().a().get(d3).getTitle();
} else {
str = null;
}
String str3 = str;
TrackCroutonViewModel fb = fb();
if (F && Ib() && this.o) {
z2 = true;
} else {
z2 = false;
}
if (F && kd()) {
z3 = true;
} else {
z3 = false;
}
if (str3 == null) {
str2 = "";
} else {
str2 = str3;
}
fb.v(new in.swiggy.android.overlays.trackCrouton.a(z2, z3, str2, F, this.o));
if (!F || !z || !Ib() || !ld || fb().r()) {
z4 = false;
}
boolean z5 = fb().g().getValue() instanceof i.b;
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("isLoggedIn", ra().F());
jSONObject.put("showCrouton", this.X0.g());
jSONObject.put("showFeedBack", this.W0.g());
jSONObject.put("showOverlaysTrack", z5);
if (str3 != null) {
jSONObject.put("selectedTabTitle", str3);
}
jSONObject.put("selectedTab", d3);
la().get().c(JSONObjectInstrumentation.toString(jSONObject), l0.a(this));
Ac(0);
} catch (JSONException e2) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", e2);
}
this.u1.o(Boolean.valueOf(z4));
vb(z4);
x4();
}
public final void uc(boolean z, boolean z2) {
Y9().a(new c.q(z2, z));
if (z) {
this.B.o(AppUpdatePopupState.VISIBLE);
}
}
@Override
public boolean v0(boolean z) {
boolean z2;
if (!this.Y0.g() && !fb().r() && !this.d1.g() && this.c1.g() && !z && !ib().c0() && !this.X1) {
z2 = false;
} else {
z2 = true;
}
if (!this.o || !Ib() || !HomeActivityViewModelHelper2Kt.k(this, !z2)) {
return false;
}
return true;
}
public final ObservableInt v9() {
return this.j1;
}
public final in.swiggy.android.mvvm.home.e va() {
return (in.swiggy.android.mvvm.home.e) this.w2.getValue();
}
public final void vc(BottomBarPopup bottomBarPopup) {
if (bottomBarPopup != null) {
this.v1.h(j9().f(bottomBarPopup));
} else {
this.v1.h(null);
}
}
public final void w8() {
io.reactivex.disposables.a aVar = this.p1;
io.reactivex.l<in.swiggy.android.detectapktamper.l> observeOn = eb().observeOn(io.reactivex.android.schedulers.a.a());
final Function1<in.swiggy.android.detectapktamper.l, Unit> function1 = new Function1<in.swiggy.android.detectapktamper.l, Unit>() {
{
super(1);
}
public final void a(in.swiggy.android.detectapktamper.l tamperResult) {
kotlin.jvm.internal.o.k(tamperResult, "tamperResult");
if (tamperResult instanceof l.b) {
HomeActivityViewModel.this.Y9().a(c.a0.a);
}
}
@Override
public Unit invoke(in.swiggy.android.detectapktamper.l lVar) {
a(lVar);
return Unit.a;
}
};
io.reactivex.functions.d<? super in.swiggy.android.detectapktamper.l> dVar = new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.x8(Function1.this, obj);
}
};
final HomeActivityViewModel$checkForTamper$2 homeActivityViewModel$checkForTamper$2 = new Function1<Throwable, Unit>() {
@Override
public Unit invoke(Throwable th) {
invoke2(th);
return Unit.a;
}
public final void invoke2(Throwable th) {
in.swiggy.android.commons.utils.x.i("HomeActivityViewModel", th);
}
};
aVar.c(observeOn.subscribe(dVar, new io.reactivex.functions.d() {
@Override
public final void accept(Object obj) {
HomeActivityViewModel.y8(Function1.this, obj);
}
}));
kotlinx.coroutines.i.d(l0.a(this), null, null, new HomeActivityViewModel$checkForTamper$3(this, null), 3, null);
}
public final dagger.a<in.swiggy.android.payment.services.interfaces.b> w9() {
dagger.a<in.swiggy.android.payment.services.interfaces.b> aVar = this.E0;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("credDataManager");
return null;
}
public final androidx.lifecycle.y<in.swiggy.android.commons.utils.l<in.swiggy.android.mvvm.home.h>> wa() {
return this.O1;
}
public final void wb(Bundle bundle) {
if (this.B0) {
return;
}
if (bundle != null && bundle.containsKey("landingActivity")) {
this.o = true;
S9().k(true);
aa().i(true);
this.y1 = true;
Y9().a(c.k.a);
rb(bundle);
} else if (G().isNetworkAvailable() && !kotlin.jvm.internal.o.f("2G", G().y())) {
q1 q1Var = this.y0;
if ((q1Var != null && q1Var.f()) || X8().n()) {
lb(ma().getLocation().getValue());
} else {
this.z0 = Boolean.TRUE;
}
} else {
this.z0 = Boolean.FALSE;
Mc();
}
}
public final void wc(boolean z) {
this.A0 = z;
}
@Override
public void x4() {
HomeActivityViewModelHelper2Kt.m(this);
}
public final dagger.a<in.swiggy.android.commoninterfaces.d> x9() {
dagger.a<in.swiggy.android.commoninterfaces.d> aVar = this.w;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("credEligibilityCallService");
return null;
}
public final dagger.a<in.swiggy.android.discovery.dynamicbottombar.a> xa() {
dagger.a<in.swiggy.android.discovery.dynamicbottombar.a> aVar = this.M;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("navigator");
return null;
}
public final void xb() {
ub();
x4();
z3();
}
public final io.reactivex.disposables.b y9() {
return this.B2;
}
public final boolean ya() {
return this.n;
}
public final void yb() {
if (Ha().A()) {
Ha().i(new c.e(OverlayType.IN_APP_UPDATE_CROUTON_OVERLAY, OverlayRemovalState.ALL_SCREENS), false);
}
this.d1.h(false);
}
public final void yc(int i) {
this.x1 = i;
}
@Override
public void z3() {
if (l6()) {
kotlinx.coroutines.i.d(l0.a(this), DispatchProviderKt.c().Q(DispatchProviderKt.b().n1()), null, new HomeActivityViewModel$handleBadFoodOrderCroutonVisibility$$inlined$ioScope$1(null, this), 2, null);
} else {
d9().z();
}
}
public final dagger.a<in.swiggy.android.feature.landing.viewmodel.g> z9() {
dagger.a<in.swiggy.android.feature.landing.viewmodel.g> aVar = this.r2;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("croutonAnimationHelper");
return null;
}
public final dagger.a<in.swiggy.android.networkutils.n> za() {
dagger.a<in.swiggy.android.networkutils.n> aVar = this.q;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.o.C("networkWrapper");
return null;
}
public final void zb() {
this.Z0.h(!this.W0.g());
this.Y0.h(false);
}
public final void zc(boolean z) {
this.o = z;
}
}