{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "schemaVersion",
    "metadata",
    "appearance",
    "layout",
    "workspace"
  ],
  "properties": {
    "format": {
      "const": "preylab.app-preferences"
    },
    "schemaVersion": {
      "const": 1
    },
    "metadata": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "notes"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 80
        },
        "notes": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "appearance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "chemMap",
        "chemOpacity"
      ],
      "properties": {
        "chemMap": {
          "type": "boolean"
        },
        "chemOpacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "perceptionLayout": {
          "type": "string",
          "enum": ["balanced", "overview", "classic", "compact", "monochrome"],
          "description": "Optional for compatibility with older preferences. Balanced Orbit, Grouped Radar, Classic Orbit, or Compact Orbit."
        }
      }
    },
    "layout": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "music",
        "topBars"
      ],
      "properties": {
        "music": {
          "type": "boolean"
        },
        "topBars": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "music",
            "nutrients",
            "info",
            "map",
            "tools",
            "app"
          ],
          "properties": {
            "music": {
              "type": "boolean"
            },
            "nutrients": {
              "type": "boolean"
            },
            "info": {
              "type": "boolean"
            },
            "map": {
              "type": "boolean"
            },
            "tools": {
              "type": "boolean"
            },
            "app": {
              "type": "boolean"
            }
          }
        }
      }
    },
    "workspace": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "racks"
      ],
      "properties": {
        "racks": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 80
              }
            }
          }
        }
      }
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PreyLab app preferences v1"
}
