{
  "version": 13,
  "name": "Is it just me?",
  "source": "endpoint",
  "tile": {
    "id": "A1324734-E1EF-47FB-8FCE-66BE58420D40",
    "kind": "status",
    "label": "GitHub",
    "value": {
      "kind": "data",
      "value": "/summary"
    },
    "maximum": {
      "kind": "literal",
      "value": "100"
    },
    "itemTitle": "/title",
    "itemSubtitle": "/subtitle",
    "icon": {
      "kind": "data",
      "value": "/icon"
    },
    "iconFilled": true,
    "iconPointSize": 16,
    "textSize": "small",
    "wrapText": true,
    "iconColorField": "/iconColor"
  },
  "popout": [
    {
      "id": "EF75E310-8339-4A5A-85A9-67FB5B38241E",
      "kind": "status",
      "label": "",
      "value": {
        "kind": "data",
        "value": "/summary"
      },
      "maximum": {
        "kind": "literal",
        "value": "100"
      },
      "itemTitle": "/title",
      "itemSubtitle": "/subtitle",
      "textSize": "medium",
      "wrapText": true
    },
    {
      "id": "45515851-1F04-4939-91C2-8107A80BC955",
      "kind": "list",
      "label": "",
      "value": {
        "kind": "data",
        "value": "/services"
      },
      "maximum": {
        "kind": "literal",
        "value": "100"
      },
      "itemTitle": "/title",
      "itemSubtitle": "/subtitle",
      "itemIcon": "/icon",
      "iconFilled": true,
      "iconPointSize": 13,
      "iconColorField": "/iconColor",
      "layout": "horizontal",
      "textSize": "small"
    },
    {
      "id": "258018BD-44F1-4720-A8C9-CDCA2BAED37A",
      "kind": "list",
      "label": "",
      "value": {
        "kind": "data",
        "value": "/incidents"
      },
      "maximum": {
        "kind": "literal",
        "value": "100"
      },
      "itemTitle": "/title",
      "itemSubtitle": "/subtitle",
      "itemIcon": "/icon",
      "iconPointSize": 13,
      "wrapText": false,
      "iconColorField": "/iconColor",
      "textSize": "small"
    }
  ],
  "inputs": [],
  "transform": "function transform(response) {\n  if (!response || typeof response.status?.description !== \"string\" || !response.status.description.trim()\n      || !Array.isArray(response.components) || !Array.isArray(response.incidents)) {\n    throw new Error(\"GitHub returned an incomplete status report.\");\n  }\n  const labels = {\n    operational: \"Operational\", degraded_performance: \"Degraded performance\",\n    partial_outage: \"Partial outage\", major_outage: \"Major outage\",\n    under_maintenance: \"Under maintenance\"\n  };\n  const color = status => status === \"operational\" ? \"green\" : [\"partial_outage\", \"major_outage\"].includes(status) ? \"red\" : \"orange\";\n  const icon = status => [\"partial_outage\", \"major_outage\"].includes(status) ? \"xmark.circle\" : status === \"operational\" ? \"checkmark.circle\" : status === \"under_maintenance\" ? \"wrench.and.screwdriver\" : \"exclamationmark.triangle\";\n  const services = [\n    [\"Actions\", \"Actions\"], [\"API Requests\", \"API\"],\n    [\"Git Operations\", \"Git operations\"], [\"Copilot\", \"Copilot\"]\n  ].map(([name, title]) => {\n    const status = response.components.find(component => component.name === name)?.status;\n    return { title, subtitle: labels[status] || \"Unknown\", icon: icon(status), iconColor: color(status) };\n  });\n  const incidents = response.incidents.filter(item => item.status !== \"resolved\" && item.status !== \"postmortem\").map(item => {\n    const updates = [...(item.incident_updates || [])].sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));\n    const latest = updates[0];\n    return {\n      title: item.name || \"Active incident\",\n      subtitle: [item.status?.replace(/_/g, \" \"), latest?.body].filter(Boolean).join(\" \u00b7 \"),\n      icon: \"exclamationmark.triangle\", iconColor: \"orange\"\n    };\n  });\n  const healthy = response.status.indicator === \"none\" && !incidents.length && services.every(row => row.subtitle === \"Operational\");\n  const down = [\"major\", \"critical\"].includes(response.status.indicator) || services.some(row => row.iconColor === \"red\");\n  return {\n    summary: response.status.description,\n    icon: healthy ? \"checkmark.circle\" : down ? \"xmark.circle\" : \"exclamationmark.triangle\",\n    iconColor: healthy ? \"green\" : down ? \"red\" : \"orange\",\n    services,\n    incidents: incidents.length ? incidents : [{ title: \"No active incidents\", subtitle: \"\", icon: \"checkmark.circle\", iconColor: \"green\" }]\n  };\n}\n"
}
