package u8;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import androidx.appcompat.app.a;
import rm.n0;

/* loaded from: classes.dex */
public class g {

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

    /* renamed from: l, reason: collision with root package name */
    public static final int f36994l = 8;

    /* renamed from: a, reason: collision with root package name */
    private String f36995a;

    /* renamed from: b, reason: collision with root package name */
    private String f36996b;

    /* renamed from: c, reason: collision with root package name */
    private View f36997c;

    /* renamed from: d, reason: collision with root package name */
    private String f36998d;

    /* renamed from: e, reason: collision with root package name */
    private String f36999e;

    /* renamed from: f, reason: collision with root package name */
    private boolean f37000f = true;

    /* renamed from: g, reason: collision with root package name */
    private dn.a f37001g;

    /* renamed from: h, reason: collision with root package name */
    private dn.a f37002h;

    /* renamed from: i, reason: collision with root package name */
    private dn.a f37003i;

    /* renamed from: j, reason: collision with root package name */
    private androidx.appcompat.app.a f37004j;

    /* loaded from: classes.dex */
    public static final class a {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: u8.g$a$a, reason: collision with other inner class name */
        /* loaded from: classes.dex */
        public static final class C0880a extends kotlin.jvm.internal.v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ Context f37005p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            C0880a(Context context) {
                super(0);
                this.f37005p = context;
            }

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

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m434invoke() {
                this.f37005p.startActivity(new Intent("android.intent.action.DIAL", Uri.parse("tel:" + this.f37005p.getString(h7.l.A))));
            }
        }

