package ka;

import androidx.lifecycle.a0;
import androidx.lifecycle.d0;
import androidx.lifecycle.f0;
import androidx.lifecycle.g0;
import ca.canadapost.core.data.addresscomplete.webservice.AddressCompleteFindItem;
import ca.canadapost.core.data.auth.model.AMSErrorResponseException;
import ca.canadapost.core.data.auth.model.AmsAddressResult;
import ca.canadapost.core.data.auth.model.FormattedAddress;
import ca.canadapost.core.data.auth.model.Name;
import ca.canadapost.core.data.auth.model.Scope;
import ca.canadapost.core.data.auth.model.UserProfile;
import ca.canadapost.core.data.model.AMSCheckSteps;
import ca.canadapost.core.data.model.CommonErrorResponse;
import ca.canadapost.core.data.model.CommonErrorResponseException;
import ca.canadapost.core.data.model.DeliveryPreference;
import ca.canadapost.core.data.model.DetailObjects;
import ca.canadapost.core.data.model.Event;
import ca.canadapost.core.data.model.PackageDeliveryOptionInstructionResponse;
import ca.canadapost.core.data.model.PhoneNumber;
import ca.canadapost.core.data.model.RepositoryError;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.core.data.model.ValidationError;
import ca.canadapost.core.data.mymail.model.AddressEligibilityBody;
import ca.canadapost.core.data.mymail.model.MyMailFlowArguments;
import ca.canadapost.core.data.profile.api.AccountQRCodeApi;
import ca.canadapost.core.data.profile.api.IAMSApi;
import ca.canadapost.core.data.profile.api.IDupEmailApi;
import ca.canadapost.core.data.profile.api.IProfileApi;
import ca.canadapost.core.data.profile.model.AMSPrerequisitesResponse;
import ca.canadapost.core.data.profile.model.AddressAMSCheckRequest;
import ca.canadapost.core.data.profile.model.EpostDisplayProfilePayload;
import ca.canadapost.core.data.profile.model.EpostDisplayProfileResponse;
import ca.canadapost.core.data.profile.model.NotificationPreferenceResponse;
import ca.canadapost.core.data.profile.model.OneToOneEmailRequest;
import ca.canadapost.core.data.profile.model.SetForgetDeliveryPrefRequest;
import ca.canadapost.core.data.profile.model.SetForgetEmailPreferenceRequest;
import ca.canadapost.core.data.profile.model.SetForgetNickNamesRequest;
import ca.canadapost.core.data.profile.model.SetForgetPreferenceResponse;
import ca.canadapost.core.data.profile.model.SetForgetSmsPreferenceRequest;
import ca.canadapost.core.data.profile.model.SetNForgotTnCResponse;
import ca.canadapost.core.data.profile.model.SetnForgetSubscriptionRequest;
import com.google.firebase.crashlytics.internal.metadata.UserMetadata;
import java.util.List;
import ka.b;
import kotlin.jvm.internal.o0;
import rm.n0;
import rm.y;

/* loaded from: classes.dex */
public final class c implements ka.b {
    private final f0 A;
    private final a0 B;
    private final f0 C;
    private final a0 D;

    /* renamed from: a, reason: collision with root package name */
    private final i9.d f25533a;

    /* renamed from: b, reason: collision with root package name */
    private final ca.a f25534b;

    /* renamed from: c, reason: collision with root package name */
    private final ja.d f25535c;

    /* renamed from: d, reason: collision with root package name */
    private final IProfileApi f25536d;

    /* renamed from: e, reason: collision with root package name */
    private final IDupEmailApi f25537e;

    /* renamed from: f, reason: collision with root package name */
    private final fa.a f25538f;

    /* renamed from: g, reason: collision with root package name */
    private final p9.h f25539g;

    /* renamed from: h, reason: collision with root package name */
    private final IAMSApi f25540h;

    /* renamed from: i, reason: collision with root package name */
    private final AccountQRCodeApi f25541i;

    /* renamed from: j, reason: collision with root package name */
    private final f0 f25542j;

    /* renamed from: k, reason: collision with root package name */
    private final f0 f25543k;

    /* renamed from: l, reason: collision with root package name */
    private final d0 f25544l;

    /* renamed from: m, reason: collision with root package name */
    private final f0 f25545m;

    /* renamed from: n, reason: collision with root package name */
    private final a0 f25546n;

    /* renamed from: o, reason: collision with root package name */
    private final f0 f25547o;

    /* renamed from: p, reason: collision with root package name */
    private final a0 f25548p;

    /* renamed from: q, reason: collision with root package name */
    private final rm.o f25549q;

    /* renamed from: r, reason: collision with root package name */
    private final d0 f25550r;

    /* renamed from: s, reason: collision with root package name */
    private final d0 f25551s;

    /* renamed from: t, reason: collision with root package name */
    private final f0 f25552t;

    /* renamed from: u, reason: collision with root package name */
    private final a0 f25553u;

    /* renamed from: v, reason: collision with root package name */
    private final f0 f25554v;

    /* renamed from: w, reason: collision with root package name */
    private final a0 f25555w;

    /* renamed from: x, reason: collision with root package name */
    private final d0 f25556x;

    /* renamed from: y, reason: collision with root package name */
    private final f0 f25557y;

    /* renamed from: z, reason: collision with root package name */
    private final a0 f25558z;

    /* loaded from: classes.dex */
    static final class a extends kotlin.jvm.internal.v implements dn.l {
        a() {
            super(1);
        }

