{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.5",
    "type": "AdaptiveCard",
    "refresh": {
        "action": {
            "type": "Action.Execute",
            "verb": "refresh"
        }
    },
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "Image",
                            "style": "Default",
                            "url": "${deviceStatus.wallpaper}",
                            "height": "52px"
                        }
                    ],
                    "width": "auto",
                    "selectAction": {
                        "type": "Action.Execute",
                        "tooltip": "${deviceStatus.opentext}",
                        "verb": "open"
                    }
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "Bolder",
                            "text": "${deviceStatus.name}",
                            "maxLines": 1,
                            "wrap": false
                        },
                        {
                            "type": "ColumnSet",
                            "spacing": "small",
                            "columns": [
                                {
                                    "type": "Column",
                                    "items": [
                                        {
                                            "type": "Image",
                                            "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.deviceStatus.connectivity.connectivitystatuslight, $root.deviceStatus.connectivity.connectivitystatusdark)}",
                                            "size": "Stretch"
                                        }
                                    ],
                                    "selectAction": {
                                        "type": "Action.Execute",
                                        "tooltip": "${deviceStatus.connectivity.connectivitystatustext}",
                                        "verb": "connectRefresh"
                                    },
                                    "width": "47px",
                                    "spacing": "None"
                                },
                                {
                                    "type": "Column",
                                    "$when": "${deviceStatus.indicators.showBluetooth == true}",
                                    "items": [
                                        {
                                            "type": "Image",
                                            "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.deviceStatus.indicators.bluetoothlight, $root.deviceStatus.indicators.bluetoothdark)}",
                                            "size": "Stretch"
                                        }
                                    ],
                                    "width": "16px",
                                    "spacing": "Small"
                                },
                                {
                                    "type": "Column",
                                    "$when": "${deviceStatus.indicators.showWifi == true}",
                                    "items": [
                                        {
                                            "type": "Image",
                                            "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.deviceStatus.indicators.wifilight, $root.deviceStatus.indicators.wifidark)}",
                                            "size": "Stretch"
                                        }
                                    ],
                                    "width": "16px",
                                    "spacing": "Small"
                                },
                                {
                                    "type": "Column",
                                    "$when": "${deviceStatus.indicators.showSignal == true}",
                                    "items": [
                                        {
                                            "type": "Image",
                                            "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.deviceStatus.indicators.signallight, $root.deviceStatus.indicators.signaldark)}",
                                            "size": "Stretch"
                                        }
                                    ],
                                    "width": "16px",
                                    "spacing": "Small"
                                },
                                {
                                    "type": "Column",
                                    "$when": "${deviceStatus.indicators.showBattery == true}",
                                    "items": [
                                        {
                                            "type": "Image",
                                            "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.deviceStatus.indicators.batterylight, $root.deviceStatus.indicators.batterydark)}",
                                            "size": "Stretch"
                                        }
                                    ],
                                    "width": "16px",
                                    "spacing": "Small"
                                },
                                {
                                    "type": "Column",
                                    "$when": "${deviceStatus.indicators.showBattery == true}",
                                    "items": [
                                        {
                                            "type": "TextBlock",
                                            "weight": "Bolder",
                                            "text": "${deviceStatus.indicators.batterypercentage}",
                                            "maxLines": 1,
                                            "wrap": false
                                        }
                                    ],
                                    "width": "auto",
                                    "spacing": "Small"
                                }
                            ]
                        }
                    ],
                    "verticalContentAlignment": "Center",
                    "width": "stretch"
                }
            ]
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "${notifications.notificationstitletext}",
                            "size": "Default",
                            "weight": "Bolder",
                            "wrap": false,
                            "horizontalAlignment": "Left"
                        }
                    ],
                    "width": "stretch",
                    "spacing": "None"
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "spacing": "None",
                            "text": "${notifications.clearalltext}",
                            "wrap": false,
                            "color": "accent",
                            "horizontalAlignment": "Right"
                        }
                    ],
                    "selectAction": {
                        "type": "Action.Execute",
                        "tooltip": "${notifications.clearalltext}",
                        "verb": "clearAllNotifications"
                    },
                    "width": "auto"
                }
            ]
        },
        {
            "type": "Container",
            "$when": "${count(notifications.notifications) == 0}",
            "height": "stretch",
            "verticalContentAlignment": "center",
            "items": [
                {
                    "type": "TextBlock",
                    "horizontalAlignment": "Center",
                    "isSubtle": true,
                    "text": "${notifications.nonewnotificationstext}"
                }
            ]
        },
        {
            "type": "Container",
            "$when": "${count(notifications.notifications) > 0 && ($host.widgetSize==\"medium\" || $host.widgetSize==\"large\")}",
            "verticalContentAlignment": "Center",
            "minHeight": "70px",
            "spacing": "Small",
            "horizontalAlignment": "Left",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "verticalContentAlignment": "Top",
                            "minHeight": "0px",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "spacing": "None",
                            "minHeight": "0px",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "{{TIME(${string(notifications.notifications[0].timestamp)})}}",
                                    "size": "small",
                                    "weight": "Lighter",
                                    "isSubtle": true,
                                    "spacing": "Large",
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationdismisslight, $root.notifications.notificationdismissdark)}",
                                    "spacing": "None",
                                    "width": "16px"
                                }
                            ],
                            "selectAction": {
                                "type": "Action.Execute",
                                "tooltip": "${notifications.clearnotificationtext}",
                                "verb": "clearNotification",
                                "data": "${notifications.notifications[0].id}"
                            }
                        },
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None"
                        }
                    ],
                    "spacing": "None",
                    "bleed": true,
                    "minHeight": "0px"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "None",
                    "minHeight": "40px",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None",
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": "32px",
                            "minHeight": "0px",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[0].appIcon != \"\"}",
                                    "url": "${notifications.notifications[0].appIcon}",
                                    "size": "Small",
                                    "spacing": "None"
                                },
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[0].appIcon == \"\"}",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationiconplaceholderlight, $root.notifications.notificationiconplaceholderdark)}",
                                    "size": "Small",
                                    "spacing": "None"
                                }
                            ],
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "Small",
                            "verticalContentAlignment": "Top",
                            "horizontalAlignment": "Left",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "weight": "Bolder",
                                    "text": "${notifications.notifications[0].line1}",
                                    "maxLines": 1,
                                    "spacing": "None",
                                    "wrap": false
                                },
                                {
                                    "type": "TextBlock",
                                    "spacing": "None",
                                    "text": "${notifications.notifications[0].line2}",
                                    "maxLines": 1,
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "8px"
                        }
                    ]
                }
            ],
            "backgroundImage": {
                "url": "${if($host.hostTheme == \"light\", $root.notifications.notificationbackgroundlight, if($host.hostTheme == \"dark\", $root.notifications.notificationbackgrounddark, \"\"))}"
            },
            "selectAction": {
                "type": "Action.Execute",
                "verb": "openNotification",
                "data": "${notifications.notifications[0].id}"
            }
        },
        {
            "type": "Container",
            "$when": "${count(notifications.notifications) > 1  && ($host.widgetSize==\"medium\" || $host.widgetSize==\"large\")}",
            "verticalContentAlignment": "Center",
            "minHeight": "70px",
            "spacing": "Small",
            "horizontalAlignment": "Left",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "verticalContentAlignment": "Top",
                            "minHeight": "0px",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "spacing": "None",
                            "minHeight": "0px",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "{{TIME(${string(notifications.notifications[1].timestamp)})}}",
                                    "size": "small",
                                    "weight": "Lighter",
                                    "isSubtle": true,
                                    "spacing": "Large",
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationdismisslight, $root.notifications.notificationdismissdark)}",
                                    "spacing": "None",
                                    "width": "16px"
                                }
                            ],
                            "selectAction": {
                                "type": "Action.Execute",
                                "tooltip": "${notifications.clearnotificationtext}",
                                "verb": "clearNotification",
                                "data": "${notifications.notifications[1].id}"
                            }
                        },
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None"
                        }
                    ],
                    "spacing": "None",
                    "bleed": true,
                    "minHeight": "0px"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "None",
                    "minHeight": "40px",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None",
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": "32px",
                            "minHeight": "0px",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[1].appIcon != \"\"}",
                                    "url": "${notifications.notifications[1].appIcon}",
                                    "size": "Small",
                                    "spacing": "None"
                                },
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[1].appIcon == \"\"}",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationiconplaceholderlight, $root.notifications.notificationiconplaceholderdark)}",
                                    "size": "Small",
                                    "spacing": "None"
                                }
                            ],
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "Small",
                            "verticalContentAlignment": "Top",
                            "horizontalAlignment": "Left",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "weight": "Bolder",
                                    "text": "${notifications.notifications[1].line1}",
                                    "maxLines": 1,
                                    "spacing": "None",
                                    "wrap": false
                                },
                                {
                                    "type": "TextBlock",
                                    "spacing": "None",
                                    "text": "${notifications.notifications[1].line2}",
                                    "maxLines": 1,
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "8px"
                        }
                    ]
                }
            ],
            "backgroundImage": {
                "url": "${if($host.hostTheme == \"light\", $root.notifications.notificationbackgroundlight, if($host.hostTheme == \"dark\", $root.notifications.notificationbackgrounddark, \"\"))}"
            },
            "selectAction": {
                "type": "Action.Execute",
                "verb": "openNotification",
                "data": "${notifications.notifications[1].id}"
            }
        },
        {
            "type": "Container",
            "$when": "${count(notifications.notifications) > 2 && $host.widgetSize==\"large\"}",
            "verticalContentAlignment": "Center",
            "minHeight": "70px",
            "spacing": "Small",
            "horizontalAlignment": "Left",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "verticalContentAlignment": "Top",
                            "minHeight": "0px",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "spacing": "None",
                            "minHeight": "0px",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "{{TIME(${string(notifications.notifications[2].timestamp)})}}",
                                    "size": "small",
                                    "weight": "Lighter",
                                    "isSubtle": true,
                                    "spacing": "Large",
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationdismisslight, $root.notifications.notificationdismissdark)}",
                                    "spacing": "None",
                                    "width": "16px"
                                }
                            ],
                            "selectAction": {
                                "type": "Action.Execute",
                                "tooltip": "${notifications.clearnotificationtext}",
                                "verb": "clearNotification",
                                "data": "${notifications.notifications[2].id}"
                            }
                        },
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None"
                        }
                    ],
                    "spacing": "None",
                    "bleed": true,
                    "minHeight": "0px"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "None",
                    "minHeight": "40px",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None",
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": "32px",
                            "minHeight": "0px",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[2].appIcon != \"\"}",
                                    "url": "${notifications.notifications[2].appIcon}",
                                    "size": "Small",
                                    "spacing": "None"
                                },
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[2].appIcon == \"\"}",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationiconplaceholderlight, $root.notifications.notificationiconplaceholderdark)}",
                                    "size": "Small",
                                    "spacing": "None"
                                }
                            ],
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "Small",
                            "verticalContentAlignment": "Top",
                            "horizontalAlignment": "Left",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "weight": "Bolder",
                                    "text": "${notifications.notifications[2].line1}",
                                    "maxLines": 1,
                                    "spacing": "None",
                                    "wrap": false
                                },
                                {
                                    "type": "TextBlock",
                                    "spacing": "None",
                                    "text": "${notifications.notifications[2].line2}",
                                    "maxLines": 1,
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "8px"
                        }
                    ]
                }
            ],
            "backgroundImage": {
                "url": "${if($host.hostTheme == \"light\", $root.notifications.notificationbackgroundlight, if($host.hostTheme == \"dark\", $root.notifications.notificationbackgrounddark, \"\"))}"
            },
            "selectAction": {
                "type": "Action.Execute",
                "verb": "openNotification",
                "data": "${notifications.notifications[2].id}"
            }
        },
        {
            "type": "Container",
            "$when": "${count(notifications.notifications) > 3 && $host.widgetSize==\"large\"}",
            "verticalContentAlignment": "Center",
            "minHeight": "70px",
            "spacing": "Small",
            "horizontalAlignment": "Left",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "verticalContentAlignment": "Top",
                            "minHeight": "0px",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "spacing": "None",
                            "minHeight": "0px",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "{{TIME(${string(notifications.notifications[3].timestamp)})}}",
                                    "size": "small",
                                    "weight": "Lighter",
                                    "isSubtle": true,
                                    "spacing": "Large",
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "verticalContentAlignment": "Top",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationdismisslight, $root.notifications.notificationdismissdark)}",
                                    "spacing": "None",
                                    "width": "16px"
                                }
                            ],
                            "selectAction": {
                                "type": "Action.Execute",
                                "tooltip": "${notifications.clearnotificationtext}",
                                "verb": "clearNotification",
                                "data": "${notifications.notifications[3].id}"
                            }
                        },
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None"
                        }
                    ],
                    "spacing": "None",
                    "bleed": true,
                    "minHeight": "0px"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "None",
                    "minHeight": "40px",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "8px",
                            "spacing": "None",
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": "32px",
                            "minHeight": "0px",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[3].appIcon != \"\"}",
                                    "url": "${notifications.notifications[3].appIcon}",
                                    "size": "Small",
                                    "spacing": "None"
                                },
                                {
                                    "type": "Image",
                                    "$when": "${notifications.notifications[3].appIcon == \"\"}",
                                    "url": "${if($host.hostTheme == \"light\" || $host.hostTheme == \"highcontrastlight\", $root.notifications.notificationiconplaceholderlight, $root.notifications.notificationiconplaceholderdark)}",
                                    "size": "Small",
                                    "spacing": "None"
                                }
                            ],
                            "spacing": "None"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "spacing": "Small",
                            "verticalContentAlignment": "Top",
                            "horizontalAlignment": "Left",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "weight": "Bolder",
                                    "text": "${notifications.notifications[3].line1}",
                                    "maxLines": 1,
                                    "spacing": "None",
                                    "wrap": false
                                },
                                {
                                    "type": "TextBlock",
                                    "spacing": "None",
                                    "text": "${notifications.notifications[3].line2}",
                                    "maxLines": 1,
                                    "wrap": false
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "8px"
                        }
                    ]
                }
            ],
            "backgroundImage": {
                "url": "${if($host.hostTheme == \"light\", $root.notifications.notificationbackgroundlight, if($host.hostTheme == \"dark\", $root.notifications.notificationbackgrounddark, \"\"))}"
            },
            "selectAction": {
                "type": "Action.Execute",
                "verb": "openNotification",
                "data": "${notifications.notifications[3].id}"
            }
        }
    ],
    "backgroundImage": {
        "url": "${if($host.hostTheme == \"light\", $root.shell.backgroundlight, if($host.hostTheme == \"dark\", $root.shell.backgrounddark, \"\"))}"
    }
}
