导航菜单

页面标题

页面副标题

Tasker v6.5.11 - a.java 源代码

正在查看: Tasker v6.5.11 应用的 a.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.joaomgcd.oldtaskercompat.aigenerator;

import android.content.Context;
import com.joaomgcd.tasker2024.edittask.repository.RepositoryEditTask;
import com.joaomgcd.taskerm.inputoutput.TaskerOutputBase;
import com.joaomgcd.taskerm.util.a6;
import com.joaomgcd.taskerm.util.g8;
import com.joaomgcd.taskerm.util.k8;
import com.joaomgcd.taskerm.util.o8;
import com.joaomgcd.taskerm.util.x2;
import com.joaomgcd.taskerm.util.z5;
import java.io.File;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import jk.d1;
import jk.j0;
import jk.n0;
import jk.o0;
import kg.o;
import kotlin.Pair;
import kotlin.collections.k0;
import kotlin.collections.r;
import lj.e0;
import lj.s;
import net.dinglisch.android.taskerm.a1;
import net.dinglisch.android.taskerm.i2;
import net.dinglisch.android.taskerm.j2;
import net.dinglisch.android.taskerm.jn;
import net.dinglisch.android.taskerm.nn;
import net.dinglisch.android.taskerm.on;
import net.dinglisch.android.taskerm.r7;
import net.dinglisch.android.taskerm.z0;
import yj.p;
import yj.q;

public final class a {
    public static final e a = new e(null);
    private static final TimeUnit b = TimeUnit.MINUTES;
    private static final b<Context, String> c = new b<>((String) null, new f(null), 1, (yj.h) null);

    public static final class C0066a {

        @nc.c("a")
        private final List<b> a;

        public C0066a(List<b> list) {
            p.i(list, "actions");
            this.a = list;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            return (obj instanceof C0066a) && p.d(this.a, ((C0066a) obj).a);
        }

        public int hashCode() {
            return this.a.hashCode();
        }

        public String toString() {
            return "ActionCatalog(actions=" + this.a + ")";
        }
    }

    public static final class c {

        @nc.c("b")
        private final List<n> a;

        public c(List<n> list) {
            p.i(list, "builtInVariables");
            this.a = list;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            return (obj instanceof c) && p.d(this.a, ((c) obj).a);
        }

        public int hashCode() {
            return this.a.hashCode();
        }

        public String toString() {
            return "BuiltInVariableCatalog(builtInVariables=" + this.a + ")";
        }
    }

    public static final class d {

        @nc.c("s")
        private final String a;

        @nc.c("m")
        private final String b;

        @nc.c("i")
        private final List<C0067a> c;

        public static final class C0067a {

            @nc.c("d")
            private final String a;

            @nc.c("t")
            private final String b;

            @nc.c("x")
            private final String c;

            @nc.c("o")
            private final List<String> d;

            public static final class C0068a {
            }

            public final C0068a a() {
                return null;
            }

            public final String b() {
                return this.c;
            }

            public final String c() {
                return this.b;
            }

            public final String d() {
                return this.a;
            }

            public final List<String> e() {
                return this.d;
            }

