package com.bytedance.adsdk.ro.jnr;

import android.graphics.Color;
import android.graphics.Rect;
import android.util.JsonReader;
import androidx.media3.exoplayer.upstream.CmcdData;
import com.bytedance.adsdk.ro.lb.lb.jnr;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

/* JADX INFO: loaded from: classes.dex */
public class maa {

    /* JADX INFO: renamed from: com.bytedance.adsdk.ro.jnr.maa$1, reason: invalid class name */
    public static /* synthetic */ class AnonymousClass1 {
        static final /* synthetic */ int[] fm;

        static {
            int[] iArr = new int[jnr.ro.values().length];
            fm = iArr;
            try {
                iArr[jnr.ro.LUMA.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                fm[jnr.ro.LUMA_INVERTED.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
        }
    }

    public static com.bytedance.adsdk.ro.lb.lb.jnr fm(com.bytedance.adsdk.ro.wsy wsyVar) {
        Rect rectYz = wsyVar.yz();
        return new com.bytedance.adsdk.ro.lb.lb.jnr(Collections.emptyList(), wsyVar, "__container", -1L, jnr.fm.PRE_COMP, -1L, null, Collections.emptyList(), new com.bytedance.adsdk.ro.lb.fm.duv(), 0, 0, 0, 0.0f, 0.0f, rectYz.width(), rectYz.height(), null, null, Collections.emptyList(), jnr.ro.NONE, null, false, null, null);
    }

    public static com.bytedance.adsdk.ro.lb.lb.jnr fm(JsonReader jsonReader, com.bytedance.adsdk.ro.wsy wsyVar) throws IOException {
        ArrayList arrayList;
        jnr.ro roVar = jnr.ro.NONE;
        ArrayList arrayList2 = new ArrayList();
        ArrayList arrayList3 = new ArrayList();
        jsonReader.beginObject();
        Float fValueOf = Float.valueOf(0.0f);
        Float fValueOf2 = Float.valueOf(1.0f);
        jnr.ro roVar2 = roVar;
        jnr.fm fmVar = null;
        String strNextString = null;
        com.bytedance.adsdk.ro.lb.fm.duv duvVarFm = null;
        com.bytedance.adsdk.ro.lb.fm.vt vtVarAjl = null;
        com.bytedance.adsdk.ro.lb.fm.ku kuVarFm = null;
        com.bytedance.adsdk.ro.lb.fm.ro roVarFm = null;
        com.bytedance.adsdk.ro.lb.ro.fm fmVarFm = null;
        vt vtVarFm = null;
        long jNextInt = 0;
        int iFm = 0;
        int iFm2 = 0;
        int color = 0;
        boolean zNextBoolean = false;
        float fNextDouble = 0.0f;
        float fNextDouble2 = 0.0f;
        float fNextDouble3 = 0.0f;
        float fWsy = 0.0f;
        long jNextInt2 = -1;
        float fNextDouble4 = 1.0f;
        String strNextString2 = "UNSET";
        String strNextString3 = null;
        float fNextDouble5 = 0.0f;
        while (jsonReader.hasNext()) {
            String strNextName = jsonReader.nextName();
            strNextName.getClass();
            switch (strNextName) {
                case "parent":
                    jNextInt2 = jsonReader.nextInt();
                    break;
                case "shapes":
                    jsonReader.beginArray();
                    while (jsonReader.hasNext()) {
                        com.bytedance.adsdk.ro.lb.ro.lb lbVarFm = wu.fm(jsonReader, wsyVar);
                        if (lbVarFm != null) {
                            arrayList3.add(lbVarFm);
                        }
                    }
                    jsonReader.endArray();
                    break;
                case "h":
                    fNextDouble3 = (float) (jsonReader.nextDouble() * ((double) com.bytedance.adsdk.ro.ajl.ajl.fm()));
                    break;
                case "t":
                    jsonReader.beginObject();
                    while (jsonReader.hasNext()) {
                        String strNextName2 = jsonReader.nextName();
                        strNextName2.getClass();
                        if (strNextName2.equals(CmcdData.OBJECT_TYPE_AUDIO_ONLY)) {
                            jsonReader.beginArray();
                            if (jsonReader.hasNext()) {
                                kuVarFm = ro.fm(jsonReader, wsyVar);
                            }
                            while (jsonReader.hasNext()) {
                                jsonReader.skipValue();
                            }
                            jsonReader.endArray();
                        } else if (!strNextName2.equals("d")) {
                            jsonReader.skipValue();
                        } else {
                            vtVarAjl = yz.ajl(jsonReader, wsyVar);
                        }
                    }
                    jsonReader.endObject();
                    break;
                case "w":
                    fNextDouble2 = (float) (jsonReader.nextDouble() * ((double) com.bytedance.adsdk.ro.ajl.ajl.fm()));
                    break;
                case "cl":
                    strNextString3 = jsonReader.nextString();
                    break;
                case "ef":
                    jsonReader.beginArray();
                    ArrayList arrayList4 = new ArrayList();
                    while (jsonReader.hasNext()) {
                        jsonReader.beginObject();
                        while (jsonReader.hasNext()) {
                            String strNextName3 = jsonReader.nextName();
                            strNextName3.getClass();
                            if (strNextName3.equals("nm")) {
                                arrayList4.add(jsonReader.nextString());
                            } else if (!strNextName3.equals("ty")) {
                                jsonReader.skipValue();
                            } else {
                                int iNextInt = jsonReader.nextInt();
                                if (iNextInt == 29) {
                                    fmVarFm = jnr.fm(jsonReader, wsyVar);
                                } else if (iNextInt == 25) {
                                    vtVarFm = new ku().fm(jsonReader, wsyVar);
                                }
                            }
                        }
                        jsonReader.endObject();
                    }
                    jsonReader.endArray();
                    wsyVar.fm("Lottie doesn't support layer effects. If you are using them for  fills, strokes, trim paths etc. then try adding them directly as contents  in your shape. Found: ".concat(String.valueOf(arrayList4)));
                    break;
                case "hd":
                    zNextBoolean = jsonReader.nextBoolean();
                    break;
                case "ip":
                    fNextDouble5 = (float) jsonReader.nextDouble();
                    break;
                case "ks":
                    duvVarFm = lb.fm(jsonReader, wsyVar);
                    break;
                case "nm":
                    strNextString2 = jsonReader.nextString();
                    break;
                case "op":
                    fWsy = (float) jsonReader.nextDouble();
                    break;
                case "sc":
                    color = Color.parseColor(jsonReader.nextString());
                    break;
                case "sh":
                    iFm2 = (int) (com.bytedance.adsdk.ro.ajl.ajl.fm() * jsonReader.nextInt());
                    break;
                case "sr":
                    fNextDouble4 = (float) jsonReader.nextDouble();
                    break;
                case "st":
                    fNextDouble = (float) jsonReader.nextDouble();
                    break;
                case "sw":
                    iFm = (int) (com.bytedance.adsdk.ro.ajl.ajl.fm() * jsonReader.nextInt());
                    break;
                case "tm":
                    roVarFm = yz.fm(jsonReader, wsyVar, false);
                    break;
                case "tt":
                    int iNextInt2 = jsonReader.nextInt();
                    if (iNextInt2 >= jnr.ro.values().length) {
                        wsyVar.fm("Unsupported matte type: ".concat(String.valueOf(iNextInt2)));
                        break;
                    } else {
                        roVar2 = jnr.ro.values()[iNextInt2];
                        int i10 = AnonymousClass1.fm[roVar2.ordinal()];
                        if (i10 == 1) {
                            wsyVar.fm("Unsupported matte type: Luma");
                        } else if (i10 == 2) {
                            wsyVar.fm("Unsupported matte type: Luma Inverted");
                        }
                        wsyVar.fm(1);
                        break;
                    }
                    break;
                case "ty":
                    int iNextInt3 = jsonReader.nextInt();
                    fmVar = jnr.fm.UNKNOWN;
                    if (iNextInt3 >= fmVar.ordinal()) {
                        break;
                    } else {
                        fmVar = jnr.fm.values()[iNextInt3];
                        break;
                    }
                    break;
                case "ind":
                    jNextInt = jsonReader.nextInt();
                    break;
                case "refId":
                    strNextString = jsonReader.nextString();
                    break;
                case "masksProperties":
                    jsonReader.beginArray();
                    while (jsonReader.hasNext()) {
                        arrayList2.add(hlt.fm(jsonReader, wsyVar));
                    }
                    wsyVar.fm(arrayList2.size());
                    jsonReader.endArray();
                    break;
                default:
                    jsonReader.skipValue();
                    break;
            }
        }
        jsonReader.endObject();
        ArrayList arrayList5 = new ArrayList();
        if (fNextDouble5 > 0.0f) {
            arrayList = arrayList2;
            arrayList5.add(new com.bytedance.adsdk.ro.wsy.fm(wsyVar, fValueOf, fValueOf, null, 0.0f, Float.valueOf(fNextDouble5)));
        } else {
            arrayList = arrayList2;
        }
        if (fWsy <= 0.0f) {
            fWsy = wsyVar.wsy();
        }
        arrayList5.add(new com.bytedance.adsdk.ro.wsy.fm(wsyVar, fValueOf2, fValueOf2, null, fNextDouble5, Float.valueOf(fWsy)));
        arrayList5.add(new com.bytedance.adsdk.ro.wsy.fm(wsyVar, fValueOf, fValueOf, null, fWsy, Float.valueOf(Float.MAX_VALUE)));
        if (strNextString2.endsWith(".ai") || "ai".equals(strNextString3)) {
            wsyVar.fm("Convert your Illustrator layers to shape layers.");
        }
        return new com.bytedance.adsdk.ro.lb.lb.jnr(arrayList3, wsyVar, strNextString2, jNextInt, fmVar, jNextInt2, strNextString, arrayList, duvVarFm, iFm, iFm2, color, fNextDouble4, fNextDouble, fNextDouble2, fNextDouble3, vtVarAjl, kuVarFm, arrayList5, roVar2, roVarFm, zNextBoolean, fmVarFm, vtVarFm);
    }
}
