package i9;

import androidx.lifecycle.a0;
import androidx.lifecycle.f0;
import ca.canadapost.core.data.auth.model.UserProfile;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.t;

/* loaded from: classes.dex */
public final class e implements d {

    /* renamed from: d, reason: collision with root package name */
    public static final a f22522d = new a(null);

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

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

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

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(k kVar) {
            this();
        }
    }

    public e(ja.c sharedPreferencesService) {
        t.g(sharedPreferencesService, "sharedPreferencesService");
        this.f22523a = sharedPreferencesService;
        f0 f0Var = new f0();
        this.f22524b = f0Var;
        this.f22525c = f0Var;
        f0Var.q(sharedPreferencesService.a("EPOST_PROFILE_DAO_KEY") ? UserProfile.INSTANCE.formJsonString(sharedPreferencesService.getString("EPOST_PROFILE_DAO_KEY", "")) : null);
    }

    @Override // i9.d
    public a0 a() {
        return this.f22525c;
    }

    @Override // i9.d
    public void b(UserProfile profile) {
        t.g(profile, "profile");
        this.f22523a.putString("EPOST_PROFILE_DAO_KEY", profile.toJsonString());
        this.f22524b.n(profile);
    }

    @Override // i9.d
    public void c() {
        this.f22523a.b("EPOST_PROFILE_DAO_KEY");
        this.f22524b.n(null);
    }
}