            public boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof C0067a)) {
                    return false;
                }
                C0067a c0067a = (C0067a) obj;
                return p.d(this.a, c0067a.a) && p.d(this.b, c0067a.b) && p.d(this.c, c0067a.c) && p.d((Object) null, (Object) null) && p.d(this.d, c0067a.d);
            }

            public int hashCode() {
                int hashCode = this.a.hashCode() * 31;
                String str = this.b;
                int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
                String str2 = this.c;
                int hashCode3 = (hashCode2 + (str2 == null ? 0 : str2.hashCode())) * 961;
                List<String> list = this.d;
                return hashCode3 + (list != null ? list.hashCode() : 0);
            }

            public String toString() {
                return "MissingInfoItem(dialogType=" + this.a + ", dialogTitle=" + this.b + ", dialogText=" + this.c + ", context=" + ((Object) null) + ", options=" + this.d + ")";
            }
        }

        public final String a() {
            return this.b;
        }

        public final List<C0067a> b() {
            return this.c;
        }

        public final String c() {
            return this.a;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof d)) {
                return false;
            }
            d dVar = (d) obj;
            return p.d(this.a, dVar.a) && p.d(this.b, dVar.b) && p.d(this.c, dVar.c);
        }

        public int hashCode() {
            return (((this.a.hashCode() * 31) + this.b.hashCode()) * 31) + this.c.hashCode();
        }

        public String toString() {
            return "ClarificationResponse(status=" + this.a + ", messageToUser=" + this.b + ", missingInfo=" + this.c + ")";
        }
    }

    public static final class e {

        public class C0069a {
            public static final int[] a;

            static {
                int[] iArr = new int[com.joaomgcd.oldtaskercompat.aigenerator.ui.n.values().length];
                try {
                    iArr[com.joaomgcd.oldtaskercompat.aigenerator.ui.n.i.ordinal()] = 1;
                } catch (NoSuchFieldError unused) {
                }
                try {
                    iArr[com.joaomgcd.oldtaskercompat.aigenerator.ui.n.q.ordinal()] = 2;
                } catch (NoSuchFieldError unused2) {
                }
                a = iArr;
            }
        }

        @qj.f(c = "com.joaomgcd.oldtaskercompat.aigenerator.AIGenerator$Companion", f = "AIGenerator.kt", l = {336, 338, 347}, m = "generateWithAI")
        static final class b extends qj.d {
            Object s;
            Object t;
            Object u;
            Object v;
            float w;
            Object x;
            int z;

            b(oj.d<? super b> dVar) {
                super(dVar);
            }

            public final Object r(Object obj) {
                this.x = obj;
                this.z |= Integer.MIN_VALUE;
                return e.this.b(null, null, null, null, null, this);
            }
        }

        @qj.f(c = "com.joaomgcd.oldtaskercompat.aigenerator.AIGenerator$Companion", f = "AIGenerator.kt", l = {659}, m = "getSystemInstructions")
        static final class c extends qj.d {
            Object s;
            int u;

            c(oj.d<? super c> dVar) {
                super(dVar);
            }

            public final Object r(Object obj) {
                this.s = obj;
                this.u |= Integer.MIN_VALUE;
                return e.this.d(null, this);
            }
        }

        public e(yj.h hVar) {
            this();
        }

        public final Object a(Context context, oj.d<? super e0> dVar) {
            b bVar = a.c;
            Context applicationContext = context.getApplicationContext();
            p.h(applicationContext, "getApplicationContext(...)");
            Object g = bVar.g(applicationContext, dVar);
            return g == pj.b.c() ? g : e0.a;
        }

        public final java.lang.Object b(android.content.Context r20, java.util.List<com.joaomgcd.oldtaskercompat.aigenerator.ui.ChatMessage> r21, java.lang.String r22, java.lang.String r23, com.joaomgcd.oldtaskercompat.aigenerator.b r24, oj.d<? super java.lang.String> r25) {
            throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.oldtaskercompat.aigenerator.a.e.b(android.content.Context, java.util.List, java.lang.String, java.lang.String, com.joaomgcd.oldtaskercompat.aigenerator.b, oj.d):java.lang.Object");
        }

        public final java.lang.Object d(android.content.Context r7, oj.d<? super java.lang.String> r8) {
            throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.oldtaskercompat.aigenerator.a.e.d(android.content.Context, oj.d):java.lang.Object");
        }

        public final TimeUnit e() {
            return a.b;
        }

        public final void f() {
            a.c.f();
        }

        private e() {
        }
    }

    @qj.f(c = "com.joaomgcd.oldtaskercompat.aigenerator.AIGenerator$Companion$instructionsComputation$1", f = "AIGenerator.kt", l = {450}, m = "invokeSuspend")
    static final class f extends qj.l implements xj.p<Context, oj.d<? super String>, Object> {
        int t;
        Object u;

        @qj.f(c = "com.joaomgcd.oldtaskercompat.aigenerator.AIGenerator$Companion$instructionsComputation$1$1", f = "AIGenerator.kt", l = {}, m = "invokeSuspend")
        static final class C0070a extends qj.l implements xj.p<n0, oj.d<? super String>, Object> {
            int t;
            private Object u;
            final Context v;

            static final class C0071a extends q implements xj.a<Boolean> {
                final Context i;
                final String q;

                C0071a(Context context, String str) {
                    super(0);
                    this.i = context;
                    this.q = str;
                }

                public final Boolean invoke() {
                    File B = g8.B("Tasker/instructions.txt");
                    if (B == null) {
                        throw new RuntimeException("Invalid local path");
                    }
                    OutputStream d0 = jf.a.b(this.i, B, true).d0("text/plain", false);
                    OutputStreamWriter outputStreamWriter = d0 != null ? new OutputStreamWriter(d0, hk.d.b) : null;
                    if (outputStreamWriter != null) {
                        outputStreamWriter.write(this.q);
                    }
                    if (outputStreamWriter != null) {
                        return Boolean.valueOf(x2.h0(outputStreamWriter));
                    }
                    return null;
                }
            }

            static final class b extends q implements xj.a<pe.d<?, ?, ?, ?, ?>> {
                final int i;

                b(int i) {
                    super(0);
                    this.i = i;
                }

                public final pe.d<?, ?, ?, ?, ?> invoke() {
                    return C0070a.C(this.i);
                }
            }

            static final class c extends q implements xj.l<jn, Boolean> {
                public static final c i = new c();

                c() {
                    super(1);
                }

                public final Boolean invoke(jn jnVar) {
                    p.i(jnVar, "it");
                    return Boolean.valueOf(jnVar.r() != 2131891151);
                }
            }

            static final class d extends q implements xj.l<jn, h> {
                final String i;
                final Context q;
                final n0 r;

                static final class C0072a extends q implements xj.a<pe.d<?, ?, ?, ?, ?>> {
                    final int i;

                    C0072a(int i) {
                        super(0);
                        this.i = i;
                    }

                    public final pe.d<?, ?, ?, ?, ?> invoke() {
                        return C0070a.D(this.i);
                    }
                }

                d(String str, Context context, n0 n0Var) {
                    super(1);
                    this.i = str;
                    this.q = context;
                    this.r = n0Var;
                }

                public final h invoke(jn jnVar) {
                    p.i(jnVar, "it");
                    int p = jnVar.p();
                    boolean d = p.d(this.i, "Event");
                    if.a d2 = d ? if.d.i.d(p) : null;
                    return new h(p, x2.Q4(jnVar.r(), this.q, new Object[0]), C0070a.F(jnVar, this.r, this.q, null, 4, null), d2 != null ? d2.a() : null, null, !d ? null : C0070a.J(this.q, new C0072a(p)), 16, null);
                }
            }

            static final class e extends q implements xj.l<Throwable, String[]> {
                final Integer i;
                final int q;
                final int r;

                e(Integer num, int i, int i2) {
                    super(1);
                    this.i = num;
                    this.q = i;
                    this.r = i2;
                }

                public final String[] invoke(Throwable th) {
                    p.i(th, "it");
                    r7.f("AIGenerator", "Invalid spinner array for action code " + this.i + " arg " + this.q + ": " + this.r);
                    return null;
                }
            }

            static final class C0073f extends q implements xj.a<String[]> {
                final Context i;
                final int q;

                C0073f(Context context, int i) {
                    super(0);
                    this.i = context;
                    this.q = i;
                }

                public final String[] invoke() {
                    return this.i.getResources().getStringArray(this.q);
                }
            }

            static final class g extends q implements xj.p<Integer, Integer, Pair<? extends String, ? extends Integer>> {
                final Context i;

                g(Context context) {
                    super(2);
                    this.i = context;
                }

                public final Pair<String, Integer> a(int i, int i2) {
                    return new Pair<>(x2.Q4(i2, this.i, new Object[0]), Integer.valueOf(i));
                }

                public Object l(Object obj, Object obj2) {
                    return a(((Number) obj).intValue(), ((Number) obj2).intValue());
                }
            }

            C0070a(Context context, oj.d<? super C0070a> dVar) {
                super(2, dVar);
                this.v = context;
            }

            private static final xj.l<jn, h> B(n0 n0Var, Context context, String str) {
                o0.h(n0Var);
                return new d(str, context, n0Var);
            }

            public static final xd.a<?, ?, ?> C(int i) {
                return xd.d.f().z(i);
            }

            public static final ze.b<?, ?, ?, ?> D(int i) {
                return ze.h.b().k(i);
            }

            private static final com.joaomgcd.oldtaskercompat.aigenerator.a.l E(net.dinglisch.android.taskerm.jn r21, jk.n0 r22, android.content.Context r23, java.lang.Integer r24) {
                throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.oldtaskercompat.aigenerator.a.f.C0070a.E(net.dinglisch.android.taskerm.jn, jk.n0, android.content.Context, java.lang.Integer):com.joaomgcd.oldtaskercompat.aigenerator.a$l");
            }

            static l F(jn jnVar, n0 n0Var, Context context, Integer num, int i, Object obj) {
                if ((i & 4) != 0) {
                    num = null;
                }
                return E(jnVar, n0Var, context, num);
            }

            private static final Map<String, Integer> H(Context context, int i, int i2) {
                String[] P0 = a1.P0(context.getResources(), i, i2, (net.dinglisch.android.taskerm.c) null);
                if (P0 == null) {
                    return null;
                }
                ArrayList arrayList = new ArrayList(P0.length);
                int length = P0.length;
                int i3 = 0;
                int i4 = 0;
                while (i3 < length) {
                    arrayList.add(new Pair(P0[i3], Integer.valueOf(i4)));
                    i3++;
                    i4++;
                }
                return k0.n(arrayList);
            }

            public static final k J(Context context, xj.a<? extends pe.d<?, ?, ?, ?, ?>> aVar) {
                com.joaomgcd.taskerm.inputoutput.a aVar2;
                pe.d dVar = (pe.d) aVar.invoke();
                if (dVar == null) {
                    return null;
                }
                Object q = dVar.q();
                List r = o8.r(q.getClass(), uf.b.class);
                ArrayList arrayList = new ArrayList(r.v(r, 10));
                Iterator it = r.iterator();
                while (it.hasNext()) {
                    arrayList.add(new a6(q, (z5) it.next()));
                }
                com.joaomgcd.taskerm.inputoutput.a<uf.e> aVar3 = new com.joaomgcd.taskerm.inputoutput.a();
                Iterator it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    Object f = ((a6) it2.next()).f();
                    if (f instanceof Class) {
                        aVar2 = new com.joaomgcd.taskerm.inputoutput.a();
                        TaskerOutputBase.add$default(aVar2, context, (Class) f, (Object) null, (xj.l) null, false, (ArrayList) null, 60, (Object) null);
                    } else if (f instanceof com.joaomgcd.taskerm.inputoutput.a) {
                        aVar2 = (com.joaomgcd.taskerm.inputoutput.a) f;
                        dVar.a(context, q, aVar2);
                    } else {
                        aVar2 = null;
                    }
                    if (aVar2 != null) {
                        aVar3.addAll(aVar2);
                    }
                }
                ArrayList arrayList2 = new ArrayList(r.v(aVar3, 10));
                for (uf.e eVar : aVar3) {
                    arrayList2.add(new n("%" + eVar.b(), eVar.k()));
                }
                if (arrayList2.isEmpty()) {
                    return null;
                }
                return new k(arrayList2);
            }

            public final Object l(n0 n0Var, oj.d<? super String> dVar) {
                return k(n0Var, dVar).r(e0.a);
            }

            public final oj.d<e0> k(Object obj, oj.d<?> dVar) {
                C0070a c0070a = new C0070a(this.v, dVar);
                c0070a.u = obj;
                return c0070a;
            }

            public final Object r(Object obj) {
                pj.b.c();
                if (this.t != 0) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s.b(obj);
                n0 n0Var = (n0) this.u;
                c cVar = c.i;
                i2[] P = j2.P();
                p.h(P, "getSpecs(...)");
                ArrayList arrayList = new ArrayList();
                for (i2 i2Var : P) {
                    if (((Boolean) cVar.invoke(i2Var)).booleanValue()) {
                        arrayList.add(i2Var);
                    }
                }
                nn[] C = on.C();
                p.h(C, "getSpecs(...)");
                ArrayList arrayList2 = new ArrayList();
                for (nn nnVar : C) {
                    if (((Boolean) cVar.invoke(nnVar)).booleanValue()) {
                        arrayList2.add(nnVar);
                    }
                }
                z0[] A0 = a1.A0();
                p.h(A0, "getSpecs(...)");
                ArrayList arrayList3 = new ArrayList();
                for (z0 z0Var : A0) {
                    if (((Boolean) cVar.invoke(z0Var)).booleanValue()) {
                        arrayList3.add(z0Var);
                    }
                }
                xj.l<jn, h> B = B(n0Var, this.v, "Event");
                ArrayList arrayList4 = new ArrayList(r.v(arrayList, 10));
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    arrayList4.add(B.invoke(it.next()));
                }
                ArrayList arrayList5 = new ArrayList();
                for (Object obj2 : arrayList4) {
                    if (!x2.e0(qj.b.d(((h) obj2).a()), new Object[]{qj.b.d(462)})) {
                        arrayList5.add(obj2);
                    }
                }
                g gVar = new g(arrayList5);
                xj.l<jn, h> B2 = B(n0Var, this.v, "State");
                ArrayList arrayList6 = new ArrayList(r.v(arrayList2, 10));
                Iterator it2 = arrayList2.iterator();
                while (it2.hasNext()) {
                    arrayList6.add(B2.invoke(it2.next()));
                }
                g gVar2 = new g(arrayList6);
                ArrayList arrayList7 = new ArrayList();
                for (Object obj3 : arrayList3) {
                    z0 z0Var2 = (z0) obj3;
                    if (!x2.e0(qj.b.d(z0Var2.p()), new Object[]{qj.b.d(254), qj.b.d(143)}) && z0Var2.o() != 102) {
                        arrayList7.add(obj3);
                    }
                }
                Context context = this.v;
                ArrayList arrayList8 = new ArrayList(r.v(arrayList7, 10));
                Iterator it3 = arrayList7.iterator();
                while (true) {
                    String str = null;
                    if (!it3.hasNext()) {
                        break;
                    }
                    z0 z0Var3 = (z0) it3.next();
                    o0.h(n0Var);
                    int p = z0Var3.p();
                    k J = J(context, new b(p));
                    if.a a = if.d.i.a(p);
                    if (a != null) {
                        str = a.a();
                    }
                    String Q4 = x2.Q4(z0Var3.r(), context, new Object[0]);
                    p.f(z0Var3);
                    arrayList8.add(new b(p, Q4, E(z0Var3, n0Var, context, qj.b.d(p)), str, null, J, 16, null));
                }
                C0066a c0066a = new C0066a(arrayList8);
                List<o> b2 = o.F.b();
                Context context2 = this.v;
                ArrayList arrayList9 = new ArrayList(r.v(b2, 10));
                for (o oVar : b2) {
                    o0.h(n0Var);
                    arrayList9.add(new j(oVar.u(), x2.Q4(oVar.G(), context2, new Object[0]), oVar.toString(), oVar.t()));
                }
                i iVar = new i(arrayList9);
                List<RepositoryEditTask.z> a2 = RepositoryEditTask.z.i.a(this.v);
                ArrayList arrayList10 = new ArrayList(r.v(a2, 10));
                for (RepositoryEditTask.z zVar : a2) {
                    arrayList10.add(new n(zVar.f(), zVar.d()));
                }
                c cVar2 = new c(arrayList10);
                o0.h(n0Var);
                String i1 = x2.i1(gVar);
                p.h(i1, "<get-json>(...)");
                String C2 = hk.o.C("## System Instructions for Tasker AI Generator\n\n**Core Goal:** Translate user's natural language requests into valid Tasker XML that Tasker can successfully import. This includes **autonomously determining** whether the request best maps to a **Tasker Profile** (automation based on context), a standalone **Task** (manually triggered sequence), or a **Project** (a container for multiple Profiles and/or named Tasks). Generation must include the correct use of Tasker variables (built-in, context-generated, action-generated, user-defined, **arrays, and structured variables**) to chain data between contexts, actions, and user input, **with a strong emphasis on creating reusable named Tasks within Projects to avoid redundancy.**\n\n**Data Definitions:**\n\n1.  **Event Context Catalog Data:**\n    *   JSON defining available Tasker **Event** Contexts. Used for **Profiles**.\n    *   Each object in this JSON represents one Event context and does NOT contain a `type` field.\n    *   For each parameter within an Event context definition, the `dialog_type_id` field is **OPTIONAL**. If provided, it dictates the required input dialog type. If omitted, you (the AI) must infer the type.\n    *   Each Event Context object MAY include an additional key `\"output_variable_list\"` containing an array of objects `{{\"name\": \"%varname\", \"description\": \"...\"}}`. Each object defines a variable the context makes available. The `name` MUST be the exact Tasker variable name.\n    *   **CRITICAL EVENT DETAIL:** Regardless of `output_variable_list`, **ALL Event Contexts** defined in this catalog implicitly generate built-in variables `%evtprm1`, `%evtprm2`, ... corresponding sequentially to ALL their input parameters listed in the `parameter_catalog` (`p.p` array), starting from the first parameter in the list (often the Bundle with `u: 0`). **Therefore, the parameter with `u: 0` corresponds to `%evtprm1`, the parameter with `u: 1` corresponds to `%evtprm2`, the parameter with `u: 2` corresponds to `%evtprm3`, and so on.** You **MUST** use this sequential mapping based on the parameter list order, not just the `u` value directly. You **MUST** know these variables are always available and form a **Variable Array** named `%evtprm`.\n    *   `<<INJECT_EVENT_CONTEXT_CATALOG_JSON>>`\n\n2.  **State Context Catalog Data:**\n    *   JSON defining available Tasker **State** Contexts. Used for **Profiles**.\n    *   Each object in this JSON represents one State context and does NOT contain a `type` field.\n    *   For each parameter within a State context definition, the `dialog_type_id` field is **OPTIONAL**. If provided, it dictates the required input dialog type. If omitted, you (the AI) must infer the type.\n    *   Each State Context object MAY include an additional key `\"output_variable_list\"` containing an array of objects `{{\"name\": \"%varname\", \"description\": \"...\"}}` defining variables the context makes available. The `name` MUST be the exact Tasker variable name. (State contexts do **not** implicitly generate `%evtprm` variables).\n    *   `<<INJECT_STATE_CONTEXT_CATALOG_JSON>>`\n\n3.  **Action Catalog Data:**\n    *   JSON defining available Tasker Actions. Used for **Tasks** (standalone, anonymous within Profiles, or named within Projects).\n    *   For each parameter, the `dialog_type_id` field is **OPTIONAL**. If provided, it dictates the required input dialog type. If omitted, you must infer the type.\n    *   **CRITICAL FORMAT ADHERENCE:** For any action parameter where a specific input format is described in its catalog entry (e.g., for HTTP Request Query Parameters, or specific date/time patterns), you **MUST** strictly adhere to that specified format when generating the value for the corresponding XML argument. Do not assume default web/common formats if Tasker specifies otherwise.\n    *   Action objects MAY include `\"output_variable_list\"`: an array of objects `{{\"name\": \"%varname\", \"description\": \"...\"}}` defining explicitly named output variables produced *after* the action runs. The `name` MUST be the exact Tasker variable name. (This is the \"New Style\"). Some actions explicitly output **Variable Arrays** (e.g., `List Files`).\n    *   Some older Actions do NOT use `output_variable_list`. Instead, they have specific **input parameters** (identified by names like \"Store Result In\", \"To Var\", \"**Variable Array**\", \"Return Value Variable\", \"Read Result To\", \"Output Variable Name\", etc.) whose **value** is the **name** of the variable the user wants the action's result stored into. You must identify these specific parameters within an action's `parameter_catalog` and understand that the user needs to provide the desired output variable name as the value for **that specific input parameter**. (This is the \"Old Style\"). This output can be a simple variable or a **Variable Array**. **Crucially, you must know the standard output variables for common dialog actions:**\n    *   `List Dialog` (code 378): `%ld_selected` (single choice item), `%ld_button` (button label if pressed), `%ld_selected_indices` (indices for multiple choice).\n    *   `Input Dialog` (code 360): The variable name specified in the 'Output Variable Name' parameter (arg8), or `%input` if arg8 is empty.\n    *   `Pick Input Dialog` (code 390): The result is **always** available in the variable `%input`. This dialog does not use a parameter to set a custom output variable name; rely on `%input` ONLY!\n    *   `Text/Image Dialog` (code 377): `%td_button` (label of button pressed).\n    *   Use these specific variables to retrieve user input from dialogs.\n    *   The `Bundle` parameter often named \"Output Variables\" (e.g., u: 0 or arg0 in XML) is typically for Tasker's internal configuration and SHOULD NOT be interpreted as the list of usable output variables like %http_data. Use the dedicated output_variable_list (New Style) or the \"Old Style\" input parameters instead for determining usable output variables. **However, if such a Bundle parameter is listed in a component's catalog parameter_catalog (p.p array), it MUST still be generated in the XML as its corresponding sequential argument (e.g., as <Bundle sr=\"arg0\">...</Bundle> if it's the first parameter in the catalog), even if it's primarily for internal use or appears empty. It contributes to the strict sequential mapping of all cataloged parameters to XML arguments.**\n    *   **Interpreting Parameter 's' Field:** **CRITICAL ADHERENCE TO `s` FIELD CONSTRAINTS: The AI MUST meticulously analyze and strictly adhere to any constraints or format specifications provided in the `\\\"s\\\"` field for every parameter in the Event, State, and Action catalogs. This is especially vital for numeric parameters where `\\\"s\\\"` often defines a `MIN:MAX:DEFAULT` range (e.g., `\\\"1:999999\\\"`). The AI MUST ensure generated values fall within the specified MIN/MAX inclusive range and conform to any other formatting rules implied by `\\\"s\\\"`. Failure to respect these `\\\"s\\\"` field constraints will lead to invalid Tasker configurations.**\\nWithin the `parameter_catalog` (`p` array within the `p` object) for Events, States, and Actions, the `\\\"s\\\"` field provides additional context about the expected input. Common formats include:\n    *   `\"t:LINES:?\"`: Indicates a text input (`t`). `LINES` is the number of lines expected (e.g., `1`, `5`, `999`). The trailing `?` signifies the parameter is optional.\n    *   `\"MIN:MAX:DEFAULT\"`: Used for integer inputs, specifying the minimum allowed value, maximum allowed value, and the default value (e.g., `0:100:50`).\n    *   `\"PREFIX:...\"`: Many other prefixes indicate specialized string input types (e.g., `\"f\"` for file path, `\"uvar\"` for user variable name (it's a normal String input that expects a value starting with %), `\"var\"` for any variable name  (it's a String input that expects a value starting with %), `\"col\"` for color, `\"m\"` for Task name, `\"prof\"` for Profile name, `\"locradi\"` for location+radius, `\"bosta\"` for structured output toggle, `\"inpval\"` for a value that can contain variables, etc.). These prefixes can provide hints for validation and may assist in inferring the appropriate `dialog_type_id` if one is not explicitly provided.\n    *   **CRITICAL STRUCTURED OUTPUT DETAIL:** Actions like `HTTP Request`, `Variable Set`, `Read File`, `Read Line` etc., MAY have a parameter option like **\"Structured Output\"** (often indicated by `bosta` in the `s` field, or named explicitly). When this option is enabled (typically by setting its corresponding XML argument value to `1`), if the variable populated by this action contains valid JSON, HTML/XML, or CSV content, Tasker allows **Structured Variable** access (see section 12). **The AI MUST explicitly plan to enable this parameter in the relevant action if it intends to use structured access syntax on the resulting variable later in the Task.**\n    *   `<<INJECT_ACTION_CATALOG_JSON>>`\n\n4.  **Tasker XML Schema Definition:**\n    *   Schema for the Tasker **TaskerData** root element, defining the overall structure allowing Projects, Profiles, and Tasks.\n    *   `<<INJECT_TASKER_XML_SCHEMA_DEFINITION>>`\n\n5.  **Tasker Profile XML Structure Description:**\n    *   Textual description of the required XML structure when generating a **Profile** (i.e., `<TaskerData>` containing `<Profile>` and associated anonymous `<Task>`). Emphasizes direct children for conditions/actions and **anonymous nature of entry/exit tasks within this structure.**\n    *   `<<INJECT_TASKER_PROFILE_XML_STRUCTURE_DESCRIPTION>>`\n\n6.  **Tasker Standalone Task XML Structure Description:**\n    *   Textual description of the required XML structure when generating a **Standalone Task** (i.e., `<TaskerData>` contains only `<Task>`, and the `<Task>` element **must** include `<nme>`).\n    *   `<<INJECT_TASKER_TASK_XML_STRUCTURE_DESCRIPTION>>`\n\n7.  **Tasker Project XML Structure Description:**\n    *   Textual description of the required XML structure when generating a **Project** (i.e., `<TaskerData>` contains `<Profile>`(s), `<Task>`(s), and one `<Project>` tag linking them). **Crucially distinguishes between required `<nme>` for named/reusable tasks vs. forbidden `<nme>` for anonymous profile tasks within this structure.**\n    *   `<<INJECT_TASKER_PROJECT_XML_STRUCTURE_DESCRIPTION>>`\n\n8.  **Tasker XML Examples:**\n    *   Complete, valid examples of Tasker XML for **Profiles**, standalone **Tasks**, and **Projects**. (Ensure provided Task/Project examples are included here).\n    *   `<<INJECT_TASKER_XML_EXAMPLES>>`\n\n9.  **Clarification JSON Schema:**\n    *   The required JSON schema for clarification responses.\n    *   `<<INJECT_CLARIFICATION_JSON_SCHEMA_DEFINITION>>`\n\n10. **Tasker Input Dialog Types Catalog JSON:**\n    *   A JSON object `{{\"dialog_types\": [...]}}` defining valid dialog types, each with an `id` (i), `name` (n), `name for Pick Input Dialog` (nd) and `format info` (f). Used for validation and inference. **The identifier 't' MUST exist and represents basic text input.**\n    *   `<<INJECT_TASKER_INPUT_DIALOG_TYPES_CATALOG_JSON>>`\n\n11. **Built-in Variable Catalog:**\n    *   A JSON object defining common Tasker built-in variables available globally.\n    *   `<<INJECT_BUILT_IN_VARIABLES_CATALOG_JSON>>`\n\n12. **Tasker Variable Types & Structures:**\n    *   Beyond simple variables, Tasker supports Variable Arrays and Structured Variable access.\n    *   **Fundamental Variable Types:** It is crucial to distinguish between **single-value variables** (e.g., `%my_variable`, `%HTTPD`, `%TIME`) which hold one piece of data, and **Variable Arrays** (e.g., `%array()`, `%evtprm()`) which represent an ordered list of values accessed via indices or specific syntax. Tasker's handling and available operations differ significantly between these types.\n    *   **Variable Arrays:**\n        *   **Concept:** Pseudo-arrays using a base name followed by numbers (e.g., `%arr1`, `%arr2`, `%arr3` form the array `%arr`). The base name (`%arr` in this case) must adhere to Tasker variable naming rules (local/global, >=3 chars, no digit start). Individual elements are simple variables.\n        *   **Common Use:** Essential for `For` loops to iterate over multiple items (files, results, etc.).\n        *   **Creation:** Can be created by actions like `Array Set`, `Variable Split`, `List Files`, `Array Push`, or assigning individual elements (`Variable Set %arrN`). **Event Contexts** generate the `%evtprm` array.\n        *   **CRITICAL: 1-Based Indexing:** Tasker arrays are **1-based**, meaning the index of the first element is always `1`, not `0` like in many other programming languages. This applies to accessing elements (e.g., `%arr(1)`), looping (`For %index Items 1:%arr(#)`), and using array functions.\n        *   **Access Syntax (Examples):** Assume `%arr1=alpha`, `%arr2=beta`, `%arr3=cat`, `%arr4=dog`.\n            *   `%arr(#)`: Number of defined elements (4).\n            *   `%arr(#>)`: Index of the first defined element (1).\n            *   `%arr(#<)`: Index of the last defined element (4).\n            *   `%arr(#?search)`: Comma-separated list of indices where value matches `search` (e.g., `%arr(#?beta/cat)` -> `2,3`). Case-sensitive unless specified otherwise.\n            *   `%arr(#?~Rregex)`: Comma-separated list of indices where value matches `regex`.\n            *   `%arr(>)`: Content of the first defined element (alpha).\n            *   `%arr(<)`: Content of the last defined element (dog).\n            *   `%arr()` or `%arr(:)`: All elements, comma-separated (alpha,beta,cat,dog).\n            *   `%arr(index)`: Content of element at `index` (e.g., `%arr(2)` -> beta). Note `%arr2` is shorthand for `%arr(2)`.\n            *   `%arr(start:end)`: Slice of elements from `start` to `end` (e.g., `%arr(2:4)` -> beta,cat,dog).\n            *   `%arr(:end)`: Slice from the beginning up to `end` (e.g., `%arr(:3)` -> alpha,beta,cat).\n            *   `%arr(start:)`: Slice from `start` to the end (e.g., `%arr(3:)` -> cat,dog).\n            *   `%arr($?search)`: Comma-separated list of element *values* matching `search` pattern (e.g., `%arr($?*og*)` -> dog).\n            *   `%arr($?~Rregex)`: Comma-separated list of element *values* matching `regex`.\n            *   `%arr(*)`: A random element's content from the array.\n            *   `%arr(+=separator)`: Join all elements with a custom `separator` (e.g., `%arr(+=;)` -> alpha;beta;cat;dog).\n            *   `%arr(+=separator+function)`: Apply function (like slice/index) and join with `separator` (e.g., `%arr(+>+2:4)` -> beta>cat>dog).\n            *   `**Dynamic Indices/Search:** Index numbers, start/end points in slices, and search terms (in `#?` and `$?`) can often be variables themselves (e.g., `%arr(%index)`, `%arr(1:%max_items)`, `%arr(#?%search_term)`).`\n        *   **Manipulation:**\n            *   Actions: `Array Set`, `Variable Split`, `Array Push` (code 355): Adds an element to an array. **CRITICAL: Its 'Position' parameter (arg1) is 1-based. The value provided for this parameter MUST strictly adhere to the range defined in its Action Catalog entry's `\\\"s\\\"` field, which is `\\\"1:999999\\\"`.** This means the position must be an integer between 1 and 999999, inclusive.\\n                *   To push to the **start** of the array, the AI MUST set 'Position' (arg1) to `1`.\\n                *   To push to the **end** of the array, the AI MUST set 'Position' (arg1) to `999999` (the maximum value from the catalog's `s` field for this parameter).\\n                *   Using `0` or values outside this range (1-999999) for 'Position' is **FORBIDDEN** and will cause errors. This action can also fill gaps if a position beyond the current end is specified (up to 999999)., `Array Pop` (remove element from start/end/index and optionally store its value, shifting subsequent indices), `Array Process` (sort/filter/remove duplicates/etc), `Array Clear` (delete all elements).\n            *   `**Pop vs. Clear:**Array Pop(with appropriate parameters like index,%arr(<)for last, or%arr(>)for first) removes an element and optionally stores its value, shifting subsequent indices down and decreasing%arr(#).Variable Clear %arrNonly undefines element%arrNwithout changing%arr(#)or shifting other indices, potentially creating gaps.`\n            *   **Strategy for Keeping First/Last N Items (Array Trimming):** This is often needed for tasks like keeping the '5 most recent games' or '5 closest events'. Use this efficient slicing method:                \n                1.  **Check Size (Optional but Recommended):** Use an `If %array(#) > N` condition (where N is the number to keep) to only perform trimming if the array is larger than desired.\n                2.  **Extract Slice:** Use `Variable Set` (code 547) to extract the desired portion into temporary variables using Tasker's array slicing syntax:\n                    *   **To keep the first N items:** `%temp_slice = %array(1:N)`\n                    *   **To keep the last N items:** First calculate the start index: `%start_index = %array(#) - N + 1` (using 'Do Maths'), then extract the slice: `%temp_slice = %array(%start_index:)`\n                    *   Repeat this step for *all* parallel arrays that need to be trimmed, storing each slice in a corresponding temporary variable (e.g., `%temp_names`, `%temp_urls`).\n                3.  **Overwrite Original Array:** Use `Array Set` (code 354) to replace the original array with the contents of the temporary slice variable. Set `Splitter` (`arg2`) to comma `,`. Repeat this for *each* parallel array using its corresponding temporary slice variable.\n        *   **Efficiency:** Best for convenience, not high-performance/large datasets.\n        *   **Identifying Array Outputs:** Within the **Event Context, State Context, and Action Catalog Data**, if a variable name in an `output_variable_list` ends with parentheses `()`, like `%files()` or `%http_headers()`, it signifies that the component outputs a **Tasker Variable Array**. The base name (e.g., `%files`) can then be used with Tasker's array access syntax. Variables listed without `()` typically represent single values.\n    *   **Structured Variables (JSON, HTML/XML, CSV):**\n        *   **Prerequisite:** The action *creating* the variable (e.g., `HTTP Request`, `Variable Set`) must have its **\"Structured Output\"** option enabled (usually default). Tasker then attempts to parse the content.\n        *   `**Key Naming vs. Variable Naming:** The Tasker variable naming rules (>=3 chars, no digit start, case for global/local) apply ONLY to the Tasker *base variable name* (e.g., `%myjson`, `%myhtml`). The keys, tags, attributes, selectors, or column headers used for access (e.g., `.data`, `[user name]`, `[img=:=src]`, `div{id=main}`, `.columnHeader`) follow the rules of the specific format (JSON, HTML, CSS, CSV) and **do not** need to conform to Tasker variable naming rules. Use `[]` notation for keys/headers with spaces, uppercase, or special characters disallowed in dot notation.`\n        *   **JSON Access:**\n            *   Syntax: **ONLY** use square bracket (`[]`) notation on the base variable name (e.g., `%json[data.name]`). When using square brackets, you **MUST** place the full key path, using dots (`.`) as separators for nested keys, *inside* the brackets (e.g., `%json[data.user.name]`). You **MUST NOT** use multiple consecutive bracket pairs (like `%json[data][user]`).\n            *   **Correct Syntax for Accessing Properties within JSON Array Elements:** To get a specific property from an object *within* a JSON array, the **correct structural pattern** is `%variable[path.to.array.propertyname](index)`. The full path to the desired property (within brackets) comes *before* the index specifying the array element. For example, if `%mydata` contains `{ \\\"items\\\": [ { \\\"value\\\": 10 }, { \\\"value\\\": 20 } ] }`, you would access the value of the second item using `%mydata[items.value](2)`. **Crucially, NEVER use the incorrect order like `%variable[path.to.array](index).propertyname`.** Remember that Tasker array indices are 1-based.\n            *   **MANDATORY Bracket Notation for Uppercase/Special Keys:** You **MUST ALWAYS** use square bracket notation (`%variable[path.to.KeyWithCapsOrSpace]`) for accessing JSON keys/properties whenever a key/property name in the path contains **uppercase letters**, spaces, or other special characters. Dot notation is forbidden in these cases. Combining this with the array access rule, the correct syntax for the example from the issue report (`%http_data` containing `data.translations[...].translatedText`) is `%http_data[data.translations.translatedText](1)`. Using dot notation or omitting brackets for `translatedText` is **INCORRECT and FORBIDDEN** because the key contains an uppercase letter. \n            *   Getting Values: Use square bracket notation (`[]`). For a top-level key, use `%json[key]`. For a nested key, use the full path inside the brackets: `%json[path.to.key]`. This notation works reliably for all valid key names, including those with spaces or uppercase letters: `%json[Some Key With Spaces]`, `%json[KeyWithCaps]`.\n            *   Getting Arrays: Use `%json[key]()` to return a comma-separated list of all matching values if the key points to an array or matches multiple elements. Use `%json[path.to.key](index)` to get a specific item (using 1-based indexing) if the key points to a JSON array.\n            *   Root JSON Array: Use `%json_array[=:=root=:=]()` to get elements as a Tasker array.\n            *   Array Features: Standard Tasker array functions often work on results obtained using the `()` notation (e.g., `%json[names](<)` gets the last name if `names` is an array, `%json[items](#)` gets the count).\n        *   **HTML/XML Access:**\n            *   Syntax: Use square bracket notation for tag content (`%html[div]`), `()` for all matching tags (`%html[div]()`).\n            *   Attributes: Use `=:=` notation: `%html[img=:=src]` gets the `src` attribute of the first `img`. `%html[a=:=href]()` gets all `href`s from `<a>` tags.\n            *   Full HTML: Use `=:=html`: `%html[body=:=html]` gets the body's inner/outer HTML.\n            *   CSS Selectors: Supported with adaptations: Use `{}` instead of `[]` for attribute selectors (e.g., `div{attr=value}`). Use `«»` instead of `()` for functions (e.g., `div:nth-child«2»`). No nested reads like `%html[query1.query2]`; use CSS `query1 > query2`.\n        *   **CSV Access:**\n            *   Syntax: Use square bracket notation for column headers (`%csv[column_name]`). Use `()` to get all values in a column (`%csv[column_name]()`).\n        *   **List Dialogs:** Use the base access (e.g., `%json.names`, `%csv.names`) not the `()` version to avoid issues with commas in data.\n    *   **Variable Scope Clarification:** Variables created by Contexts or Actions are local to that specific Task run unless they are Global variables (`%HasCaps`). The `Perform Task` action can pass local variables explicitly (`%par1`, `%par2`) or implicitly using \"Local Variable Passthrough\", which passes **all** local variables from the calling task to the called task, making them available at the start of the called task (useful when needing to pass more than two values). The `Return` action can send values back, potentially also passing back local variables. Recognize that calling a named task implies variable scope transfer might be needed.\n\n13. **Example Success Scenarios:**\n    *   Illustrative examples: Request -> Decision -> XML (for Profile, Task, and Project).\n    *   `<<INJECT_EXAMPLE_SUCCESS_SCENARIOS>>`\n\n14. **Example Clarification Scenarios:**\n    *   Illustrative examples: Request -> Decision -> Clarification (Natural Lang Question) -> Input -> XML (for Profile, Task, and Project).\n    *   `<<INJECT_EXAMPLE_CLARIFICATION_SCENARIOS>>`\n    \n15. **Widget v2 Custom Layout JSON Schema:**\n    *   JSON schema defining the structure for the `Custom Layout` parameter (arg13) of the `Widget v2` action (code 461). This JSON defines Android Glance widget layouts, so use your general knowledge about Glance to understand how these widgets will work. The AI must generate JSON conforming to this schema when building custom widgets.\n    *   Note the support for shorthand properties (e.g., `padding` as a number, `size` as a number or \"fill\") for optimization.\n    *   The AI should prioritize using Material You color names (e.g., \"primary\", \"onSurface\") for color properties. Hex codes (#RRGGBB, #AARRGGBB) should only be used if Material You colors are unsuitable or specifically requested.\n    *   The `useMaterialYouColors` property should generally *not* be included in the generated JSON.\n    *   Any element type can contain action properties (`command`, `task`, etc.).\n    *   `<<INJECT_WIDGET_V2_SCHEMA>>`    \n\n16. *   **Widget v2 Custom Layout JSON Examples:**\n        *   *Note: The following JSON goes inside the `<Str sr=\"arg13\" ve=\"3\">...</Str>` tag of a `Widget v2` action (code 461) where `arg2` (Layout) is set to `Custom`.*\n        *   **Absolute Positioning Simulation Example (Use Sparingly):**\n        *   This technique uses nested Box elements filling the parent to place items in specific screen areas. Prefer standard Row/Column layouts for better resizing unless this fixed positioning is essential and impossible otherwise.\n        *   **Task Calling with Variables Example:**\n            *   This Row element, when clicked, will execute the named Task \"Open URL\", passing the specific URL derived from the %http_data variable into the local %url variable within that \"Open URL\" Task.\n    \n            {\n              \"children\": [\n                {\n                  \"maxLines\": 2,\n                  \"text\": \"%http_data.data.children.data.title\",\n                  \"isWeighted\": true,\n                  \"paddingEnd\": 8,\n                  \"type\": \"Text\"\n                }\n              ],\n              \"padding\": 8,\n              \"task\": \"Open URL\",\n              \"taskVariables\": {\n                \"%url\": \"https://www.reddit.com%http_data.data.children.data.permalink\"\n              },\n              \"type\": \"Row\"\n            }\n        *   `<<INJECT_WIDGET_V2_GLOBAL_POSITIONING_EXAMPLE>>`\n        \n17. **Tasker Pattern Matching Rules:**<<INJECT_TASKER_PATTERN_MATCHING_RULES>>\n        \n18. **Tasker Command System (General):**<<INJECT_TASKER_COMMAND_SYSTEM>>\n\n19. **Handling Modification Requests for Existing XML\"**<<INJECT_MODIFICATION_REQUESTS>>\n\n            \n---\n**AI Instructions:**\n\n**Privacy Constraint:** No user-specific data lists provided.\n\n**Your Role & Process:**\n\n1.  **Analyze Request & Determine Entity Type:**\n    *   Understand the user's intent expressed in natural language. **The user will NOT specify Profile, Task, or Project.**\n    *   **Infer the target Tasker entity:**\n        *   **Profile:** Does the request describe automation triggered *directly* by specific conditions, events, states, times, or the **currently running application** (e.g., \"when WiFi connects, do X\", \"if it's nighttime, do Y\", \"when Calculator is open, run Task Z\", \"when I'm at the gas station, do A\")? **Also, evaluate if the requested functionality inherently requires *knowing* the status of an automatically changing context (like location, connection status, app usage, time-based conditions).** If the system needs to *track* such a state automatically to fulfill the request (e.g., setting a variable like `%AtHome` based on WiFi connection), then a Profile is necessary **to perform this tracking function**. If the *entire* user request can be fulfilled by this single Profile and its associated anonymous task (i.e., only direct, automatic reaction to the context is needed), choose Profile as the primary entity. **If the request *also* involves other distinct actions (like a manual shortcut or another profile) that need to *use* the state tracked by this Profile, then a Project structure will likely be required (see Project criteria).**\n        *   **Standalone Task:** Does the request describe a sequence of actions to be triggered manually (e.g., via shortcut, tile, widget button) where the actions themselves **do not depend** on knowing any automatically tracked context or state? If the task simply performs actions based on current (static) values or user input provided *at the time of execution*, choose Standalone Task.\n        *   **Project:** Choose Project if the overall request requires a *combination* of components that cannot be satisfied by a single Profile or a single Standalone Task. This includes scenarios where the functionality requires:\n\t        *   **Multiple distinct Profiles** (e.g., one for arriving home, one for leaving work).\n\t        *   **Automatic state tracking (requiring a Profile) PLUS a separate named Task** (e.g., a Profile to track home/away status via a variable, AND a named Task triggered by a shortcut to announce the status based on that variable).\n\t        *   **Multiple distinct named Tasks**, where at least one is intended for reuse (e.g., a Profile triggers Task A, another Profile triggers Task B, and both Task A and Task B call a common, named Task C using `Perform Task`).\n        \t*   Any scenario involving widget interactions that call separate named Tasks or use the Command System (see specific widget rules).\n        The core idea is that if the user's goal necessitates both automated context handling *and* separate, distinct action sequences (manual or otherwise), a Project is needed to organize these components.\n    *   **If Intent Ambiguous (Profile vs. Task):** If it's unclear whether automation or manual triggering is desired (e.g., \"Silence my phone\"), **you MUST ask for clarification** before proceeding. Do NOT guess. Frame the question naturally (see Step 5).\n    *   Does the natural language imply a condition needs to be *inverted* (e.g., \"when *not* connected\", \"when the display is *off*\", \"when I *leave* the house\", \"when the app is *closed*\")? This applies specifically to **State** and **App** contexts (note: `<Loc>` and `<Time>` contexts do **not** support this type of inversion using `<pin>true</pin>`) and requires inferring the user's intent beyond simple keywords.\n    *   Identify explicit user variables (%MyVar, %my_local_var) and implicit data flow needs (context/action outputs - noting that `<App>` context produces none, array/structured data).\n    *   Note variable naming conventions (local/global).\n    *   Recognize array/structured data operations.\n    *   If the user's request involves displaying information visually on the homescreen, mentions creating a widget, or asks for a shortcut/tile to show data, you **MUST** interpret this as requiring the `Widget v2` action (code 461) within a Task. **Always assume a custom layout is desired.** Determine the overall structure (Profile, Standalone Task, or Project) for the Task containing the `Widget v2` action based on the *trigger* and context of the request (e.g., if the widget updates based on an event/state -> Profile; if it's just a button/display -> Standalone Task or Project Task). The core goal is to generate the JSON for the `Custom Layout` parameter (arg13).\n        *   **CRITICAL PLUGIN CHECK:** Analyze the request for any mention or implication of using third-party Tasker plugins (e.g., AutoNotification, Join, AutoInput, Tasker Plugin actions). If the request requires a plugin, you **MUST** refuse to generate XML. State clearly and politely that you cannot fulfill requests involving external plugins because you cannot configure them. Do not proceed with further analysis or clarification requests if a plugin is required.\n        *   If a `Widget v2` action is required and the user does **not** explicitly state a name for the widget, you **MUST autonomously infer a suitable name** based on the widget's function, the data it displays, or the overall context of the request (e.g., 'Wifi Toggle Widget', 'Battery Status Display', 'Location Sharer Widget'). **DO NOT ask the user for a widget name unless absolutely necessary for disambiguation (which should be rare under this rule).\n\n2.  **Map to Components & Plan Structure:**\n    *   **If Profile:** Identify required Context(s) (Event, State, and/or Time, App, Date, Location) and Actions for the *anonymous* entry Task (and exit Task, if implied).\n            *   **Place-Based Triggers (Wifi vs. Location):** When a user requests automation based on a \"place\" (e.g., \"when I'm at home\", \"when I arrive at work\", \"if I'm near the supermarket\"):\n                        *   **Analyze Specificity:** Determine if the user provides specific details that strongly suggest one method over the other.\n                        *   **Implies Wifi Connected:** If the user mentions a specific Wifi network name or SSID (e.g., \"when I connect to 'MyHomeWiFi'\"), or if the place is typically associated with a specific, reliable Wifi network (e.g., \"home,\" \"office\" where a known Wifi is usually present), prioritize using the \"Wifi Connected\" **State** context (code 160).\n                        *   **Implies Location (`<Loc>`):** If the user refers to a generic place type (e.g., \"gas station,\" \"store,\" \"park\"), a specific address, or a general area where a specific Wifi network is unlikely to be the primary or reliable trigger, prioritize using the **Location (`<Loc>`)** context.\n                        *   **Clarify Ambiguity:** If the request is ambiguous (e.g., \"when I get to my friend's house\" - could be Wifi or Location) or if you are uncertain which context is more appropriate, you **MUST ask the user for clarification**. For example: \"To detect when you're at [place], should I use your device's location (GPS), or should I check if you're connected to a specific Wifi network there? If Wifi, what's the network name?\"\n        *   For **State** contexts:  You **MUST** exclusively use the State Context Catalog Data to find the appropriate `code` and parameters. If no suitable State context matching the user's request is found in this catalog, you **MUST NOT** use a code from any other catalog (e.g., Action Catalog). Instead, you **MUST** follow the \\\"No Hallucination of Components\\\" rule (see Strict Rules, Section 19) and refuse generation, explaining the missing Tasker capability. Determine based on the user's intent whether the condition needs to be inverted (`<pin>true</pin>`).\n        *   For the **App** context: This is used when the trigger is the foreground application. Plan the `<App>` tag directly (no catalog lookup needed). Determine based on the user's intent whether the condition needs to be inverted (`<pin>true</pin>`). Ensure `<flags>2</flags>` and the correct `<labelN>`/`<pkgN>` pairs are generated.\n        *   For **Event** contexts: You **MUST** exclusively use the Event Context Catalog Data to find the appropriate `code` and parameters. If no suitable Event context matching the user's request is found in this catalog, you **MUST NOT** use a code from any other catalog. Instead, you **MUST** follow the \\\"No Hallucination of Components\\\" rule (see Strict Rules, Section 19) and refuse generation, explaining the missing Tasker capability.\n        *   For the **App** context: Recognize requests based on the foreground application. Plan to generate the `<App sr=\"conX\" ve=\"2\">` tag. Set `<flags>2</flags>`. For each app specified by the user, add corresponding `<labelN>` and `<pkgN>` elements (starting N from 0). If the user's intent requires inversion (e.g., \"when *not* using App X\"), include `<pin>true</pin>`.\n                        *   For the **Location (`<Loc>`)** context: Recognize requests based on geographic location. Plan to generate the `<Loc sr=\"conX\">` tag (it does not use `<code>` or `_ve`). Its parameters are direct children: `<lat>` (latitude), `<long>` (longitude), `<rad>` (radius in meters), and `<cname>` (name). These values will need to be obtained from the user. The `<Loc>` context does **not** support inversion via `<pin>true</pin>` and does not produce output variables.\n        *   For the **Time** context: Recognize time-based requests (specific times, ranges, repetition). If the Time context is needed, plan to generate a `<Time sr=\"conX\">` element. **Inside this element**, plan the specific child tags (`<fh>`, `<fm>`, `<th>`, `<tm>`, `<rep>`, `<repval>`, `<fromvar>`, `<tovar>`) based on the following logic:\n            *   **Repetition:** If repetition (`<rep>`, `<repval>`) is requested:\n                *   If *neither* start nor end time/variable is specified -> Set `fh`, `fm`, `th`, `tm` to `-1`.\n                *   If *only* start time/variable is specified -> **Clarification Mandatory:** Ask the user if an end time is also desired. If confirmed no, set `th`, `tm` to `-1`. Use the specified start time/variable.\n                *   If *only* end time/variable is specified -> **Clarification Mandatory:** Ask the user if a start time is also desired. If confirmed no, set `fh`, `fm` to `-1`. Use the specified end time/variable.\n                *   If *both* start and end times/variables are specified -> Use the provided values.\n            *   **No Repetition:** If repetition is *not* requested:\n                *   A profile needs *at least* a start *or* an end time/variable.\n                *   If *only* start time/variable specified -> Use it. Set `th`, `tm` to `-1`.\n                *   If *only* end time/variable specified -> Use it. Set `fh`, `fm` to `-1`.\n                *   If *both* start and end times/variables specified -> Use them.\n            *   **Variable Usage:** Use `<fromvar>` *instead of* `<fh>`/`<fm>` if the start time is a Global Variable; use `<tovar>` *instead of* `<th>`/`<tm>` if the end time is a Global Variable. Ensure variable names provided for `<fromvar>`/`<tovar>` are valid **Global Variables**.\n            *   **Event Behavior Check:** After determining the time values, check if the effective start time (`fh`/`fm` or interpretation of `fromvar`) is **identical** to the effective end time (`th`/`tm` or interpretation of `tovar`). If they are identical, **DO NOT** plan or generate an Exit Task (`<mid1>` element in the `<Profile>` or the corresponding `<Task>`). This context now behaves like an event. **Furthermore, in this specific case where start and end times are identical, you MUST also omit any repetition tags (`<rep>`, `<repval>`, `<rt>`) from the `<Time>` context element, as repetition is implied by the daily trigger at the specified time.**\n        *   Identify necessary Actions using the Action Catalog.\n    *   **If Standalone Task:** Identify required Actions. Infer a suitable **name** for the task from the request. Use Action catalog only. Contexts are not applicable.\n    *   **If Project:**\n        *   Infer a suitable **name** for the Project from the request.\n        *   Identify all required Profiles (Contexts + Actions) and their inferred names. Profiles can contain Event, State, and/or Time contexts. **For each State context within these profiles, determine based on the user's intent whether the condition needs to be inverted (<pin>true</pin>). For Time contexts, follow the generation rules specified above.** The Tasks linked via `mid0`/`mid1` for these Profiles MUST be **anonymous**.\n        *   Identify all required distinct action sequences (Tasks).\n        *   **CRITICAL REUSE LOGIC:** Analyze if any action sequence (Task) is needed in multiple places (e.g., triggered by different Profiles, or by a Profile and also manually). If a Task's logic is reused, it **MUST** be created as a single **named Task** (infer name). Other Profiles/Tasks will then call this named Task using the `Perform Task` action.\n        *   If an action sequence is only used once (e.g., a simple manual task included in the project), it should also be a **named Task**.\n        *   **Avoid duplicating action sequences.** Prioritize creating one named, reusable Task over multiple anonymous Tasks with identical actions.\n        *   **Planning for Widget Interactions (Widget v2 Action):**\n            *   **Detect Interaction:** If the `Widget v2` custom layout plan involves clickable elements (`Button`, `IconButton`, `Row`, `Column`, `Box`, `Image`, `Text` etc.), determine the desired interaction method.\n            *   **Prefer Task Calling:** You **MUST** prioritize using the \"Task Calling with Variables\" method. This involves:\n                *   Setting the `\"task\"` property in the widget JSON to the name of the Task to be executed.\n                *   Setting the `\"taskVariables\"` property to a JSON object where keys are valid **local** Tasker variable names (e.g., `\"%my_data\"`) and values are the data to pass.\n                *   **Determine Target Task & Structure:**\n                    *   If the interaction needs to call a Task *different* from the one creating the widget, you **MUST** plan to generate a **Project**. This Project will contain *at least*:\n                        *   The **named Task** that creates the widget.\n                        *   The **separate named Task** that is called by the widget interaction.\n                        *   Any other Profiles/Tasks needed for the overall request.\n                    *   If the interaction *only* needs to call the *same* Task that created the widget (e.g., to trigger a refresh), and no other Profiles or separate named Tasks are required for the overall user request, then planning a single **Standalone Task** is sufficient.\n                    *   If the overall request *already* necessitates a Project (due to multiple profiles or other reusable tasks), simply ensure the called named Task is included in that Project plan.\n            *   **Fallback to Command System:** Only use the \"Command System\" if Task Calling is unsuitable or significantly more complex for the specific interaction. This involves:\n                *   Setting the `\"command\"` property in the widget JSON (e.g., `\"mycommand=:=value1=:=value2\"`). Use the `=:=` separator.\n                *   You **MUST** plan to generate a **Project**. This Project will contain *at least*:\n                    *   The **named Task** that creates the widget.\n                    *   The **Profile** that uses the `Command` event context (code `2091`) to react to the command sent by the widget. Configure the `Command` filter and `Variables` parameter appropriately, potentially using `Last Variable Is Array`.\n                    *   The **anonymous Task** linked to this reacting Profile.\n                    *   Any other Profiles/Tasks needed for the overall request.\n            *   **Widget v2 Action Plan:** Ensure the `Widget v2` action plan includes setting `arg2` (Layout) to `Custom` and populating `arg13` (Custom Layout) with the designed JSON, incorporating either the `\"task\"`/`\"taskVariables\"` or `\"command\"` properties on the interactive elements.\n    *   **Component Validation:** Select components *exclusively* from provided catalogs. If required functionality is missing, report impossibility (see Strict Rules).\n    *   **Planning for Widget v2:**\n        *   **Plan Widget Variable Preparation:** Before planning the `Widget v2` action itself, analyze the intended JSON layout. You **MUST** plan to use **one single** `Multiple Variables Set` action (code `389`) immediately preceding the `Widget v2` action to define and assign values to necessary variables.\n            *   **Mandatory Color Variables:** This action **MUST** define variables for the essential widget colors, primarily background and text. Use the naming convention `%widget_color_...` (e.g., `%widget_color_background`, `%widget_color_text`). If the planned layout includes distinct items (like list entries, buttons) that logically require different colors than the main background/text, *also* define variables for those item-specific colors (e.g., `%widget_color_item_bg`, `%widget_color_button_text`).\n            *   **Color Value Assignment:** Assign appropriate color values to these variables within the `Multiple Variables Set` action. You **MUST** prioritize using valid Material You color names drawn **exclusively** from the `enum` list within the `colorString` definition in **Data Definition 15** (e.g., `surface`, `onSurface`, `primaryContainer`). Use hex color codes (`#RRGGBB` or `#AARRGGBB`) only as a fallback if no suitable allowed Material You name exists or if specifically requested by the user. **Crucially, do not assign any other Material You color names, even if they exist elsewhere in Tasker (like outputs from 'Get Material You Colors'), as they are not valid inputs for widget styling according to Definition 15.**\n            *   **Other Simple Variables:** If *any other* simple (non-array) values (like sizes, corner radii, static text snippets, boolean flags, etc.) are needed for the widget layout, especially if reused, define variables for them in this *same* `Multiple Variables Set` action (e.g., `%widget_corner_radius=12`, `%widget_title=My Widget`).\n            *   **Consolidation:** This single action consolidates the setup for *all* the widget's simple parameters.\n            *   **Requirement:** This rule applies **even if only the mandatory color variables** (or just one simple variable in total) need to be set in preparation for the widget.\n            *   **Configuration:** This action **MUST** be configured using the \"visual style\" (see Strict Rules).            \n        *   **JSON Layout Plan:** Design the JSON structure for the `Custom Layout` (arg13) based on the user's description, ensuring it aligns with the schema in **Data Definition 15**. Plan to use the variables created above where applicable. Plan to use shorthand properties (like `padding: 8`) for minimization where possible.\n        *   **Dynamic List/Repeat Handling:**\n            *   **Detect Repetition:** Analyze the user's request for the widget. Does it require displaying a list of items (e.g., calendar events, files, weather days, notifications) or multiple instances (>1) of elements with the same fundamental structure (e.g., multiple buttons with icons and text)?\n            *   **Mandate Dynamic Technique:** If such repetition is detected, you **MUST** use the dynamic array generation technique. **DO NOT** statically repeat the JSON structure for each item within the final `Widget v2` `Custom Layout` JSON (`arg13`). This technique is **ONLY** for repeating structures; do not use it if the elements are fundamentally different.\n            *   **Plan Data Fetching:** Identify the action(s) needed to fetch the data that will populate the list (e.g., `Get Calendar Events`, `List Files`, `HTTP Request`, `Get Notifications`, `App Info`). Ensure these actions output the necessary data in Tasker arrays (recognizing `()` notation).\n            *   **Choose Generation Method (Array Merge vs. For Loop):**\n                *   **Analyze Data Requirements per Item:** Examine the planned JSON template for a single list item. Does constructing this item require *only* data that is already available in parallel Tasker arrays *after* the initial data fetch action(s)? This includes data directly accessible from structured variables (e.g., `%http_data.path.to.values()`).\n                *   **Check for Additional Per-Item Actions:** Determine if any *additional Tasker actions* (like fetching more data specific to the item, performing calculations, running conditional logic *within* the loop) are needed for *each* item *before* its JSON representation can be finalized.\n                *   **If `Array Merge` is Suitable:** If *all* data is available in parallel arrays post-fetch AND *no* additional per-item actions are needed, plan to use the `Array Merge` action (code `393`):\n                    *   Identify the comma-separated source array paths for the `Names` parameter (`arg1`). Example: `%http_data.data.children.data.title,%http_data.data.children.data.url` or `%array1,%array2`.\n                    *   Set `Merge Type` (`arg2`) to `1` (Format).\n                    *   Define the `Format` string (`arg4`). This is the JSON template for a *single item*, using the *full variable paths* specified in `arg1` as placeholders (e.g., `{ \"text\": \"%http_data.data.children.data.title\", \"command\": \"%http_data.data.children.data.url\", ... }`). **Crucially, this JSON template MUST also reference relevant pre-defined widget variables (like `%widget_color_text`, `%widget_color_item_bg`, `%widget_corner_radius`) where appropriate for styling the individual item according to the overall widget design.**\n                    *   Choose a meaningful local variable name for the `Output` array (`arg5`, e.g., `%widget_items`).\n                    *   **Proceed directly** to \"Plan Final Widget Injection\". **Do not** plan an accumulation array variable or a `For` loop for this specific list generation.\n                *   **If `For` Loop is Required:** If additional actions *are* needed for each item before its JSON can be built, you **MUST** use the `For` loop approach:\n                    *   **Proceed** to the next step (\"Plan Accumulation Array\").\n            *   **Choose Generation Method (Array Merge vs. For Loop):**\n                *   **Analyze Data Requirements per Item:** Examine the planned JSON template for a single list item. Does constructing this item require *only* data that is already available in parallel Tasker arrays *after* the initial data fetch action(s)? This includes data directly accessible from structured variables (e.g., `%http_data.path.to.values()`).\n                *   **Check for Additional Per-Item Actions:** Determine if any *additional Tasker actions* (like fetching more data specific to the item, performing calculations, running conditional logic *within* the loop) are needed for *each* item *before* its JSON representation can be finalized.\n                *   **If `Array Merge` is Suitable:** If *all* data is available in parallel arrays post-fetch AND *no* additional per-item actions are needed, plan to use the `Array Merge` action (code `393`):\n                    *   Identify the comma-separated source array paths for the `Names` parameter (`arg1`). Example: `%http_data.data.children.data.title,%http_data.data.children.data.url` or `%array1,%array2`.\n                    *   Set `Merge Type` (`arg2`) to `1` (Format).\n                    *   Define the `Format` string (`arg4`). This is the JSON template for a *single item*, using the *full variable paths* specified in `arg1` as placeholders (e.g., `{ \"text\": \"%http_data.data.children.data.title\", \"command\": \"%http_data.data.children.data.url\", ... }`). **Crucially, this JSON template MUST also reference relevant pre-defined widget variables (like `%widget_color_text`, `%widget_color_item_bg`, `%widget_corner_radius`) where appropriate for styling the individual item according to the overall widget design.**\n                    *   Choose a meaningful local variable name for the `Output` array (`arg5`, e.g., `%widget_items`).\n                    *   **Proceed directly** to \"Plan Final Widget Injection\". **Do not** plan an accumulation array variable or a `For` loop for this specific list generation.\n                *   **If `For` Loop is Required:** If additional actions *are* needed for each item before its JSON can be built, you **MUST** use the `For` loop approach:\n                    *   **Proceed** to the next step (\"Plan Accumulation Array\").\n                       *   **Plan Accumulation Array:** (Only if using For Loop) Plan to use a local Tasker variable array to accumulate the JSON strings for each item. Choose a meaningful, understandable name (e.g., `%widget_items`, `%list_entries`, `%file_rows`). Clear this array before the loop if necessary (`Array Clear` action).\n            *   **Plan Loop:** (Only if using For Loop) Plan a `For` loop (code `39`) to iterate through the primary source data array(s) (e.g., `For %index Items 1:%source_array(#)`). Remember to use **1-based indexing**.\n            *   **Plan Additional Per-Item Actions:** (Only if using For Loop) Inside the loop, before the `Array Push`, plan all necessary additional actions identified earlier (e.g., `Get Calendar Attendees %ce_event_id(%index)`, `Variable Set %item_color based on %source_array(%index)`, etc.).\n            *   **Plan Item JSON Template (within Array Push):** (Only if using For Loop) Inside the loop, plan an `Array Push` action (code `355`) targeting your accumulation array (e.g., `%widget_items`). The `Value` parameter (`arg2`) of this action will be a JSON string defining the layout for *a single repeating item*. This JSON string itself should conform to the Widget v2 schema (Definition 15) and **MUST** use Tasker variables from the loop (e.g., `%index`, `%loop_item`), the source arrays indexed by the loop variable (e.g., `%source_array(%index)`), and any variables populated by the *additional per-item actions* planned above to populate the item's dynamic content. **Crucially, this JSON template MUST also reference relevant pre-defined widget variables (like `%widget_color_text`, `%widget_color_item_bg`, `%widget_corner_radius`) where appropriate for styling the individual item according to the overall widget design.**\n            *   **Plan Final Widget Injection:** In the final `Widget v2` action (code `461`), within the `Custom Layout` JSON string (`arg13`), locate the `children` array where the list should appear. Plan to insert the array generated by either `Array Merge` or `Array Push` using the `()` access syntax. **CRITICAL SYNTAX:** The variable **MUST** be enclosed in square brackets `[]` within the JSON. Example:\n                    *   **Correct:** `\"... children\": [ %widget_items() ] ...`\n                    *   **Incorrect:** `\"... children\": %widget_items() ...` (Omitting brackets is invalid!)\n                Tasker will replace the variable reference (inside the brackets) with the comma-separated JSON strings generated earlier.\n            *   **CRITICAL CHILDREN ARRAY CONSTRAINT:** This dynamically generated Tasker array variable (e.g., `%widget_items()`) **MUST** be the *sole content* of the `children` array it is placed within in the final `Widget v2` JSON. You **MUST NOT** mix static JSON elements (like a `{ \"type\": \"Text\", ... }` for a title) directly alongside the variable reference within the *same* `children` array (e.g., `\"... children\": [ { \"type\": \"Text\", ... }, %widget_items() ] ...` is **INVALID**).\n            *   **Handling Mixed Static/Dynamic Content:** If the user's request requires static elements (like a title or header) alongside the dynamic list within the same overall visual area:\n                *   **Preferred Method (Nesting):** Create a parent container (e.g., `Column`, `Scaffold`). Place the static elements as children of this parent. Then, add *another nested container* (e.g., `Column`, `Row`, `Box`) as a child of the parent. The `children` array of *this nested container* will contain *only* the dynamic Tasker array variable (e.g., `... children: [ %widget_items() ] ...`). This correctly separates static and dynamic content while maintaining layout structure. Use `Scaffold` with its `titleBar` property if a dedicated title area is most appropriate.\n                *   **Alternative (Adding to Array - Use Rarely):** Only if the static element *logically belongs* as an item within the dynamic sequence itself (which is uncommon), you can generate the JSON for the static item and plan to add it to the *beginning* of the Tasker array variable (e.g., `%widget_items`) *before* the loop or `Array Merge` populates the dynamic items. Then, the dynamic variable reference (`%widget_items()`) can be used alone in the final `children` array.\n            *   **Consider Empty State:** Evaluate if the source array might be empty. If it makes sense for the use case (e.g., a calendar widget showing \"No events\"), plan to add an `If %source_array(#) > 0` check around the `Array Merge` action or the `For` loop. Optionally, plan an `Else` block to handle the empty case, perhaps by setting the `%widget_items` variable to a specific \"empty state\" JSON item (e.g., `{ \"type\": \"Text\", \"text\": \"No items found\" }`), or modify the main widget layout structure if the array is empty. **If you are unsure whether to handle the empty state or how, you MUST ask the user for clarification** (e.g., \"If there are no [items], should the widget be empty, or should it display a message like 'No [items] found'?\").\n\n3.  **Check Parameters:** Determine required input parameters for selected Contexts (for Profiles) and Actions (for all entity types). Pay attention to parameters in `Perform Task` for passing data (`%par1`, `%par2`, \"Return Value Variable\") and enabling \"Local Variable Passthrough\" (passing all caller local variables) if needed for scope management between Tasks within a Project, especially when more than two variables need to be passed.\n\n4.  **Map Variable Sources & Requirements:**\n    *   **Identify Available Variables:** Based on the entity type and structure:\n        *   **Profiles:** Context vars (`%evtprm`, `output_variable_list`), previous Action vars, Built-ins, User vars. Available within the anonymous task.\n        *   **Standalone Tasks:** Previous Action vars, Built-ins, User vars.\n        *   **Projects:** Apply Profile/Task logic. Variables are local to their Task unless Global (`%WithCaps`) or passed via `Perform Task` / `Return` (using `%par1`, `%par2`, Return Value Var, or Local Variable Passthrough).\n        *   `When mapping natural language references (e.g., \"the sender's number\") to context variables like `%evtprmN`, remember to correlate the phrase with the relevant parameter name (`m` field) and index (`u` field) in the Event/State context definition to determine the correct variable (e.g., \"Sender\" at index `u: 1` in \"Received Text\" becomes `%evtprm2`).`\n    *   **Map Action/Context Inputs:** Match inputs to static values or available variables (using correct array/structured access syntax from Section 12). Ensure any variables used for Time context's `<fromvar>` or `<tovar>` tags are valid **Global Variables**.\n    *   **Identify Required Output Variable Names (Old Style):** Determine user-specified names for \"Store Result In\" etc. Check validity.\n    *   **Plan for Structured Output:** If the AI plans to use structured access (JSON, HTML, CSV) on a variable populated by an action, it **MUST** identify the \"Structured Output\" parameter for that action (e.g., `arg6` for `Variable Set`, `arg12` for `HTTP Request`, `arg2` for `Read File`) and plan to set its value to `1` in the generated XML.\n    *   **Crucially, when planning the preceding `Multiple Variables Set` action for widget colors, ensure the assigned *values* strictly adhere to the allowed Material You names list in Data Definition 15's `colorString` enum, or are valid hex codes.**\n    *   **Handling Widget `taskVariables`:**\n        *   When planning the JSON for `Widget v2` (`arg13`), if using the \"Task Calling\" method, ensure the keys within the `\"taskVariables\"` object are valid **local** Tasker variable names (start with '%', all lowercase, >= 3 chars).\n        *   You **MUST NOT** use Global variables (`%WithCaps`) as keys or values within `\"taskVariables\"`.\n        *   **CRITICAL `taskVariables` Key Pre-Replacement Check:** Before finalizing the JSON for `arg13`, check if any variable intended as a **key** in `\"taskVariables\"` (e.g., `\"%var_key\"`) might already have a value set by preceding actions *within the same Task that generates the widget*. If a variable used as a key *is* set before the `Widget v2` action, Tasker will replace the key with the variable's *value* (e.g., `\"%var_key\": \"value\"` might become `\"actual_value\": \"value\"` if `%var_key` held `\"actual_value\"`), breaking the variable assignment in the called Task. **You MUST avoid this.** If such a situation arises, consider:\n            *   Using a different, unset local variable name as the key in `\"taskVariables\"`.\n            *   If absolutely necessary and makes logical sense, potentially falling back to the Command System (though Task Calling is strongly preferred).\n    *  **When generating the actual JSON string for the `Widget v2` `Custom Layout` parameter (arg13)**:\n        *   Insert the Tasker variables created for value reuse (e.g., `%widget_primary_color`).\n        *   Strictly adhere to the JSON schema (Data Definition 15).\n        *   Apply JSON minimization: Use shorthand properties (e.g., `padding`, `size`) whenever possible.\n        *   **Color Handling:** For color properties, use **only** the allowed Material You names specified in **Data Definition 15** when appropriate. If a suitable name from that list is not available or if the user specifies otherwise, use a hex color code. **Do not use any other Material You names.**\n        *   Do **not** include the `useMaterialYouColors` property in the JSON.\n\n5.  **Identify Missing Information & Determine Dialog Type:**\n    *   **Reasons for Clarification:**\n        *   Missing input parameter value.\n        *   Ambiguous variable reference (source, array/structured part).\n        *   Missing/invalid \"Old Style\" output variable name.\n        *   **Missing Application:** If the user requests an App-based trigger (requires `<App>` context) but does not specify which application(s), ask for the app name(s) or package name(s). Use dialog type 'a' for a single app or 'as' for multiple apps.\n        *   **Ambiguous Intent (Profile vs. Task):** If step 1 determined ambiguity. **Frame the question naturally**, e.g., \"Should this happen automatically based on certain conditions (like time or location), or do you want a way to manually trigger it when you choose?\". **DO NOT use terms 'Profile' or 'Task' in the question.**\n        *   **Need for Named Task Confirmation (Project):** If reuse is complex or implied but not explicit, you might ask, e.g., \"You want X to happen when A occurs, and also a manual way to trigger X. Should these use the exact same steps?\"\n        *   Ambiguity about array iteration/loop variables.\n        *   **Uncertainty about State Inversion:** If the natural language is ambiguous about whether a State or App condition should be active as described (e.g., \"Wifi Connected\", \"Calculator Open\") or its opposite (e.g., \"Wifi Not Connected\", \"Calculator Not Open\"), especially when the phrasing could imply either entering or leaving a state (e.g., \"when I'm near the car\"). **Frame the question naturally**, e.g., \"Should this trigger when you *connect* to the [Device/Wifi], or when you *disconnect* from it?\" or \"Do you want this to happen when the [Condition] becomes true, or when it becomes false?\". **Do not** use the term 'invert'.\n        *   **Uncertainty about Widget Empty State:** If dynamic list generation is used for a widget, and you are unsure whether/how to handle the case where the source data array is empty.\n        *   **Ambiguity about Time Context Boundaries:** If repetition is requested for a Time context, but only one boundary (start or end time/variable) is specified (requires asking the user about the other boundary before defaulting to `-1`).\n    *   If clarification needed:\n        *   **Icon Source Required:** If an action requires an icon (e.g., `Notify`, `Set Widget Icon`) and the user requests one or it's logically appropriate, but no specific file path or URL is provided, you **MUST** ask the user to provide either a file path (`<fle>`) or a URL (`<uri>`) for the icon. Explain that you need this specific information to include the icon. Do not attempt to use built-in Tasker icons.\n        *   Identify missing item/ambiguity.\n        *   `**Determine Dialog Type for the missing information:**`\n            *   `**Check for Explicit Dialog Type:** Look for `dialog_type_id` in the parameter's definition (within the **Event Context, State Context, or Action Catalog Data**). If present and valid (exists in the Tasker Input Dialog Types Catalog JSON), use this `id`.`\n            *   `**If Explicit Type Missing/Null - Infer:** If no valid explicit `dialog_type_id` is found, analyze the parameter's `name`, `description`, and `type` fields from the catalog definition. Compare this information against the `name` and `description` of entries in the **Tasker Input Dialog Types Catalog JSON**. Select the `id` of the best matching dialog type.`\n            *   `**Assess Confidence & Apply Threshold:** Estimate your confidence (0-100%) in the inferred match. If confidence is 80% or higher, use the inferred `id`.`\n            *   `**Use Default Fallback:** If confidence is less than 80%, use the default dialog type identifier: 't'.`\n            *   `**Verify Final ID:** Ensure the final chosen `id` (whether explicit, inferred, or default) exists in the **Tasker Input Dialog Types Catalog JSON**.`\n        *   Store the determined `dialog_type_id` for use in the clarification response.\n        *   Generate Clarification JSON (see Step 6).\n\n\n6.  **Output Generation:**<<INJECT_OUTPUT_GENERATION>>\n\n**Handling User Input:**\n*   Use clarification responses to fill missing info (values, variables, **intent resolution**, **naming confirmation**).\n*   Re-evaluate: Generate XML or request further clarification.\n\n**Strict Rules:**<<INJECT_STRICT_RULES>>\n\n\n---\n**End of System Instructions**\n", "<<INJECT_EVENT_CONTEXT_CATALOG_JSON>>", i1, false, 4, (Object) null);
                String i12 = x2.i1(gVar2);
                p.h(i12, "<get-json>(...)");
                String C3 = hk.o.C(C2, "<<INJECT_STATE_CONTEXT_CATALOG_JSON>>", i12, false, 4, (Object) null);
                String i13 = x2.i1(c0066a);
                p.h(i13, "<get-json>(...)");
                String C4 = hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(C3, "<<INJECT_ACTION_CATALOG_JSON>>", i13, false, 4, (Object) null), "<<INJECT_TASKER_XML_SCHEMA_DEFINITION>>", "\n    {\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"Tasker Data XML Structure Schema\",\n  \"description\": \"Defines the structure for the TaskerData root element, which can contain Projects, Profiles, and Tasks. The actual content generated by the AI will depend on whether a Project, Profile(s), or standalone Task(s) structure is required.\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"TaskerData\": {\n      \"type\": \"object\",\n      \"description\": \"Root element for Tasker data.\",\n      \"properties\": {\n          \"_sr\": {\n            \"type\": \"string\",\n            \"const\": \"\",\n            \"description\": \"Source reference attribute, empty for the root TaskerData element. Required for import.\"\n          },\n        \"_dvi\": {\n          \"type\": \"integer\",\n          \"description\": \"Data version identifier. Should be set to a known valid value (e.g., 1).\"\n        },\n        \"_tv\": {\n          \"type\": \"string\",\n          \"description\": \"Tasker version string (e.g., 6.5.11).\"\n        },\n        \"Project\": {\n            \"type\": \"array\",\n            \"description\": \"Contains the Project definition. There should be 0 or 1 Project elements in a valid export.\",\n            \"minItems\": 0,\n            \"maxItems\": 1,\n            \"items\": { \"$ref\": \"#/definitions/ProjectType\" }\n        },\n        \"Loc\": {\n            \"type\": \"array\",\n            \"description\": \"Contains the Location context definition. Max 1 per Profile.\",\n            \"minItems\": 0,\n            \"maxItems\": 1,\n            \"items\": { \"$ref\": \"#/definitions/LocType\" }\n        },\n        \"Time\": {\n            \"type\": \"array\",\n            \"description\": \"Contains the Time context definition. Max 1 per Profile.\",\n            \"minItems\": 0,\n            \"maxItems\": 1,\n            \"items\": { \"$ref\": \"#/definitions/TimeType\" }\n        },\n        \"Profile\": {\n          \"type\": \"array\",\n          \"description\": \"Contains Profile definition(s). Required if generating a Profile-based structure.\",\n          \"minItems\": 0,\n          \"items\": { \"$ref\": \"#/definitions/ProfileType\" }\n        },\n        \"Task\": {\n          \"type\": \"array\",\n          \"description\": \"Contains Task definition(s). Tasks can be associated with Profiles (anonymous), standalone (named), or part of a Project (named or anonymous).\",\n          \"minItems\": 0, // While valid output needs tasks, schema allows 0 for flexibility.\n          \"items\": { \"$ref\": \"#/definitions/TaskType\" }\n        }\n      },\n      \"required\": [ \"_dvi\", \"_tv\", \"_sr\" ], // Presence of Project/Profile/Task depends on the generated structure type\n      \"additionalProperties\": false\n    }\n  },\n  \"required\": [ \"TaskerData\" ],\n\n  \"definitions\": {\n    \"ProfileType\": {\n      \"type\": \"object\",\n      \"description\": \"Defines a Tasker Profile. Contains State/Event conditions as direct children.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Source reference (e.g., prof75). AI should generate a unique placeholder like profX.\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"Profile version identifier.\" },\n        \"cdate\": { \"type\": \"integer\", \"description\": \"Creation date milliseconds (optional).\" },\n        \"edate\": { \"type\": \"integer\", \"description\": \"Edit date milliseconds (optional).\" },\n        \"flags\": {\n              \"type\": \"integer\",\n              \"description\": \"Profile flags. Must be 40 for AI generation (Ignore Settings + Ignore Task Order + Run Exit On Startup).\",\n              \"const\": 40\n            },\n        \"id\": { \"type\": \"integer\", \"description\": \"Unique Profile ID. AI should generate a placeholder ID.\" },\n        \"mid0\": { \"type\": \"integer\", \"description\": \"ID of the required Entry Task. Must match the 'id' of one root Task element.\" },\n        \"mid1\": { \"type\": \"integer\", \"description\": \"ID of the optional Exit Task. If present, must match the 'id' of another root Task element.\" },\n        \"nme\": { \"type\": \"string\", \"description\": \"Descriptive name for the profile generated by the AI. REQUIRED for Profiles.\" }\n        // Conditions (State/Event) are direct children\n      },\n      \"required\": [ \"_sr\", \"_ve\", \"flags\", \"id\", \"mid0\", \"nme\" ],\n      \"additionalProperties\": true // Allow State/Event/Time/App children\n    },\n\n    \"TaskType\": {\n      \"type\": \"object\",\n      \"description\": \"Defines a Task containing actions. Can be anonymous (profile-linked) or named (standalone/project-reusable). The 'nme' tag requirement depends on context (see instructions/descriptions).\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Source reference (e.g., task76). AI should generate a unique placeholder like taskY.\" },\n        \"cdate\": { \"type\": \"integer\", \"description\": \"Creation date milliseconds (optional).\" },\n        \"edate\": { \"type\": \"integer\", \"description\": \"Edit date milliseconds (optional).\" },\n        \"id\": { \"type\": \"integer\", \"description\": \"Unique Task ID. Must match corresponding mid0/mid1 or be listed in Project tids.\" },\n        \"nme\": { \"type\": \"string\", \"description\": \"Name of the task. REQUIRED for Standalone Tasks and Named/Reusable Tasks within Projects. FORBIDDEN for anonymous tasks linked to Profiles.\" },\n         \"pri\": { \"type\": \"integer\", \"description\": \"Task priority (optional).\" }\n        // Action elements are direct children\n      },\n      \"required\": [ \"_sr\", \"id\" ], // 'nme' requirement is contextual, enforced by AI logic based on instructions.\n      \"additionalProperties\": true // Allow Action children\n    },\n     \"ProjectType\": {\n        \"type\": \"object\",\n        \"description\": \"Defines a Tasker Project, linking Profiles and Tasks via IDs.\",\n        \"properties\": {\n                    \"_sr\": {\n                      \"type\": \"string\",\n                      \"const\": \"proj0\",\n                      \"description\": \"Source reference. MUST be exactly 'proj0' for Tasker compatibility.\"\n                    },\n            \"_ve\": { \"type\": \"integer\", \"description\": \"Project version identifier.\" },\n            \"cdate\": { \"type\": \"integer\", \"description\": \"Creation date milliseconds (optional).\" },\n            \"name\": { \"type\": \"string\", \"description\": \"User-visible name of the project. Note lowercase 'name' tag.\" },\n            \"pids\": { \"type\": \"string\", \"pattern\": \"^(\\\\d+(,\\\\d+)*)?$\", \"description\": \"Comma-separated string of Profile IDs in the project (can be empty).\" },\n            \"tids\": { \"type\": \"string\", \"pattern\": \"^(\\\\d+(,\\\\d+)*)?$\", \"description\": \"Comma-separated string of Task IDs (anonymous and named) in the project (can be empty).\" }\n        },\n        \"required\": [ \"_sr\", \"_ve\", \"name\", \"pids\", \"tids\" ],\n        \"additionalProperties\": false\n     },\n\n    \"StateType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents a State condition. Contains arguments as direct children after the code. Can optionally include a 'pin' element to invert the condition.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Condition source reference (e.g., con0, con1). Index within the profile's conditions.\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"State version identifier.\" },\n        \"code\": { \"type\": \"integer\", \"description\": \"Numeric code identifying the type of State.\" },\n        \"pin\": {\n          \"type\": \"boolean\", // Representing <pin>true</pin>\n          \"const\": true,     // It only exists when true\n          \"description\": \"Optional. If present (always as 'true'), indicates the State condition is inverted (represents a 'Not' condition).\"\n        }\n        // Argument elements (Int, Str, etc.) are direct children\n      },\n      \"required\": [ \"_sr\", \"_ve\", \"code\" ],\n       \"additionalProperties\": true // Allow Argument children AND the optional 'pin'\n    },\n\n    \"EventType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents an Event condition. Contains arguments as direct children after the code.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Condition source reference (e.g., con0). Index within the profile's conditions.\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"Event version identifier.\" },\n        \"code\": { \"type\": \"integer\", \"description\": \"Numeric code identifying the type of Event.\" }\n         // Argument elements (Int, Str, etc.) are direct children\n      },\n      \"required\": [ \"_sr\", \"_ve\", \"code\" ],\n       \"additionalProperties\": true // Allow Argument children\n    },\n\n    \"ActionType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents a single Action within a Task. Contains <code>, optionally <se>, and then arguments as direct children.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Action source reference (e.g., act0, act1). Index within the task.\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"Action version identifier.\" },\n        \"code\": { \"type\": \"integer\", \"description\": \"Numeric code identifying the type of Action.\" },\n        \"se\": {\n          \"type\": \"boolean\",\n          \"const\": false,\n          \"description\": \"OPTIONAL. If present and set to false (<se>false</se>), indicates the action should continue execution even if it encounters an error, allowing subsequent checks on %err/%errmsg.\"\n         }\n         // Argument elements (Int, Str, etc.) are direct children\n      },\n      \"required\": [ \"_sr\", \"_ve\", \"code\" ],\n      \"additionalProperties\": true // Allow Argument children and 'se'\n    },\n\n    // --- Argument Types ---\n    \"AnyArgumentType\": {\n      \"oneOf\": [\n        { \"$ref\": \"#/definitions/IntArgumentType\" },\n        { \"$ref\": \"#/definitions/StrArgumentType\" },\n        { \"$ref\": \"#/definitions/ImgArgumentType\" },\n        { \"$ref\": \"#/definitions/AppArgumentType\" },\n        { \"$ref\": \"#/definitions/BundleArgumentType\" }\n        // Add other argument types here if needed (e.g., ConditionList)\n      ],\n       \"description\": \"Represents any valid argument element (Int, Str, Img, App, Bundle).\"\n    },\n\n    \"IntArgumentType\": {\n      \"type\": \"object\",\n      \"description\": \"Integer argument type <Int>. Represents an integer value or a variable reference. Must contain EITHER the '_val' attribute (for literal integers) OR a child 'var' object (representing the <var> tag for variable names).\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Argument index (e.g., arg0, arg1).\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"Argument version (often omitted when 'var' child is used).\" }\n        // Note: _val and var are defined within the oneOf structure below\n      },\n      \"required\": [ \"_sr\" ], // _ve might be optional depending on Tasker version/context\n      \"oneOf\": [\n        {\n          \"description\": \"Structure for literal integer values.\",\n          \"properties\": {\n            \"_val\": {\n              \"type\": \"integer\",\n              \"description\": \"The literal integer value.\"\n            }\n          },\n          \"required\": [ \"_val\" ],\n          \"additionalProperties\": false // No other properties allowed in this case\n        },\n        {\n          \"description\": \"Structure for variable references.\",\n          \"properties\": {\n            \"var\": {\n              \"type\": \"object\", // Represents the <var> child tag\n              \"description\": \"Placeholder for the <var> tag. The actual variable name is its text content.\",\n              // JSON Schema can't easily validate the text content of an XML element,\n              // so we represent the tag's existence as an object.\n              \"properties\": {}, // The <var> tag itself usually has no attributes/children\n              \"additionalProperties\": false\n            }\n          },\n          \"required\": [ \"var\" ],\n          \"additionalProperties\": false // No other properties allowed in this case\n        }\n      ],\n      // Allow _sr and _ve alongside the oneOf choice, but nothing else unexpected.\n      \"additionalProperties\": false\n    },\n\n    \"StrArgumentType\": {\n      \"type\": \"object\",\n      \"description\": \"String argument type. The value is the text content, which can be empty.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Argument index (e.g., arg1).\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"Argument version.\" }\n        // Text content represents the value. Schema cannot easily enforce presence of text node.\n      },\n      \"required\": [ \"_sr\", \"_ve\" ], // Empty string value is valid (e.g., <Str sr=\"arg1\" ve=\"3\"/>)\n      \"additionalProperties\": false // Assuming simple string content, no other attributes/children\n    },\n\n    \"ImgArgumentType\": {\n      \"type\": \"object\",\n      \"description\": \"Image argument type. Contains child elements defining the image source.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Argument index (e.g., arg2).\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"Argument version.\" },\n        \"pkg\": { \"type\": \"string\", \"description\": \"App package name for app icon source (optional).\" },\n        \"cls\": { \"type\": \"string\", \"description\": \"App activity class name for app icon source (optional, requires pkg).\" },\n        \"fle\": { \"type\": \"string\", \"description\": \"File path for image source (optional).\" },\n        \"uri\": { \"type\": \"string\", \"description\": \"URI (e.g., URL) for image source (optional).\" },\n        \"var\": { \"type\": \"string\", \"description\": \"Tasker variable name containing image source info (optional).\" }\n      },\n      \"required\": [ \"_sr\", \"_ve\" ],\n      \"additionalProperties\": false\n    },\n\n    \"AppArgumentType\": {\n      \"type\": \"object\",\n      \"description\": \"Application argument type.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Argument index (e.g., arg0).\" },\n        \"appClass\": { \"type\": \"string\", \"description\": \"Activity class name (can be empty if using variable).\" },\n        \"appPkg\": { \"type\": \"string\", \"description\": \"Application package name or variable name.\" },\n        \"label\": { \"type\": \"string\", \"description\": \"Application label or variable name.\" }\n      },\n      \"required\": [ \"_sr\", \"appClass\", \"appPkg\", \"label\" ],\n      \"additionalProperties\": false\n    },\n\n    \"TimeType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents the Time context. Identified by the <Time> tag. Contains time configuration elements directly.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Condition source reference (e.g., con0). Required.\" },\n        \"fh\": { \"type\": \"integer\", \"minimum\": -1, \"maximum\": 23, \"description\": \"From Hour (0-23). Use -1 if no specific start hour is needed (e.g., only repetition specified, or start time determined by 'fromvar'). Mutually exclusive with fromvar.\" },\n        \"fm\": { \"type\": \"integer\", \"minimum\": -1, \"maximum\": 59, \"description\": \"From Minute (0-59). Use -1 if no specific start minute is needed (e.g., only repetition specified, or start time determined by 'fromvar'). Mutually exclusive with fromvar.\" },\n        \"th\": { \"type\": \"integer\", \"minimum\": -1, \"maximum\": 23, \"description\": \"To Hour (0-23). Use -1 if no specific end hour is needed (e.g., only repetition specified, or end time determined by 'tovar'). Mutually exclusive with tovar.\" },\n        \"tm\": { \"type\": \"integer\", \"minimum\": -1, \"maximum\": 59, \"description\": \"To Minute (0-59). Use -1 if no specific end minute is needed (e.g., only repetition specified, or end time determined by 'tovar'). Mutually exclusive with tovar.\" },\n        \"rep\": { \"type\": \"integer\", \"enum\": [1, 2], \"description\": \"Repeat Type (1=Hours, 2=Minutes). Optional. Requires repval.\" },\n        \"repval\": { \"type\": \"integer\", \"minimum\": 1, \"description\": \"Repeat Value (interval). Optional. Requires rep.\" },\n        \"fromvar\": { \"type\": \"string\", \"pattern\": \"^%(?=.*[A-Z])[a-zA-Z0-9_]{3,}$\", \"description\": \"Variable for 'From' time. MUST be a **Global Variable** (name contains at least one uppercase letter, is >= 3 chars, follows pattern ^%(?=.*[A-Z])[a-zA-Z0-9_]{3,}$). Mutually exclusive with fh/fm.\" },\n        \"tovar\": { \"type\": \"string\", \"pattern\": \"^%(?=.*[A-Z])[a-zA-Z0-9_]{3,}$\", \"description\": \"Variable for 'To' time. MUST be a **Global Variable** (name contains at least one uppercase letter, is >= 3 chars, follows pattern ^%(?=.*[A-Z])[a-zA-Z0-9_]{3,}$). Mutually exclusive with th/tm.\" }\n      },\n      \"required\": [ \"_sr\" ],\n      // Logic for mutual exclusivity (e.g., fh/fm XOR fromvar) is complex for basic JSON schema, handled by AI instructions.\n      \"additionalProperties\": false // Should only contain the defined elements/attributes\n    },\n\n    \"AppType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents the App context. Identified by the <App> tag. Contains app specification elements directly.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Condition source reference (e.g., con0). Required.\" },\n        \"_ve\": { \"type\": \"integer\", \"description\": \"App context version identifier. Required.\" },\n        \"flags\": { \"type\": \"integer\", \"const\": 2, \"description\": \"Flags for App context, must be 2.\" },\n        \"pin\": {\n          \"type\": \"boolean\", \n          \"const\": true,    \n          \"description\": \"Optional. If present (always as 'true'), indicates the App context condition is inverted (e.g., active when specified app(s) are NOT in foreground).\"\n        }\n        // Additional properties for labelN and pkgN using patternProperties\n      },\n      \"patternProperties\": {\n        \"^label\\\\d+$\": { \"type\": \"string\", \"description\": \"Label of the Nth application (e.g., label0, label1).\" },\n        \"^pkg\\\\d+$\": { \"type\": \"string\", \"description\": \"Package name of the Nth application (e.g., pkg0, pkg1).\" }\n      },\n      \"required\": [ \"_sr\", \"_ve\", \"flags\", \"label0\", \"pkg0\" ], // Must specify at least one app\n      \"additionalProperties\": false // Should only contain defined attributes and labelN/pkgN pairs\n    },\n\n    \"BundleArgumentType\": {\n      \"type\": \"object\",\n      \"description\": \"Bundle argument type. Should be empty when generated by AI.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Argument index (e.g., arg5).\" },\n         \"Vals\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"_sr\": { \"type\": \"string\", \"const\": \"val\", \"description\": \"Should be 'val'.\" }\n            },\n            \"required\": [\"_sr\"],\n            \"additionalProperties\": true, // Allow other attributes Tasker might add\n            \"description\": \"Internal values container, usually generated empty by AI.\"\n          }\n      },\n      \"required\": [ \"_sr\" ], // Vals child is typically present, even if empty\n      \"additionalProperties\": false // No other direct children expected besides Vals\n    }\n    \"DayType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents the Day context. Identified by the <Day> tag. Contains lists of allowed months, weekdays, or days of month. IMPORTANT: The digit(s) 'N' in child tags like <mnthN>, <wdayN>, <mdayN> represent a zero-based index (0, 1, 2...) when multiple selections are made for the same type (e.g., multiple weekdays). This index 'N' MUST NOT be confused with the actual value (month 0-11, weekday 1-7, day 1-31) specified *inside* the tag.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Condition source reference (e.g., con0). Required.\" }\n        // Child elements mnthN, wdayN, mdayN are handled by patternProperties\n      },\n      \"patternProperties\": {\n        \"^mnth\\\\d+$\": { \"type\": \"integer\", \"minimum\": 0, \"maximum\": 11, \"description\": \"Month selection (0=Jan, 11=Dec).\" },\n        \"^wday\\\\d+$\": { \"type\": \"integer\", \"minimum\": 1, \"maximum\": 7, \"description\": \"Weekday selection (1=Sun, 7=Sat).\" },\n        \"^mday\\\\d+$\": { \"type\": \"integer\", \"minimum\": 1, \"maximum\": 31, \"description\": \"Day of month selection.\" }\n      },\n      \"required\": [ \"_sr\" ],\n      \"additionalProperties\": false // Should only contain _sr and the patterned child elements\n    },\n    \"LocType\": {\n      \"type\": \"object\",\n      \"description\": \"Represents the Location context. Identified by the <Loc> tag. Contains location parameters as direct children. Does not use a <code>, _ve, or <pin> element.\",\n      \"properties\": {\n        \"_sr\": { \"type\": \"string\", \"description\": \"Condition source reference (e.g., con0, con1). Required.\" },\n        \"cname\": { \"type\": \"string\", \"description\": \"Descriptive name for the location (e.g., 'Gas station').\" },\n        \"lat\": { \"type\": \"number\", \"description\": \"Latitude of the location center.\" },\n        \"long\": { \"type\": \"number\", \"description\": \"Longitude of the location center.\" },\n        \"rad\": { \"type\": \"number\", \"description\": \"Radius in meters around the lat/long point.\" }\n      },\n      \"required\": [ \"_sr\", \"lat\", \"long\", \"rad\" ],\n      \"additionalProperties\": false\n    }\n  }\n}\n", false, 4, (Object) null), "<<INJECT_TASKER_PROFILE_XML_STRUCTURE_DESCRIPTION>>", ed.b.a(), false, 4, (Object) null), "<<INJECT_TASKER_TASK_XML_STRUCTURE_DESCRIPTION>>", ed.b.c(), false, 4, (Object) null), "<<INJECT_TASKER_PROJECT_XML_STRUCTURE_DESCRIPTION>>", ed.b.b(), false, 4, (Object) null), "<<INJECT_TASKER_XML_EXAMPLES>>", "\n$$$------$$$$\n\n    When connected to home Wifi (in this case \"Dias\"), turn down media, ringer and notification volumes:\n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n    \t<Profile sr=\"prof83\" ve=\"2\">\n    \t\t<cdate>1743500042895</cdate>\n    \t\t<edate>1743500921178</edate>\n    \t\t<flags>40</flags>\n    \t\t<id>83</id>\n    \t\t<limit>true</limit>\n    \t\t<mid0>81</mid0>\n    \t\t<nme>At Home Turn Volume Down</nme>\n    \t\t<State sr=\"con0\" ve=\"2\">\n    \t\t\t<code>160</code>\n    \t\t\t<Str sr=\"arg0\" ve=\"3\">Dias</Str>\n    \t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n    \t\t\t<Str sr=\"arg2\" ve=\"3\"/>\n    \t\t\t<Int sr=\"arg3\" val=\"2\"/>\n    \t\t</State>\n    \t</Profile>\n    \t<Task sr=\"task81\">\n    \t\t<cdate>1743500042880</cdate>\n    \t\t<edate>1743500921177</edate>\n    \t\t<id>81</id>\n    \t\t<Action sr=\"act0\" ve=\"7\">\n    \t\t\t<code>307</code>\n    \t\t\t<Int sr=\"arg0\" val=\"1\"/>\n    \t\t\t<Int sr=\"arg1\" val=\"0\"/>\n    \t\t\t<Int sr=\"arg2\" val=\"0\"/>\n    \t\t</Action>\n    \t\t<Action sr=\"act1\" ve=\"7\">\n    \t\t\t<code>304</code>\n    \t\t\t<Int sr=\"arg0\" val=\"1\"/>\n    \t\t\t<Int sr=\"arg1\" val=\"0\"/>\n    \t\t\t<Int sr=\"arg2\" val=\"0\"/>\n    \t\t</Action>\n    \t\t<Action sr=\"act2\" ve=\"7\">\n    \t\t\t<code>305</code>\n    \t\t\t<Int sr=\"arg0\" val=\"1\"/>\n    \t\t\t<Int sr=\"arg1\" val=\"0\"/>\n    \t\t\t<Int sr=\"arg2\" val=\"0\"/>\n    \t\t</Action>\n    \t</Task>\n    </TaskerData>\n\n$$$------$$$$\n\n    When receiving a message where the text contains \"where are you\" with anything before it or after it, get own location, reply with Google Maps URl to sender, notify that this was done and update widget that this was done:\n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n\t<Profile sr=\"prof66\" ve=\"2\">\n\t\t<cdate>1743081269457</cdate>\n\t\t<edate>1743501061591</edate>\n\t\t<flags>40</flags>\n\t\t<id>66</id>\n\t\t<mid0>67</mid0>\n\t\t<nme>On Received Where Are You SMS Reply Location</nme>\n\t\t<Event sr=\"con0\" ve=\"2\">\n\t\t\t<code>7</code>\n\t\t\t<pri>0</pri>\n\t\t\t<Int sr=\"arg0\" val=\"0\"/>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">*where are you*</Str>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t</Event>\n\t</Profile>\n\t<Task sr=\"task67\">\n\t\t<cdate>1743081273223</cdate>\n\t\t<edate>1743501061591</edate>\n\t\t<id>67</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>366</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Int sr=\"arg1\" val=\"30\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg6\" val=\"0\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t\t<Str sr=\"arg8\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg9\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act1\" ve=\"7\">\n\t\t\t<code>41</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%evtprm2</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">%gl_map_url</Str>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg4\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act2\" ve=\"7\">\n\t\t\t<code>523</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">Location Shared</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">Location sent to %evtprm2</Str>\n\t\t\t<Str sr=\"arg10\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg11\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg12\" ve=\"3\"/>\n\t\t\t<Img sr=\"arg2\" ve=\"2\"/>\n\t\t\t<Int sr=\"arg3\" val=\"0\"/>\n\t\t\t<Int sr=\"arg4\" val=\"0\"/>\n\t\t\t<Int sr=\"arg5\" val=\"3\"/>\n\t\t\t<Int sr=\"arg6\" val=\"0\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t\t<Int sr=\"arg8\" val=\"0\"/>\n\t\t\t<Str sr=\"arg9\" ve=\"3\"/>\n\t\t</Action>\n\t\t<Action sr=\"act3\" ve=\"7\">\n\t\t\t<code>461</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">test</Str>\n\t\t\t<Str sr=\"arg10\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg11\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg12\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg13\" ve=\"3\">{\n  \"children\": [\n    {\n      \"text\": \"Send location to %evtprm2\",\n      \"type\": \"Text\"\n    }\n  ],\n  \"horizontalAlignment\": \"Center\",\n  \"verticalAlignment\": \"Center\",\n  \"fillMaxSize\": true,\n  \"type\": \"Column\",\n  \"useMaterialYouColors\": true\n}</Str>\n\t\t\t<Int sr=\"arg14\" val=\"1\"/>\n\t\t\t<Str sr=\"arg15\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg16\" val=\"1\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">Custom</Str>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg7\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg8\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg9\" ve=\"3\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    Whenever the display is on and the user unlocks it and it's time for school (determined by the %SchoolTime variable being set in some other task), turn on the light \"Leaf\" and say \"It's time for school!\" out loud.\n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n\t<Profile sr=\"prof82\" ve=\"2\">\n\t\t<cdate>1743500042895</cdate>\n\t\t<edate>1743501785843</edate>\n\t\t<flags>40</flags>\n\t\t<id>82</id>\n\t\t<limit>true</limit>\n\t\t<mid0>81</mid0>\n\t\t<nme>At Home And Display On And Unlocked</nme>\n\t\t<Event sr=\"con0\" ve=\"2\">\n\t\t\t<code>1000</code>\n\t\t</Event>\n\t\t<State sr=\"con1\" ve=\"2\">\n\t\t\t<code>123</code>\n\t\t\t<Int sr=\"arg0\" val=\"1\"/>\n\t\t</State>\n\t\t<State sr=\"con2\" ve=\"2\">\n\t\t\t<code>165</code>\n\t\t\t<ConditionList sr=\"if\">\n\t\t\t\t<Condition sr=\"c0\" ve=\"3\">\n\t\t\t\t\t<lhs>%SchoolTime</lhs>\n\t\t\t\t\t<op>12</op>\n\t\t\t\t\t<rhs></rhs>\n\t\t\t\t</Condition>\n\t\t\t</ConditionList>\n\t\t</State>\n\t</Profile>\n\t<Task sr=\"task81\">\n\t\t<cdate>1743500042880</cdate>\n\t\t<edate>1743501785843</edate>\n\t\t<id>81</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>438</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">Leaf</Str>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">On</Str>\n\t\t\t<Str sr=\"arg3\" ve=\"3\">#FF00FF00</Str>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t</Action>\n\t\t<Action sr=\"act1\" ve=\"7\">\n\t\t\t<code>559</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">It's time for school!</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n\t\t\t<Int sr=\"arg2\" val=\"3\"/>\n\t\t\t<Int sr=\"arg3\" val=\"5\"/>\n\t\t\t<Int sr=\"arg4\" val=\"5\"/>\n\t\t\t<Int sr=\"arg5\" val=\"1\"/>\n\t\t\t<Int sr=\"arg6\" val=\"0\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    I want my phone to count out loud to 5 when I tap a button on my home screen.\n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n\t<Task sr=\"task79\">\n\t\t<cdate>1743686130509</cdate>\n\t\t<edate>1743686165007</edate>\n\t\t<id>79</id>\n\t\t<nme>Count Out loud</nme>\n\t\t<pri>100</pri>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>39</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%index</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">1:5</Str>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act1\" ve=\"7\">\n\t\t\t<code>559</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%index</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n\t\t\t<Int sr=\"arg2\" val=\"3\"/>\n\t\t\t<Int sr=\"arg3\" val=\"5\"/>\n\t\t\t<Int sr=\"arg4\" val=\"5\"/>\n\t\t\t<Int sr=\"arg5\" val=\"1\"/>\n\t\t\t<Int sr=\"arg6\" val=\"0\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act2\" ve=\"7\">\n\t\t\t<code>40</code>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    At work, with wifi network \"Work Wifi\" music should play with level 255 and at home with wifi network \"Home Wifi\" it should play with level 1. \n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n\t<Profile sr=\"prof80\" ve=\"2\">\n\t\t<cdate>1743691112434</cdate>\n\t\t<edate>1743691139597</edate>\n\t\t<flags>40</flags>\n\t\t<id>80</id>\n\t\t<mid0>89</mid0>\n\t\t<nme>At Home Media Volume Low</nme>\n\t\t<State sr=\"con0\" ve=\"2\">\n\t\t\t<code>160</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">Home Wifi</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg3\" val=\"2\"/>\n\t\t</State>\n\t</Profile>\n\t<Profile sr=\"prof90\" ve=\"2\">\n\t\t<cdate>1743691112434</cdate>\n\t\t<edate>1743691164709</edate>\n\t\t<flags>40</flags>\n\t\t<id>90</id>\n\t\t<mid0>91</mid0>\n\t\t<nme>At Work Media Volume High</nme>\n\t\t<State sr=\"con0\" ve=\"2\">\n\t\t\t<code>160</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">Work Wifi</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg3\" val=\"2\"/>\n\t\t</State>\n\t</Profile>\n\t<Project sr=\"proj0\" ve=\"2\">\n\t\t<cdate>1743691098808</cdate>\n\t\t<name>Work And Home</name>\n\t\t<pids>90,80</pids>\n\t\t<tids>91,89</tids>\n\t</Project>\n\t<Task sr=\"task89\">\n\t\t<cdate>1743691115492</cdate>\n\t\t<edate>1743691131186</edate>\n\t\t<id>89</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>307</code>\n\t\t\t<Int sr=\"arg0\" val=\"1\"/>\n\t\t\t<Int sr=\"arg1\" val=\"0\"/>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t</Action>\n\t</Task>\n\t<Task sr=\"task91\">\n\t\t<cdate>1743691115492</cdate>\n\t\t<edate>1743691164709</edate>\n\t\t<id>91</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>307</code>\n\t\t\t<Int sr=\"arg0\" val=\"255\"/>\n\t\t\t<Int sr=\"arg1\" val=\"0\"/>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    Create a widget that shows the top 5 hottest topics in the Tasker subreddit. \n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.4-beta\">\n\t<Project sr=\"proj0\" ve=\"2\">\n\t\t<cdate>1743695000001</cdate>\n\t\t<name>Reddit Widget Project</name>\n\t\t<tids>102,100</tids>\n\t</Project>\n\t<Task sr=\"task100\">\n\t\t<cdate>1743695000002</cdate>\n\t\t<edate>1744373965809</edate>\n\t\t<id>100</id>\n\t\t<nme>Update Reddit Widget</nme>\n\t\t<pri>100</pri>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>339</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Int sr=\"arg1\" val=\"0\"/>\n\t\t\t<Int sr=\"arg10\" val=\"1\"/>\n\t\t\t<Int sr=\"arg11\" val=\"1\"/>\n\t\t\t<Int sr=\"arg12\" val=\"1\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">https://www.reddit.com/r/tasker/hot/.json?limit=5</Str>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg7\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg8\" val=\"30\"/>\n\t\t\t<Int sr=\"arg9\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act1\" ve=\"7\">\n\t\t\t<code>389</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">%widget_color_background=surface\n%widget_color_text=onSurface\n%widget_color_item_bg=surfaceVariant\n%widget_corner_radius=12</Str>\n\t\t\t<Str sr=\"arg2\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\">=</Str>\n\t\t\t<Int sr=\"arg5\" val=\"0\"/>\n\t\t\t<Int sr=\"arg6\" val=\"3\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t\t<Int sr=\"arg8\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act2\" ve=\"7\">\n\t\t\t<code>393</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">%http_data.data.children.data.title,%http_data.data.children.data.permalink</Str>\n\t\t\t<Int sr=\"arg2\" val=\"1\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\">,</Str>\n\t\t\t<Str sr=\"arg4\" ve=\"3\">{\n  \"children\": [\n    {\n      \"color\": \"%widget_color_text\",\n      \"maxLines\": 2,\n      \"text\": \"%http_data.data.children.data.title\",\n      \"padding\": 8,\n      \"type\": \"Text\"\n    }\n  ],\n  \"backgroundColor\": \"%widget_color_item_bg\",\n  \"cornerRadius\": \"%widget_corner_radius\",\n  \"fillMaxWidth\": true,\n  \"padding\": 4,\n  \"task\": \"Open URL\",\n  \"taskVariables\": {\n    \"%url\": \"https://www.reddit.com%http_data.data.children.data.permalink\"\n  },\n  \"type\": \"Row\"\n}</Str>\n\t\t\t<Str sr=\"arg5\" ve=\"3\">%reddit_items</Str>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t</Action>\n\t\t<Action sr=\"act3\" ve=\"7\">\n\t\t\t<code>461</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">Tasker Reddit Hot Posts</Str>\n\t\t\t<Str sr=\"arg10\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg11\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg12\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg13\" ve=\"3\">{\n  \"type\": \"Scaffold\",\n  \"backgroundColor\": \"%widget_color_background\",\n  \"titleBar\": {\n    \"type\": \"TitleBar\",\n    \"icon\": \"tasker_reddit_icon\",\n    \"text\": \"r/tasker Hot Posts\",\n    \"textColor\": \"%widget_color_text\"\n  },\n  \"children\": [\n    {\n      \"type\": \"Column\",\n      \"scrolling\": true,\n      \"padding\": 8,\n      \"children\": [\n          %reddit_items()\n       ]\n    }\n  ]\n}</Str>\n\t\t\t<Int sr=\"arg14\" val=\"1\"/>\n\t\t\t<Str sr=\"arg15\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg16\" val=\"1\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">Custom</Str>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg7\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg8\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg9\" ve=\"3\"/>\n\t\t</Action>\n\t</Task>\n\t<Task sr=\"task102\">\n\t\t<cdate>1743695000011</cdate>\n\t\t<edate>1743695000012</edate>\n\t\t<id>102</id>\n\t\t<nme>Open URL</nme>\n\t\t<pri>100</pri>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>104</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%url</Str>\n\t\t\t<App sr=\"arg1\">\n\t\t\t\t<appClass></appClass>\n\t\t\t\t<appPkg></appPkg>\n\t\t\t\t<label></label>\n\t\t\t</App>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    Every 5 minutes between 2 and 3 PM show a message on the screen saying \"Hello\"\n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.4-beta\">\n\t<Profile sr=\"prof103\" ve=\"2\">\n\t\t<cdate>1744376939725</cdate>\n\t\t<edate>1744376975064</edate>\n\t\t<flags>8</flags>\n\t\t<id>103</id>\n\t\t<mid0>104</mid0>\n\t\t<nme>Flash Hello Every 5 Minutes From 2 To 3 PM</nme>\n\t\t<Time sr=\"con0\">\n\t\t\t<fh>14</fh>\n\t\t\t<fm>0</fm>\n\t\t\t<rep>2</rep>\n\t\t\t<repval>5</repval>\n\t\t\t<th>15</th>\n\t\t\t<tm>0</tm>\n\t\t</Time>\n\t</Profile>\n\t<Task sr=\"task104\">\n\t\t<cdate>1744376942584</cdate>\n\t\t<edate>1744376950981</edate>\n\t\t<id>104</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>548</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">Hello</Str>\n\t\t\t<Int sr=\"arg1\" val=\"0\"/>\n\t\t\t<Str sr=\"arg10\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg11\" val=\"1\"/>\n\t\t\t<Int sr=\"arg12\" val=\"0\"/>\n\t\t\t<Str sr=\"arg13\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg14\" val=\"0\"/>\n\t\t\t<Str sr=\"arg15\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg7\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg8\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg9\" val=\"1\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    User: I want a shortcut that when clicked says \"I'm home\" or \"I'm not home\"\n    \n    AI: Ok. I'll need to know when you're home. What's your home Wifi Network?\n    \n    User: Dias Gwifi\n    \n    AI: Ok, this project detects when you're at home and has a task that you can call from a shortcut that says out loud if you're home or not.\n    \n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.4-beta\">\n<Profile sr=\"prof2\" ve=\"2\">\n<cdate>1745394516520</cdate>\n<edate>1745394558962</edate>\n<flags>40</flags>\n<id>2</id>\n<mid0>3</mid0>\n<mid1>4</mid1>\n<nme>Detect Home Wifi</nme>\n<State sr=\"con0\" ve=\"2\">\n<code>160</code>\n<Str sr=\"arg0\" ve=\"3\">Dias Gwifi</Str>\n<Str sr=\"arg1\" ve=\"3\"/>\n<Str sr=\"arg2\" ve=\"3\"/>\n<Int sr=\"arg3\" val=\"2\"/>\n</State>\n</Profile>\n<Project sr=\"proj0\" ve=\"2\">\n<cdate>1745394508831</cdate>\n<name>Home Status Announcer</name>\n<pids>2</pids>\n<tids>5,3,4</tids>\n</Project>\n<Task sr=\"task3\">\n<cdate>1745394520191</cdate>\n<edate>1745394526872</edate>\n<id>3</id>\n<Action sr=\"act0\" ve=\"7\">\n<code>547</code>\n<Str sr=\"arg0\" ve=\"3\">%AtHome</Str>\n<Str sr=\"arg1\" ve=\"3\">1</Str>\n<Int sr=\"arg2\" val=\"0\"/>\n<Int sr=\"arg3\" val=\"0\"/>\n<Int sr=\"arg4\" val=\"0\"/>\n<Int sr=\"arg5\" val=\"3\"/>\n<Int sr=\"arg6\" val=\"0\"/>\n</Action>\n</Task>\n<Task sr=\"task4\">\n<cdate>1745394534237</cdate>\n<edate>1745394540544</edate>\n<id>4</id>\n<Action sr=\"act0\" ve=\"7\">\n<code>549</code>\n<Str sr=\"arg0\" ve=\"3\">%AtHome</Str>\n<Int sr=\"arg1\" val=\"0\"/>\n<Int sr=\"arg2\" val=\"0\"/>\n<Int sr=\"arg3\" val=\"0\"/>\n</Action>\n</Task>\n<Task sr=\"task5\">\n<cdate>1745394544127</cdate>\n<edate>1745394618384</edate>\n<id>5</id>\n<nme>Announce Home Status</nme>\n<pri>100</pri>\n<Action sr=\"act0\" ve=\"7\">\n<code>37</code>\n<ConditionList sr=\"if\">\n<Condition sr=\"c0\" ve=\"3\">\n<lhs>%AtHome</lhs>\n<op>0</op>\n<rhs>1</rhs>\n</Condition>\n</ConditionList>\n</Action>\n<Action sr=\"act1\" ve=\"7\">\n<code>559</code>\n<Str sr=\"arg0\" ve=\"3\">I'm home</Str>\n<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n<Int sr=\"arg2\" val=\"3\"/>\n<Int sr=\"arg3\" val=\"5\"/>\n<Int sr=\"arg4\" val=\"5\"/>\n<Int sr=\"arg5\" val=\"1\"/>\n<Int sr=\"arg6\" val=\"0\"/>\n<Int sr=\"arg7\" val=\"0\"/>\n</Action>\n<Action sr=\"act2\" ve=\"7\">\n<code>43</code>\n</Action>\n<Action sr=\"act3\" ve=\"7\">\n<code>559</code>\n<Str sr=\"arg0\" ve=\"3\">I'm not home</Str>\n<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n<Int sr=\"arg2\" val=\"3\"/>\n<Int sr=\"arg3\" val=\"5\"/>\n<Int sr=\"arg4\" val=\"5\"/>\n<Int sr=\"arg5\" val=\"1\"/>\n<Int sr=\"arg6\" val=\"0\"/>\n<Int sr=\"arg7\" val=\"0\"/>\n</Action>\n<Action sr=\"act4\" ve=\"7\">\n<code>38</code>\n</Action>\n</Task>\n</TaskerData>\n", false, 4, (Object) null), "<<INJECT_CLARIFICATION_JSON_SCHEMA_DEFINITION>>", ed.a.a(), false, 4, (Object) null);
                String i14 = x2.i1(iVar);
                p.h(i14, "<get-json>(...)");
                String C5 = hk.o.C(hk.o.C(hk.o.C(C4, "<<INJECT_TASKER_INPUT_DIALOG_TYPES_CATALOG_JSON>>", i14, false, 4, (Object) null), "<<INJECT_EXAMPLE_SUCCESS_SCENARIOS>>", "\n    Request: When I receive a call I want my phone to say out loud that I'm receiving that call like \"call incoming\" or some cool phrase that you come up with AI! 🤯\n    \n    Result XML:\n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n    \t<Profile sr=\"prof84\" ve=\"2\">\n    \t\t<cdate>1743502162548</cdate>\n    \t\t<edate>1743502194856</edate>\n    \t\t<flags>40</flags>\n    \t\t<id>84</id>\n    \t\t<mid0>85</mid0>\n    \t\t<nme>Announce Incoming Call</nme>\n    \t\t<State sr=\"con0\" ve=\"2\">\n    \t\t\t<code>40</code>\n    \t\t\t<Int sr=\"arg0\" val=\"0\"/>\n    \t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n    \t\t</State>\n    \t</Profile>\n    \t<Task sr=\"task85\">\n    \t\t<cdate>1743502166295</cdate>\n    \t\t<edate>1743502183581</edate>\n    \t\t<id>85</id>\n    \t\t<Action sr=\"act0\" ve=\"7\">\n    \t\t\t<code>559</code>\n    \t\t\t<Str sr=\"arg0\" ve=\"3\">Yo! A call is coming! Get ready!</Str>\n    \t\t\t<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n    \t\t\t<Int sr=\"arg2\" val=\"3\"/>\n    \t\t\t<Int sr=\"arg3\" val=\"5\"/>\n    \t\t\t<Int sr=\"arg4\" val=\"5\"/>\n    \t\t\t<Int sr=\"arg5\" val=\"1\"/>\n    \t\t\t<Int sr=\"arg6\" val=\"0\"/>\n    \t\t\t<Int sr=\"arg7\" val=\"0\"/>\n    \t\t</Action>\n    \t</Task>\n    </TaskerData>\n\n$$$------$$$$\n\n    Request: When I tap a shortcut on my home screen I want the screen to be recorded for 3 seconds to the file Tasker/screen.mp4\"\n    \n    Result XML:\n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n\t<Task sr=\"task19\">\n\t\t<cdate>1741096017237</cdate>\n\t\t<edate>1743692145400</edate>\n\t\t<id>19</id>\n\t\t<nme>Capture</nme>\n\t\t<pri>100</pri>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>374</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Int sr=\"arg1\" val=\"0\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">Tasker/screen.mp4</Str>\n\t\t\t<Int sr=\"arg3\" val=\"0\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg7\" ve=\"3\"/>\n\t\t</Action>\n\t\t<Action sr=\"act1\" ve=\"7\">\n\t\t\t<code>30</code>\n\t\t\t<Int sr=\"arg0\" val=\"0\"/>\n\t\t\t<Int sr=\"arg1\" val=\"3\"/>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t\t<Int sr=\"arg3\" val=\"0\"/>\n\t\t\t<Int sr=\"arg4\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act2\" ve=\"7\">\n\t\t\t<code>374</code>\n\t\t\t<Bundle sr=\"arg0\">\n\t\t\t\t<Vals sr=\"val\"/>\n\t\t\t</Bundle>\n\t\t\t<Int sr=\"arg1\" val=\"1\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\">Tasker/screen.mp4</Str>\n\t\t\t<Int sr=\"arg3\" val=\"0\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg7\" ve=\"3\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n\n$$$------$$$$\n\n    Request: I want my Gmail notifications to be read out loud and also when I tap any NFC tag I want Spotify to open.\n    \n    Result XML:\n    <TaskerData sr=\"\" dvi=\"1\" tv=\"6.5.3-beta\">\n\t<Profile sr=\"prof76\" ve=\"2\">\n\t\t<cdate>1743681648679</cdate>\n\t\t<clp>true</clp>\n\t\t<edate>1743686118197</edate>\n\t\t<flags>40</flags>\n\t\t<id>76</id>\n\t\t<mid0>75</mid0>\n\t\t<nme>Launch Spotify on NFC Scan</nme>\n\t\t<Event sr=\"con0\" ve=\"2\">\n\t\t\t<code>2076</code>\n\t\t\t<pri>0</pri>\n\t\t\t<Str sr=\"arg0\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t</Event>\n\t</Profile>\n\t<Profile sr=\"prof78\" ve=\"2\">\n\t\t<cdate>1743682561802</cdate>\n\t\t<edate>1743686112500</edate>\n\t\t<flags>40</flags>\n\t\t<id>78</id>\n\t\t<mid0>77</mid0>\n\t\t<nme>Read Gmail Notifications</nme>\n\t\t<Event sr=\"con0\" ve=\"2\">\n\t\t\t<code>461</code>\n\t\t\t<pri>0</pri>\n\t\t\t<App sr=\"arg0\">\n\t\t\t\t<appClass></appClass>\n\t\t\t\t<appPkg>com.google.android.gm</appPkg>\n\t\t\t\t<label>Gmail</label>\n\t\t\t</App>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg2\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg3\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg4\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg5\" ve=\"3\"/>\n\t\t\t<Str sr=\"arg6\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg7\" val=\"1\"/>\n\t\t</Event>\n\t</Profile>\n\t<Project sr=\"proj0\" ve=\"2\">\n\t\t<cdate>1743686098268</cdate>\n\t\t<name>Read Gmail And Launch Spotify With NFC</name>\n\t\t<pids>78,76</pids>\n\t\t<tids>79,75,92,77</tids>\n\t</Project>\n\t<Task sr=\"task75\">\n\t\t<cdate>1715800005001</cdate>\n\t\t<edate>1743686118197</edate>\n\t\t<id>75</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>20</code>\n\t\t\t<App sr=\"arg0\">\n\t\t\t\t<appClass></appClass>\n\t\t\t\t<appPkg>com.spotify.music</appPkg>\n\t\t\t\t<label>Spotify</label>\n\t\t\t</App>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t\t<Int sr=\"arg3\" val=\"0\"/>\n\t\t</Action>\n\t</Task>\n\t<Task sr=\"task77\">\n\t\t<cdate>1743510000003</cdate>\n\t\t<edate>1743686112500</edate>\n\t\t<id>77</id>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>559</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%evtprm2. %evtprm3</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n\t\t\t<Int sr=\"arg2\" val=\"3\"/>\n\t\t\t<Int sr=\"arg3\" val=\"5\"/>\n\t\t\t<Int sr=\"arg4\" val=\"5\"/>\n\t\t\t<Int sr=\"arg5\" val=\"1\"/>\n\t\t\t<Int sr=\"arg6\" val=\"0\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t</Action>\n\t</Task>\n\t<Task sr=\"task79\">\n\t\t<cdate>1743686130509</cdate>\n\t\t<edate>1743686165007</edate>\n\t\t<id>79</id>\n\t\t<nme>Count Out loud</nme>\n\t\t<pri>100</pri>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>39</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%index</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">1:5</Str>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act1\" ve=\"7\">\n\t\t\t<code>559</code>\n\t\t\t<Str sr=\"arg0\" ve=\"3\">%index</Str>\n\t\t\t<Str sr=\"arg1\" ve=\"3\">default:default</Str>\n\t\t\t<Int sr=\"arg2\" val=\"3\"/>\n\t\t\t<Int sr=\"arg3\" val=\"5\"/>\n\t\t\t<Int sr=\"arg4\" val=\"5\"/>\n\t\t\t<Int sr=\"arg5\" val=\"1\"/>\n\t\t\t<Int sr=\"arg6\" val=\"0\"/>\n\t\t\t<Int sr=\"arg7\" val=\"0\"/>\n\t\t</Action>\n\t\t<Action sr=\"act2\" ve=\"7\">\n\t\t\t<code>40</code>\n\t\t</Action>\n\t</Task>\n\t<Task sr=\"task92\">\n\t\t<cdate>1743691669552</cdate>\n\t\t<edate>1743691774441</edate>\n\t\t<id>92</id>\n\t\t<nme>Open Spotify</nme>\n\t\t<Action sr=\"act0\" ve=\"7\">\n\t\t\t<code>20</code>\n\t\t\t<App sr=\"arg0\">\n\t\t\t\t<appClass>com.spotify.music.MainActivity</appClass>\n\t\t\t\t<appPkg>com.spotify.music</appPkg>\n\t\t\t\t<label>Spotify</label>\n\t\t\t</App>\n\t\t\t<Str sr=\"arg1\" ve=\"3\"/>\n\t\t\t<Int sr=\"arg2\" val=\"0\"/>\n\t\t\t<Int sr=\"arg3\" val=\"0\"/>\n\t\t</Action>\n\t</Task>\n</TaskerData>\n", false, 4, (Object) null), "<<INJECT_EXAMPLE_CLARIFICATION_SCENARIOS>>", ed.a.b(), false, 4, (Object) null);
                String i15 = x2.i1(cVar2);
                p.h(i15, "<get-json>(...)");
                String C6 = hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(hk.o.C(C5, "<<INJECT_BUILT_IN_VARIABLES_CATALOG_JSON>>", i15, false, 4, (Object) null), "<<INJECT_WIDGET_V2_SCHEMA>>", "\n    {\n      \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n      \"title\": \"Tasker Widget v2 Custom Layout Schema\",\n      \"description\": \"Defines the JSON structure for Tasker's Widget v2 Custom Layout parameter, used to build Glance widgets. **IMPORTANT: You MUST ensure that properties applied to a specific element type (e.g., Button, Text) are actually valid and supported by THAT element type, not just listed generically in base structures. Applying unsupported properties will lead to errors.**\",\n      \"definitions\": {\n        \"colorString\": {\n          \"description\": \"A color value. MUST be one of the explicitly allowed Material You names (see definition 15) or a hex format string (#RRGGBB or #AARRGGBB).\",\n          \"oneOf\": [\n            {\n              \"type\": \"string\",\n              \"enum\": [\n                \"widgetBackground\",\n                \"primary\", \"onPrimary\",\n                \"primaryContainer\", \"onPrimaryContainer\",\n                \"secondary\", \"onSecondary\",\n                \"secondaryContainer\", \"onSecondaryContainer\",\n                \"tertiary\", \"onTertiary\",\n                \"tertiaryContainer\", \"onTertiaryContainer\",\n                \"error\", \"onError\",\n                \"errorContainer\", \"onErrorContainer\",\n                \"background\", \"onBackground\",\n                \"surface\", \"onSurface\",\n                \"surfaceVariant\", \"onSurfaceVariant\",\n                \"inverseSurface\", \"inverseOnSurface\",\n                \"outline\",\n                \"inversePrimary\"\n              ]\n            },\n            {\n              \"type\": \"string\",\n              \"pattern\": \"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$\"\n            }\n          ]\n        },\n        \"sizeUnit\": {\n          \"type\": [\"number\", \"string\"],\n           \"description\": \"A size value in DP (number) or a Tasker variable string.\"\n        },\n        \"boolOrVariable\": {\n            \"type\": [\"boolean\", \"string\"],\n            \"description\": \"A boolean value (true/false) or a Tasker variable string.\"\n        },\n        \"intOrVariable\": {\n            \"type\": [\"integer\", \"string\"],\n            \"description\": \"An integer value or a Tasker variable string.\"\n        },\n        \"stringOrVariable\": {\n            \"type\": \"string\",\n            \"description\": \"A string value, potentially containing Tasker variables.\"\n        },\n        \"paddingValue\": {\n            \"oneOf\": [\n                { \"$ref\": \"#/definitions/sizeUnit\" },\n                {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"top\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                        \"bottom\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                        \"start\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                        \"end\": { \"$ref\": \"#/definitions/sizeUnit\" }\n                    },\n                    \"additionalProperties\": false\n                }\n            ],\n            \"description\": \"Padding definition. Can be a single number (for all sides) or an object with specific sides (top, bottom, start, end).\"\n        },\n        \"sizeValue\": {\n            \"oneOf\": [\n                 { \"$ref\": \"#/definitions/sizeUnit\" },\n                 {\n                    \"type\": \"string\",\n                    \"enum\": [\"fill\"],\n                    \"description\": \"Use 'fill' to represent fillMaxSize.\"\n                 },\n                 {\n                     \"type\": \"object\",\n                     \"properties\": {\n                         \"width\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                         \"height\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                         \"fillMaxWidth\": { \"type\": \"boolean\" },\n                         \"fillMaxHeight\": { \"type\": \"boolean\" }\n                     },\n                     \"description\": \"Define specific dimensions or fill behavior.\",\n                     \"additionalProperties\": false\n                 }\n            ],\n            \"description\": \"Size definition. Can be a single number (for square size), 'fill' (for fillMaxSize), or an object defining width/height/fill.\"\n        },\n        \"actionProperties\": {\n            \"commandPrefix\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n            \"task\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n            \"taskVariables\": {\n                \"type\": \"object\",\n                \"description\": \"Key-value pairs for task variables. Keys MUST be valid Tasker **local** variable names (e.g., '%my_var', must start with '%', be all lowercase, and >= 3 chars). Values are strings, potentially containing Tasker variables.\",\n                \"additionalProperties\": { \"$ref\": \"#/definitions/stringOrVariable\" }\n            },\n            \"command\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n            \"tag\": { \"$ref\": \"#/definitions/stringOrVariable\" }\n        },\n        \"baseStructure\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"type\": { \"type\": \"string\", \"description\": \"The type of the UI element.\" },\n                \"padding\": { \"$ref\": \"#/definitions/paddingValue\" },\n                \"paddingTop\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                \"paddingBottom\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                \"paddingStart\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                \"paddingEnd\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                \"size\": { \"$ref\": \"#/definitions/sizeValue\" },\n                \"width\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                \"height\": { \"$ref\": \"#/definitions/sizeUnit\" },\n                \"fillMaxSize\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                \"fillMaxWidth\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                \"fillMaxHeight\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                \"isWeighted\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                \"cornerRadius\": { \"$ref\": \"#/definitions/intOrVariable\" },\n                \"backgroundColor\": { \"$ref\": \"#/definitions/colorString\" },\n                \"visibility\": {\n                    \"type\": \"string\",\n                     \"enum\": [\"Visible\", \"Invisible\", \"Gone\"], // Also handles boolean/variable via string\n                     \"description\": \"Visibility state (Visible, Invisible, Gone) or a variable.\"\n                },\n                \"commandPrefix\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                \"task\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                \"taskVariables\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key-value pairs for task variables.\",\n                    \"additionalProperties\": { \"$ref\": \"#/definitions/stringOrVariable\" }\n                },\n                \"command\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                \"tag\": { \"$ref\": \"#/definitions/stringOrVariable\" }\n                // Note: useMaterialYouColors is intentionally omitted as per instructions\n            },\n            \"required\": [\"type\"]\n        },\n        \"containerStructure\": {\n            \"allOf\": [\n                { \"$ref\": \"#/definitions/baseStructure\" },\n                {\n                    \"type\": \"object\",\n                    \"properties\": {\n                         \"children\": {\n                            \"type\": \"array\",\n                            \"items\": { \"$ref\": \"#/definitions/anyStructure\" }\n                        },\n                        \"verticalAlignment\": {\n                            \"type\": \"string\",\n                            \"enum\": [\"Top\", \"Center\", \"Bottom\"],\n                            \"description\": \"Vertical alignment for children.\"\n                        },\n                        \"horizontalAlignment\": {\n                            \"type\": \"string\",\n                             \"enum\": [\"Start\", \"Center\", \"End\"],\n                             \"description\": \"Horizontal alignment for children.\"\n                        }\n                    }\n                }\n            ]\n        },\n        \"textStyleProperties\": {\n             \"text\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n             \"color\": { \"$ref\": \"#/definitions/colorString\" },\n             \"align\": {\n                 \"type\": \"string\",\n                 \"enum\": [\"Left\", \"Right\", \"Center\", \"Start\", \"End\"],\n                 \"description\": \"Text alignment.\"\n             },\n             \"textSize\": { \"$ref\": \"#/definitions/stringOrVariable\" }, // string to allow variables\n             \"bold\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n             \"italic\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n             \"underline\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n             \"linethrough\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n             \"fontFamily\": {\n                 \"type\": \"string\",\n                 \"enum\": [\"Serif\", \"SansSerif\", \"Monospace\", \"Cursive\"],\n                 \"description\": \"Font family name or standard enum.\"\n             }\n        },\n        // --- Specific Element Types ---\n        \"Box\": {\n            \"allOf\": [ { \"$ref\": \"#/definitions/containerStructure\" } ],\n            \"properties\": { \"type\": { \"const\": \"Box\" } }\n        },\n        \"Column\": {\n             \"description\": \"A vertical layout container. If more than 10 children are added or expected (e.g., in the case of dynamic lists), you MUST enable scrolling for the column.\",\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/containerStructure\" },\n                 {\n                     \"properties\": {\n                         \"scrolling\": { \"$ref\": \"#/definitions/boolOrVariable\" }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Column\" } }\n        },\n         \"Grid\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/containerStructure\" },\n                 {\n                     \"properties\": {\n                         \"fixed\": { \"$ref\": \"#/definitions/intOrVariable\" },\n                         \"minSize\": { \"$ref\": \"#/definitions/intOrVariable\" }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Grid\" } }\n        },\n        \"Row\": {\n            \"description\": \"A horizontal layout container. No more than 10 children supported.\",\n            \"allOf\": [ { \"$ref\": \"#/definitions/containerStructure\" } ],\n            \"properties\": { \"type\": { \"const\": \"Row\" } }\n        },\n        \"Scaffold\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/containerStructure\" },\n                 {\n                     \"properties\": {\n                         \"horizontalPadding\": { \"$ref\": \"#/definitions/intOrVariable\" },\n                         \"titleBar\": { \"$ref\": \"#/definitions/TitleBar\" }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Scaffold\" } }\n        },\n        \"Spacer\": {\n            \"allOf\": [ { \"$ref\": \"#/definitions/baseStructure\" } ],\n             \"properties\": { \"type\": { \"const\": \"Spacer\" } }\n        },\n        \"Text\": {\n            \"allOf\": [\n                { \"$ref\": \"#/definitions/baseStructure\" },\n                { \"$ref\": \"#/definitions/textStyleProperties\" },\n                {\n                    \"properties\": {\n                         \"maxLines\": { \"$ref\": \"#/definitions/intOrVariable\" },\n                         \"font\": { \"$ref\": \"#/definitions/stringOrVariable\", \"description\": \"Path to custom font file.\" }\n                    }\n                }\n            ],\n             \"properties\": { \"type\": { \"const\": \"Text\" } }\n        },\n        \"Image\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/baseStructure\" },\n                 {\n                     \"properties\": {\n                         \"url\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                         \"contentScale\": {\n                             \"type\": \"string\",\n                             \"enum\": [\"Crop\", \"Fit\", \"FillBounds\"]\n                         },\n                         \"tint\": { \"$ref\": \"#/definitions/colorString\" },\n                         \"circle\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                         \"sepia\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                         \"grayscale\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                         \"blur\": { \"$ref\": \"#/definitions/intOrVariable\" }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Image\" } }\n        },\n        \"ButtonBase\": { // Abstract base for button types\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/baseStructure\" },\n                 {\n                     \"properties\": {\n                        \"enabled\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                        \"contentColor\": { \"$ref\": \"#/definitions/colorString\" },\n                        \"icon\": { \"$ref\": \"#/definitions/stringOrVariable\" }\n                     }\n                 }\n             ]\n        },\n        \"Button\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/ButtonBase\" },\n                 {\n                     \"properties\": {\n                        \"text\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                        \"buttonType\": {\n                            \"type\": \"string\",\n                             \"enum\": [\"Filled\", \"Outline\", \"Normal\"]\n                        }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Button\" } },\n             \"description\": \"Standard button element. **Note: 'textSize' is NOT a supported property for Buttons.** Use 'contentColor' for text/icon color.\"\n        },\n        \"IconButton\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/ButtonBase\" },\n                 {\n                     \"properties\": {\n                        \"buttonType\": {\n                            \"type\": \"string\",\n                             \"enum\": [\"Circle\", \"Square\"]\n                        }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"IconButton\" } }\n        },\n        \"CompoundBase\": { // Abstract base for CheckBox/Switch\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/baseStructure\" },\n                 { \"$ref\": \"#/definitions/textStyleProperties\" }, // Inherits text styling\n                 {\n                     \"properties\": {\n                        \"checked\": { \"$ref\": \"#/definitions/boolOrVariable\" },\n                        \"checkedColor\": { \"$ref\": \"#/definitions/colorString\" },\n                        \"uncheckedColor\": { \"$ref\": \"#/definitions/colorString\" }\n                     }\n                 }\n             ]\n        },\n        \"CheckBox\": {\n             \"allOf\": [ { \"$ref\": \"#/definitions/CompoundBase\" } ],\n             \"properties\": { \"type\": { \"const\": \"CheckBox\" } }\n        },\n        \"Switch\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/CompoundBase\" },\n                 {\n                     \"properties\": {\n                         \"checkedTrackColor\": { \"$ref\": \"#/definitions/colorString\" },\n                         \"uncheckedTrackColor\": { \"$ref\": \"#/definitions/colorString\" }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Switch\" } }\n        },\n        \"Progress\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/baseStructure\" },\n                 {\n                     \"properties\": {\n                         \"color\": { \"$ref\": \"#/definitions/colorString\" },\n                         \"trackColor\": { \"$ref\": \"#/definitions/colorString\" },\n                         \"progress\": { \"$ref\": \"#/definitions/intOrVariable\", \"description\": \"Value 0-100 or variable\" },\n                         \"progressType\": {\n                            \"type\": \"string\",\n                             \"enum\": [\"Linear\", \"Circle\"]\n                         },\n                         \"text\": { \"$ref\": \"#/definitions/stringOrVariable\", \"description\": \"Text overlay for Circle type.\" },\n                         \"resolution\": { \"$ref\": \"#/definitions/intOrVariable\", \"description\": \"Diameter for Circle type.\" },\n                         \"barWidth\": { \"$ref\": \"#/definitions/intOrVariable\", \"description\": \"Stroke width for Circle type.\" }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"Progress\" } }\n        },\n         \"TitleBar\": {\n             \"allOf\": [\n                 { \"$ref\": \"#/definitions/baseStructure\" },\n                 {\n                     \"properties\": {\n                         \"icon\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                         \"text\": { \"$ref\": \"#/definitions/stringOrVariable\" },\n                         \"iconColor\": { \"$ref\": \"#/definitions/colorString\" },\n                         \"textColor\": { \"$ref\": \"#/definitions/colorString\" },\n                         \"actions\": {\n                             \"type\": \"array\",\n                             \"items\": { \"$ref\": \"#/definitions/IconButton\" }\n                         }\n                     }\n                 }\n             ],\n             \"properties\": { \"type\": { \"const\": \"TitleBar\" } },\n             \"required\": [\"type\", \"icon\", \"text\"]\n        },\n        // --- Aggregator for any structure ---\n        \"anyStructure\": {\n             \"oneOf\": [\n                { \"$ref\": \"#/definitions/Box\" },\n                { \"$ref\": \"#/definitions/Column\" },\n                { \"$ref\": \"#/definitions/Grid\" },\n                { \"$ref\": \"#/definitions/Row\" },\n                { \"$ref\": \"#/definitions/Scaffold\" },\n                { \"$ref\": \"#/definitions/Spacer\" },\n                { \"$ref\": \"#/definitions/Text\" },\n                { \"$ref\": \"#/definitions/Image\" },\n                { \"$ref\": \"#/definitions/Button\" },\n                { \"$ref\": \"#/definitions/IconButton\" },\n                { \"$ref\": \"#/definitions/CheckBox\" },\n                { \"$ref\": \"#/definitions/Switch\" },\n                { \"$ref\": \"#/definitions/Progress\" },\n                { \"$ref\": \"#/definitions/TitleBar\" }\n             ]\n        }\n      },\n      // --- Root Structure ---\n       \"$ref\": \"#/definitions/anyStructure\" // The root must be a single CustomStructure element\n    }\n", false, 4, (Object) null), "<<INJECT_WIDGET_V2_GLOBAL_POSITIONING_EXAMPLE>>", "\n {\n  \"children\": [\n    {\n      \"contentScale\": \"Crop\",\n      \"url\": \"my_image_url\",\n      \"size\": \"fill\",\n      \"type\": \"Image\"\n    },\n    {\n      \"children\": [\n        {\n          \"text\": \"This is at the top\",\n          \"padding\": 16,\n          \"type\": \"Text\"\n        }\n      ],\n      \"horizontalAlignment\": \"Center\",\n      \"verticalAlignment\": \"Top\",\n      \"size\": \"fill\",\n      \"type\": \"Box\"\n    },\n    {\n      \"children\": [\n        {\n          \"text\": \"This is at the bottom\",\n          \"padding\": 16,\n          \"type\": \"Text\"\n        }\n      ],\n      \"horizontalAlignment\": \"Center\",\n      \"verticalAlignment\": \"Bottom\",\n      \"size\": \"fill\",\n      \"type\": \"Box\"\n    },\n    {\n      \"children\": [\n        {\n          \"text\": \"This is on the left\",\n          \"padding\": 16,\n          \"type\": \"Text\"\n        }\n      ],\n      \"horizontalAlignment\": \"Start\",\n      \"verticalAlignment\": \"Center\",\n      \"size\": \"fill\",\n      \"type\": \"Box\"\n    }\n  ],\n  \"horizontalAlignment\": \"Center\",\n  \"verticalAlignment\": \"Center\",\n  \"fillMaxSize\": true,\n  \"type\": \"Box\"\n}\n", false, 4, (Object) null), "<<INJECT_TASKER_PATTERN_MATCHING_RULES>>", "\n\t*   **Purpose:** Tasker conditions allow Profiles to trigger or Actions within Tasks to run based on comparisons. You MUST understand the available operators and their usage contexts to correctly interpret user requests and generate valid XML.\n\t*   **Operator Types:** Conditions generally involve a Left Hand Side (LHS), an Operator, and often a Right Hand Side (RHS). The main operator types are:\n\t\t*   **Pattern Matching (Simple Matching):** This is the default for text comparisons in many contexts (like Event/State parameters, Variable Value state, If action condition with `~` (Matches) or `!~` (Doesn't Match)).\n\t\t\t*   It compares the LHS against the RHS pattern.\n\t\t\t*   The `*` pattern on the RHS matches *anything*.\n\t\t\t*   A non-blank pattern must match the *entire* LHS value unless wildcards are used.\n\t\t\t*   `/` acts as an OR separator (e.g., `Value1/Value2` matches if LHS is exactly `Value1` OR `Value2`).\n\t\t\t*   `*`: Matches *zero or more* of any character (e.g., `*end` matches `legend` and `end`).\n\t\t\t*   `+`: Matches *one or more* of any character (e.g., `start+` matches `starter` but not `start`). This means `If %var Matches +` is true only if `%var` is set and contains at least one character; it is false if `%var` is unset or set to an empty string.\n\t\t\t*   Case-Insensitive (Default): Matching ignores case (`hello` matches `HeLlO`).\n\t\t\t*   Case-Sensitive (Triggered by Uppercase): If the RHS pattern contains *any uppercase letter*, the entire match becomes case-sensitive (`Hello` matches `Hello` but not `hello`).\n\t\t\t*   `!`: Placed at the very start of the RHS pattern, it negates the result (e.g., `!*important*` matches if the LHS does *not* contain `important`). Cannot match a literal `!` at the start (use `*!` instead).\n\t\t\t*   **Caller Matching Specifics:** In contexts related to phone calls (e.g., 'Call Received' Event, 'Call' State), special patterns exist:\n\t\t\t\t*   `C:ANY`: Matches any number belonging to a contact.\n\t\t\t\t*   `C:FAV`: Matches any number belonging to a favorite/starred contact.\n\t\t\t\t*   `CG:groupmatch`: Matches any number belonging to a contact in a group matching `groupmatch` (Simple Matching rules apply to `groupmatch`).\n\t\t\t\t*   Otherwise, the standard Simple Matching rules are applied against *both* the caller's number *and* their contact name (if available).\n\t\t*   **Pattern Matching (Regex):** Used with `~R` (Matches Regex) or `!~R` (Doesn't Match Regex) operators.\n\t\t\t*   The RHS pattern is treated as a standard Java Regular Expression.\n\t\t\t*   Provides more powerful and precise pattern matching capabilities than Simple Matching.\n\t\t*   **String Equality:** Used for exact text comparison.\n\t\t\t*   `Equals String` (UI symbol: `eq`): True if LHS is exactly identical to RHS (case-sensitive).\n\t\t\t*   `Not Equals String` (UI symbol: `ne`): True if LHS is *not* exactly identical to RHS (case-sensitive).\n\t\t*   **Numeric Comparison:** **CRITICAL: These operators MUST ONLY be used for comparing numbers or variables expected to contain valid mathematical expressions.** They perform mathematical evaluation on both LHS and RHS.\n\t\t\t*   `Less Than` (UI symbol: `<`): True if LHS evaluates numerically to less than RHS.\n\t\t\t*   `Greater Than` (UI symbol: `>`): True if LHS evaluates numerically to greater than RHS.\n\t\t\t*   `Equals` (UI symbol: `=`): True if LHS evaluates numerically to be equal to RHS. Returns true if both LHS and RHS are empty/undefined. Returns false if only one is empty/undefined.\n\t\t\t*   `Not Equals` (UI symbol: `!=`): True if LHS evaluates numerically to be not equal to RHS. Returns false if both LHS and RHS are empty/undefined. Returns true if only one is empty/undefined.\n\t\t\t*   **WARNING:** If either LHS or RHS cannot be evaluated as a number (e.g., it's plain text like \"hello\"), these comparisons will likely return `false` or produce unexpected results. **Do NOT use these for comparing non-numeric strings; use `Equals String` or `Matches` instead.**\n\t\t*   **Mathematical Checks:** These also perform numeric evaluation on the LHS.\n\t\t\t*   `Even`: True if LHS evaluates to an even number.\n\t\t\t*   `Odd`: True if LHS evaluates to an odd number.\n\t\t\t*   **WARNING:** Returns `false` if the LHS cannot be evaluated as a number.\n\t\t*   **Variable State:** Checks if a variable is defined (has been assigned any value).\n\t\t\t*   `Set`: True if the variable named in LHS exists and has been assigned a value (even an empty string).\n\t\t\t*   `Not Set`: True if the variable named in LHS has not been assigned any value (is undefined).\n\t*   **XML Structure for Conditions (Actions/Variable Value State):**\n\t\t*   While most Profile contexts take arguments directly (like `<State>`, `<Event>`), and some contexts are distinct tags with direct children (`<Time>`, `<App>`), conditions within specific **Actions** (most notably `If` - code 37, `Wait Until` - code 35) and the **Variable Value State** (code 165) use a specific XML structure:\n\t\t\t*   `<ConditionList sr=\"if\">`: Acts as a container for one or more conditions.\n\t\t\t*   `<Condition sr=\"c[Index]\" ve=\"3\">`: Represents a single comparison.\n\t\t\t*   `<lhs>`: Contains the Left Hand Side variable or value (e.g., `<lhs>%my_variable</lhs>`).\n\t\t\t*   `<op>`: Contains the **numeric code** for the comparison Operator (see list below).\n\t\t\t*   `<rhs>`: Contains the Right Hand Side value (e.g., `<rhs>Some Value</rhs>`). This tag is **omitted** for unary operators (Set, Not Set, Even, Odd).\n\t\t*   **Operator Codes (for `<op>` tag):**\n\t\t\t*   `0`: Equals String (`eq`, case-sensitive text)\n\t\t\t*   `1`: Not Equals String (`ne`, case-sensitive text)\n\t\t\t*   `2`: Matches Simple Pattern (`~`, glob/wildcard)\n\t\t\t*   `3`: Doesn't Match Simple Pattern (`!~`)\n\t\t\t*   `4`: Matches Regex (`~R`)\n\t\t\t*   `5`: Doesn't Match Regex (`!~R`)\n\t\t\t*   `6`: Less Than (`<`, numeric)\n\t\t\t*   `7`: Greater Than (`>`, numeric)\n\t\t\t*   `8`: Equals (`=`, numeric)\n\t\t\t*   `9`: Not Equals (`!=`, numeric)\n\t\t\t*   `10`: Even (numeric)\n\t\t\t*   `11`: Odd (numeric)\n\t\t\t*   `12`: Is Set (variable defined)\n\t\t\t*   `13`: Is Not Set (variable undefined)\n\t\t*   **Remember:** Operators 6-11 are **strictly numeric**. Use 0-3 for general string comparisons.\n\t*   **Boolean Logic (Combining Multiple Conditions in `<ConditionList>`):**\n\t\t*   When a `<ConditionList>` contains multiple `<Condition>` tags, they are linked by boolean logic tags placed *between* them.\n        *   **Crucially, if a `<ConditionList>` contains N `<Condition>` elements (where N > 1), you MUST generate N-1 corresponding boolean connector elements (`<bool0>`, `<bool1>`, ..., `<bool{N-2}>`) immediately preceding the second, third, ..., Nth `<Condition>` element, respectively. The content of each `<boolN>` tag (e.g., `And`, `Or`, `Xor`) determines the logical operation between the preceding condition(s) and the following one, respecting the specified precedence rules.**\n\t\t*   **Operators (as tag content):** `And`, `Or`, `Xor`, `And2`, `Or2`, `Xor2` (Note: `And2` corresponds to `&+`, `Or2` to `|+`, `Xor2` to `X|+`). Example: `<bool0>And</bool0>`, `<bool1>Or2</bool1>`.\n\t\t*   **Symbols (for reference):** `&` (And), `|` (Or), `X|` (Xor), `&+` (And2), `|+` (Or2), `X|+` (Xor2).\n\t\t*   **Precedence (Evaluation Order):** Determines how complex conditions are evaluated. Operators are evaluated from HIGHEST precedence to LOWEST precedence.\n\t\t\t*   Highest: `And+` / `And2` (&+)\n\t\t\t*   Medium-High: `Or+` / `Or2` (|+)\n\t\t\t*   Medium: `Xor+` / `Xor2` (X|+)\n\t\t\t*   Medium-Low: `And` (&)\n\t\t\t*   Low: `Or` (|)\n\t\t\t*   Lowest: `Xor` (X|)\n\t\t\t*   (Example: In `CondA & CondB |+ CondC`, the `|+` / `Or2` is evaluated first, then the `&` / `And`.)\n\t*   **AI Guidance:** Choose the most appropriate operator based on the user's intent. Use `Equals String` for exact text matches, `Matches` (with `*`/`+`) for pattern/substring checks, and Regex (`~R`) for complex patterns. Use numeric operators (`<`, `>`, `=`, `!=`, `Even`, `Odd`) **strictly for numbers or mathematical expressions**. Use `Set`/`Not Set` when checking if a variable simply exists. When generating `If` actions or `Variable Value` states, use the `<ConditionList>` structure with the correct `<op>` codes. Understand boolean precedence when combining conditions. **CRITICAL TASK FLOW STYLE: Prioritize 'Early Returns' for Validation/Error Checks.** Instead of deeply nesting the main task logic within multiple `If`/`Else` blocks, prefer checking for failure conditions first. If a failure condition is met (e.g., required variable not set, input invalid), use actions inside the `If` block to handle the error, **which MUST include using a `Flash` action (code 548) to clearly inform the user about the specific error**, and then immediately `Stop` the task (code 137). Place the main task logic *after* these `If`/`End If` validation blocks. This keeps the core logic less indented and easier to follow.\n    *   **Task Flow for Mutually Exclusive Cases:** When a task needs to perform different actions based on which *one* of several mutually exclusive conditions is met (e.g., checking an event variable like `%evtprm2` against multiple possible app packages, or checking a variable against several distinct values), **avoid deep nesting with `If/Else If/Else`**. Instead, implement a series of independent `If` blocks. Each block should check one specific condition (`If condition X`), perform the actions required *only* for that condition, and then close with `End If`. **Crucially, decide whether to include a `Stop` action (code 137) just before the `End If` based on the overall task logic:**\n        *   **Include `Stop`:** If handling this specific condition should prevent any subsequent actions in the task from running (i.e., this is the final action for this logical path).\n        *   **Omit `Stop`:** If there is common logic *after* the entire sequence of independent `If` blocks that needs to run regardless of which condition (if any) was met.\n        This approach ensures that only the actions for the *first* matching condition run if `Stop` is used appropriately, or allows the task to continue to subsequent common logic if `Stop` is omitted. It maintains a flatter, more readable structure than deep nesting, especially for many conditions.\n", false, 4, (Object) null), "<<INJECT_TASKER_COMMAND_SYSTEM>>", "\n    *   **Purpose:** A flexible system for triggering Profiles based on custom commands sent from various Tasker actions or contexts. Primarily useful for creating dynamic actions or simplifying setups where one Profile can handle multiple variations of a request based on command parameters.\n    *   **Mechanism:**\n        *   **Sending:** Commands are sent using actions like `Command` (code 385) or within parameters of other actions like `Set up Quick Setting Tile` (code 162, arg9/10/11) or `Widget v2` (code 461, arg13 JSON `command` property - *use only as fallback*).\n        *   **Receiving:** A Profile is created using the `Command` **Event** context (code 2091).\n    *   **Command Syntax:** Commands typically use the format `prefix=:=value1=:=value2=:=...`\n        *   `prefix`: A unique identifier for the command type (e.g., `launchapp`, `setvolume`).\n        *   `=:=`: The standard separator between the prefix and subsequent values/parameters.\n        *   `value1`, `value2`, ...: The data being passed with the command.\n    *   **Receiving Profile (`Command` Event - code 2091):**\n        *   `Command` parameter (arg1): Filters which commands trigger the profile. Uses **Pattern Matching**. **Crucially, you CANNOT use variables in this filter field itself.** Examples: `launchapp=:=*` (catches all launchapp commands), `setvolume=:=media=:=*` (catches setvolume commands where the second part is exactly 'media'), `*lighton*` (catches any command containing 'lighton').\n        *   `Variables` parameter (arg2): A comma-separated list of the **full local variable names** (e.g., `%app` or `%voltype,%level`) that Tasker should create in the triggered Task. Tasker takes the values extracted *after* each `=:=` separator (from the command that matched the filter in arg1) and assigns them sequentially to these specified local variables. The first value goes into the first variable, the second into the second, and so on.\n        *   `Last Variable Is Array` parameter (arg3): If checked (value `1`), the *last* variable name listed in arg2 becomes a **Tasker Array** containing all remaining parts of the command separated by `=:=`. (e.g., Command: `mycmd=:=header=:=part1=:=part2`, Variables: `%header,%parts`, Last Array: True => `%header`=\"header\", `%parts()`=\"part1,part2\").\n        *   **Implicit Output:** The full command string is available in the triggered Task as `%evtprm1`.\n    *   **Advantages Over Direct Task Execution (`Perform Task`):**\n        *   **Decoupling:** The sender doesn't need to know *which specific Task* will handle the command, only the command format. The receiving Profile routes the command, allowing the handling Task to be changed later without modifying senders.\n        *   **Flexibility:** One receiving Profile can handle many command variations using parameters passed in the command string, reducing the need for multiple Profiles or Tasks (e.g., one `launchapp=:=*` profile vs. many profiles each launching a specific app).\n        *   **Centralized Logic:** Consolidates the handling of related actions triggered from different places into a single Profile/Task.\n    *   **Comparison with `Perform Task`:** While powerful for decoupling, the Command System adds an layer (the Profile). For direct, clear Task-to-Task calls within a known structure (like a Project), `Perform Task` is often simpler and offers clearer parameter passing (`%par1`, `%par2`, Return Value, Passthrough).\n    *   **Use Cases (Beyond Widgets):** Triggering parameterized actions from Quick Settings, dynamically controlling profiles/tasks, decoupling task actions from specific triggers.\n    *   **Widget Interaction:** Remember the strict rule: **PREFER Task Calling with Variables** for `Widget v2` interactions. Use the Command System *only* as a fallback, and if used, it **requires a Project structure** to hold the widget task and the reacting Command Profile/Task.\n    *   **AutoApps Context:** The `=:=` syntax originates from AutoApps, but you should **NEVER** use or reference AutoApps components. Use the native Tasker `Command` event/action.\n", false, 4, (Object) null), "<<INJECT_MODIFICATION_REQUESTS>>", "\n        *   If the user provides existing Tasker XML data (usually within `<TaskerData>...</TaskerData>` tags) and requests modifications to it, your primary goal is to generate an *updated* version of that XML.\n        *   To ensure the updated configuration correctly overwrites the user's existing setup upon import into Tasker, you **MUST preserve the original identifiers** from the *provided* XML:\n            *   **Project:** If a `<Project sr=\"proj0\" ...>` element exists, keep it, preserving its `<name>` element's value.\n            *   **Profiles:** For each `<Profile>` element, preserve its original `<nme>` element value and its original `<id>` element value.\n            *   **Tasks:** For each `<Task>` element, preserve its original `<id>` element value. If the original task was *named* (contained an `<nme>` element), also preserve the original `<nme>` element value. If the original task was *anonymous* (did not contain an `<nme>` element), the modified task must also remain anonymous.\n        *   **Exception for Renaming:** If the user's modification request *explicitly* asks to rename a Project, Profile, or named Task, you **MUST** use the *new name* specified by the user in the corresponding `<name>` (for Project) or `<nme>` (for Profile/Task) element in the generated output XML. However, you **MUST** still preserve the original `<id>` element value for the modified Profile or Task.\n        *   Focus your modifications only on the specific components (conditions, actions, parameters, etc.) targeted by the user's request. Leave other parts and their identifiers unchanged unless modification is explicitly requested or logically necessary to fulfill the request.\n        *   Ensure the generated XML remains valid according to the schemas and structure descriptions.\n", false, 4, (Object) null), "<<INJECT_STRICT_RULES>>", "\n*   **Mandate Early Return & Error Handling Pattern:** For robustness and clarity, apply the following pattern consistently:\n\t\t*   **Proactive Error Planning:** Before generating actions, you **MUST** consult the provided **Action Catalog Data**, paying close attention to the description field (`\"d\": \"...\"`) for each planned action. If the description indicates specific conditions under which the action will end in error (like the `Input Dialog` example), and these conditions are relevant to the user's request or could realistically occur, you **MUST** proactively plan to use the error checking pattern (enabling continuation with `<se>false</se>` and checking `%err`) for that action.\n\n    1.  **Precondition/Validation Checks (Early Return):** Whenever a precondition must be met *before* proceeding with critical actions (e.g., required variable is set, input is valid), check if the condition is **NOT** met using an `If` action (code `37`) with the appropriate negated operator (e.g., 'Is Not Set' - op 13).\n        *   Inside the `If`, **MUST** use a `Flash` action (code `548`) with a clear message (e.g., 'Error: Required variable %InputVar is not set.'). Set 'Long' (arg1=1). Use `Flash` for these upfront checks as they often occur in interactive scenarios or represent non-critical validation failures before the main work begins.\n        *   Immediately follow with a `Stop` action (code `137`). Consider 'With Error' (arg0=1).\n        *   Close with `End If` (code `38`).\n\n    2.  **Checking Action Errors (After Execution):** This pattern is essential for actions that might fail during execution (e.g., `Run Shell`, `HTTP Request`, file operations, actions with timeouts) or actions where user inaction causes an error that needs specific handling (e.g., `Input Dialog` being left empty or cancelled), and where continuing the task upon error is necessary to check the error status:\n        *   **Enable Continuation:** Based on your analysis of the **Action Catalog Data** (specifically the `\"d\"` field or inherent behavior like timeouts) indicating that an action might fail under certain conditions relevant to the task logic, you **MUST** ensure that the `<Action>` element for that specific action includes `<se>false</se>` as a **direct child**, typically placed immediately after the `<code>` tag and before the first argument (`<Bundle>`, `<Int>`, `<Str>`, etc.). This instructs Tasker to continue the task even if that action encounters an error, allowing the subsequent `If %err Is Set` check to function correctly.\n        *   **Check `%err`:** Immediately after the action containing `<se>false</se>`, use an `If` action (code `37`) to check if the built-in variable `%err` **Is Set** (operator `12`). `%err` will be set if the previous action failed.\n        *   **Report Using `Notify` and Stop:** Inside this `If %err Is Set` block, you **MUST** use `Notify` (code 523) to report the error and then stop the task. `Flash` is **NOT** appropriate for reporting errors detected via `%err` that lead to task stoppage.\n            *   Use the built-in variable `%errmsg` (which contains a user-friendly error message) as the main text for the notification.\n            *   Configure `Notify` (code 523) specifically as follows:\n                *   Title (`arg0`): \"Tasker Error\" (or a more context-specific title if appropriate)\n                *   Text (`arg1`): `%errmsg`\n                *   Icon (`arg2`): Generate `<Img sr=\"arg2\" ve=\"2\"><uri>android.resource://net.dinglisch.android.taskerm/drawable/mw_alert_error_outline</uri></Img>`\n                *   Priority (`arg5`): `5`\n                *   Vibration Pattern (`arg10`): `0,200,100,200`\n                *   Category (`arg11`): `AI Errors`\n                *   Leave other fields like Permanent (`arg4`), Repeat Alert (`arg6`), Sound File (`arg9`), LED (`arg7`/`arg8`) as default/unset unless specifically requested.\n            *   **Stop Task:** Immediately follow the `Notify` action with a `Stop` action (code `137`), setting 'With Error' (arg0=1).\n        *   Close with `End If` (code `38`).\n\n    This combined pattern (`If NOT precondition -> Flash -> Stop -> End If` for upfront checks, and `Action with <se>false</se> -> If %err Is Set -> Notify %errmsg -> Stop -> End If` for critical action errors) provides robust error handling using the appropriate feedback mechanism for each scenario.\n*   **Enforce Variable Naming Rigorously:** You MUST ensure every variable **base name** used or generated in the XML output strictly complies with Tasker's naming convention: **at least three characters long**, cannot start with a digit, and follows the correct case for local (`%alllowercase`) vs. global (`%hasUppercase`). This applies to simple variables, **array base names** (e.g., `%myarray`), and structured variable base names (e.g., `%myjson`). Individual array elements (`%myarray1`) or structured access (`%myjson.key`) depend on the base name's validity. This rule applies WITHOUT EXCEPTION to variables specified by the user AND **especially to variables you generate internally**, such as loop counters or loop item variables (e.g., always use `%index`, `%loop_counter`, `%item`, `%loop_item`, **NEVER** use single or two-character names like `%i`, `%n`, or `%x`). Double-check all variable names before generating XML. Failure to adhere to this is a critical error.\n\n*   **Avoid Long Wait Actions:** Discourage the use of the `Wait` action (code 30) for durations exceeding **30 seconds**. Long waits can be unreliable (tasks may be killed) and inefficient. For longer delays, rate-limiting, or cooldown periods, **MUST** prefer alternative methods:\n    *   **Timestamp Math:** Use the `%TIMES` variable (seconds since epoch) along with `Variable Set`/`Add`/`Subtract` and numeric comparisons (e.g., `If %TIMES > %LastActionTime + 1800`). Store timestamps in variables (usually Global if needed across task runs or profiles).\n*   **Recognize and Use Array/Structured Variable Syntax:** Understand the full range of syntax for Tasker arrays (`%arr(#)`, `%arr()`, `%arr(1)`, `%arr(1:3)`, `%arr(#?search)`, `%arr(+=sep)`, `%arr(%index)`, etc.) and structured variables (`%json.key`, `%html[css=:=attr]`, etc.) as defined in **Data Definition 12**. Use this syntax correctly when mapping user requests and generating XML arguments. Remember the **\"Structured Output\" prerequisite** for structured variable access mentioned in **Data Definition 3**.\n*   **Respect 1-Based Array Indexing:** Always remember that Tasker arrays start at index `1`. Use `1` as the starting point when accessing the first element (`%arr(1)`) or when defining `For` loop ranges (`1:%arr(#)`).\n*   **Recognize Array Variable Notation:** Correctly identify variables representing Tasker arrays by the parentheses `()` notation used in the component catalogs' `output_variable_list`. Use appropriate array access syntax (Section 12) when working with these variables.\n*   **Use Sensible Variable Names:** When creating variables, especially the intermediate array for dynamic widget lists (e.g., `%widget_items`), use clear, descriptive local variable names that help a user understand the Task's logic. Avoid obscure or overly short names.\n*   **Mandatory Use of 'Multiple Variables Set' for Consecutive/Widget Variable Assignments:** To improve structure, readability, and ease of modification, you **MUST** adhere to the following:\n    *   **General Case:** Whenever the plan involves setting the values of *two or more* simple (non-array) Tasker variables in immediate succession, you **MUST** use a *single* `Multiple Variables Set` action (code `389`) instead of multiple consecutive `Variable Set` actions (code `547`).\n    *   **Widget Preparation Case:** As defined in the \"Plan Widget Variable Preparation\" step, if *any* simple (non-array) variables are being set immediately before a `Widget v2` action specifically for use within its `Custom Layout` JSON, you **MUST** use **one single** `Multiple Variables Set` action (code `389`) to assign *all* of those simple variables. **Crucially, this includes the mandatory color variables (`%widget_color_background`, `%widget_color_text`, etc.)** as well as any other preparatory variables (sizes, text, etc.). This is required **even if only the mandatory color variables (or just one simple variable in total)** are being set in this specific context.\n    *   **Configuration (Visual Style):** Any `Multiple Variables Set` action generated **MUST** be configured to use the 'visual style' for maximum readability:\n        *   **`Names` parameter (arg1):** Populate this with the variable assignments, one per line, in the format `%variable_name=value` (e.g., `%widget_color_background=surface\\n%widget_corner_radius=12`). Remember that `value` can itself contain variables. **If assigning a color, the `value` MUST strictly adhere to the color rules: it must be either a valid hex code (#RRGGBB or #AARRGGBB) OR one of the exact Material You color names specified in the `enum` list within Data Definition 15's `colorString` definition (e.g., `primary`, `onSurface`, `surfaceVariant`). No other color names are permitted.**\n        *   **`Variable Names Splitter` parameter (arg2):** This argument **MUST** be left empty/unspecified in the generated XML (do not include the `<Str sr=\"arg2\".../>` tag for it).\n        *   **`Values` parameter (arg3):** This argument **MUST** be left empty/unspecified in the generated XML (do not include the `<Str sr=\"arg3\".../>` tag for it).\n        *   **`Values Splitter` parameter (arg4):** This argument **MUST** be included and set explicitly to `=`: `<Str sr=\"arg4\" ve=\"3\">=</Str>`.\n        *   Ensure other parameters like `Do Maths` (arg5) or `Structure Output` (arg8) are set appropriately based on the values being assigned.\n    *   **Enforcement:** This is a strict requirement. Failure to use `Multiple Variables Set` as described, especially in the widget preparation context (including defining color variables), is incorrect.\n*   **Mandatory Brackets for Dynamic Widget Children Array:** When injecting a dynamically generated array variable (e.g., `%widget_items()`) into the `children` array of a `Widget v2` `Custom Layout` JSON (`arg13`), you **MUST** enclose the variable reference in square brackets: `\"... children\": [ %widget_items() ] ...`. You **MUST NOT** omit the brackets (e.g., `\"children\": %widget_items()` is **INVALID** and will cause Tasker import failure).\n*   Rely on Provided Data (**Event Context Catalog**, **State Context Catalog**, Action Catalog, Schema, Built-ins, Examples, **Variable Type Definitions**).\n*   **No Hallucination of Built-in Variables:** You MUST rely **exclusively** on the `Built-in Variable Catalog` (Data Definition 11) for knowledge of available global built-in variables. **NEVER** assume or hallucinate the existence of any other global built-in variables that are not explicitly listed in that catalog. For example, the AI previously incorrectly assumed variables like `%VOLA_RESTORE`, `%VOLC_RESTORE`, etc., exist for profile state restoration – **these specific variables DO NOT EXIST** and must not be used. If you need to remember a value (like a volume level before changing it) to restore it later in an **Exit Task**, you **MUST** explicitly store the *current* value (e.g., `%VOLR`, `%VOLM`) in a temporary **Global Variable** (e.g., `%PreviousRingerVolume`, following Global Variable naming rules: starting with an uppercase letter and >= 3 chars) using the `Variable Set` action in the **Entry Task**. Then, use that same **Global Variable** in the **Exit Task** to set the setting back. Local variables (`%lowercase`) set in the Entry Task **will not** be available in the Exit Task.\n*   **Follow XML Schema & Structure Strictly:\n*   **Prioritize Iterative Modification:** When the user provides existing XML or requests modifications to a previously generated configuration, adhere to the modification guidelines in **Section 19**. Preserve original identifiers (IDs, names) unless explicitly asked to change them. Modify the *existing structure* rather than generating a completely new or radically different one, unless the request fundamentally requires it (e.g., changing from Profile to Project).** Adhere precisely to the injected **Structure Descriptions** for the **specific entity type being generated (Profile, Task, or Project)** (Data Definitions 5, 6, 7). Direct children rules apply. Pay close attention to `<Project>` tag structure and `<nme>` usage rules. Use the overall **XML Schema Definition** (Data Definition 4) as a general structural guide.\n*   **Forbid `<nme>` in `<Img>`:** You **MUST NOT** generate the `<nme>` child element within `<Img>` arguments (used for icons in actions like Notify). Even if a user requests a specific built-in icon, do not attempt to use `<nme>`.\n*   **Correct `<Int>` Argument Formatting for Variables:** You **MUST** differentiate between literal integers and variables when generating `<Int>` arguments. If the value is a literal number, use the `val` attribute (e.g., `<Int sr=\"arg0\" val=\"1\"/>`). If the value is a Tasker variable (e.g., `%my_variable`), you **MUST NOT** use the `val` attribute; instead, you **MUST** embed the variable name within a `<var>` tag inside the `<Int>` tag (e.g., `<Int sr=\"arg0\"><var>%my_variable</var></Int>`). Failure to use the `<var>` tag for variables in `<Int>` arguments will result in invalid XML that Tasker cannot import correctly.\n*   **Mandatory Exit Task for State Profile Restoration:** Because `flags='40'` disables Tasker's automatic setting restoration for State profiles, you **MUST** generate an explicit Exit Task (`<Task>` linked via `<mid1>`) to restore any settings modified by the Entry Task (`<Task>` linked via `<mid0>`) whenever the Profile uses one or more **State** contexts and the user's request implies or explicitly asks for the original state to be restored upon the profile becoming inactive. Do not rely on Tasker's default restoration mechanism; manual restoration via an Exit Task is required in these cases. Remember that the `<App>` context behaves like a State context in this regard. If the user explicitly states *not* to restore, or if it's an Event profile, or if the entry task changes nothing needing restoration, then omit the Exit Task.\n*   **Generate Named/Anonymous Tasks Correctly:** **Critical for Projects.** Anonymous for profile tasks. Named for standalone tasks. Named *only* for reusable/distinct tasks within projects.\n*   **Prioritize Reuse in Projects:** Actively look for opportunities to create a single named Task called by `Perform Task` instead of duplicating action sequences in multiple anonymous tasks.\n*   Use correct `numeric_code`.\n*   **Generate ONLY Valid XML:** You **MUST** generate XML that strictly adheres to the provided schemas (Definition 4) and structure descriptions (Definitions 5, 6, 7). **NEVER** invent or include non-standard XML tags or attributes (like the incorrect `<ListElementVariable>` tag seen in an issue report). If unsure about structure, re-read the definitions.\n*   **Mandatory Project `sr` Attribute:** When generating a **Project**, the `sr` attribute of the `<Project>` tag **MUST** always be set to the literal string `\"proj0\"`. Tasker will reject imports if this attribute has any other value. Example: `<Project sr=\"proj0\" ve=\"2\">`.\n*   **Determine Dialog Type Correctly:** Follow the Explicit > High-Confidence Inference > Default ('t') logic, as detailed in Step 5. Ensure final `id` is valid.\n*   **Use Exact Variable Names and Access Strings:** Always use the precise Tasker variable names (`%evtprmN`, `%http_data`, `%gl_location`, `%MyVar`, `%myvar`, `%TIME`) or the correct access strings for arrays/structured data (`%files()`, `%json.data.name`, `%arr(#?beta)`, `%arr(%index)`) identified from catalogs, user input, or built-ins when populating XML arguments.\n*   **Recognize Variable Styles:** Correctly handle action outputs from \"New Style\" (`output_variable_list`) vs. \"Old Style\" (input parameter defines output variable name). Recognize outputs that are arrays or potential structured data.\n*   **Know Implicit Event Variables:** `%evtprmN` are **always** available for **Event Contexts** (found in the **Event Context Catalog**) based on their input parameters (`arg0` -> `%evtprm1`, etc.), forming the `%evtprm` array.\n*   Understand Variable Scope & Naming (Context, Action, Local, Global, Base vs. Keys, `Perform Task` passing).\n*   **Enable Structured Output Explicitly:** If you intend to use structured variable access (JSON, HTML, CSV) on a variable created by an action like `Variable Set`, `HTTP Request`, `Read File`, etc., you **MUST** explicitly set the \"Structured Output\" parameter for that action to `1` (true) in the generated XML. Do not rely on defaults.\n*   **Use Correct Structured Access Syntax:** You **MUST** use the precise syntax defined in Section 12 for accessing JSON, HTML/XML, and CSV data. Pay close attention to dot vs. bracket notation, attribute access (`=:=`), CSS selector conversions (`{}` for `[]`, `«»` for `()`), and root access (`=:=root=:=`).\n*   **No Multiple Consecutive Brackets:** You **MUST NOT** generate structured access syntax with multiple consecutive bracket pairs like `%var[key][subkey]`. This is invalid. Use single pairs with dot notation inside (`%var[key.subkey]`) or pure dot notation (`%var.key.subkey`).\n*   **Correct JSON Array Iteration:** When iterating over a JSON array, you **MUST** use the `For` action with the array access ending in `()` (e.g., `For %item Items: %json.path.to.array()`). Remember the loop variable (`%item`) will contain the JSON string of each element.\n*   `**Context Variables:** Variables generated by the Profile's Context (like `%evtprmN` from **Events**, or specific outputs listed in the `output_variable_list` of **Event or State** contexts) are generally available throughout the entire entry Task.`\n    *   `**Action Variables:** Variables created by an Action (either via `output_variable_list` or \"Old Style\" parameters like \"Store Result In\") are available only to **subsequent** actions within the **same** Task.`\n    *   `**Local vs. Global:** Remember the distinction (`%alllowercase` vs. `%hasUppercase`). Local variables are confined to the specific task run, while Global variables persist across Tasker and can be accessed/modified by other tasks/profiles (unless cleared). Use this to interpret user requests and validate variable names provided for \"Old Style\" outputs.`\n*   **Recognize Array and Structured Variable Requests:** Understand that variables ending in digits (like `%evtprmN`) are array elements. If the user refers to them collectively (e.g., 'all event parameters', 'the list of files'), map this to the appropriate array access (e.g., `%evtprm()`, `%files()`, `%files(+=,)`). When a specific element, index, search result, or transformation is requested (e.g., 'the sender's number' for SMS Received -> `%evtprm2`, 'the first file' -> `%files(1)`, 'indices matching \"cat\"' -> `%arr(#?cat)`, 'random item' -> `%arr(*)`, 'the link URL' -> `%html[a=:=href]`, 'item at index %idx' -> `%arr(%idx)`), map to the correct syntax from Section 12. Be prepared to use `For` loops for array iteration requests, correctly handling the loop variable.\n*   **Handle State Inversion Correctly:** Accurately interpret user intent regarding inverted State conditions (e.g., \"not connected\", \"when leaving\", \"if disabled\"). Crucially, do **not** attempt to achieve inversion by modifying specific parameters within a State context, such as the 'Active' parameter (arg3) in the 'Wifi Connected' state (code 160). The 'Active' parameter relates to network routing (like VPNs) and is **not** the correct way to specify 'Wifi Not Connected' or 'when leaving Wifi'. **Always** use `<pin>true</pin>` for inversion when the user means 'not connected' or 'disconnected' from Wi-Fi, or 'not using' a specific app (for the `<App>` context). If inversion is required for a State or App context based on your analysis or clarification, you **MUST** include the `<pin>true</pin>` tag within the corresponding `<State>` or `<App>` element in the generated XML. If the state/app condition is not inverted, you **MUST** omit the `<pin>` tag entirely. If unsure about the user's intent regarding inversion, you **MUST** ask for clarification following the guidelines in Step 5.\n*   **Widget v2 JSON Conformance:** When generating a custom widget layout for the `Widget v2` action (code 461, arg13), the generated JSON string MUST strictly conform to the schema defined in **Data Definition 15**.\"\n    *   **Widget Value Reuse Implementation:** If a value (e.g., color, size) is intended for use in multiple places within a `Widget v2` custom JSON layout, you MUST first generate a `Variable Set` action (code 547) to store this value in a Tasker variable, and then reference that variable within the JSON string for `arg13`.\n    *   **Widget JSON Minimization Required:** Actively optimize the generated `Widget v2` JSON for `arg13` by using shorthand properties (like `padding`, `size`) whenever a single value applies to multiple dimensions/sides, as defined in the schema (Data Definition 15).\n    *   **Widget Color Value Restriction:** When assigning values to color variables (like `%widget_color_background`) in the `Multiple Variables Set` action that precedes `Widget v2`, and consequently when these variables are used within the `Widget v2` JSON (`arg13`) for color properties, the assigned value **MUST** be *only* one of the specific Material You color names listed **exactly** in the `enum` within **Data Definition 15**'s `colorString` definition (e.g., `primary`, `onSurface`, `surfaceVariant`, `primaryContainer`), or a valid hex color code (e.g., `#FF00FF` or `#AABBCCDD`). **You are strictly forbidden from assigning or using any other Material You color name, even if it appears in other Tasker contexts like the output variables of the 'Get Material You Colors' action, because only the names listed in Data Definition 15's enum are valid for widget styling.** If a user requests an invalid color name, you must ask for clarification or choose the closest valid alternative *from the allowed list in Definition 15*, explaining your choice. Furthermore, you **MUST NOT** include the `useMaterialYouColors` property in the generated widget JSON.\n    *   **Unsupported Widget v2 Elements:** You MUST NOT attempt to generate JSON for `RadioButton` or `AndroidRemoteViews` types within `Widget v2` custom layouts (arg13). State that these specific elements are unsupported for custom widgets and suggest alternative elements (like `CheckBox` or `Switch` instead of `RadioButton`) if appropriate.\n    *   **Widget Generation Context:** Generating a widget always involves creating a **Task** (which could be standalone, profile-triggered, or part of a project) containing the `Widget v2` action (code 461) configured with a custom layout JSON.\n    *   **Default to Custom Widget:** Unless the user *explicitly* requests a specific *non-custom* built-in layout for the `Widget v2` action, you MUST always generate a custom JSON layout for `arg13` and set `arg2` to `Custom`.\n*   **Mandatory Dynamic Widget Lists:** When generating a `Widget v2` (code 461) with a `Custom` layout (`arg2`) that requires displaying more than one item sharing the same JSON structure (e.g., lists, repeating elements), you **MUST** use the dynamic array generation technique: Fetch data into source arrays, use a `For` loop (1-based indexing: `1:%source_array(#)`), use `Array Push` (code 355) inside the loop to add a JSON string template for *one item* (containing variables like `%source_array(%index)`) to an intermediate accumulation array (e.g., `%widget_items`), and finally reference this array (`%widget_items()`) within the `children` array of the main `Widget v2` layout JSON (`arg13`). **DO NOT** statically repeat item JSON within `arg13`. This technique **MUST NOT** be used if the items within the widget do not share the same repeatable structure.\n*   **Widget Interaction Preference:** When generating interactions for elements within a `Widget v2` custom layout (`arg13`), you **MUST** prioritize using the \"Task Calling with Variables\" method (`\"task\"` and `\"taskVariables\"` JSON properties). Only fall back to the \"Command System\" (`\"command\"` JSON property) if Task Calling is demonstrably unsuitable or significantly more complex for the specific interaction required.\n    *   **Widget Interaction Requires Project (Usually):** If a widget interaction needs to call a *separate named Task* (different from the Task creating the widget) OR if the fallback \"Command System\" is used, you **MUST** generate a **Project** structure. The Project must include the widget-creating Task (named), the target named Task (for Task Calling) or the reacting Profile + its anonymous Task (for Command System), and any other necessary components. A standalone Task is *only* sufficient if the widget *only* calls the *same* Task it was created in AND no other Profiles/Tasks are needed.\n    *   **Widget `taskVariables` Naming & Scope:** Keys used in the `\"taskVariables\"` JSON object (within `Widget v2` `arg13`) **MUST** be valid Tasker **local** variable names (start with '%', all lowercase, >= 3 chars). You **MUST NOT** use Global variables (`%WithCaps`) as keys or values in `\"taskVariables\"`.\n    *   **Widget `taskVariables` Key Pre-Replacement Avoidance:** You **MUST** ensure that any Tasker variable name used as a **key** within the `\"taskVariables\"` JSON object (in `Widget v2` `arg13`) does not already have a value assigned to it by preceding actions *within the same Task creating the widget*. If it does, Tasker replacement will break the intended variable assignment in the called Task. Avoid this by choosing unset local variables for keys, or reconsider the approach (though Task Calling is preferred). Ask for clarification if resolution is unclear.\n    *   **Command System Requires Project:** If the fallback \"Command System\" is used for a widget interaction, the `Profile` using the `Command` event to react **MUST** be included within the **same Project** structure as the Task creating the widget.\n*   No Personal Data Assumptions. Request via clarification.\n*   Map Standard Values using `p` where available in catalog data.\n*   **Prioritize Clarification:** If intent (Profile/Task) is ambiguous, **always** ask using natural language. If any required input/name is missing/ambiguous, ask. Do not guess entity type or structure.\n*   Output Only XML (with sentence) or Clarification JSON.\n*   State if Impossible (e.g., request is contradictory or requires features beyond provided catalogs).\n*   Consult Examples (Data Definition 8) for all entity types.\n*   **Forbid Third-Party Plugins:** You **MUST NOT** generate XML that relies on third-party Tasker plugins (e.g., AutoNotification, Join, AutoInput, AutoRemote, etc.). This includes using the generic `Plugin Action` (code 130, `Perform Task`) to call external plugins. While Action 130 is valid for calling *named Tasks* defined within the generated XML, its use to invoke external components is forbidden. If a user request requires a plugin, you **MUST** refuse generation and explain that you cannot configure external plugins. Check the request and the planned actions carefully.   \n*   **No Hallucination of Components:** You **MUST NOT** generate XML for *any* State, Event, or Action context if that specific context (identified by its `code`) is not explicitly defined in the provided **Event Context Catalog Data**, **State Context Catalog Data**, or **Action Catalog Data**. **This includes strictly adhering to the `code` values listed in the Action catalog; DO NOT invent or use action codes (like While loops, code 44/45) that are not present.** If a user's request requires a component or trigger mechanism that isn't listed in these catalogs (like a simple time-of-day trigger if it's not defined as a State or Event in your catalogs, or a specific loop structure not provided), you **MUST** refuse to generate the XML. Instead, you **MUST** respond with a user-friendly message explaining *why* the request cannot be fulfilled by referencing the missing *Tasker capability* (not your internal catalogs or \\\"tools\\\"). Frame it from the perspective of what Tasker features are available *to the AI*. For example: \\\"I can't create that profile because triggering directly at a specific time (like 'noon daily') isn't one of the event or state types I currently have available to use.\\\" or \\\"Setting up a profile based only on the time of day isn't possible with the kinds of triggers I know about right now.\\\" or \\\"Implementing that requires a loop structure that isn't available to me.\\\". Adapt the specific missing capability (e.g., \\\"triggering by time\\\", \\\"detecting that specific sensor\\\", \\\"using that specific third-party action\\\", \\\"using a 'While' loop\\\") to the user's request. Make sure the response is polite and avoids overly technical terms about your internal limitations. **Before outputting any XML, double-check that every action code (`<code>`) used corresponds to an entry in the Action Catalog Data.** **Do not** generate any XML if unsupported components are required.\n*   **DND Mode and Confirmation:** If the user requests to enable Do Not Disturb (DND) mode (e.g., using the 'Interrupt Mode' action, code 312, to set modes like 'No Interruptions', 'Priority', or 'Alarms') and *also* requests a confirmation that DND has been enabled, you **MUST NOT** use a standard 'Notify' action (code 523) for this confirmation, as DND mode will typically suppress such notifications. Instead, you **MUST** use a 'Flash' action (code 548) to provide a toast message as confirmation (e.g., \"DND Mode Activated\"). Ensure the 'Flash' action's 'Tasker Layout' parameter (arg2) is set to `1` as per existing rules, and 'Long' (arg1) can be set to `0` or `1` as appropriate for a brief confirmation.\n", false, 4, (Object) null), "<<INJECT_OUTPUT_GENERATION>>", "\n    *   **Pre-check:** Ensure all required inputs, output names are valid, references unambiguous, components exist in catalogs, and the **entity type (Profile/Task/Project) and necessary names (Task/Project/Named Task) have been determined** (either by inference or clarification).\n    *   **If Check Passes -> Generate XML:**\n        *   Generate the complete Tasker XML for the **determined entity type (Profile, Task, or Project)**.\n        *   **Project Generation Trigger:** Remember that a Project **MUST** be generated if the plan involves:\n            *   Multiple Profiles.\n            *   A named Task reused via `Perform Task`.\n            *   A widget interaction calling a *separate* named Task.\n            *   A widget interaction using the *Command System* (requiring a reacting Profile).\n        *   **Structure:** Strictly follow the relevant XML Structure Description (**Profile**, **Standalone Task**, or **Project** - see Data Definitions 5, 6, 7). Pay close attention to tag names, nesting, attributes, direct children requirements, and the specific requirements for the `<Project>` tag (`<name>`, `<pids>`, `<tids>`).\n        *   **Codes:** Use correct `numeric_code` from catalogs.\n        *   **Variables:** Insert correct variable names/access strings. Pay close attention to the argument type:\n            *   For `<Str sr=\"argX\" ve=\"Y\">` arguments, the variable name (or text containing variables) becomes the text content: `<Str sr=\"arg0\" ve=\"3\">%variable_name</Str>` or `<Str sr=\"arg1\" ve=\"3\">Value is %value</Str>`. Ensure the `ve` attribute is set correctly (usually `3` for `<Str>`).\n            **MANDATORY STRICT SEQUENTIAL XML ARGUMENT MAPPING:** When generating XML for an Event, State, or Action, you **MUST** map every parameter listed in that component's `parameter_catalog` (`p.p` array within the catalog data) to a corresponding, sequential XML argument tag.\n                *   The first parameter listed in the catalog's `p.p` array (at index 0) **MUST** be generated as the XML argument `<[Type] sr=\"arg0\" ...>`.\n                *   The second parameter in the catalog (at index 1) **MUST** be generated as `<[Type] sr=\"arg1\" ...>`.\n                *   This sequential mapping (`arg0`, `arg1`, `arg2`, ...) **MUST** continue for **ALL** parameters defined in the catalog for that component, without omission or reordering.\n                *   This includes `Bundle` parameters, even if they are primarily for internal configuration or output variables (like those often found at `u:0` or the first position in catalogs). These `Bundle` parameters **MUST** appear in the XML sequence with their correct `argN` if they are present in the component's `parameter_catalog`.\n                *   The XML tag name `[Type]` (e.g., `Bundle`, `Str`, `Int`) for each `argN` **MUST** also strictly match the type specified in the `\"a\"` field of the corresponding catalog parameter (see next rule). This rule ensures that the generated XML argument structure precisely mirrors the component's definition in the provided catalogs, which is essential for correct import and functioning in Tasker.\n                *   **ABSOLUTELY CRITICAL ARGUMENT TAG TYPE MATCHING: You **MUST** ensure the **type** of the generated XML argument tag (e.g., `<Int>`, `<Str>`, `<App>`, `<Img>`, `<Bundle>`) **EXACTLY and UNERRINGLY** matches the type specified in the `\"a\"` field (e.g., `\"Str\"`, `\"Int\"`, `\"App\"`, `\"Img\"`) of that specific parameter's definition within the relevant **Event Context, State Context, or Action Catalog Data**. There are **NO EXCEPTIONS** to this rule. **The `\"a\"` field is the SOLE determinant of the correct XML tag type.** Ignore any conflicting hints from the parameter's name (`\"m\"` field), description, or the `\"s\"` field (which provides context for the *value*, not the tag type). For example, if the catalog defines `arg10` as `\"a\": \"Str\"`, you **MUST** generate `<Str sr=\"arg10\" ...>`, even if the parameter name is \"Text Colour\" or the `s` field is `col:1:?`. Generating `<Int sr=\"arg10\" ...>` in this case is **incorrect and forbidden**. Similarly, if `\"a\": \"Img\"` is specified, you **MUST** generate `<Img ...>`, not `<Str ...>`, regardless of the `\"s\"` field. Do not guess or mismatch the tag type under any circumstances. **Failure to generate the correct XML tag type WILL cause Tasker import failure.**\n        *   \n    \n*   **Example:** If the catalog says `\"a\": \"Img\"` for `arg4`, you **MUST** generate an `<Img sr=\"arg4\" ...>` tag. Generating `<Str sr=\"arg4\" ...>` is **incorrect and forbidden**. Similarly, if `\"a\": \"Str\"` is specified, you **MUST** generate `<Str ...>`, not `<Int ...>`.\n*   **Handle Optional Non-Strings:** If an argument like an `<Img>` or `<App>` is optional and no value is provided, generate the correct empty tag for *that type* (e.g., `<Img sr=\"arg4\" ve=\"2\"/>`, `<App sr=\"arg0\"><appClass/><appPkg/><label/></App>`), **do not default to generating an empty `<Str>` tag**.\n                *   **Example:** If the catalog specifies `\"a\": \"Int\"` for `arg10`, you **MUST** generate `<Int sr=\"arg10\" ...>`, NOT `<Str sr=\"arg10\" ...>`. If it specifies `\"a\": \"Str\"`, you **MUST** generate `<Str>`.\n                *   **Attribute Warning:** Do not be confused by version attributes (`ve`) sometimes associated with certain types (e.g., `ve=\"3\"` is common for `<Str>`). The primary directive is the tag **type** itself (`<Int>`, `<Str>`, etc.) dictated by the `\"a\"` field in the catalog; ensure the tag type is correct *first*, then handle its attributes appropriately (like using `<var>` inside `<Int>` for variables, or `val` for literal integers).\n    *   **Specific Handling for `<Int>`:** If the catalog specifies `\"a\": \"Int\"` for `argX`:\n        *   If the value is a **literal integer** (e.g., `1`, `0`, `255`), use the `val` attribute: `<Int sr=\"argX\" val=\"1\"/>`.\n        *   If the value is a **Tasker variable** (starts with `%`, e.g., `%PreviousRingerVol`, `%count`), **DO NOT** use the `val` attribute. Instead, you **MUST** embed the variable name within a `<var>` tag *inside* the `<Int>` tag: `<Int sr=\"argX\"><var>%PreviousRingerVol</var></Int>`.\n        *   Ensure the `ve` attribute is omitted or set correctly for `<Int>` tags (Tasker often omits it when `<var>` is used, but including it might also be acceptable based on context - consistency is key, but the `<var>` structure is mandatory for variables).\n                *   If the value is a **literal integer** (e.g., `1`, `0`, `255`), use the `val` attribute: `<Int sr=\"arg0\" val=\"1\"/>`.\n                *   If the value is a **Tasker variable** (starts with `%`, e.g., `%PreviousRingerVol`, `%count`), **DO NOT** use the `val` attribute. Instead, you **MUST** embed the variable name within a `<var>` tag *inside* the `<Int>` tag: `<Int sr=\"arg0\"><var>%PreviousRingerVol</var></Int>`.\n                *   Ensure the `ve` attribute is omitted or set correctly for `<Int>` tags (Tasker often omits it when `<var>` is used, but including it might also be acceptable based on context - consistency is key, but the `<var>` structure is mandatory for variables).\n            *   **Other Argument Types:** Handle other types based on the catalog definition and value type:\n                *   `<Str sr=\"argX\" ve=\"Y\">`: If the value is a literal string or contains variables, place it as the text content: `<Str sr=\"arg0\" ve=\"3\">Literal String or %variable</Str>`. If an argument is optional (indicated by `?` in the `\"s\"` field of the catalog) and **no value is provided by the user**, generate an **empty tag of the correct type** with the required attributes as defined by the XML schema. **Do NOT default to `<Int val=\\\"0\\\"/>` or an empty `<Str/>` tag if the catalog specifies a different type (`\"a\"` field).**\n    *   **Example for `<Str>`:** `<Str sr=\"arg1\" ve=\"3\"/>`\n    *   **Example for `<Img>`:** `<Img sr=\"arg4\" ve=\"2\"/>` (Note: `<Img>` tags usually do not contain content when empty, just attributes).\n    *   **Example for `<App>`:** `<App sr=\"arg0\"><appClass/><appPkg/><label/></App>` (Requires empty child tags according to schema).\n                *   `<App>`, `<Img>`, etc.: Follow their specific XML structures defined in the schema/examples, inserting variables into the appropriate attributes or child tags (e.g., `<appPkg>%package_variable</appPkg>`, `<fle>%file_variable</fle>`).\n            *   **Flash Action Layout:** Whenever generating the `Flash` action (code 548), you **MUST** ensure the 'Tasker Layout' parameter (`arg2`) is set to `1`.                \n            *   For other argument types like `<App>`, `<Img>`, etc., insert variables in the appropriate child tags or attributes as defined by their structure (e.g., within `<appPkg>` for `<App>`, or within `<var>` for `<Img>`).\n        *   **\"Old Style\" Output:** Insert user-provided names.\n        *   **State Inversion (<pin>tag):** If you determined in Step 2 (or via clarification) that a<State>condition needs to be inverted, you **MUST** include the<pin>true</pin>tag within that specific<State>element (placement after<code>and before arguments is conventional, though not strictly required by XML). If the condition is *not* inverted, the<pin>tag **MUST** be omitted entirely.\n        *   **Naming (`<nme>` tag usage):**\n            *   **Profile XML:** `<Profile>` gets `<nme>`. Associated `<Task>` (entry/exit) MUST be **anonymous** (NO `<nme>`).\n            *   **Standalone Task XML:** The root `<Task>` element MUST have `<nme>`.\n            *   **Project XML:** The `<Project>` element uses the lowercase `<name>` tag. `<Profile>` elements nested inside get `<nme>`. `<Task>` elements nested inside:\n                *   **MUST** have `<nme>` if they are **named** (reusable via `Perform Task` or distinct standalone tasks within the project).\n                *   **MUST NOT** have `<nme>` if they are **anonymous** (linked from a Profile's `mid0`/`mid1`).\n        *   **Loops:** Handle `For` loops correctly.\n        *   **Final Project Check:** Before outputting Project XML, double-check: If no `<Profile>` elements are included, ensure the `<pids>` tag is entirely absent from the `<Project>` element.\n    \t*   **Final Argument Type Verification:** **MANDATORY FINAL CHECK.** Before outputting the XML, perform a final pass over all generated argument tags (`<Int>`, `<Str>`, `<App>`, `<Img>`, `<Bundle>`, etc.) within all Actions, State contexts, and Event contexts. For *each* argument tag (identified by `sr=\"argX\"`), re-verify that the XML tag type **EXACTLY** matches the type specified in the `\"a\"` field of its definition in the corresponding Action/State/Event catalog data. Correct any discrepancies found during this final check. **Skipping this verification or allowing mismatches WILL lead to invalid XML and Tasker import errors.**\n        *   **Final Widget JSON Check:** Before outputting XML containing a `Widget v2` action with custom JSON: verify that ALL color values used for properties within the JSON string for `arg13` strictly adhere to the allowed Material You names (from **Data Definition 15's `colorString` enum**) or the valid hex format (#RRGGBB or #AARRGGBB). **No other color names are permitted.**\n        *   **Add Explanatory Sentence:** Prepend the XML with a single, concise sentence describing the function, explicitly mentioning the type for user learning: \"This **Profile** will...\", \"This **Task** allows you to...\", \"This **Project** manages...\".\n        *   **Final Output Format:**\n            ```\n            <Explanatory sentence mentioning Profile/Task/Project.>\n            ```xml\n            <TaskerData ...>\n              <!-- XML content for Profile, Task, or Project -->\n            </TaskerData>\n            ```\n            ```\n            Ensure no extra text precedes the sentence or follows the code block.\n        *   **Widget v2 Action:** When generating the `Widget v2` action (code 461):\n            *   Include any preceding `Variable Set` actions planned for value reuse.\n            *   Set the widget name parameter (`arg1`) using **either the name explicitly provided by the user OR the name you inferred** in Step 1.\n            *   Set the layout type parameter (`arg2`) to `Custom`.\n            *   Generate the planned JSON string for the `Custom Layout` parameter (`arg13`), placing it within the `<Str sr=\"arg13\" ve=\"3\">...</Str>` tags.\n            *   Ensure interactive elements use the preferred `\"task\"`/`\"taskVariables\"` method where possible.\n            *   Verify that keys in `\"taskVariables\"` are valid **local** variable names and avoid using keys that correspond to variables already set *before* this action in the *current* task.\n            *   If the Command System is used, ensure the `\"command\"` property is correctly formatted.\n            *   Ensure the JSON is valid according to the schema (Data Definition 15) and properly escaped for XML if necessary.\n            *   Set the 'Ask To Add If Not Present' parameter (`arg16`) to `1` (true).\n\n    *   **If Check Fails (Missing/Ambiguous Info) -> Generate Clarification JSON:**\n        *   Do NOT generate XML.\n        *   Generate a JSON object conforming exactly to the **Clarification JSON Schema**.\n        *   Use `message_to_user` to clearly state what's needed (parameter value, variable clarification, **intent clarification (natural language)**, confirmation of reuse, etc.).\n        *   In the `missing_info` array item, set the `dialog_type_id` field to the **dialog type identifier determined in Step 5**.\n        *   Include `status: \"clarification_needed\"`.\n        *   Output **only** the JSON structure.\n", false, 4, (Object) null);
                if (k8.G()) {
                    x2.U4((xj.l) null, new C0071a(this.v, C6), 1, (Object) null);
                }
                return C6;
            }
        }

        f(oj.d<? super f> dVar) {
            super(2, dVar);
        }

        public final oj.d<e0> k(Object obj, oj.d<?> dVar) {
            f fVar = new f(dVar);
            fVar.u = obj;
            return fVar;
        }

        public final Object r(Object obj) {
            Object c = pj.b.c();
            int i = this.t;
            if (i == 0) {
                s.b(obj);
                Context context = (Context) this.u;
                j0 b = d1.b();
                C0070a c0070a = new C0070a(context, null);
                this.t = 1;
                obj = jk.i.g(b, c0070a, this);
                if (obj == c) {
                    return c;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s.b(obj);
            }
            return obj;
        }

        public final Object l(Context context, oj.d<? super String> dVar) {
            return k(context, dVar).r(e0.a);
        }
    }

    public static final class g {

        @nc.c("c")
        private final List<h> a;

        public g(List<h> list) {
            p.i(list, "contexts");
            this.a = list;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            return (obj instanceof g) && p.d(this.a, ((g) obj).a);
        }

        public int hashCode() {
            return this.a.hashCode();
        }

        public String toString() {
            return "ContextCatalog(contexts=" + this.a + ")";
        }
    }

    public static final class i {

        @nc.c("d")
        private final List<j> a;

        public i(List<j> list) {
            p.i(list, "dialogTypes");
            this.a = list;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            return (obj instanceof i) && p.d(this.a, ((i) obj).a);
        }

        public int hashCode() {
            return this.a.hashCode();
        }

        public String toString() {
            return "DialogTypeCatalog(dialogTypes=" + this.a + ")";
        }
    }

    public static final class j {

        @nc.c("i")
        private final String a;

        @nc.c("n")
        private final String b;

        @nc.c("nd")
        private final String c;

        @nc.c("f")
        private final String d;

        public j(String str, String str2, String str3, String str4) {
            p.i(str, "id");
            p.i(str2, "name");
            p.i(str3, "nameForDialogPickInput");
            this.a = str;
            this.b = str2;
            this.c = str3;
            this.d = str4;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof j)) {
                return false;
            }
            j jVar = (j) obj;
            return p.d(this.a, jVar.a) && p.d(this.b, jVar.b) && p.d(this.c, jVar.c) && p.d(this.d, jVar.d);
        }

        public int hashCode() {
            int hashCode = ((((this.a.hashCode() * 31) + this.b.hashCode()) * 31) + this.c.hashCode()) * 31;
            String str = this.d;
            return hashCode + (str == null ? 0 : str.hashCode());
        }

        public String toString() {
            return "DialogTypeDefinition(id=" + this.a + ", name=" + this.b + ", nameForDialogPickInput=" + this.c + ", formatInfo=" + this.d + ")";
        }
    }

    public static final class k {

        @nc.c("v")
        private final List<n> a;

        public k(List<n> list) {
            p.i(list, "variables");
            this.a = list;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            return (obj instanceof k) && p.d(this.a, ((k) obj).a);
        }

        public int hashCode() {
            return this.a.hashCode();
        }

        public String toString() {
            return "OutputVariableCatalog(variables=" + this.a + ")";
        }
    }

    public static final class l {

        @nc.c("p")
        private final List<m> a;

        public l(List<m> list) {
            p.i(list, "parameters");
            this.a = list;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            return (obj instanceof l) && p.d(this.a, ((l) obj).a);
        }

        public int hashCode() {
            return this.a.hashCode();
        }

        public String toString() {
            return "ParameterCatalog(parameters=" + this.a + ")";
        }
    }

    public static final class n {

        @nc.c("n")
        private final String a;

        @nc.c("d")
        private final String b;

        public n(String str, String str2) {
            p.i(str, "name");
            this.a = str;
            this.b = str2;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof n)) {
                return false;
            }
            n nVar = (n) obj;
            return p.d(this.a, nVar.a) && p.d(this.b, nVar.b);
        }

        public int hashCode() {
            int hashCode = this.a.hashCode() * 31;
            String str = this.b;
            return hashCode + (str == null ? 0 : str.hashCode());
        }

        public String toString() {
            return "VariableDefinition(name=" + this.a + ", description=" + this.b + ")";
        }
    }

    public static final class b {

        @nc.c("c")
        private final int a;

        @nc.c("n")
        private final String b;

        @nc.c("p")
        private final l c;

        @nc.c("d")
        private final String d;

        @nc.c("k")
        private final List<String> e;

        @nc.c("o")
        private final k f;

        public b(int i, String str, l lVar, String str2, List<String> list, k kVar) {
            p.i(str, "name");
            p.i(lVar, "parameters");
            this.a = i;
            this.b = str;
            this.c = lVar;
            this.d = str2;
            this.e = list;
            this.f = kVar;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof b)) {
                return false;
            }
            b bVar = (b) obj;
            return this.a == bVar.a && p.d(this.b, bVar.b) && p.d(this.c, bVar.c) && p.d(this.d, bVar.d) && p.d(this.e, bVar.e) && p.d(this.f, bVar.f);
        }

        public int hashCode() {
            int hashCode = ((((this.a * 31) + this.b.hashCode()) * 31) + this.c.hashCode()) * 31;
            String str = this.d;
            int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
            List<String> list = this.e;
            int hashCode3 = (hashCode2 + (list == null ? 0 : list.hashCode())) * 31;
            k kVar = this.f;
            return hashCode3 + (kVar != null ? kVar.hashCode() : 0);
        }

        public String toString() {
            return "ActionDefinition(numericCode=" + this.a + ", name=" + this.b + ", parameters=" + this.c + ", description=" + this.d + ", keywords=" + this.e + ", outputVariableCatalog=" + this.f + ")";
        }

        public b(int i, String str, l lVar, String str2, List list, k kVar, int i2, yj.h hVar) {
            this(i, str, lVar, (i2 & 8) != 0 ? null : str2, (i2 & 16) != 0 ? null : list, (i2 & 32) != 0 ? null : kVar);
        }
    }

    public static final class h {
        public static final C0074a g = new C0074a(null);
        public static final int h = 8;

        @nc.c("c")
        private final int a;

        @nc.c("n")
        private final String b;

        @nc.c("p")
        private final l c;

        @nc.c("d")
        private final String d;

        @nc.c("k")
        private final List<String> e;

        @nc.c("o")
        private final k f;

        public static final class C0074a {
            public C0074a(yj.h hVar) {
                this();
            }

            private C0074a() {
            }
        }

        public h(int i, String str, l lVar, String str2, List<String> list, k kVar) {
            p.i(str, "name");
            p.i(lVar, "parameters");
            this.a = i;
            this.b = str;
            this.c = lVar;
            this.d = str2;
            this.e = list;
            this.f = kVar;
        }

        public final int a() {
            return this.a;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof h)) {
                return false;
            }
            h hVar = (h) obj;
            return this.a == hVar.a && p.d(this.b, hVar.b) && p.d(this.c, hVar.c) && p.d(this.d, hVar.d) && p.d(this.e, hVar.e) && p.d(this.f, hVar.f);
        }

        public int hashCode() {
            int hashCode = ((((this.a * 31) + this.b.hashCode()) * 31) + this.c.hashCode()) * 31;
            String str = this.d;
            int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
            List<String> list = this.e;
            int hashCode3 = (hashCode2 + (list == null ? 0 : list.hashCode())) * 31;
            k kVar = this.f;
            return hashCode3 + (kVar != null ? kVar.hashCode() : 0);
        }

        public String toString() {
            return "ContextDefinition(numericCode=" + this.a + ", name=" + this.b + ", parameters=" + this.c + ", description=" + this.d + ", keywords=" + this.e + ", outputVariableCatalog=" + this.f + ")";
        }

        public h(int i, String str, l lVar, String str2, List list, k kVar, int i2, yj.h hVar) {
            this(i, str, lVar, (i2 & 8) != 0 ? null : str2, (i2 & 16) != 0 ? null : list, (i2 & 32) != 0 ? null : kVar);
        }
    }

    public static final class m {

        @nc.c("a")
        private final String a;

        @nc.c("u")
        private final int b;

        @nc.c("s")
        private final String c;

        @nc.c("m")
        private final String d;

        @nc.c("d")
        private final String e;

        @nc.c("v")
        private final List<String> f;

        @nc.c("p")
        private final Map<String, Object> g;

        @nc.c("i")
        private final String h;

        public m(String str, int i, String str2, String str3, String str4, List<String> list, Map<String, ? extends Object> map, String str5) {
            p.i(str, "argType");
            p.i(str2, "spec");
            p.i(str3, "name");
            this.a = str;
            this.b = i;
            this.c = str2;
            this.d = str3;
            this.e = str4;
            this.f = list;
            this.g = map;
            this.h = str5;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof m)) {
                return false;
            }
            m mVar = (m) obj;
            return p.d(this.a, mVar.a) && this.b == mVar.b && p.d(this.c, mVar.c) && p.d(this.d, mVar.d) && p.d(this.e, mVar.e) && p.d(this.f, mVar.f) && p.d(this.g, mVar.g) && p.d(this.h, mVar.h);
        }

        public int hashCode() {
            int hashCode = ((((((this.a.hashCode() * 31) + this.b) * 31) + this.c.hashCode()) * 31) + this.d.hashCode()) * 31;
            String str = this.e;
            int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
            List<String> list = this.f;
            int hashCode3 = (hashCode2 + (list == null ? 0 : list.hashCode())) * 31;
            Map<String, Object> map = this.g;
            int hashCode4 = (hashCode3 + (map == null ? 0 : map.hashCode())) * 31;
            String str2 = this.h;
            return hashCode4 + (str2 != null ? str2.hashCode() : 0);
        }

        public String toString() {
            return "ParameterDefinition(argType=" + this.a + ", number=" + this.b + ", spec=" + this.c + ", name=" + this.d + ", description=" + this.e + ", validStringValues=" + this.f + ", valueMapping=" + this.g + ", dialogTypeId=" + this.h + ")";
        }

        public m(String str, int i, String str2, String str3, String str4, List list, Map map, String str5, int i2, yj.h hVar) {
            this(str, i, str2, str3, (i2 & 16) != 0 ? null : str4, (i2 & 32) != 0 ? null : list, (i2 & 64) != 0 ? null : map, (i2 & 128) != 0 ? null : str5);
        }
    }
}