package defpackage;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/* renamed from: ᵡᵽᵝᵮ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3233 extends AbstractC1149 {

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final Object f12161;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final /* synthetic */ int f12162 = 4;

    public C3233(C1557 c1557) {
        super("internal.registerCallback");
        this.f12161 = c1557;
    }

    public C3233(C1601 c1601) {
        super("internal.eventLogger");
        this.f12161 = c1601;
    }

    public C3233(CallableC3294 callableC3294) {
        super("internal.appMetadata");
        this.f12161 = callableC3294;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C3233(C4417 c4417, C1557 c1557) {
        super("getValue");
        this.f12161 = c1557;
    }

    public C3233(C5246 c5246) {
        super("internal.logger");
        this.f12161 = c5246;
        this.f4912.put("log", new C5518(this, false, true));
        this.f4912.put("silent", new C4417(1, "silent"));
        ((AbstractC1149) this.f4912.get("silent")).mo1678("log", new C5518(this, true, true));
        this.f4912.put("unmonitored", new C4417(2, "unmonitored"));
        ((AbstractC1149) this.f4912.get("unmonitored")).mo1678("log", new C5518(this, false, false));
    }

    @Override // defpackage.AbstractC1149
    /* renamed from: ᵥᵯˎ */
    public final InterfaceC0401 mo1546(C0030 c0030, List list) {
        TreeMap treeMap;
        int i = this.f12162;
        String str = this.f4913;
        C3162 c3162 = InterfaceC0401.f2287;
        Object obj = this.f12161;
        String str2 = null;
        switch (i) {
            case 0:
                ᵭʝʜ.ˎˑː(str, 3, list);
                String strMo1609 = ((C0553) c0030.f1155).m2370(c0030, (InterfaceC0401) list.get(0)).mo1609();
                InterfaceC0401 interfaceC0401 = (InterfaceC0401) list.get(1);
                C0553 c0553 = (C0553) c0030.f1155;
                long j = (long) ᵭʝʜ.ﾞⁱ(c0553.m2370(c0030, interfaceC0401).mo1608().doubleValue());
                InterfaceC0401 interfaceC0401M2370 = c0553.m2370(c0030, (InterfaceC0401) list.get(2));
                HashMap map = interfaceC0401M2370 instanceof C0302 ? ᵭʝʜ.ᵡᵘˎʽ((C0302) interfaceC0401M2370) : new HashMap();
                C1601 c1601 = (C1601) obj;
                c1601.getClass();
                HashMap map2 = new HashMap();
                for (String str3 : map.keySet()) {
                    HashMap map3 = ((C4587) c1601.f6352).f17031;
                    map2.put(str3, C4587.m9733(str3, map3.containsKey(str3) ? map3.get(str3) : null, map.get(str3)));
                }
                ((ArrayList) c1601.f6354).add(new C4587(strMo1609, j, map2));
                return c3162;
            case 1:
                ᵭʝʜ.ˎˑː("getValue", 2, list);
                InterfaceC0401 interfaceC0401M23702 = ((C0553) c0030.f1155).m2370(c0030, (InterfaceC0401) list.get(0));
                InterfaceC0401 interfaceC0401M23703 = ((C0553) c0030.f1155).m2370(c0030, (InterfaceC0401) list.get(1));
                String strMo16092 = interfaceC0401M23702.mo1609();
                C1557 c1557 = (C1557) obj;
                Map map4 = (Map) ((C3245) c1557.f6204).f12220.get((String) c1557.f6205);
                if (map4 != null && map4.containsKey(strMo16092)) {
                    str2 = (String) map4.get(strMo16092);
                }
                return str2 != null ? new C3470(str2) : interfaceC0401M23703;
            case 2:
                return c3162;
            case 3:
                try {
                    return ˆᴵ.ˎˑː(((CallableC3294) obj).call());
                } catch (Exception unused) {
                    return c3162;
                }
            default:
                ᵭʝʜ.ˎˑː(str, 3, list);
                ((C0553) c0030.f1155).m2370(c0030, (InterfaceC0401) list.get(0)).mo1609();
                InterfaceC0401 interfaceC04012 = (InterfaceC0401) list.get(1);
                C0553 c05532 = (C0553) c0030.f1155;
                InterfaceC0401 interfaceC0401M23704 = c05532.m2370(c0030, interfaceC04012);
                if (interfaceC0401M23704 instanceof C3456) {
                    InterfaceC0401 interfaceC0401M23705 = c05532.m2370(c0030, (InterfaceC0401) list.get(2));
                    if (interfaceC0401M23705 instanceof C0302) {
                        C0302 c0302 = (C0302) interfaceC0401M23705;
                        HashMap map5 = c0302.f1936;
                        if (map5.containsKey("type")) {
                            String strMo16093 = c0302.mo1677("type").mo1609();
                            int iIntValue = map5.containsKey("priority") ? ᵭʝʜ.ˁˑᵰ(c0302.mo1677("priority").mo1608().doubleValue()) : 1000;
                            C1557 c15572 = (C1557) obj;
                            C3456 c3456 = (C3456) interfaceC0401M23704;
                            c15572.getClass();
                            if ("create".equals(strMo16093)) {
                                treeMap = (TreeMap) c15572.f6204;
                            } else if ("edit".equals(strMo16093)) {
                                treeMap = (TreeMap) c15572.f6205;
                            } else {
                                ᵹˉᵞ.ᵳٴᵶ("Unknown callback type: ".concat(String.valueOf(strMo16093)));
                            }
                            if (treeMap.containsKey(Integer.valueOf(iIntValue))) {
                                iIntValue = ((Integer) treeMap.lastKey()).intValue() + 1;
                            }
                            treeMap.put(Integer.valueOf(iIntValue), c3456);
                            return c3162;
                        }
                        ᵹˉᵞ.ˌᵜᵹᵩ("Undefined rule type");
                    } else {
                        ᵹˉᵞ.ˌᵜᵹᵩ("Invalid callback params");
                    }
                } else {
                    ᵹˉᵞ.ˌᵜᵹᵩ("Invalid callback type");
                }
                return null;
        }
    }
}