        /* loaded from: classes.dex */
        static final class b extends kotlin.jvm.internal.v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ Context f37006p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            b(Context context) {
                super(0);
                this.f37006p = context;
            }

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

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m435invoke() {
                Context context = this.f37006p;
                if (context != null) {
                    context.startActivity(new Intent("android.settings.SETTINGS"));
                }
            }
        }

        /* loaded from: classes.dex */
        static final class c extends kotlin.jvm.internal.v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ Context f37007p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            c(Context context) {
                super(0);
                this.f37007p = context;
            }

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

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m436invoke() {
                Context context = this.f37007p;
                if (context != null) {
                    context.startActivity(new Intent("android.settings.SETTINGS"));
                }
            }
        }

        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }

        public static /* synthetic */ g b(a aVar, String str, String str2, View view, int i10, Object obj) {
            if ((i10 & 2) != 0) {
                str2 = null;
            }
            if ((i10 & 4) != 0) {
                view = null;
            }
            return aVar.a(str, str2, view);
        }

        public static /* synthetic */ g f(a aVar, Context context, String str, String str2, boolean z10, int i10, Object obj) {
            if ((i10 & 2) != 0) {
                str = "";
            }
            if ((i10 & 4) != 0) {
                str2 = context.getString(h7.l.W);
                kotlin.jvm.internal.t.f(str2, "getString(...)");
            }
            if ((i10 & 8) != 0) {
                z10 = false;
            }
            return aVar.e(context, str, str2, z10);
        }

        public static /* synthetic */ g k(a aVar, Context context, String str, String str2, int i10, Object obj) {
            if ((i10 & 4) != 0) {
                str2 = null;
            }
            return aVar.j(context, str, str2);
        }

        public static /* synthetic */ g n(a aVar, Context context, String str, String str2, int i10, Object obj) {
            if ((i10 & 4) != 0) {
                str2 = null;
            }
            return aVar.m(context, str, str2);
        }

        public final g a(String str, String str2, View view) {
            g gVar = new g();
            gVar.v(str2);
            gVar.u(str);
            gVar.w(view);
            return gVar;
        }

        public final g c(Context context) {
            String str;
            if (context == null || (str = context.getString(h7.l.f21134e0)) == null) {
                str = "";
            }
            g l10 = l(context, str, context != null ? context.getString(h7.l.f21139f0) : null);
            l10.n(context != null ? context.getString(h7.l.f21129d0) : null);
            l10.p(context != null ? context.getString(h7.l.f21218v) : null);
            return l10;
        }

        public final g d(Context context, String message, String str) {
            kotlin.jvm.internal.t.g(message, "message");
            if (str == null) {
                str = context != null ? context.getString(h7.l.W) : null;
            }
            return j(context, message, str);
        }

        public final g e(Context context, String message, String title, boolean z10) {
            kotlin.jvm.internal.t.g(context, "context");
            kotlin.jvm.internal.t.g(message, "message");
            kotlin.jvm.internal.t.g(title, "title");
            g l10 = l(context, message, title);
            l10.p(null);
            if (z10) {
                l10.p(context.getString(h7.l.f21238z));
                l10.q(new C0880a(context));
            }
            return l10;
        }

        public final g g(Context context) {
            String str;
            if (context == null || (str = context.getString(h7.l.f21181n2)) == null) {
                str = "";
            }
            g l10 = l(context, str, context != null ? context.getString(h7.l.f21186o2) : null);
            l10.n(context != null ? context.getString(h7.l.V) : null);
            l10.p(context != null ? context.getString(h7.l.C) : null);
            return l10;
        }

        public final g h(Context context) {
            String str;
            if (context == null || (str = context.getString(h7.l.E1)) == null) {
                str = "";
            }
            g l10 = l(context, str, context != null ? context.getString(h7.l.F1) : null);
            l10.p(context != null ? context.getString(h7.l.f21166k2) : null);
            l10.q(new b(context));
            return l10;
        }

        public final g i(Context context) {
            String str;
            if (context == null || (str = context.getString(h7.l.I3)) == null) {
                str = "";
            }
            g l10 = l(context, str, context != null ? context.getString(h7.l.G1) : null);
            l10.p(context != null ? context.getString(h7.l.f21166k2) : null);
            l10.q(new c(context));
            return l10;
        }

        public final g j(Context context, String message, String str) {
            kotlin.jvm.internal.t.g(message, "message");
            g b10 = b(this, message, str, null, 4, null);
            b10.n(context != null ? context.getString(h7.l.T) : null);
            return b10;
        }

        public final g l(Context context, String message, String str) {
            kotlin.jvm.internal.t.g(message, "message");
            g b10 = b(this, message, str, null, 4, null);
            b10.n(context != null ? context.getString(h7.l.T) : null);
            b10.p(context != null ? context.getString(h7.l.C) : null);
            return b10;
        }

        public final g m(Context context, String message, String str) {
            kotlin.jvm.internal.t.g(message, "message");
            g b10 = b(this, message, str, null, 4, null);
            b10.n(context != null ? context.getString(h7.l.J3) : null);
            b10.p(context != null ? context.getString(h7.l.D1) : null);
            return b10;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void k(g this$0, DialogInterface dialogInterface) {
        kotlin.jvm.internal.t.g(this$0, "this$0");
        dn.a aVar = this$0.f37003i;
        if (aVar != null) {
            aVar.invoke();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void l(g this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.t.g(this$0, "this$0");
        dn.a aVar = this$0.f37001g;
        if (aVar != null) {
            aVar.invoke();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void m(g this$0, DialogInterface dialogInterface, int i10) {
        kotlin.jvm.internal.t.g(this$0, "this$0");
        dn.a aVar = this$0.f37002h;
        if (aVar != null) {
            aVar.invoke();
        }
    }

    public final String d() {
        return this.f36998d;
    }

    public final dn.a e() {
        return this.f37001g;
    }

    public final String f() {
        return this.f36999e;
    }

    public final dn.a g() {
        return this.f37002h;
    }

    public final androidx.appcompat.app.a h() {
        return this.f37004j;
    }

    public final View i() {
        return this.f36997c;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void j(Context context, a.C0023a builder) {
        kotlin.jvm.internal.t.g(builder, "builder");
        String str = this.f36995a;
        if (str != null) {
            builder.p(str);
        }
        String str2 = this.f36996b;
        if (str2 != null) {
            builder.g(str2);
        }
        View view = this.f36997c;
        if (view != null) {
            builder.r(view);
        }
        builder.d(this.f37000f);
        builder.j(new DialogInterface.OnCancelListener() { // from class: u8.d
            @Override // android.content.DialogInterface.OnCancelListener
            public final void onCancel(DialogInterface dialogInterface) {
                g.k(g.this, dialogInterface);
            }
        });
        builder.n(this.f36998d, new DialogInterface.OnClickListener() { // from class: u8.e
            @Override // android.content.DialogInterface.OnClickListener
            public final void onClick(DialogInterface dialogInterface, int i10) {
                g.l(g.this, dialogInterface, i10);
            }
        });
        builder.i(this.f36999e, new DialogInterface.OnClickListener() { // from class: u8.f
            @Override // android.content.DialogInterface.OnClickListener
            public final void onClick(DialogInterface dialogInterface, int i10) {
                g.m(g.this, dialogInterface, i10);
            }
        });
    }

    public final void n(String str) {
        this.f36998d = str;
    }

    public final void o(dn.a aVar) {
        this.f37001g = aVar;
    }

    public final void p(String str) {
        this.f36999e = str;
    }

    public final void q(dn.a aVar) {
        this.f37002h = aVar;
    }

    public final void r(dn.a aVar) {
        this.f37003i = aVar;
    }

    public final void s(boolean z10) {
        this.f37000f = z10;
    }

    public final void t(androidx.appcompat.app.a aVar) {
        this.f37004j = aVar;
    }

    public final void u(String str) {
        this.f36996b = str;
    }

    public final void v(String str) {
        this.f36995a = str;
    }

    public final void w(View view) {
        this.f36997c = view;
    }

    public void x(Context context) {
        kotlin.jvm.internal.t.d(context);
        a.C0023a c0023a = new a.C0023a(context, h7.m.f21243a);
        j(context, c0023a);
        c0023a.s();
    }
}
