package com.applovin.impl; import androidx.core.app.NotificationCompat; import com.applovin.impl.sdk.utils.JsonUtils; import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil; import org.json.JSONObject; /* loaded from: classes.dex */ public class l4 { private final com.applovin.impl.sdk.j a; private final JSONObject b; public enum a { NEUTRAL, POSITIVE, NEGATIVE } public String toString() { return "ConsentFlowStateAlertAction{title=" + d() + "destinationStateId=" + a() + "event=" + b() + "}"; } public static l4 a(JSONObject jSONObject, com.applovin.impl.sdk.j jVar) { String string = JsonUtils.getString(JsonUtils.getJSONObject(jSONObject, "title", (JSONObject) null), "key", null); if ("TOS".equalsIgnoreCase(string) && jVar.u().i() == null) { return null; } if ("PP".equalsIgnoreCase(string) && jVar.u().h() == null) { return null; } return new l4(jSONObject, jVar); } private l4(JSONObject jSONObject, com.applovin.impl.sdk.j jVar) { this.a = jVar; this.b = jSONObject; } public String d() { JSONObject jSONObject = JsonUtils.getJSONObject(this.b, "title", (JSONObject) null); return com.applovin.impl.sdk.j.a(JsonUtils.getString(jSONObject, "key", ""), JsonUtils.optList(JsonUtils.getJSONArray(jSONObject, "replacements", null), null)); } public a c() { String string = JsonUtils.getString(this.b, "style", null); if (MRAIDCommunicatorUtil.STATES_DEFAULT.equalsIgnoreCase(string)) { return a.POSITIVE; } if (!"destructive".equalsIgnoreCase(string) && !"cancel".equalsIgnoreCase(string)) { return a.NEUTRAL; } return a.NEGATIVE; } public String b() { return JsonUtils.getString(this.b, NotificationCompat.CATEGORY_EVENT, null); } public String a() { return JsonUtils.getString(this.b, "destination_state_id", null); } }