[
    {
        "type": "style",
        "content": {
            "targets": [
                "body"
            ],
            "properties": [
                {
                    "type": "background",
                    "url": "https://crhscountyline.com/wp-content/uploads/2020/03/Capture.png"
                }
            ]
        }
    },
    {
        "type": "style",
        "content": {
            "targets": [
                ".comment"
            ],
            "properties": [
                {
                    "type": "background",
                    "color": "lightgray"
                },
                {
                    "type": "padding",
                    "amount": "12px"
                }
            ]
        }
    },
    {
        "type": "style",
        "content": {
            "targets": [
                ".author"
            ],
            "properties": [
                {
                    "type": "font",
                    "bold": true
                },
                {
                    "type": "color",
                    "color": "black"
                }
            ]
        }
    },
    {
        "type": "style",
        "content": {
            "targets": [
                "button"
            ],
            "properties": [
                {
                    "type": "background",
                    "color": "black"
                },
                {
                    "type": "color",
                    "color": "white"
                },
                {
                    "type": "padding",
                    "amount": "20px"
                },
                {
                    "type": "border",
                    "color": "blue",
                    "width": "12px"
                }
            ]
        }
    },
    {
        "type": "style",
        "content": {
            "targets": [
                ".title"
            ],
            "properties": [
                {
                    "type": "font",
                    "bold": true
                },
                {
                    "type": "font",
                    "bold": false,
                    "size": "26px"
                }
            ]
        }
    },
    {
        "type": "style",
        "content": {
            "targets": [
                ".upvotes"
            ],
            "properties": [
                {
                    "type": "float",
                    "side": "right"
                },
                {
                    "type": "margin",
                    "rightAmount": "10px"
                }
            ]
        }
    },
    {
        "type": "style",
        "content": {
            "targets": [
                ".container"
            ],
            "properties": [
                {
                    "type": "padding",
                    "amount": "16px"
                },
                {
                    "type": "background",
                    "color": "white"
                },
                {
                    "type": "border",
                    "color": "black",
                    "width": "1px"
                },
                {
                    "type": "margin",
                    "bottomAmount": "20px"
                }
            ]
        }
    },
    {
        "type": "html",
        "content": [
            {
                "type": "html",
                "tag": "div",
                "classes": [
                    "container"
                ],
                "children": [
                    {
                        "type": "html",
                        "tag": "div",
                        "classes": [],
                        "children": [
                            {
                                "type": "html",
                                "tag": "p",
                                "classes": [
                                    "title"
                                ],
                                "text": "This is even more advanced"
                            }
                        ]
                    },
                    {
                        "type": "html",
                        "tag": "p",
                        "classes": [],
                        "text": "Click the button below for a present"
                    },
                    {
                        "type": "html",
                        "tag": "button",
                        "classes": [],
                        "text": "This is a button",
                        "eventHandlers": [
                            {
                                "refName": "userInfo",
                                "eventName": "click"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        "type": "html",
        "content": [
            {
                "type": "html",
                "tag": "li",
                "classes": [],
                "children": [
                    {
                        "type": "html",
                        "tag": "div",
                        "classes": [
                            "comment"
                        ],
                        "children": [
                            {
                                "type": "html",
                                "tag": "div",
                                "classes": [
                                    "upvotes"
                                ],
                                "children": [
                                    {
                                        "type": "html",
                                        "tag": "p",
                                        "classes": [],
                                        "text": "[upvotes]"
                                    }
                                ]
                            },
                            {
                                "type": "html",
                                "tag": "p",
                                "classes": [
                                    "author"
                                ],
                                "text": "[author]"
                            },
                            {
                                "type": "html",
                                "tag": "p",
                                "classes": [],
                                "text": "[content]"
                            }
                        ]
                    }
                ],
                "sourceUrl": "https://5fc4327e36bc79001634363f.mockapi.io/posts"
            }
        ]
    },
    {
        "type": "script",
        "content": {
            "name": "userInfo",
            "inputs": [],
            "isAsync": false,
            "lines": [
                {
                    "type": "alert",
                    "isAsync": false,
                    "variables": [],
                    "text": "\"Hey, you pressed me!\""
                },
                {
                    "type": "prompt",
                    "isAsync": false,
                    "variables": [
                        "{{variable}}"
                    ],
                    "text": "What is your name?"
                },
                {
                    "type": "if",
                    "isAsync": false,
                    "conditions": {
                        "type": "and",
                        "items": [
                            [
                                {
                                    "type": "equal",
                                    "tokens": [
                                        {
                                            "group": "script",
                                            "section": "initiator",
                                            "key": "if",
                                            "original": "if"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "verify",
                                            "original": "verify"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "name",
                                            "original": "name"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "logic",
                                            "key": "not",
                                            "original": "isnt"
                                        },
                                        {
                                            "group": "script",
                                            "section": "value",
                                            "key": "true",
                                            "original": "true"
                                        }
                                    ],
                                    "leftSide": "",
                                    "leftSideOriginal": [
                                        {
                                            "group": "script",
                                            "section": "initiator",
                                            "key": "if",
                                            "original": "if"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "verify",
                                            "original": "verify"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "name",
                                            "original": "name"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "logic",
                                            "key": "not",
                                            "original": "isnt"
                                        },
                                        {
                                            "group": "script",
                                            "section": "value",
                                            "key": "true",
                                            "original": "true"
                                        }
                                    ],
                                    "rightSide": "true",
                                    "rightSideOriginal": []
                                }
                            ]
                        ],
                        "isNegated": true
                    },
                    "variables": [],
                    "children": [
                        {
                            "type": "alert",
                            "isAsync": false,
                            "variables": [],
                            "text": "\"That does not look like a proper name\""
                        },
                        {
                            "type": "return",
                            "isAsync": false,
                            "value": "false"
                        }
                    ]
                },
                {
                    "type": "alert",
                    "isAsync": false,
                    "variables": [],
                    "text": "\"Hi \" + {{variable:name}} + \", nice to meet you!\""
                },
                {
                    "type": "store",
                    "isAsync": false,
                    "variables": [
                        "currentWeather"
                    ],
                    "rightSide": "weatherInformation"
                },
                {
                    "type": "alert",
                    "isAsync": false,
                    "variables": [],
                    "text": "\"It is \" + {{variable:current_temperature}} + \" degrees right now in \" + {{variable:city_name}}"
                },
                {
                    "type": "if",
                    "isAsync": false,
                    "conditions": {
                        "type": "and",
                        "items": [
                            [
                                {
                                    "type": "contains",
                                    "tokens": [
                                        {
                                            "group": "custom",
                                            "key": "check",
                                            "original": "check"
                                        },
                                        {
                                            "group": "script",
                                            "section": "initiator",
                                            "key": "if",
                                            "original": "if"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "their",
                                            "original": "their"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "name",
                                            "original": "name"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "operation",
                                            "key": "contains",
                                            "original": "contains"
                                        },
                                        {
                                            "group": "custom",
                                            "section": "string",
                                            "key": "Cameron",
                                            "original": "\"Cameron\""
                                        }
                                    ],
                                    "leftSide": "name",
                                    "leftSideOriginal": [
                                        {
                                            "group": "custom",
                                            "key": "name",
                                            "original": "name"
                                        }
                                    ],
                                    "rightSide": "\"Cameron\"",
                                    "rightSideOriginal": [
                                        {
                                            "group": "custom",
                                            "section": "string",
                                            "key": "Cameron",
                                            "original": "\"Cameron\""
                                        }
                                    ]
                                }
                            ]
                        ],
                        "isNegated": false
                    },
                    "variables": [],
                    "children": [
                        {
                            "type": "alert",
                            "isAsync": false,
                            "variables": [],
                            "text": "\"Hello, creator!\""
                        }
                    ]
                }
            ]
        }
    },
    {
        "type": "script",
        "content": {
            "name": "verifyName",
            "inputs": [
                "theirName"
            ],
            "isAsync": false,
            "lines": [
                {
                    "type": "if",
                    "isAsync": false,
                    "conditions": {
                        "type": "and",
                        "items": [
                            [
                                {
                                    "type": "equal",
                                    "tokens": [
                                        {
                                            "group": "custom",
                                            "key": "its",
                                            "original": "its"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "operation",
                                            "key": "empty",
                                            "original": "empty"
                                        }
                                    ],
                                    "leftSide": "{{variable}}",
                                    "leftSideOriginal": [],
                                    "rightSide": "\"\"",
                                    "rightSideOriginal": []
                                }
                            ]
                        ],
                        "isNegated": false
                    },
                    "children": [
                        {
                            "type": "return",
                            "isAsync": false,
                            "value": "false"
                        }
                    ]
                },
                {
                    "type": "if",
                    "isAsync": false,
                    "conditions": {
                        "type": "or",
                        "items": [
                            [
                                {
                                    "type": "lessThan",
                                    "tokens": [
                                        {
                                            "group": "custom",
                                            "key": "its",
                                            "original": "its"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "compare",
                                            "key": "lessThan",
                                            "original": "less than"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "3",
                                            "original": "3"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "hint",
                                            "key": "length",
                                            "original": "characters"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "logic",
                                            "key": "or",
                                            "original": "or"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "compare",
                                            "key": "greaterThan",
                                            "original": "more than"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "20",
                                            "original": "20"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "hint",
                                            "key": "length",
                                            "original": "characters"
                                        }
                                    ],
                                    "leftSide": "{{variable}}",
                                    "leftSideOriginal": [],
                                    "rightSide": "3",
                                    "rightSideOriginal": [
                                        {
                                            "group": "custom",
                                            "key": "3",
                                            "original": "3"
                                        }
                                    ]
                                }
                            ],
                            [
                                {
                                    "type": "greaterThan",
                                    "tokens": [
                                        {
                                            "group": "custom",
                                            "key": "its",
                                            "original": "its"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "compare",
                                            "key": "lessThan",
                                            "original": "less than"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "3",
                                            "original": "3"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "hint",
                                            "key": "length",
                                            "original": "characters"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "logic",
                                            "key": "or",
                                            "original": "or"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "compare",
                                            "key": "greaterThan",
                                            "original": "more than"
                                        },
                                        {
                                            "group": "custom",
                                            "key": "20",
                                            "original": "20"
                                        },
                                        {
                                            "group": "generic",
                                            "section": "hint",
                                            "key": "length",
                                            "original": "characters"
                                        }
                                    ],
                                    "leftSide": "{{variable}}",
                                    "leftSideOriginal": [],
                                    "rightSide": "20",
                                    "rightSideOriginal": [
                                        {
                                            "group": "custom",
                                            "key": "20",
                                            "original": "20"
                                        }
                                    ]
                                }
                            ]
                        ],
                        "isNegated": false
                    },
                    "children": [
                        {
                            "type": "return",
                            "isAsync": false,
                            "value": "false"
                        }
                    ]
                },
                {
                    "type": "return",
                    "isAsync": false,
                    "value": "true"
                }
            ]
        }
    },
    {
        "type": "script",
        "content": {
            "name": "weatherInformation",
            "inputs": [],
            "isAsync": false,
            "lines": [
                {
                    "type": "ajax",
                    "isAsync": true,
                    "method": "get",
                    "variables": [
                        "current_temperature",
                        "city_name"
                    ],
                    "properties": [
                        "current_temperature",
                        "city_name"
                    ],
                    "url": "https://5fc4327e36bc79001634363f.mockapi.io/weather/1"
                }
            ]
        }
    }
]