package com.bytedance.adsdk.ugeno.yz;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes.dex */
public class ajl {
    private fm fm;
    private List<fm> ro;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private boolean f6420lb = false;
    private int yz = 0;

    public static class fm {
        private Map<String, Object> ajl;
        private String fm;
        private Map<String, Object> jnr;

        /* JADX INFO: renamed from: lb, reason: collision with root package name */
        private String f6421lb = "global";
        private String ro;
        private String yz;

        public String fm() {
            return this.f6421lb;
        }

        public String jnr() {
            return this.ro;
        }

        public Map<String, Object> lb() {
            return this.jnr;
        }

        public String ro() {
            return this.yz;
        }

        public String toString() {
            return "Action{scheme='" + this.f6421lb + "', name='" + this.yz + "', params=" + this.jnr + ", host='" + this.ro + "', origin='" + this.fm + "', extra=" + this.ajl + '}';
        }

        public String yz() {
            return this.fm;
        }

        public void fm(String str) {
            this.f6421lb = str;
        }

        public void lb(String str) {
            this.fm = str;
        }

        public void ro(String str) {
            this.yz = str;
        }

        public void yz(String str) {
            this.ro = str;
        }

        public void fm(Map<String, Object> map) {
            this.jnr = map;
        }

        public void ro(Map<String, Object> map) {
            this.ajl = map;
        }
    }

    public fm fm() {
        return this.fm;
    }

    public boolean lb() {
        return this.f6420lb;
    }

    public List<fm> ro() {
        return this.ro;
    }

    public int yz() {
        return this.yz;
    }

    public static ajl fm(JSONObject jSONObject, JSONObject jSONObject2) {
        fm fmVarFm;
        if (jSONObject == null) {
            return null;
        }
        ajl ajlVar = new ajl();
        Object objOpt = jSONObject.opt("on");
        JSONArray jSONArrayOptJSONArray = jSONObject.optJSONArray("handlers");
        fm fmVarFm2 = objOpt instanceof String ? duv.fm((String) objOpt, jSONObject2) : objOpt instanceof JSONObject ? duv.fm((JSONObject) objOpt, jSONObject2) : null;
        if (fmVarFm2 != null) {
            ajlVar.fm = fmVarFm2;
        }
        if (jSONArrayOptJSONArray == null || jSONArrayOptJSONArray.length() <= 0) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (int i10 = 0; i10 < jSONArrayOptJSONArray.length(); i10++) {
            Object objOpt2 = jSONArrayOptJSONArray.opt(i10);
            if (objOpt2 instanceof String) {
                fm fmVarFm3 = duv.fm((String) objOpt2, jSONObject2);
                if (fmVarFm3 != null) {
                    arrayList.add(fmVarFm3);
                }
            } else if ((objOpt2 instanceof JSONObject) && (fmVarFm = duv.fm((JSONObject) objOpt2, jSONObject2)) != null) {
                arrayList.add(fmVarFm);
            }
        }
        ajlVar.ro = arrayList;
        if (jSONObject.has("delay")) {
            ajlVar.yz = com.bytedance.adsdk.ugeno.wsy.lb.fm(com.bytedance.adsdk.ugeno.lb.ro.fm(jSONObject.optString("delay"), jSONObject2), 0);
        }
        if (jSONObject.has("disable")) {
            ajlVar.f6420lb = com.bytedance.adsdk.ugeno.wsy.lb.fm(com.bytedance.adsdk.ugeno.lb.ro.fm(jSONObject.optString("disable"), jSONObject2), false);
        }
        return ajlVar;
    }
}
