{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "9in theme manifest",
  "description": "manifest.json of a custom theme: options shown in the console and security settings.",
  "type": "object",
  "properties": {
    "version": {
      "type": "number",
      "const": 1
    },
    "name": {
      "type": "string",
      "maxLength": 100
    },
    "options": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "maxLength": 100
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "enum",
                    "color",
                    "boolean",
                    "string",
                    "number",
                    "image"
                  ]
                },
                "enum": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "default": {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                },
                "overrides": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                },
                "when": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}(=[^=]{0,100})?$"
                },
                "target": {
                  "type": "string",
                  "maxLength": 300,
                  "pattern": "^[^{}<>;@\\\\]+$"
                },
                "css_var": {
                  "type": "string",
                  "pattern": "^--[a-z0-9][a-z0-9-]{0,40}$"
                },
                "unit": {
                  "type": "string",
                  "pattern": "^(px|rem|em|%|ms|s)$"
                },
                "preview": {
                  "type": "object",
                  "properties": {
                    "page": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,39}$"
                    },
                    "device": {
                      "type": "string",
                      "enum": [
                        "desktop",
                        "tablet",
                        "mobile"
                      ]
                    }
                  }
                }
              },
              "required": [
                "title",
                "type",
                "default"
              ]
            }
          },
          "collapsed": {
            "type": "boolean"
          }
        },
        "required": [
          "properties"
        ]
      }
    },
    "security": {
      "default": {},
      "type": "object",
      "properties": {
        "scriptSrc": {
          "default": [],
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "styleSrc": {
          "default": [],
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "imgSrc": {
          "default": [],
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fontSrc": {
          "default": [],
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "connectSrc": {
          "default": [],
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "frameSrc": {
          "default": [],
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "allowInlineScripts": {
          "default": false,
          "type": "boolean"
        }
      }
    }
  },
  "required": [
    "version"
  ]
}
