package c.a.a; import android.content.Context; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentViewModelLazyKt; import c.a.a.v; import c.a.d.h0; import c.a.d.j0; import c.a.i.i5; import com.discord.app.AppDialog; import com.discord.app.AppViewModel; import com.discord.stores.StoreStream; import com.discord.utilities.rx.ObservableExtensionsKt; import com.discord.utilities.viewbinding.FragmentViewBindingDelegate; import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt; import com.discord.views.LoadingButton; import d0.z.d.a0; import d0.z.d.k; import d0.z.d.m; import d0.z.d.o; import java.util.Objects; import kotlin.Lazy; import kotlin.NoWhenBranchMatchedException; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.reflect.KProperty; import rx.subjects.PublishSubject; /* compiled from: WidgetUrgentMessageDialog.kt */ public final class r extends AppDialog { public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(r.class, "binding", "getBinding()Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0)}; public static final a j = new a(null); public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, b.i, null, 2, null); public final Lazy l; /* compiled from: WidgetUrgentMessageDialog.kt */ public static final class a { public a(DefaultConstructorMarker defaultConstructorMarker) { } } /* compiled from: WidgetUrgentMessageDialog.kt */ public static final /* synthetic */ class b extends k implements Function1 { public static final b i = new b(); public b() { super(1, i5.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0); } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kotlin.jvm.functions.Function1 public i5 invoke(View view) { View view2 = view; m.checkNotNullParameter(view2, "p1"); int i2 = 2131365490; LoadingButton loadingButton = (LoadingButton) view2.findViewById(2131365490); if (loadingButton != null) { i2 = 2131365491; TextView textView = (TextView) view2.findViewById(2131365491); if (textView != null) { i2 = 2131365492; TextView textView2 = (TextView) view2.findViewById(2131365492); if (textView2 != null) { return new i5((LinearLayout) view2, loadingButton, textView, textView2); } } } throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2))); } } /* compiled from: WidgetUrgentMessageDialog.kt */ public static final class c extends o implements Function1 { public final /* synthetic */ r this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public c(r rVar) { super(1); this.this$0 = rVar; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kotlin.jvm.functions.Function1 public Unit invoke(v.d dVar) { v.d dVar2 = dVar; m.checkNotNullParameter(dVar2, "viewState"); r rVar = this.this$0; KProperty[] kPropertyArr = r.i; TextView textView = rVar.g().f107c; m.checkNotNullExpressionValue(textView, "binding.viewDialogConfirmationHeader"); textView.setText(rVar.getString(2131893727)); TextView textView2 = rVar.g().d; m.checkNotNullExpressionValue(textView2, "binding.viewDialogConfirmationText"); textView2.setText(rVar.getString(2131893726)); rVar.g().b.setText(rVar.getString(2131891666)); rVar.g().b.setIsLoading(dVar2.b); rVar.g().b.setOnClickListener(new s(rVar)); return Unit.a; } } /* compiled from: WidgetUrgentMessageDialog.kt */ public static final class d extends o implements Function1 { public final /* synthetic */ r this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public d(r rVar) { super(1); this.this$0 = rVar; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kotlin.jvm.functions.Function1 public Unit invoke(v.b bVar) { v.b bVar2 = bVar; m.checkNotNullParameter(bVar2, "event"); r rVar = this.this$0; KProperty[] kPropertyArr = r.i; Objects.requireNonNull(rVar); if (m.areEqual(bVar2, v.b.a.a)) { rVar.dismiss(); } else if (m.areEqual(bVar2, v.b.C0018b.a)) { c.a.d.o.g(rVar.getContext(), 2131890463, 0, null, 12); } else { throw new NoWhenBranchMatchedException(); } return Unit.a; } } /* compiled from: WidgetUrgentMessageDialog.kt */ public static final class e extends o implements Function0> { public static final e i = new e(); public e() { super(0); } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public AppViewModel mo1invoke() { return new v(null, null, null, 7); } } public r() { super(2131559256); e eVar = e.i; h0 h0Var = new h0(this); this.l = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(v.class), new m(1, h0Var), new j0(eVar)); } public final i5 g() { return (i5) this.k.getValue((Fragment) this, i[0]); } public final v h() { return (v) this.l.getValue(); } @Override // androidx.fragment.app.Fragment public void onDestroy() { StoreStream.Companion.getNotices().markDialogSeen("URGENT_MESSAGE_DIALOG"); super.onDestroy(); } @Override // com.discord.app.AppDialog public void onViewBound(View view) { m.checkNotNullParameter(view, "view"); super.onViewBound(view); setCancelable(false); ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(h().observeViewState(), this), r.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new c(this), 62, (Object) null); PublishSubject publishSubject = h().j; m.checkNotNullExpressionValue(publishSubject, "eventSubject"); ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(publishSubject, this), r.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new d(this), 62, (Object) null); } }