2021-08-18 07:29:27 +00:00
|
|
|
package c.a.k.f;
|
2021-08-09 22:50:52 +00:00
|
|
|
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.webkit.URLUtil;
|
2021-08-18 07:29:27 +00:00
|
|
|
import c.a.k.a;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.discord.i18n.Hook;
|
|
|
|
import com.discord.i18n.RenderContext;
|
|
|
|
import com.discord.simpleast.core.node.Node;
|
2021-11-01 07:19:03 +00:00
|
|
|
import d0.z.d.m;
|
2021-08-09 22:50:52 +00:00
|
|
|
import java.util.List;
|
|
|
|
/* compiled from: HookNode.kt */
|
|
|
|
public final class c extends Node.a<RenderContext> {
|
|
|
|
public final String a;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public c(String str) {
|
|
|
|
super(new Node[0]);
|
|
|
|
m.checkNotNullParameter(str, "key");
|
|
|
|
this.a = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.simpleast.core.node.Node.a, com.discord.simpleast.core.node.Node
|
|
|
|
public void render(SpannableStringBuilder spannableStringBuilder, Object obj) {
|
|
|
|
List<Object> list;
|
|
|
|
RenderContext renderContext = (RenderContext) obj;
|
|
|
|
m.checkNotNullParameter(spannableStringBuilder, "builder");
|
|
|
|
m.checkNotNullParameter(renderContext, "renderContext");
|
|
|
|
Hook hook = renderContext.b.get(this.a);
|
|
|
|
int length = spannableStringBuilder.length();
|
|
|
|
super.render(spannableStringBuilder, renderContext);
|
|
|
|
Hook.a aVar = null;
|
2021-09-27 21:20:28 +00:00
|
|
|
CharSequence charSequence = hook != null ? hook.b : null;
|
|
|
|
if (charSequence != null) {
|
|
|
|
spannableStringBuilder.replace(length, spannableStringBuilder.length(), charSequence);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
if (!(hook == null || (list = hook.a) == null)) {
|
|
|
|
for (Object obj2 : list) {
|
|
|
|
spannableStringBuilder.setSpan(obj2, length, spannableStringBuilder.length(), 33);
|
|
|
|
}
|
|
|
|
}
|
2021-11-22 08:31:21 +00:00
|
|
|
Hook.a aVar2 = hook != null ? hook.f2133c : null;
|
2021-08-09 22:50:52 +00:00
|
|
|
if (aVar2 != null) {
|
|
|
|
aVar = aVar2;
|
|
|
|
} else if (URLUtil.isValidUrl(this.a)) {
|
|
|
|
a aVar3 = a.d;
|
2021-11-01 07:19:03 +00:00
|
|
|
aVar = new Hook.a(a.b.mo1invoke(), a.f202c);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
if (aVar != null) {
|
|
|
|
Integer num = aVar.a;
|
|
|
|
if (num == null) {
|
|
|
|
a aVar4 = a.d;
|
2021-11-01 07:19:03 +00:00
|
|
|
num = a.b.mo1invoke();
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
2021-08-18 07:29:27 +00:00
|
|
|
spannableStringBuilder.setSpan(new c.a.k.e.a(new b(this, aVar), num), length, spannableStringBuilder.length(), 33);
|
2021-08-09 22:50:52 +00:00
|
|
|
renderContext.g = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|