        public final void a(AddressCompleteFindItem.AddressCompleteRetrieveItem addressCompleteRetrieveItem) {
            if (addressCompleteRetrieveItem != null) {
                c cVar = c.this;
                cVar.B().q(new ka.a(addressCompleteRetrieveItem.Line1, addressCompleteRetrieveItem.Line2, addressCompleteRetrieveItem.City, addressCompleteRetrieveItem.Province, addressCompleteRetrieveItem.PostalCode, x8.a.CANADA.getCode()));
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((AddressCompleteFindItem.AddressCompleteRetrieveItem) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes.dex */
    static final class b extends kotlin.jvm.internal.v implements dn.l {
        b() {
            super(1);
        }

        public final void a(AddressCompleteFindItem.AddressCompleteRetrieveItem addressCompleteRetrieveItem) {
            if (addressCompleteRetrieveItem != null) {
                c cVar = c.this;
                cVar.q().q(new ka.a(addressCompleteRetrieveItem.Line1, addressCompleteRetrieveItem.Line2, addressCompleteRetrieveItem.City, addressCompleteRetrieveItem.Province, addressCompleteRetrieveItem.PostalCode, x8.a.CANADA.getCode()));
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((AddressCompleteFindItem.AddressCompleteRetrieveItem) obj);
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* renamed from: ka.c$c, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public static final class C0541c extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25561p;

        /* renamed from: q, reason: collision with root package name */
        Object f25562q;

        /* renamed from: r, reason: collision with root package name */
        Object f25563r;

        /* renamed from: s, reason: collision with root package name */
        int f25564s;

        /* renamed from: t, reason: collision with root package name */
        /* synthetic */ Object f25565t;

        /* renamed from: v, reason: collision with root package name */
        int f25567v;

        C0541c(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25565t = obj;
            this.f25567v |= Integer.MIN_VALUE;
            return c.this.w(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class d extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25568p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25569q;

        /* renamed from: s, reason: collision with root package name */
        int f25571s;

        d(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25569q = obj;
            this.f25571s |= Integer.MIN_VALUE;
            return c.this.m(false, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class e extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25572p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25573q;

        /* renamed from: s, reason: collision with root package name */
        int f25575s;

        e(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25573q = obj;
            this.f25575s |= Integer.MIN_VALUE;
            return c.this.fetchNotificationPreference(this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class f extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25576p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25577q;

        /* renamed from: s, reason: collision with root package name */
        int f25579s;

        f(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25577q = obj;
            this.f25579s |= Integer.MIN_VALUE;
            return c.this.fetchSetForgetPreference(this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class g extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25580p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25581q;

        /* renamed from: s, reason: collision with root package name */
        int f25583s;

        g(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25581q = obj;
            this.f25583s |= Integer.MIN_VALUE;
            return c.this.D(this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class h extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25584p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25585q;

        /* renamed from: s, reason: collision with root package name */
        int f25587s;

        h(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25585q = obj;
            this.f25587s |= Integer.MIN_VALUE;
            return c.this.getSetNForgotTnCContent(null, this);
        }
    }

    /* loaded from: classes.dex */
    static final class i extends kotlin.jvm.internal.v implements dn.a {
        i() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final a0 invoke() {
            return c.this.f25533a.a();
        }
    }

    /* loaded from: classes.dex */
    static final class j implements g0, kotlin.jvm.internal.n {

        /* renamed from: a, reason: collision with root package name */
        private final /* synthetic */ dn.l f25589a;

        j(dn.l function) {
            kotlin.jvm.internal.t.g(function, "function");
            this.f25589a = function;
        }

        @Override // kotlin.jvm.internal.n
        public final rm.i b() {
            return this.f25589a;
        }

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f25589a.invoke(obj);
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof g0) && (obj instanceof kotlin.jvm.internal.n)) {
                return kotlin.jvm.internal.t.b(b(), ((kotlin.jvm.internal.n) obj).b());
            }
            return false;
        }

        public final int hashCode() {
            return b().hashCode();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class k extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25590p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25591q;

        /* renamed from: s, reason: collision with root package name */
        int f25593s;

        k(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25591q = obj;
            this.f25593s |= Integer.MIN_VALUE;
            return c.this.U(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class l extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25594p;

        /* renamed from: q, reason: collision with root package name */
        Object f25595q;

        /* renamed from: r, reason: collision with root package name */
        /* synthetic */ Object f25596r;

        /* renamed from: t, reason: collision with root package name */
        int f25598t;

        l(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25596r = obj;
            this.f25598t |= Integer.MIN_VALUE;
            return c.this.y(false, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class m extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25599p;

        /* renamed from: q, reason: collision with root package name */
        Object f25600q;

        /* renamed from: r, reason: collision with root package name */
        Object f25601r;

        /* renamed from: s, reason: collision with root package name */
        /* synthetic */ Object f25602s;

        /* renamed from: u, reason: collision with root package name */
        int f25604u;

        m(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25602s = obj;
            this.f25604u |= Integer.MIN_VALUE;
            return c.this.E(null, false, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class n extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25605p;

        /* renamed from: q, reason: collision with root package name */
        Object f25606q;

        /* renamed from: r, reason: collision with root package name */
        Object f25607r;

        /* renamed from: s, reason: collision with root package name */
        /* synthetic */ Object f25608s;

        /* renamed from: u, reason: collision with root package name */
        int f25610u;

        n(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25608s = obj;
            this.f25610u |= Integer.MIN_VALUE;
            return c.this.n(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class o extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25611p;

        /* renamed from: q, reason: collision with root package name */
        Object f25612q;

        /* renamed from: r, reason: collision with root package name */
        Object f25613r;

        /* renamed from: s, reason: collision with root package name */
        Object f25614s;

        /* renamed from: t, reason: collision with root package name */
        Object f25615t;

        /* renamed from: u, reason: collision with root package name */
        Object f25616u;

        /* renamed from: v, reason: collision with root package name */
        /* synthetic */ Object f25617v;

        /* renamed from: x, reason: collision with root package name */
        int f25619x;

        o(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25617v = obj;
            this.f25619x |= Integer.MIN_VALUE;
            return c.this.s(null, null, null, null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class p extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25620p;

        /* renamed from: q, reason: collision with root package name */
        Object f25621q;

        /* renamed from: r, reason: collision with root package name */
        Object f25622r;

        /* renamed from: s, reason: collision with root package name */
        Object f25623s;

        /* renamed from: t, reason: collision with root package name */
        /* synthetic */ Object f25624t;

        /* renamed from: v, reason: collision with root package name */
        int f25626v;

        p(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25624t = obj;
            this.f25626v |= Integer.MIN_VALUE;
            return c.this.u(null, null, false, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class q extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25627p;

        /* renamed from: q, reason: collision with root package name */
        /* synthetic */ Object f25628q;

        /* renamed from: s, reason: collision with root package name */
        int f25630s;

        q(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25628q = obj;
            this.f25630s |= Integer.MIN_VALUE;
            return c.this.updateNotificationPreference(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class r extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25631p;

        /* renamed from: q, reason: collision with root package name */
        Object f25632q;

        /* renamed from: r, reason: collision with root package name */
        Object f25633r;

        /* renamed from: s, reason: collision with root package name */
        /* synthetic */ Object f25634s;

        /* renamed from: u, reason: collision with root package name */
        int f25636u;

        r(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25634s = obj;
            this.f25636u |= Integer.MIN_VALUE;
            return c.this.F(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class s extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25637p;

        /* renamed from: q, reason: collision with root package name */
        Object f25638q;

        /* renamed from: r, reason: collision with root package name */
        Object f25639r;

        /* renamed from: s, reason: collision with root package name */
        /* synthetic */ Object f25640s;

        /* renamed from: u, reason: collision with root package name */
        int f25642u;

        s(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25640s = obj;
            this.f25642u |= Integer.MIN_VALUE;
            return c.this.r(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class t extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25643p;

        /* renamed from: q, reason: collision with root package name */
        Object f25644q;

        /* renamed from: r, reason: collision with root package name */
        Object f25645r;

        /* renamed from: s, reason: collision with root package name */
        Object f25646s;

        /* renamed from: t, reason: collision with root package name */
        Object f25647t;

        /* renamed from: u, reason: collision with root package name */
        Object f25648u;

        /* renamed from: v, reason: collision with root package name */
        Object f25649v;

        /* renamed from: w, reason: collision with root package name */
        /* synthetic */ Object f25650w;

        /* renamed from: y, reason: collision with root package name */
        int f25652y;

        t(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25650w = obj;
            this.f25652y |= Integer.MIN_VALUE;
            return c.this.l(null, null, null, null, null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class u extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25653p;

        /* renamed from: q, reason: collision with root package name */
        Object f25654q;

        /* renamed from: r, reason: collision with root package name */
        Object f25655r;

        /* renamed from: s, reason: collision with root package name */
        /* synthetic */ Object f25656s;

        /* renamed from: u, reason: collision with root package name */
        int f25658u;

        u(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25656s = obj;
            this.f25658u |= Integer.MIN_VALUE;
            return c.this.A(null, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class v extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f25659p;

        /* renamed from: q, reason: collision with root package name */
        Object f25660q;

        /* renamed from: r, reason: collision with root package name */
        Object f25661r;

        /* renamed from: s, reason: collision with root package name */
        Object f25662s;

        /* renamed from: t, reason: collision with root package name */
        Object f25663t;

        /* renamed from: u, reason: collision with root package name */
        int f25664u;

        /* renamed from: v, reason: collision with root package name */
        /* synthetic */ Object f25665v;

        /* renamed from: x, reason: collision with root package name */
        int f25667x;

        v(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f25665v = obj;
            this.f25667x |= Integer.MIN_VALUE;
            return c.this.g(null, null, null, this);
        }
    }

    public c(i9.d profileDao, a9.b addressCompleteRepository, ca.a languageService, ja.d sharedPreferencesService, IProfileApi profileAPIService, IDupEmailApi dupEmailAPIService, fa.a myMailRepository, p9.h featureFlagRepository, IAMSApi amsAPIService, AccountQRCodeApi accountQRCodeApi) {
        rm.o a10;
        kotlin.jvm.internal.t.g(profileDao, "profileDao");
        kotlin.jvm.internal.t.g(addressCompleteRepository, "addressCompleteRepository");
        kotlin.jvm.internal.t.g(languageService, "languageService");
        kotlin.jvm.internal.t.g(sharedPreferencesService, "sharedPreferencesService");
        kotlin.jvm.internal.t.g(profileAPIService, "profileAPIService");
        kotlin.jvm.internal.t.g(dupEmailAPIService, "dupEmailAPIService");
        kotlin.jvm.internal.t.g(myMailRepository, "myMailRepository");
        kotlin.jvm.internal.t.g(featureFlagRepository, "featureFlagRepository");
        kotlin.jvm.internal.t.g(amsAPIService, "amsAPIService");
        kotlin.jvm.internal.t.g(accountQRCodeApi, "accountQRCodeApi");
        this.f25533a = profileDao;
        this.f25534b = languageService;
        this.f25535c = sharedPreferencesService;
        this.f25536d = profileAPIService;
        this.f25537e = dupEmailAPIService;
        this.f25538f = myMailRepository;
        this.f25539g = featureFlagRepository;
        this.f25540h = amsAPIService;
        this.f25541i = accountQRCodeApi;
        this.f25542j = new f0();
        this.f25543k = new f0();
        this.f25544l = new d0();
        f0 f0Var = new f0();
        this.f25545m = f0Var;
        this.f25546n = f0Var;
        f0 f0Var2 = new f0();
        this.f25547o = f0Var2;
        this.f25548p = f0Var2;
        a10 = rm.q.a(new i());
        this.f25549q = a10;
        this.f25550r = new d0();
        this.f25551s = new d0();
        f0 f0Var3 = new f0();
        this.f25552t = f0Var3;
        this.f25553u = f0Var3;
        f0 f0Var4 = new f0();
        this.f25554v = f0Var4;
        this.f25555w = f0Var4;
        this.f25556x = new d0();
        f0 f0Var5 = new f0();
        this.f25557y = f0Var5;
        this.f25558z = f0Var5;
        Boolean bool = Boolean.FALSE;
        f0 f0Var6 = new f0(bool);
        this.A = f0Var6;
        this.B = f0Var6;
        f0 f0Var7 = new f0(bool);
        this.C = f0Var7;
        this.D = f0Var7;
        B().r(addressCompleteRepository.g(), new j(new a()));
        q().r(addressCompleteRepository.g(), new j(new b()));
    }

    private final void L() {
        this.f25547o.q(null);
    }

    private final void M() {
        this.f25544l.q(null);
    }

    private final ResultWrapper.Error N(AMSErrorResponseException aMSErrorResponseException, ResultWrapper.Error error) {
        AmsAddressResult amsAddressResult;
        String code;
        List<AmsAddressResult> amsAddressResults = aMSErrorResponseException.getAddressAMSCheckResponse().getAmsAddressResults();
        if (amsAddressResults == null || (code = (amsAddressResult = amsAddressResults.get(0)).getCode()) == null) {
            return error;
        }
        switch (code.hashCode()) {
            case 49:
                return !code.equals("1") ? error : O(amsAddressResult);
            case 50:
                if (!code.equals("2")) {
                    return error;
                }
                S(amsAddressResult.getFormattedAddresses());
                RepositoryError repositoryError = RepositoryError.SuggestedAddress;
                List<FormattedAddress> formattedAddresses = amsAddressResult.getFormattedAddresses();
                return new ResultWrapper.Error(null, "Suggested Address", repositoryError, formattedAddresses != null ? formattedAddresses.get(0) : null);
            case 51:
                return !code.equals("3") ? error : new ResultWrapper.Error(null, "Invalid Address service is not supported", RepositoryError.InvalidAddress, amsAddressResult.getFormattedAddresses());
            default:
                return error;
        }
    }

    private final ResultWrapper.Error O(AmsAddressResult amsAddressResult) {
        List<Scope> scope = amsAddressResult.getScope();
        if (scope == null || !(!scope.isEmpty())) {
            return new ResultWrapper.Error(null, "Invalid Address service is not supported", RepositoryError.InvalidAddress, amsAddressResult.getFormattedAddresses());
        }
        for (Scope scope2 : scope) {
            this.f25554v.n(scope);
        }
        return new ResultWrapper.Error(null, "Error in Address", RepositoryError.AddressError, amsAddressResult.getScope());
    }

    private final String P() {
        PackageDeliveryOptionInstructionResponse packageDeliveryOptionInstructionResponse = (PackageDeliveryOptionInstructionResponse) qa.d.p(this.f25535c.getString("DEFAULT_DELIVERY_PREFERENCE_KEY", ""), PackageDeliveryOptionInstructionResponse.class);
        if (packageDeliveryOptionInstructionResponse != null) {
            if (packageDeliveryOptionInstructionResponse.getCd().length() > 0) {
                return packageDeliveryOptionInstructionResponse.getCd();
            }
        }
        return DeliveryPreference.NO_DEFAULT.getValue();
    }

    private final ResultWrapper.Error Q(ResultWrapper resultWrapper) {
        ResultWrapper.Error N;
        if (resultWrapper instanceof ResultWrapper.Success) {
            return null;
        }
        if (!(resultWrapper instanceof ResultWrapper.Error)) {
            throw new rm.t();
        }
        ResultWrapper.Error error = (ResultWrapper.Error) resultWrapper;
        Throwable exception = error.getException();
        AMSErrorResponseException aMSErrorResponseException = exception instanceof AMSErrorResponseException ? (AMSErrorResponseException) exception : null;
        return (aMSErrorResponseException == null || (N = N(aMSErrorResponseException, error)) == null) ? error : N;
    }

    private final ResultWrapper.Error R(ResultWrapper resultWrapper) {
        List<ValidationError> validationErrors;
        ValidationError validationError;
        String str = null;
        if (resultWrapper instanceof ResultWrapper.Success) {
            return null;
        }
        if (!(resultWrapper instanceof ResultWrapper.Error)) {
            throw new rm.t();
        }
        ResultWrapper.Error error = (ResultWrapper.Error) resultWrapper;
        Throwable exception = error.getException();
        CommonErrorResponseException commonErrorResponseException = exception instanceof CommonErrorResponseException ? (CommonErrorResponseException) exception : null;
        if (commonErrorResponseException != null) {
            DetailObjects detailObjects = commonErrorResponseException.getCommonError().getDetailObjects();
            if (detailObjects != null && (validationErrors = detailObjects.getValidationErrors()) != null && (validationError = validationErrors.get(0)) != null) {
                str = validationError.getMessage();
            }
            String str2 = str;
            ResultWrapper.Error error2 = str2 != null ? new ResultWrapper.Error(null, str2, RepositoryError.ServiceError, null, 8, null) : error;
            if (error2 != null) {
                return error2;
            }
        }
        return error;
    }

    private final void S(List list) {
        if (list != null && (!list.isEmpty()) && list.size() == 2) {
            FormattedAddress formattedAddress = (FormattedAddress) (kotlin.jvm.internal.t.b(this.f25534b.c(), "en") ? list.get(0) : list.get(1));
            this.f25552t.n(new ka.a(formattedAddress.getAddressLine1(), formattedAddress.getAddressLine2(), formattedAddress.getCity(), formattedAddress.getRegion(), formattedAddress.getPostCode(), x8.a.CANADA.getCode()));
        }
    }

    private final void T(b.EnumC0540b enumC0540b) {
        this.f25542j.n(new Event(enumC0540b));
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0043  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0029  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object A(SetForgetSmsPreferenceRequest setForgetSmsPreferenceRequest, vm.d dVar) {
        u uVar;
        Object f10;
        int i10;
        c cVar;
        ResultWrapper.Error R;
        SetForgetPreferenceResponse setForgetPreferenceResponse;
        SetForgetPreferenceResponse copy;
        c cVar2 = this;
        SetForgetSmsPreferenceRequest setForgetSmsPreferenceRequest2 = setForgetSmsPreferenceRequest;
        if (dVar instanceof u) {
            uVar = (u) dVar;
            int i11 = uVar.f25658u;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                uVar.f25658u = i11 - Integer.MIN_VALUE;
                Object obj = uVar.f25656s;
                f10 = wm.d.f();
                i10 = uVar.f25658u;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = cVar2.f25536d;
                    uVar.f25653p = cVar2;
                    uVar.f25654q = setForgetSmsPreferenceRequest2;
                    uVar.f25655r = cVar2;
                    uVar.f25658u = 1;
                    obj = iProfileApi.updateSetForgetPreference(setForgetSmsPreferenceRequest2, uVar);
                    if (obj == f10) {
                        return f10;
                    }
                    cVar = cVar2;
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    cVar2 = (c) uVar.f25655r;
                    setForgetSmsPreferenceRequest2 = (SetForgetSmsPreferenceRequest) uVar.f25654q;
                    cVar = (c) uVar.f25653p;
                    y.b(obj);
                }
                R = cVar2.R((ResultWrapper) obj);
                if (R == null && (setForgetPreferenceResponse = (SetForgetPreferenceResponse) cVar.H().f()) != null) {
                    copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : null, (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : kotlin.coroutines.jvm.internal.b.a(setForgetSmsPreferenceRequest2.getSmsPref()), (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : null, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : null, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : null, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : null, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : null, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : null);
                    cVar.f25544l.n(copy);
                }
                return R;
            }
        }
        uVar = new u(dVar);
        Object obj2 = uVar.f25656s;
        f10 = wm.d.f();
        i10 = uVar.f25658u;
        if (i10 != 0) {
        }
        R = cVar2.R((ResultWrapper) obj2);
        if (R == null) {
            copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : null, (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : kotlin.coroutines.jvm.internal.b.a(setForgetSmsPreferenceRequest2.getSmsPref()), (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : null, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : null, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : null, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : null, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : null, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : null);
            cVar.f25544l.n(copy);
        }
        return R;
    }

    @Override // ka.b
    public d0 B() {
        return this.f25550r;
    }

    @Override // ka.b
    public void C(Boolean bool) {
        this.A.q(bool);
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x004b  */
    /* JADX WARN: Removed duplicated region for block: B:19:0x0075  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0035  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object D(vm.d dVar) {
        g gVar;
        Object f10;
        int i10;
        ResultWrapper resultWrapper;
        if (dVar instanceof g) {
            gVar = (g) dVar;
            int i11 = gVar.f25583s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                gVar.f25583s = i11 - Integer.MIN_VALUE;
                Object obj = gVar.f25581q;
                f10 = wm.d.f();
                i10 = gVar.f25583s;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = this.f25536d;
                    gVar.f25580p = this;
                    gVar.f25583s = 1;
                    obj = iProfileApi.fetchProfile(gVar);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    this = (c) gVar.f25580p;
                    y.b(obj);
                }
                resultWrapper = (ResultWrapper) obj;
                if (resultWrapper instanceof ResultWrapper.Success) {
                    if (resultWrapper instanceof ResultWrapper.Error) {
                        return (ResultWrapper.Error) resultWrapper;
                    }
                    throw new rm.t();
                }
                EpostDisplayProfilePayload payload = ((EpostDisplayProfileResponse) ((ResultWrapper.Success) resultWrapper).getData()).getPayload();
                if (payload == null) {
                    return new ResultWrapper.Error(null, null, RepositoryError.ServiceError, null, 8, null);
                }
                this.f25533a.b(UserProfile.INSTANCE.fromEpostDisplayProfilePayload(payload));
                return null;
            }
        }
        gVar = new g(dVar);
        Object obj2 = gVar.f25581q;
        f10 = wm.d.f();
        i10 = gVar.f25583s;
        if (i10 != 0) {
        }
        resultWrapper = (ResultWrapper) obj2;
        if (resultWrapper instanceof ResultWrapper.Success) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x0102  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x0067  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x002b  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object E(ka.a aVar, boolean z10, vm.d dVar) {
        m mVar;
        Object f10;
        int i10;
        c cVar;
        ResultWrapper resultWrapper;
        c cVar2;
        ResultWrapper.Error R;
        UserProfile copy;
        c cVar3 = this;
        ka.a aVar2 = aVar;
        if (dVar instanceof m) {
            mVar = (m) dVar;
            int i11 = mVar.f25604u;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                mVar.f25604u = i11 - Integer.MIN_VALUE;
                Object obj = mVar.f25602s;
                f10 = wm.d.f();
                i10 = mVar.f25604u;
                if (i10 != 0) {
                    y.b(obj);
                    if (z10) {
                        IProfileApi iProfileApi = cVar3.f25536d;
                        String c10 = aVar.c();
                        if (c10 == null) {
                            c10 = "";
                        }
                        String d10 = aVar.d();
                        if (d10 == null) {
                            d10 = "";
                        }
                        String a10 = aVar.a();
                        if (a10 == null) {
                            a10 = "";
                        }
                        String f11 = aVar.f();
                        if (f11 == null) {
                            f11 = "";
                        }
                        String e10 = aVar.e();
                        if (e10 == null) {
                            e10 = "";
                        }
                        String b10 = aVar.b();
                        if (b10 == null) {
                            b10 = "";
                        }
                        mVar.f25599p = cVar3;
                        mVar.f25600q = aVar2;
                        mVar.f25601r = cVar3;
                        mVar.f25604u = 1;
                        obj = iProfileApi.updateAddress(c10, d10, a10, f11, e10, b10, true, mVar);
                        if (obj == f10) {
                            return f10;
                        }
                        cVar = cVar3;
                        resultWrapper = (ResultWrapper) obj;
                    } else {
                        IProfileApi iProfileApi2 = cVar3.f25536d;
                        String c11 = aVar.c();
                        if (c11 == null) {
                            c11 = "";
                        }
                        String d11 = aVar.d();
                        if (d11 == null) {
                            d11 = "";
                        }
                        String a11 = aVar.a();
                        if (a11 == null) {
                            a11 = "";
                        }
                        String f12 = aVar.f();
                        if (f12 == null) {
                            f12 = "";
                        }
                        String e11 = aVar.e();
                        if (e11 == null) {
                            e11 = "";
                        }
                        String b11 = aVar.b();
                        String str = b11 != null ? b11 : "";
                        mVar.f25599p = cVar3;
                        mVar.f25600q = aVar2;
                        mVar.f25601r = cVar3;
                        mVar.f25604u = 2;
                        obj = iProfileApi2.updateAddress(c11, d11, a11, f12, e11, str, mVar);
                        if (obj == f10) {
                            return f10;
                        }
                        cVar = cVar3;
                        resultWrapper = (ResultWrapper) obj;
                    }
                } else if (i10 == 1) {
                    cVar3 = (c) mVar.f25601r;
                    aVar2 = (ka.a) mVar.f25600q;
                    cVar = (c) mVar.f25599p;
                    y.b(obj);
                    resultWrapper = (ResultWrapper) obj;
                } else {
                    if (i10 != 2) {
                        if (i10 != 3) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        R = (ResultWrapper.Error) mVar.f25600q;
                        cVar2 = (c) mVar.f25599p;
                        y.b(obj);
                        cVar2.f25538f.j();
                        cVar2.T(b.EnumC0540b.UpdateAddress);
                        return R;
                    }
                    cVar3 = (c) mVar.f25601r;
                    aVar2 = (ka.a) mVar.f25600q;
                    cVar = (c) mVar.f25599p;
                    y.b(obj);
                    resultWrapper = (ResultWrapper) obj;
                }
                ResultWrapper resultWrapper2 = resultWrapper;
                ka.a aVar3 = aVar2;
                cVar2 = cVar;
                R = cVar3.R(resultWrapper2);
                if (R == null) {
                    UserProfile userProfile = (UserProfile) cVar2.a().f();
                    if (userProfile != null) {
                        i9.d dVar2 = cVar2.f25533a;
                        copy = userProfile.copy((r42 & 1) != 0 ? userProfile.firstName : null, (r42 & 2) != 0 ? userProfile.lastName : null, (r42 & 4) != 0 ? userProfile.userName : null, (r42 & 8) != 0 ? userProfile.email : null, (r42 & 16) != 0 ? userProfile.additionalEmail : null, (r42 & 32) != 0 ? userProfile.transactionalEmail : null, (r42 & 64) != 0 ? userProfile.primaryPhone : null, (r42 & 128) != 0 ? userProfile.mobilePhone : null, (r42 & 256) != 0 ? userProfile.additionalPhone : null, (r42 & 512) != 0 ? userProfile.addressLine1 : aVar3.c(), (r42 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? userProfile.addressLine2 : aVar3.d(), (r42 & 2048) != 0 ? userProfile.city : aVar3.a(), (r42 & 4096) != 0 ? userProfile.region : aVar3.f(), (r42 & UserMetadata.MAX_INTERNAL_KEY_SIZE) != 0 ? userProfile.country : aVar3.b(), (r42 & 16384) != 0 ? userProfile.postalZip : aVar3.e(), (r42 & 32768) != 0 ? userProfile.securityQuestion : null, (r42 & 65536) != 0 ? userProfile.securityQuestionAnswer : null, (r42 & 131072) != 0 ? userProfile.receiveMarketingEmails : null, (r42 & 262144) != 0 ? userProfile.securityQuestion2 : null, (r42 & 524288) != 0 ? userProfile.securityQuestionAnswer2 : null, (r42 & 1048576) != 0 ? userProfile.mfaPhone : null, (r42 & 2097152) != 0 ? userProfile.mfaPhoneCallingCode : null, (r42 & 4194304) != 0 ? userProfile.mfaPhoneCountryCode : null, (r42 & 8388608) != 0 ? userProfile.hasDuplicateEmails : null);
                        dVar2.b(copy);
                    }
                    mVar.f25599p = cVar2;
                    mVar.f25600q = R;
                    mVar.f25601r = null;
                    mVar.f25604u = 3;
                    if (cVar2.m(true, mVar) == f10) {
                        return f10;
                    }
                    cVar2.f25538f.j();
                    cVar2.T(b.EnumC0540b.UpdateAddress);
                }
                return R;
            }
        }
        mVar = new m(dVar);
        Object obj2 = mVar.f25602s;
        f10 = wm.d.f();
        i10 = mVar.f25604u;
        if (i10 != 0) {
        }
        ResultWrapper resultWrapper22 = resultWrapper;
        ka.a aVar32 = aVar2;
        cVar2 = cVar;
        R = cVar3.R(resultWrapper22);
        if (R == null) {
        }
        return R;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0043  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0029  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object F(String str, vm.d dVar) {
        r rVar;
        Object f10;
        int i10;
        c cVar;
        String str2;
        ResultWrapper.Error R;
        SetForgetPreferenceResponse setForgetPreferenceResponse;
        SetForgetPreferenceResponse copy;
        c cVar2 = this;
        String str3 = str;
        if (dVar instanceof r) {
            rVar = (r) dVar;
            int i11 = rVar.f25636u;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                rVar.f25636u = i11 - Integer.MIN_VALUE;
                Object obj = rVar.f25634s;
                f10 = wm.d.f();
                i10 = rVar.f25636u;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = cVar2.f25536d;
                    SetForgetDeliveryPrefRequest setForgetDeliveryPrefRequest = new SetForgetDeliveryPrefRequest(str3);
                    rVar.f25631p = cVar2;
                    rVar.f25632q = str3;
                    rVar.f25633r = cVar2;
                    rVar.f25636u = 1;
                    obj = iProfileApi.updateSetForgetPreference(setForgetDeliveryPrefRequest, rVar);
                    if (obj == f10) {
                        return f10;
                    }
                    cVar = cVar2;
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    cVar2 = (c) rVar.f25633r;
                    str3 = (String) rVar.f25632q;
                    cVar = (c) rVar.f25631p;
                    y.b(obj);
                }
                str2 = str3;
                R = cVar2.R((ResultWrapper) obj);
                if (R == null && (setForgetPreferenceResponse = (SetForgetPreferenceResponse) cVar.H().f()) != null) {
                    copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : null, (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : null, (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : str2, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : null, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : null, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : null, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : null, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : null);
                    cVar.f25544l.q(copy);
                }
                return R;
            }
        }
        rVar = new r(dVar);
        Object obj2 = rVar.f25634s;
        f10 = wm.d.f();
        i10 = rVar.f25636u;
        if (i10 != 0) {
        }
        str2 = str3;
        R = cVar2.R((ResultWrapper) obj2);
        if (R == null) {
            copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : null, (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : null, (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : str2, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : null, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : null, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : null, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : null, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : null);
            cVar.f25544l.q(copy);
        }
        return R;
    }

    @Override // ka.b
    public a0 G() {
        return this.B;
    }

    @Override // ka.b
    public a0 H() {
        return this.f25544l;
    }

    @Override // ka.b
    public a0 I() {
        return this.f25555w;
    }

    @Override // ka.b
    public a0 J() {
        return this.f25548p;
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x004c  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x0091 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0035  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object U(OneToOneEmailRequest oneToOneEmailRequest, vm.d dVar) {
        k kVar;
        Object f10;
        int i10;
        ResultWrapper resultWrapper;
        Integer httpStatus;
        if (dVar instanceof k) {
            kVar = (k) dVar;
            int i11 = kVar.f25593s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                kVar.f25593s = i11 - Integer.MIN_VALUE;
                Object obj = kVar.f25591q;
                f10 = wm.d.f();
                i10 = kVar.f25593s;
                if (i10 != 0) {
                    y.b(obj);
                    IDupEmailApi iDupEmailApi = this.f25537e;
                    kVar.f25590p = this;
                    kVar.f25593s = 1;
                    obj = iDupEmailApi.setOneToOneEmail(oneToOneEmailRequest, kVar);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    this = (c) kVar.f25590p;
                    y.b(obj);
                }
                resultWrapper = (ResultWrapper) obj;
                if (resultWrapper instanceof ResultWrapper.Error) {
                    return null;
                }
                ResultWrapper.Error error = (ResultWrapper.Error) resultWrapper;
                Throwable exception = error.getException();
                CommonErrorResponseException commonErrorResponseException = exception instanceof CommonErrorResponseException ? (CommonErrorResponseException) exception : null;
                CommonErrorResponse commonError = commonErrorResponseException != null ? commonErrorResponseException.getCommonError() : null;
                return (commonError == null || (httpStatus = commonError.getHttpStatus()) == null || httpStatus.intValue() != 409) ? false : true ? new ResultWrapper.Error(error.getException(), error.getMessage(), RepositoryError.DuplicateEmail, null, 8, null) : this.R(resultWrapper);
            }
        }
        kVar = new k(dVar);
        Object obj2 = kVar.f25591q;
        f10 = wm.d.f();
        i10 = kVar.f25593s;
        if (i10 != 0) {
        }
        resultWrapper = (ResultWrapper) obj2;
        if (resultWrapper instanceof ResultWrapper.Error) {
        }
    }

    @Override // ka.b
    public a0 a() {
        return (a0) this.f25549q.getValue();
    }

    @Override // ka.b
    public Object b(vm.d dVar) {
        Object f10;
        Object a10 = b.a.a(this, false, dVar, 1, null);
        f10 = wm.d.f();
        return a10 == f10 ? a10 : n0.f34904a;
    }

    @Override // ka.b
    public a0 c() {
        return this.D;
    }

    @Override // ka.b
    public a0 d() {
        return this.f25543k;
    }

    @Override // ka.b
    public a0 e() {
        return this.f25542j;
    }

    @Override // ka.b
    public String f() {
        SetForgetPreferenceResponse setForgetPreferenceResponse = (SetForgetPreferenceResponse) H().f();
        if (setForgetPreferenceResponse == null) {
            return P();
        }
        String dlvryPref = setForgetPreferenceResponse.getDlvryPref();
        return dlvryPref == null || dlvryPref.length() == 0 ? DeliveryPreference.NO_DEFAULT.getValue() : setForgetPreferenceResponse.getDlvryPref();
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x004b  */
    /* JADX WARN: Removed duplicated region for block: B:15:0x0058  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0035  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object fetchNotificationPreference(vm.d dVar) {
        e eVar;
        Object f10;
        int i10;
        ResultWrapper resultWrapper;
        if (dVar instanceof e) {
            eVar = (e) dVar;
            int i11 = eVar.f25575s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                eVar.f25575s = i11 - Integer.MIN_VALUE;
                Object obj = eVar.f25573q;
                f10 = wm.d.f();
                i10 = eVar.f25575s;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = this.f25536d;
                    eVar.f25572p = this;
                    eVar.f25575s = 1;
                    obj = iProfileApi.fetchNotificationPreference(eVar);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    this = (c) eVar.f25572p;
                    y.b(obj);
                }
                resultWrapper = (ResultWrapper) obj;
                if (!(resultWrapper instanceof ResultWrapper.Success)) {
                    this.f25543k.n(((ResultWrapper.Success) resultWrapper).getData());
                    return null;
                }
                if (resultWrapper instanceof ResultWrapper.Error) {
                    return (ResultWrapper.Error) resultWrapper;
                }
                throw new rm.t();
            }
        }
        eVar = new e(dVar);
        Object obj2 = eVar.f25573q;
        f10 = wm.d.f();
        i10 = eVar.f25575s;
        if (i10 != 0) {
        }
        resultWrapper = (ResultWrapper) obj2;
        if (!(resultWrapper instanceof ResultWrapper.Success)) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x004b  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0035  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object fetchSetForgetPreference(vm.d dVar) {
        f fVar;
        Object f10;
        int i10;
        ResultWrapper resultWrapper;
        if (dVar instanceof f) {
            fVar = (f) dVar;
            int i11 = fVar.f25579s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                fVar.f25579s = i11 - Integer.MIN_VALUE;
                Object obj = fVar.f25577q;
                f10 = wm.d.f();
                i10 = fVar.f25579s;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = this.f25536d;
                    fVar.f25576p = this;
                    fVar.f25579s = 1;
                    obj = iProfileApi.fetchSetForgetPreference(fVar);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    this = (c) fVar.f25576p;
                    y.b(obj);
                }
                resultWrapper = (ResultWrapper) obj;
                if (resultWrapper instanceof ResultWrapper.Success) {
                    this.f25544l.n(((ResultWrapper.Success) resultWrapper).getData());
                }
                return n0.f34904a;
            }
        }
        fVar = new f(dVar);
        Object obj2 = fVar.f25577q;
        f10 = wm.d.f();
        i10 = fVar.f25579s;
        if (i10 != 0) {
        }
        resultWrapper = (ResultWrapper) obj2;
        if (resultWrapper instanceof ResultWrapper.Success) {
        }
        return n0.f34904a;
    }

    /* JADX WARN: Removed duplicated region for block: B:20:0x0168  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x0066  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x002d  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object g(String str, String str2, String str3, vm.d dVar) {
        v vVar;
        Object f10;
        int i10;
        int i11;
        Object obj;
        Object obj2;
        c cVar;
        String str4;
        Object obj3;
        String str5;
        c cVar2;
        String str6;
        String str7;
        String areaCode;
        String str8;
        String str9;
        String str10;
        Boolean l1AuthStatus;
        ResultWrapper.Error R;
        ResultWrapper.Error error;
        c cVar3;
        UserProfile copy;
        String str11 = str3;
        if (dVar instanceof v) {
            vVar = (v) dVar;
            int i12 = vVar.f25667x;
            if ((i12 & Integer.MIN_VALUE) != 0) {
                vVar.f25667x = i12 - Integer.MIN_VALUE;
                Object obj4 = vVar.f25665v;
                f10 = wm.d.f();
                i10 = vVar.f25667x;
                if (i10 != 0) {
                    y.b(obj4);
                    AMSPrerequisitesResponse aMSPrerequisitesResponse = (AMSPrerequisitesResponse) this.f25547o.f();
                    boolean booleanValue = (aMSPrerequisitesResponse == null || (l1AuthStatus = aMSPrerequisitesResponse.getL1AuthStatus()) == null) ? false : l1AuthStatus.booleanValue();
                    int i13 = str2 != null ? 1 : 0;
                    boolean z10 = i13 != 0 && booleanValue;
                    o0 o0Var = new o0();
                    o0 o0Var2 = new o0();
                    o0 o0Var3 = new o0();
                    if (str11 != null) {
                        PhoneNumber parsePhoneNumber$default = PhoneNumber.Companion.parsePhoneNumber$default(PhoneNumber.INSTANCE, str11, null, 2, null);
                        if (parsePhoneNumber$default == null || (str8 = parsePhoneNumber$default.getAreaCode()) == null) {
                            str8 = "";
                        }
                        o0Var.f26199p = str8;
                        if (parsePhoneNumber$default == null || (str9 = parsePhoneNumber$default.getPrefix()) == null) {
                            str9 = "";
                        }
                        o0Var2.f26199p = str9;
                        if (parsePhoneNumber$default == null || (str10 = parsePhoneNumber$default.getSuffix()) == null) {
                            str10 = "";
                        }
                        o0Var3.f26199p = str10;
                    }
                    o0 o0Var4 = new o0();
                    o0 o0Var5 = new o0();
                    o0 o0Var6 = new o0();
                    if (str2 != null) {
                        PhoneNumber parsePhoneNumber$default2 = PhoneNumber.Companion.parsePhoneNumber$default(PhoneNumber.INSTANCE, str2, null, 2, null);
                        o0Var4.f26199p = (parsePhoneNumber$default2 == null || (areaCode = parsePhoneNumber$default2.getAreaCode()) == null) ? "" : areaCode;
                        if (parsePhoneNumber$default2 == null || (str6 = parsePhoneNumber$default2.getPrefix()) == null) {
                            str6 = "";
                        }
                        o0Var5.f26199p = str6;
                        if (parsePhoneNumber$default2 == null || (str7 = parsePhoneNumber$default2.getSuffix()) == null) {
                            str7 = "";
                        }
                        o0Var6.f26199p = str7;
                    }
                    IProfileApi iProfileApi = this.f25536d;
                    String str12 = (String) o0Var.f26199p;
                    String str13 = (String) o0Var2.f26199p;
                    String str14 = (String) o0Var3.f26199p;
                    String str15 = (String) o0Var4.f26199p;
                    String str16 = (String) o0Var5.f26199p;
                    String str17 = (String) o0Var6.f26199p;
                    vVar.f25659p = this;
                    vVar.f25660q = str;
                    vVar.f25661r = str2;
                    vVar.f25662s = str11;
                    vVar.f25663t = this;
                    vVar.f25664u = i13;
                    vVar.f25667x = 1;
                    i11 = i13;
                    obj = null;
                    boolean z11 = z10;
                    obj2 = f10;
                    Object updateContactInfo = iProfileApi.updateContactInfo(str, str, str12, str13, str14, str15, str16, str17, z11, vVar);
                    if (updateContactInfo == obj2) {
                        return obj2;
                    }
                    cVar = this;
                    str4 = str;
                    obj3 = updateContactInfo;
                    str5 = str2;
                    cVar2 = cVar;
                } else {
                    if (i10 != 1) {
                        if (i10 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        error = (ResultWrapper.Error) vVar.f25660q;
                        cVar3 = (c) vVar.f25659p;
                        y.b(obj4);
                        cVar3.f25538f.j();
                        cVar = cVar3;
                        R = error;
                        cVar.T(b.EnumC0540b.UpdateMobilePhone);
                        return R;
                    }
                    int i14 = vVar.f25664u;
                    cVar2 = (c) vVar.f25663t;
                    str11 = (String) vVar.f25662s;
                    str5 = (String) vVar.f25661r;
                    str4 = (String) vVar.f25660q;
                    cVar = (c) vVar.f25659p;
                    y.b(obj4);
                    i11 = i14;
                    obj3 = obj4;
                    obj = null;
                    obj2 = f10;
                }
                R = cVar2.R((ResultWrapper) obj3);
                if (R == null) {
                    UserProfile userProfile = (UserProfile) cVar.a().f();
                    if (userProfile != null) {
                        i9.d dVar2 = cVar.f25533a;
                        if (str4 == null) {
                            str4 = userProfile.getEmail();
                        }
                        String str18 = str4;
                        if (str5 == null) {
                            str5 = userProfile.getMobilePhone();
                        }
                        String str19 = str5;
                        if (str11 == null) {
                            str11 = userProfile.getPrimaryPhone();
                        }
                        copy = userProfile.copy((r42 & 1) != 0 ? userProfile.firstName : null, (r42 & 2) != 0 ? userProfile.lastName : null, (r42 & 4) != 0 ? userProfile.userName : null, (r42 & 8) != 0 ? userProfile.email : str18, (r42 & 16) != 0 ? userProfile.additionalEmail : null, (r42 & 32) != 0 ? userProfile.transactionalEmail : null, (r42 & 64) != 0 ? userProfile.primaryPhone : str11, (r42 & 128) != 0 ? userProfile.mobilePhone : str19, (r42 & 256) != 0 ? userProfile.additionalPhone : null, (r42 & 512) != 0 ? userProfile.addressLine1 : null, (r42 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? userProfile.addressLine2 : null, (r42 & 2048) != 0 ? userProfile.city : null, (r42 & 4096) != 0 ? userProfile.region : null, (r42 & UserMetadata.MAX_INTERNAL_KEY_SIZE) != 0 ? userProfile.country : null, (r42 & 16384) != 0 ? userProfile.postalZip : null, (r42 & 32768) != 0 ? userProfile.securityQuestion : null, (r42 & 65536) != 0 ? userProfile.securityQuestionAnswer : null, (r42 & 131072) != 0 ? userProfile.receiveMarketingEmails : null, (r42 & 262144) != 0 ? userProfile.securityQuestion2 : null, (r42 & 524288) != 0 ? userProfile.securityQuestionAnswer2 : null, (r42 & 1048576) != 0 ? userProfile.mfaPhone : null, (r42 & 2097152) != 0 ? userProfile.mfaPhoneCallingCode : null, (r42 & 4194304) != 0 ? userProfile.mfaPhoneCountryCode : null, (r42 & 8388608) != 0 ? userProfile.hasDuplicateEmails : null);
                        dVar2.b(copy);
                    }
                    if (i11 != 0) {
                        vVar.f25659p = cVar;
                        vVar.f25660q = R;
                        vVar.f25661r = obj;
                        vVar.f25662s = obj;
                        vVar.f25663t = obj;
                        vVar.f25667x = 2;
                        if (cVar.m(true, vVar) == obj2) {
                            return obj2;
                        }
                        error = R;
                        cVar3 = cVar;
                        cVar3.f25538f.j();
                        cVar = cVar3;
                        R = error;
                    }
                    cVar.T(b.EnumC0540b.UpdateMobilePhone);
                }
                return R;
            }
        }
        vVar = new v(dVar);
        Object obj42 = vVar.f25665v;
        f10 = wm.d.f();
        i10 = vVar.f25667x;
        if (i10 != 0) {
        }
        R = cVar2.R((ResultWrapper) obj3);
        if (R == null) {
        }
        return R;
    }

    @Override // ka.b
    public Object getDigitalID(vm.d dVar) {
        return this.f25541i.getDigitalID(dVar);
    }

    @Override // ka.b
    public Object getDuplicateProfilesForEmail(String str, vm.d dVar) {
        IDupEmailApi iDupEmailApi = this.f25537e;
        if (str == null) {
            str = "";
        }
        return iDupEmailApi.getDuplicateProfilesForEmail(str, dVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x0056  */
    /* JADX WARN: Removed duplicated region for block: B:15:0x0068 A[ORIG_RETURN, RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0035  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object getSetNForgotTnCContent(String str, vm.d dVar) {
        h hVar;
        Object f10;
        int i10;
        ResultWrapper resultWrapper;
        if (dVar instanceof h) {
            hVar = (h) dVar;
            int i11 = hVar.f25587s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                hVar.f25587s = i11 - Integer.MIN_VALUE;
                Object obj = hVar.f25585q;
                f10 = wm.d.f();
                i10 = hVar.f25587s;
                if (i10 != 0) {
                    y.b(obj);
                    SetNForgotTnCResponse setNForgotTnCResponse = (SetNForgotTnCResponse) this.f25545m.f();
                    if (setNForgotTnCResponse != null) {
                        return setNForgotTnCResponse;
                    }
                    IProfileApi iProfileApi = this.f25536d;
                    hVar.f25584p = this;
                    hVar.f25587s = 1;
                    obj = iProfileApi.getSetNForgotTnCContent(str, hVar);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    this = (c) hVar.f25584p;
                    y.b(obj);
                }
                resultWrapper = (ResultWrapper) obj;
                if (resultWrapper instanceof ResultWrapper.Success) {
                    return null;
                }
                ResultWrapper.Success success = (ResultWrapper.Success) resultWrapper;
                this.f25545m.n(success.getData());
                return (SetNForgotTnCResponse) success.getData();
            }
        }
        hVar = new h(dVar);
        Object obj2 = hVar.f25585q;
        f10 = wm.d.f();
        i10 = hVar.f25587s;
        if (i10 != 0) {
        }
        resultWrapper = (ResultWrapper) obj2;
        if (resultWrapper instanceof ResultWrapper.Success) {
        }
    }

    @Override // ka.b
    public Object h(vm.d dVar) {
        return this.f25536d.acceptSetNForgotTnC(dVar);
    }

    @Override // ka.b
    public void i() {
        L();
        M();
        this.f25533a.c();
    }

    @Override // ka.b
    public void j(ka.a aVar) {
        q().n(aVar);
        B().n(aVar);
    }

    @Override // ka.b
    public a0 k() {
        return this.f25553u;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0056  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0027  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object l(String str, String str2, String str3, String str4, String str5, vm.d dVar) {
        t tVar;
        Object f10;
        int i10;
        c cVar;
        String str6;
        String str7;
        String str8;
        String str9;
        String str10;
        ResultWrapper.Error R;
        SetForgetPreferenceResponse setForgetPreferenceResponse;
        SetForgetPreferenceResponse copy;
        c cVar2 = this;
        if (dVar instanceof t) {
            tVar = (t) dVar;
            int i11 = tVar.f25652y;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                tVar.f25652y = i11 - Integer.MIN_VALUE;
                Object obj = tVar.f25650w;
                f10 = wm.d.f();
                i10 = tVar.f25652y;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = cVar2.f25536d;
                    SetForgetNickNamesRequest setForgetNickNamesRequest = new SetForgetNickNamesRequest(str, str2, str3, str4, str5);
                    tVar.f25643p = cVar2;
                    tVar.f25644q = str;
                    tVar.f25645r = str2;
                    tVar.f25646s = str3;
                    tVar.f25647t = str4;
                    tVar.f25648u = str5;
                    tVar.f25649v = cVar2;
                    tVar.f25652y = 1;
                    obj = iProfileApi.updateSetForgetPreference(setForgetNickNamesRequest, tVar);
                    if (obj == f10) {
                        return f10;
                    }
                    cVar = cVar2;
                    str6 = str2;
                    str7 = str3;
                    str8 = str4;
                    str9 = str5;
                    str10 = str;
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    cVar2 = (c) tVar.f25649v;
                    String str11 = (String) tVar.f25648u;
                    String str12 = (String) tVar.f25647t;
                    String str13 = (String) tVar.f25646s;
                    String str14 = (String) tVar.f25645r;
                    String str15 = (String) tVar.f25644q;
                    cVar = (c) tVar.f25643p;
                    y.b(obj);
                    str9 = str11;
                    str8 = str12;
                    str7 = str13;
                    str6 = str14;
                    str10 = str15;
                }
                R = cVar2.R((ResultWrapper) obj);
                if (R == null && (setForgetPreferenceResponse = (SetForgetPreferenceResponse) cVar.H().f()) != null) {
                    copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : null, (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : null, (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : null, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : str10, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : str6, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : str7, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : str8, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : str9);
                    cVar.f25544l.n(copy);
                }
                return R;
            }
        }
        tVar = new t(dVar);
        Object obj2 = tVar.f25650w;
        f10 = wm.d.f();
        i10 = tVar.f25652y;
        if (i10 != 0) {
        }
        R = cVar2.R((ResultWrapper) obj2);
        if (R == null) {
            copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : null, (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : null, (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : null, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : str10, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : str6, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : str7, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : str8, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : str9);
            cVar.f25544l.n(copy);
        }
        return R;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0073  */
    /* JADX WARN: Removed duplicated region for block: B:26:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0040  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0024  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m(boolean z10, vm.d dVar) {
        d dVar2;
        Object f10;
        int i10;
        AMSPrerequisitesResponse aMSPrerequisitesResponse;
        ResultWrapper resultWrapper;
        ResultWrapper resultWrapper2;
        if (dVar instanceof d) {
            dVar2 = (d) dVar;
            int i11 = dVar2.f25571s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                dVar2.f25571s = i11 - Integer.MIN_VALUE;
                Object obj = dVar2.f25569q;
                f10 = wm.d.f();
                i10 = dVar2.f25571s;
                if (i10 != 0) {
                    y.b(obj);
                    if (!z10 && (aMSPrerequisitesResponse = (AMSPrerequisitesResponse) this.f25547o.f()) != null) {
                        this.f25547o.n(aMSPrerequisitesResponse);
                        return new ResultWrapper.Success(aMSPrerequisitesResponse);
                    }
                    IProfileApi iProfileApi = this.f25536d;
                    dVar2.f25568p = this;
                    dVar2.f25571s = 1;
                    obj = IProfileApi.a.a(iProfileApi, null, null, dVar2, 3, null);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        if (i10 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        resultWrapper2 = (ResultWrapper) dVar2.f25568p;
                        y.b(obj);
                        return resultWrapper2;
                    }
                    this = (c) dVar2.f25568p;
                    y.b(obj);
                }
                resultWrapper = (ResultWrapper) obj;
                if (resultWrapper instanceof ResultWrapper.Success) {
                    return resultWrapper;
                }
                ResultWrapper.Success success = (ResultWrapper.Success) resultWrapper;
                this.f25547o.n(success.getData());
                if (!kotlin.jvm.internal.t.b(((AMSPrerequisitesResponse) success.getData()).getStatus(), kotlin.coroutines.jvm.internal.b.a(true))) {
                    return resultWrapper;
                }
                dVar2.f25568p = resultWrapper;
                dVar2.f25571s = 2;
                if (this.fetchSetForgetPreference(dVar2) == f10) {
                    return f10;
                }
                resultWrapper2 = resultWrapper;
                return resultWrapper2;
            }
        }
        dVar2 = new d(dVar);
        Object obj2 = dVar2.f25569q;
        f10 = wm.d.f();
        i10 = dVar2.f25571s;
        if (i10 != 0) {
        }
        resultWrapper = (ResultWrapper) obj2;
        if (resultWrapper instanceof ResultWrapper.Success) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x0061  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0043  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0029  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object n(String str, vm.d dVar) {
        n nVar;
        Object f10;
        int i10;
        c cVar;
        ResultWrapper.Error R;
        UserProfile copy;
        c cVar2 = this;
        String str2 = str;
        if (dVar instanceof n) {
            nVar = (n) dVar;
            int i11 = nVar.f25610u;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                nVar.f25610u = i11 - Integer.MIN_VALUE;
                Object obj = nVar.f25608s;
                f10 = wm.d.f();
                i10 = nVar.f25610u;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = cVar2.f25536d;
                    nVar.f25605p = cVar2;
                    nVar.f25606q = str2;
                    nVar.f25607r = cVar2;
                    nVar.f25610u = 1;
                    obj = iProfileApi.updateAdditionalEmail(str2, str2, nVar);
                    if (obj == f10) {
                        return f10;
                    }
                    cVar = cVar2;
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    cVar2 = (c) nVar.f25607r;
                    str2 = (String) nVar.f25606q;
                    cVar = (c) nVar.f25605p;
                    y.b(obj);
                }
                String str3 = str2;
                R = cVar2.R((ResultWrapper) obj);
                if (R == null) {
                    UserProfile userProfile = (UserProfile) cVar.a().f();
                    if (userProfile != null) {
                        i9.d dVar2 = cVar.f25533a;
                        copy = userProfile.copy((r42 & 1) != 0 ? userProfile.firstName : null, (r42 & 2) != 0 ? userProfile.lastName : null, (r42 & 4) != 0 ? userProfile.userName : null, (r42 & 8) != 0 ? userProfile.email : null, (r42 & 16) != 0 ? userProfile.additionalEmail : str3, (r42 & 32) != 0 ? userProfile.transactionalEmail : null, (r42 & 64) != 0 ? userProfile.primaryPhone : null, (r42 & 128) != 0 ? userProfile.mobilePhone : null, (r42 & 256) != 0 ? userProfile.additionalPhone : null, (r42 & 512) != 0 ? userProfile.addressLine1 : null, (r42 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? userProfile.addressLine2 : null, (r42 & 2048) != 0 ? userProfile.city : null, (r42 & 4096) != 0 ? userProfile.region : null, (r42 & UserMetadata.MAX_INTERNAL_KEY_SIZE) != 0 ? userProfile.country : null, (r42 & 16384) != 0 ? userProfile.postalZip : null, (r42 & 32768) != 0 ? userProfile.securityQuestion : null, (r42 & 65536) != 0 ? userProfile.securityQuestionAnswer : null, (r42 & 131072) != 0 ? userProfile.receiveMarketingEmails : null, (r42 & 262144) != 0 ? userProfile.securityQuestion2 : null, (r42 & 524288) != 0 ? userProfile.securityQuestionAnswer2 : null, (r42 & 1048576) != 0 ? userProfile.mfaPhone : null, (r42 & 2097152) != 0 ? userProfile.mfaPhoneCallingCode : null, (r42 & 4194304) != 0 ? userProfile.mfaPhoneCountryCode : null, (r42 & 8388608) != 0 ? userProfile.hasDuplicateEmails : null);
                        dVar2.b(copy);
                    }
                    cVar.T(b.EnumC0540b.UpdateAdditionalEmail);
                }
                return R;
            }
        }
        nVar = new n(dVar);
        Object obj2 = nVar.f25608s;
        f10 = wm.d.f();
        i10 = nVar.f25610u;
        if (i10 != 0) {
        }
        String str32 = str2;
        R = cVar2.R((ResultWrapper) obj2);
        if (R == null) {
        }
        return R;
    }

    @Override // ka.b
    public void o(ka.a aVar) {
        B().n(aVar);
    }

    @Override // ka.b
    public void p(NotificationPreferenceResponse notificationPreferenceResponse) {
        kotlin.jvm.internal.t.g(notificationPreferenceResponse, "notificationPreferenceResponse");
        this.f25543k.q(notificationPreferenceResponse);
    }

    @Override // ka.b
    public d0 q() {
        return this.f25551s;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0043  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0029  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object r(SetForgetEmailPreferenceRequest setForgetEmailPreferenceRequest, vm.d dVar) {
        s sVar;
        Object f10;
        int i10;
        c cVar;
        ResultWrapper.Error R;
        SetForgetPreferenceResponse setForgetPreferenceResponse;
        SetForgetPreferenceResponse copy;
        c cVar2 = this;
        SetForgetEmailPreferenceRequest setForgetEmailPreferenceRequest2 = setForgetEmailPreferenceRequest;
        if (dVar instanceof s) {
            sVar = (s) dVar;
            int i11 = sVar.f25642u;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                sVar.f25642u = i11 - Integer.MIN_VALUE;
                Object obj = sVar.f25640s;
                f10 = wm.d.f();
                i10 = sVar.f25642u;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = cVar2.f25536d;
                    sVar.f25637p = cVar2;
                    sVar.f25638q = setForgetEmailPreferenceRequest2;
                    sVar.f25639r = cVar2;
                    sVar.f25642u = 1;
                    obj = iProfileApi.updateSetForgetPreference(setForgetEmailPreferenceRequest2, sVar);
                    if (obj == f10) {
                        return f10;
                    }
                    cVar = cVar2;
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    cVar2 = (c) sVar.f25639r;
                    setForgetEmailPreferenceRequest2 = (SetForgetEmailPreferenceRequest) sVar.f25638q;
                    cVar = (c) sVar.f25637p;
                    y.b(obj);
                }
                R = cVar2.R((ResultWrapper) obj);
                if (R == null && (setForgetPreferenceResponse = (SetForgetPreferenceResponse) cVar.H().f()) != null) {
                    copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : kotlin.coroutines.jvm.internal.b.a(setForgetEmailPreferenceRequest2.getEmailPref()), (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : null, (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : null, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : null, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : null, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : null, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : null, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : null);
                    cVar.f25544l.n(copy);
                }
                return R;
            }
        }
        sVar = new s(dVar);
        Object obj2 = sVar.f25640s;
        f10 = wm.d.f();
        i10 = sVar.f25642u;
        if (i10 != 0) {
        }
        R = cVar2.R((ResultWrapper) obj2);
        if (R == null) {
            copy = setForgetPreferenceResponse.copy((r24 & 1) != 0 ? setForgetPreferenceResponse.isSubscribed : null, (r24 & 2) != 0 ? setForgetPreferenceResponse.subscriptionOverride : null, (r24 & 4) != 0 ? setForgetPreferenceResponse.emailPref : kotlin.coroutines.jvm.internal.b.a(setForgetEmailPreferenceRequest2.getEmailPref()), (r24 & 8) != 0 ? setForgetPreferenceResponse.smsPref : null, (r24 & 16) != 0 ? setForgetPreferenceResponse.dlvryPref : null, (r24 & 32) != 0 ? setForgetPreferenceResponse.tncDate : null, (r24 & 64) != 0 ? setForgetPreferenceResponse.name1 : null, (r24 & 128) != 0 ? setForgetPreferenceResponse.name2 : null, (r24 & 256) != 0 ? setForgetPreferenceResponse.name3 : null, (r24 & 512) != 0 ? setForgetPreferenceResponse.name4 : null, (r24 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? setForgetPreferenceResponse.name5 : null);
            cVar.f25544l.n(copy);
        }
        return R;
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x0092  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0056  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0028  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object s(String str, String str2, String str3, String str4, vm.d dVar) {
        o oVar;
        Object f10;
        int i10;
        c cVar;
        String str5;
        String str6;
        String str7;
        String str8;
        ResultWrapper.Error R;
        UserProfile copy;
        c cVar2 = this;
        if (dVar instanceof o) {
            oVar = (o) dVar;
            int i11 = oVar.f25619x;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                oVar.f25619x = i11 - Integer.MIN_VALUE;
                o oVar2 = oVar;
                Object obj = oVar2.f25617v;
                f10 = wm.d.f();
                i10 = oVar2.f25619x;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = cVar2.f25536d;
                    oVar2.f25611p = cVar2;
                    oVar2.f25612q = str;
                    oVar2.f25613r = str2;
                    oVar2.f25614s = str3;
                    oVar2.f25615t = str4;
                    oVar2.f25616u = cVar2;
                    oVar2.f25619x = 1;
                    Object updateSecreteQuestionsAndAnswers = iProfileApi.updateSecreteQuestionsAndAnswers(str, str2, str3, str4, oVar2);
                    if (updateSecreteQuestionsAndAnswers == f10) {
                        return f10;
                    }
                    cVar = cVar2;
                    str5 = str;
                    obj = updateSecreteQuestionsAndAnswers;
                    str6 = str2;
                    str7 = str3;
                    str8 = str4;
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    cVar2 = (c) oVar2.f25616u;
                    String str9 = (String) oVar2.f25615t;
                    String str10 = (String) oVar2.f25614s;
                    String str11 = (String) oVar2.f25613r;
                    String str12 = (String) oVar2.f25612q;
                    cVar = (c) oVar2.f25611p;
                    y.b(obj);
                    str8 = str9;
                    str7 = str10;
                    str6 = str11;
                    str5 = str12;
                }
                R = cVar2.R((ResultWrapper) obj);
                if (R == null) {
                    UserProfile userProfile = (UserProfile) cVar.a().f();
                    if (userProfile != null) {
                        i9.d dVar2 = cVar.f25533a;
                        copy = userProfile.copy((r42 & 1) != 0 ? userProfile.firstName : null, (r42 & 2) != 0 ? userProfile.lastName : null, (r42 & 4) != 0 ? userProfile.userName : null, (r42 & 8) != 0 ? userProfile.email : null, (r42 & 16) != 0 ? userProfile.additionalEmail : null, (r42 & 32) != 0 ? userProfile.transactionalEmail : null, (r42 & 64) != 0 ? userProfile.primaryPhone : null, (r42 & 128) != 0 ? userProfile.mobilePhone : null, (r42 & 256) != 0 ? userProfile.additionalPhone : null, (r42 & 512) != 0 ? userProfile.addressLine1 : null, (r42 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? userProfile.addressLine2 : null, (r42 & 2048) != 0 ? userProfile.city : null, (r42 & 4096) != 0 ? userProfile.region : null, (r42 & UserMetadata.MAX_INTERNAL_KEY_SIZE) != 0 ? userProfile.country : null, (r42 & 16384) != 0 ? userProfile.postalZip : null, (r42 & 32768) != 0 ? userProfile.securityQuestion : str5, (r42 & 65536) != 0 ? userProfile.securityQuestionAnswer : str6, (r42 & 131072) != 0 ? userProfile.receiveMarketingEmails : null, (r42 & 262144) != 0 ? userProfile.securityQuestion2 : str7, (r42 & 524288) != 0 ? userProfile.securityQuestionAnswer2 : str8, (r42 & 1048576) != 0 ? userProfile.mfaPhone : null, (r42 & 2097152) != 0 ? userProfile.mfaPhoneCallingCode : null, (r42 & 4194304) != 0 ? userProfile.mfaPhoneCountryCode : null, (r42 & 8388608) != 0 ? userProfile.hasDuplicateEmails : null);
                        dVar2.b(copy);
                    }
                    cVar.T(b.EnumC0540b.UpdateQuestionsAnswers);
                }
                return R;
            }
        }
        oVar = new o(dVar);
        o oVar22 = oVar;
        Object obj2 = oVar22.f25617v;
        f10 = wm.d.f();
        i10 = oVar22.f25619x;
        if (i10 != 0) {
        }
        R = cVar2.R((ResultWrapper) obj2);
        if (R == null) {
        }
        return R;
    }

    @Override // ka.b
    public void t() {
        this.f25554v.q(null);
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x00bb  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x007b  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x002e  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object u(String str, String str2, boolean z10, vm.d dVar) {
        p pVar;
        Object f10;
        int i10;
        c cVar;
        ResultWrapper resultWrapper;
        c cVar2;
        ResultWrapper.Error R;
        UserProfile copy;
        c cVar3 = this;
        String str3 = str;
        String str4 = str2;
        if (dVar instanceof p) {
            pVar = (p) dVar;
            int i11 = pVar.f25626v;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                pVar.f25626v = i11 - Integer.MIN_VALUE;
                Object obj = pVar.f25624t;
                f10 = wm.d.f();
                i10 = pVar.f25626v;
                if (i10 != 0) {
                    y.b(obj);
                    if (str3 == null || str4 == null) {
                        return null;
                    }
                    if (z10) {
                        IProfileApi iProfileApi = cVar3.f25536d;
                        pVar.f25620p = cVar3;
                        pVar.f25621q = str3;
                        pVar.f25622r = str4;
                        pVar.f25623s = cVar3;
                        pVar.f25626v = 1;
                        obj = iProfileApi.updateFirstLastName(str3, str4, true, pVar);
                        if (obj == f10) {
                            return f10;
                        }
                        cVar = cVar3;
                        resultWrapper = (ResultWrapper) obj;
                    } else {
                        IProfileApi iProfileApi2 = cVar3.f25536d;
                        pVar.f25620p = cVar3;
                        pVar.f25621q = str3;
                        pVar.f25622r = str4;
                        pVar.f25623s = cVar3;
                        pVar.f25626v = 2;
                        obj = iProfileApi2.updateFirstLastName(str3, str4, pVar);
                        if (obj == f10) {
                            return f10;
                        }
                        cVar = cVar3;
                        resultWrapper = (ResultWrapper) obj;
                    }
                } else if (i10 == 1) {
                    cVar3 = (c) pVar.f25623s;
                    String str5 = (String) pVar.f25622r;
                    String str6 = (String) pVar.f25621q;
                    cVar = (c) pVar.f25620p;
                    y.b(obj);
                    str4 = str5;
                    str3 = str6;
                    resultWrapper = (ResultWrapper) obj;
                } else {
                    if (i10 != 2) {
                        if (i10 != 3) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        R = (ResultWrapper.Error) pVar.f25621q;
                        cVar2 = (c) pVar.f25620p;
                        y.b(obj);
                        cVar2.f25538f.j();
                        cVar2.T(b.EnumC0540b.Username);
                        return R;
                    }
                    cVar3 = (c) pVar.f25623s;
                    String str7 = (String) pVar.f25622r;
                    String str8 = (String) pVar.f25621q;
                    cVar = (c) pVar.f25620p;
                    y.b(obj);
                    str4 = str7;
                    str3 = str8;
                    resultWrapper = (ResultWrapper) obj;
                }
                String str9 = str3;
                String str10 = str4;
                cVar2 = cVar;
                R = cVar3.R(resultWrapper);
                if (R == null) {
                    UserProfile userProfile = (UserProfile) cVar2.a().f();
                    if (userProfile != null) {
                        i9.d dVar2 = cVar2.f25533a;
                        copy = userProfile.copy((r42 & 1) != 0 ? userProfile.firstName : str9, (r42 & 2) != 0 ? userProfile.lastName : str10, (r42 & 4) != 0 ? userProfile.userName : null, (r42 & 8) != 0 ? userProfile.email : null, (r42 & 16) != 0 ? userProfile.additionalEmail : null, (r42 & 32) != 0 ? userProfile.transactionalEmail : null, (r42 & 64) != 0 ? userProfile.primaryPhone : null, (r42 & 128) != 0 ? userProfile.mobilePhone : null, (r42 & 256) != 0 ? userProfile.additionalPhone : null, (r42 & 512) != 0 ? userProfile.addressLine1 : null, (r42 & UserMetadata.MAX_ATTRIBUTE_SIZE) != 0 ? userProfile.addressLine2 : null, (r42 & 2048) != 0 ? userProfile.city : null, (r42 & 4096) != 0 ? userProfile.region : null, (r42 & UserMetadata.MAX_INTERNAL_KEY_SIZE) != 0 ? userProfile.country : null, (r42 & 16384) != 0 ? userProfile.postalZip : null, (r42 & 32768) != 0 ? userProfile.securityQuestion : null, (r42 & 65536) != 0 ? userProfile.securityQuestionAnswer : null, (r42 & 131072) != 0 ? userProfile.receiveMarketingEmails : null, (r42 & 262144) != 0 ? userProfile.securityQuestion2 : null, (r42 & 524288) != 0 ? userProfile.securityQuestionAnswer2 : null, (r42 & 1048576) != 0 ? userProfile.mfaPhone : null, (r42 & 2097152) != 0 ? userProfile.mfaPhoneCallingCode : null, (r42 & 4194304) != 0 ? userProfile.mfaPhoneCountryCode : null, (r42 & 8388608) != 0 ? userProfile.hasDuplicateEmails : null);
                        dVar2.b(copy);
                    }
                    pVar.f25620p = cVar2;
                    pVar.f25621q = R;
                    pVar.f25622r = null;
                    pVar.f25623s = null;
                    pVar.f25626v = 3;
                    if (cVar2.m(true, pVar) == f10) {
                        return f10;
                    }
                    cVar2.f25538f.j();
                    cVar2.T(b.EnumC0540b.Username);
                }
                return R;
            }
        }
        pVar = new p(dVar);
        Object obj2 = pVar.f25624t;
        f10 = wm.d.f();
        i10 = pVar.f25626v;
        if (i10 != 0) {
        }
        String str92 = str3;
        String str102 = str4;
        cVar2 = cVar;
        R = cVar3.R(resultWrapper);
        if (R == null) {
        }
        return R;
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x0035  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object updateNotificationPreference(NotificationPreferenceResponse notificationPreferenceResponse, vm.d dVar) {
        q qVar;
        Object f10;
        int i10;
        if (dVar instanceof q) {
            qVar = (q) dVar;
            int i11 = qVar.f25630s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                qVar.f25630s = i11 - Integer.MIN_VALUE;
                Object obj = qVar.f25628q;
                f10 = wm.d.f();
                i10 = qVar.f25630s;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = this.f25536d;
                    qVar.f25627p = this;
                    qVar.f25630s = 1;
                    obj = iProfileApi.updateNotificationPreference(notificationPreferenceResponse, qVar);
                    if (obj == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    this = (c) qVar.f25627p;
                    y.b(obj);
                }
                return this.R((ResultWrapper) obj);
            }
        }
        qVar = new q(dVar);
        Object obj2 = qVar.f25628q;
        f10 = wm.d.f();
        i10 = qVar.f25630s;
        if (i10 != 0) {
        }
        return this.R((ResultWrapper) obj2);
    }

    @Override // ka.b
    public void v(boolean z10) {
        this.C.q(Boolean.valueOf(z10));
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:22:0x017e  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x01ba  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x01f8  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x00e3  */
    /* JADX WARN: Removed duplicated region for block: B:81:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:85:0x00db A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:86:0x00dc  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x002c  */
    /* JADX WARN: Removed duplicated region for block: B:90:0x00bd  */
    /* JADX WARN: Removed duplicated region for block: B:94:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:95:0x007c  */
    /* JADX WARN: Type inference failed for: r1v13 */
    /* JADX WARN: Type inference failed for: r1v14, types: [int] */
    /* JADX WARN: Type inference failed for: r1v49 */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object w(ka.a aVar, vm.d dVar) {
        C0541c c0541c;
        Object f10;
        int i10;
        ka.a aVar2;
        c cVar;
        ResultWrapper.Error Q;
        c cVar2;
        c cVar3;
        ResultWrapper resultWrapper;
        ResultWrapper.Error error;
        int i11;
        c cVar4;
        Boolean l1AuthStatus;
        ResultWrapper resultWrapper2;
        c cVar5 = this;
        if (dVar instanceof C0541c) {
            c0541c = (C0541c) dVar;
            int i12 = c0541c.f25567v;
            if ((i12 & Integer.MIN_VALUE) != 0) {
                c0541c.f25567v = i12 - Integer.MIN_VALUE;
                Object obj = c0541c.f25565t;
                f10 = wm.d.f();
                i10 = c0541c.f25567v;
                if (i10 != 0) {
                    y.b(obj);
                    j(aVar);
                    IAMSApi iAMSApi = cVar5.f25540h;
                    AddressAMSCheckRequest addressAMSCheckRequest = new AddressAMSCheckRequest(aVar.c(), aVar.d(), aVar.a(), aVar.f(), aVar.e(), aVar.b());
                    c0541c.f25561p = cVar5;
                    c0541c.f25562q = aVar;
                    c0541c.f25563r = cVar5;
                    c0541c.f25567v = 1;
                    obj = iAMSApi.addressAmsCheck(addressAMSCheckRequest, c0541c);
                    if (obj == f10) {
                        return f10;
                    }
                    aVar2 = aVar;
                    cVar = cVar5;
                } else if (i10 == 1) {
                    cVar5 = (c) c0541c.f25563r;
                    aVar2 = (ka.a) c0541c.f25562q;
                    cVar = (c) c0541c.f25561p;
                    y.b(obj);
                } else {
                    if (i10 != 2) {
                        if (i10 != 3) {
                            if (i10 != 4) {
                                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                            }
                            i11 = c0541c.f25564s;
                            error = (ResultWrapper.Error) c0541c.f25562q;
                            cVar4 = (c) c0541c.f25561p;
                            y.b(obj);
                            resultWrapper2 = (ResultWrapper) obj;
                            if ((resultWrapper2 instanceof ResultWrapper.Success) && (resultWrapper2 instanceof ResultWrapper.Error)) {
                                return new ResultWrapper.Error(null, null, RepositoryError.Unknown, kotlin.coroutines.jvm.internal.b.a(false));
                            }
                            if (kotlin.jvm.internal.t.b(cVar4.f25538f.s().f(), kotlin.coroutines.jvm.internal.b.a(true))) {
                                MyMailFlowArguments myMailFlowArguments = (MyMailFlowArguments) cVar4.f25538f.p().f();
                                if (myMailFlowArguments != null ? kotlin.jvm.internal.t.b(myMailFlowArguments.getHasAddressSupport(), kotlin.coroutines.jvm.internal.b.a(false)) : false) {
                                    return new ResultWrapper.Error(null, null, RepositoryError.ClientError, AMSCheckSteps.MYMAIL);
                                }
                            }
                            if (kotlin.jvm.internal.t.b(cVar4.f25538f.s().f(), kotlin.coroutines.jvm.internal.b.a(true))) {
                                MyMailFlowArguments myMailFlowArguments2 = (MyMailFlowArguments) cVar4.f25538f.p().f();
                                if (myMailFlowArguments2 != null ? kotlin.jvm.internal.t.b(myMailFlowArguments2.getHasAddressSupport(), kotlin.coroutines.jvm.internal.b.a(true)) : false) {
                                    if (cVar4.f25539g.d(p9.a.L2)) {
                                        return new ResultWrapper.Error(null, null, RepositoryError.ClientError, AMSCheckSteps.L2);
                                    }
                                    if (i11 == 0) {
                                        return new ResultWrapper.Error(null, null, RepositoryError.ClientError, AMSCheckSteps.L1AUTH);
                                    }
                                    return error;
                                }
                            }
                            if (i11 == 0) {
                                return new ResultWrapper.Error(null, null, RepositoryError.ClientError, AMSCheckSteps.L1AUTH);
                            }
                            return error;
                        }
                        Q = (ResultWrapper.Error) c0541c.f25563r;
                        aVar2 = (ka.a) c0541c.f25562q;
                        cVar3 = (c) c0541c.f25561p;
                        y.b(obj);
                        resultWrapper = (ResultWrapper) obj;
                        if (resultWrapper instanceof ResultWrapper.Success) {
                            return Q;
                        }
                        AMSPrerequisitesResponse aMSPrerequisitesResponse = (AMSPrerequisitesResponse) ((ResultWrapper.Success) resultWrapper).getData();
                        ?? booleanValue = (aMSPrerequisitesResponse == null || (l1AuthStatus = aMSPrerequisitesResponse.getL1AuthStatus()) == null) ? 0 : l1AuthStatus.booleanValue();
                        String c10 = aVar2.c();
                        String str = c10 == null ? "" : c10;
                        String d10 = aVar2.d();
                        String a10 = aVar2.a();
                        String str2 = a10 == null ? "" : a10;
                        String f11 = aVar2.f();
                        String str3 = f11 == null ? "" : f11;
                        String b10 = aVar2.b();
                        String str4 = b10 == null ? "" : b10;
                        String e10 = aVar2.e();
                        if (e10 == null) {
                            e10 = "";
                        }
                        AddressEligibilityBody addressEligibilityBody = new AddressEligibilityBody(str, d10, str2, str3, str4, e10);
                        fa.a aVar3 = cVar3.f25538f;
                        c0541c.f25561p = cVar3;
                        c0541c.f25562q = Q;
                        c0541c.f25563r = null;
                        c0541c.f25564s = booleanValue;
                        c0541c.f25567v = 4;
                        Object v10 = aVar3.v(addressEligibilityBody, true, c0541c);
                        if (v10 == f10) {
                            return f10;
                        }
                        error = Q;
                        i11 = booleanValue;
                        obj = v10;
                        cVar4 = cVar3;
                        resultWrapper2 = (ResultWrapper) obj;
                        if (resultWrapper2 instanceof ResultWrapper.Success) {
                        }
                        if (kotlin.jvm.internal.t.b(cVar4.f25538f.s().f(), kotlin.coroutines.jvm.internal.b.a(true))) {
                        }
                        if (kotlin.jvm.internal.t.b(cVar4.f25538f.s().f(), kotlin.coroutines.jvm.internal.b.a(true))) {
                        }
                        if (i11 == 0) {
                        }
                        return error;
                    }
                    Q = (ResultWrapper.Error) c0541c.f25563r;
                    aVar2 = (ka.a) c0541c.f25562q;
                    cVar2 = (c) c0541c.f25561p;
                    y.b(obj);
                    c0541c.f25561p = cVar2;
                    c0541c.f25562q = aVar2;
                    c0541c.f25563r = Q;
                    c0541c.f25567v = 3;
                    obj = cVar2.m(true, c0541c);
                    if (obj != f10) {
                        return f10;
                    }
                    cVar3 = cVar2;
                    resultWrapper = (ResultWrapper) obj;
                    if (resultWrapper instanceof ResultWrapper.Success) {
                    }
                }
                Q = cVar5.Q((ResultWrapper) obj);
                if (Q == null) {
                    return Q;
                }
                c0541c.f25561p = cVar;
                c0541c.f25562q = aVar2;
                c0541c.f25563r = Q;
                c0541c.f25567v = 2;
                if (cVar.D(c0541c) == f10) {
                    return f10;
                }
                cVar2 = cVar;
                c0541c.f25561p = cVar2;
                c0541c.f25562q = aVar2;
                c0541c.f25563r = Q;
                c0541c.f25567v = 3;
                obj = cVar2.m(true, c0541c);
                if (obj != f10) {
                }
            }
        }
        c0541c = new C0541c(dVar);
        Object obj2 = c0541c.f25565t;
        f10 = wm.d.f();
        i10 = c0541c.f25567v;
        if (i10 != 0) {
        }
        Q = cVar5.Q((ResultWrapper) obj2);
        if (Q == null) {
        }
    }

    @Override // ka.b
    public a0 x() {
        return this.f25546n;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0068  */
    /* JADX WARN: Removed duplicated region for block: B:22:0x0048  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0024  */
    @Override // ka.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object y(boolean z10, vm.d dVar) {
        l lVar;
        Object f10;
        int i10;
        c cVar;
        ResultWrapper.Error R;
        if (dVar instanceof l) {
            lVar = (l) dVar;
            int i11 = lVar.f25598t;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                lVar.f25598t = i11 - Integer.MIN_VALUE;
                Object obj = lVar.f25596r;
                f10 = wm.d.f();
                i10 = lVar.f25598t;
                if (i10 != 0) {
                    y.b(obj);
                    IProfileApi iProfileApi = this.f25536d;
                    SetnForgetSubscriptionRequest setnForgetSubscriptionRequest = new SetnForgetSubscriptionRequest(z10);
                    lVar.f25594p = this;
                    lVar.f25595q = this;
                    lVar.f25598t = 1;
                    obj = iProfileApi.updateSetForgetPreference(setnForgetSubscriptionRequest, lVar);
                    if (obj == f10) {
                        return f10;
                    }
                    cVar = this;
                } else {
                    if (i10 != 1) {
                        if (i10 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        R = (ResultWrapper.Error) lVar.f25595q;
                        cVar = (c) lVar.f25594p;
                        y.b(obj);
                        cVar.M();
                        return R;
                    }
                    this = (c) lVar.f25595q;
                    cVar = (c) lVar.f25594p;
                    y.b(obj);
                }
                R = this.R((ResultWrapper) obj);
                if (R == null) {
                    lVar.f25594p = cVar;
                    lVar.f25595q = R;
                    lVar.f25598t = 2;
                    if (cVar.m(true, lVar) == f10) {
                        return f10;
                    }
                    cVar.M();
                }
                return R;
            }
        }
        lVar = new l(dVar);
        Object obj2 = lVar.f25596r;
        f10 = wm.d.f();
        i10 = lVar.f25598t;
        if (i10 != 0) {
        }
        R = this.R((ResultWrapper) obj2);
        if (R == null) {
        }
        return R;
    }

    @Override // ka.b
    public void z(Name name) {
        this.f25557y.q(name);
    }
}
