{
  "namespace": "dev_console",

  "keyboard_button_content@common_buttons.button_content_panel": {
    "controls": [
      {
        "keyboard_image@chat.keyboard_image": {
        }
      }
    ]
  },

  "keyboard_button@common_buttons.light_content_button": {
    "$pressed_button_name": "keyboard_button",
    "$button_content": "dev_console.keyboard_button_content",
    "size": [ 20, 20 ]
  },

  "button_content@common_buttons.button_content_panel": {
    "controls": [
      {
        "image@$button_content_image_control": {
        }
      }
    ]
  },

  "up_arrow": {
    "type": "image",
    "texture": "textures/ui/up_arrow",
    "size": [ 12, 12 ]
  },

  "down_arrow": {
    "type": "image",
    "texture": "textures/ui/down_arrow",
    "size": [ 12, 12 ]
  },

  "send_button@common_buttons.light_content_button": {
    "$pressed_button_name": "button.send",
    "$button_content": "dev_console.button_content",
    "$button_content_image_control": "chat.send_image",
    "size": [ 44, 27 ]
  },

  "sent_message_up_button@common_buttons.light_content_button": {
    "$pressed_button_name": "button.chat_previous_message",
    "$button_content": "dev_console.button_content",
    "$button_content_image_control": "dev_console.up_arrow",
    "size": [ 30, 27 ],
    "bindings": [
      {
        "binding_name": "(not #keyboard_helper_visible)",
        "binding_name_override": "#visible"
      }
    ]
  },

  "sent_message_down_button@common_buttons.light_content_button": {
    "$pressed_button_name": "button.chat_next_message",
    "$button_content": "dev_console.button_content",
    "$button_content_image_control": "dev_console.down_arrow",
    "size": [ 30, 27 ],
    "bindings": [
      {
        "binding_name": "(not #keyboard_helper_visible)",
        "binding_name_override": "#visible"
      }
    ]
  },

  "chat_stack_panel": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", 27 ],
    "controls": [
      {
        "text_box@chat.text_edit_box": {
        }
      },
      {
        "send_button@dev_console.send_button": {
        }
      },
      {
        "sent_message_up_button@dev_console.sent_message_up_button": {
        }
      },
      {
        "sent_message_down_button@dev_console.sent_message_down_button": {
        }
      }
    ]
  },

  "main_stack_panel": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100% - 4px", "100%" ],
    "controls": [
      {
        "messages_scrolling_panel@chat.messages_scrolling_panel": {
          "size": [ "100%-2px", "100%-29px" ]
        }
      },
      {
        "chat_stack_panel@dev_console.chat_stack_panel": {
        }
      }
    ]
  },

  "main_with_intellisense": {
    "type": "panel",
    "controls": [
      {
        "main_stack@dev_console.main_stack_panel": {}
      },
      {
        "commands_panel@chat.commands_panel": {
          "size": [ "100%", "100%-29px" ],
          "offset": [ 0, -29 ],
          "layer": 11
        }
      }
    ]
  },

  "clipboard_icon": {
    "layer": 1,
    "type": "image",
    "texture": "textures/ui/copy",
    "size": [ 13, 14 ]
  },

  "clipboard_button_content": {
    "type": "panel",
    "size": [ "100% - 2px", "100% - 2px" ],
    "controls": [
      {
        "stack_panel": {
          "type": "stack_panel",
          "orientation": "horizontal",
          "controls": [
            {
              "icon_panel": {
                "type": "panel",
                "size": [ "100%c", "100%" ],
                "controls": [
                  { "icon@dev_console.clipboard_icon": {} }
                ]
              }
            },
            {
              "offset": {
                "type": "panel",
                "size": [ 4, "100%" ]
              }
            },
            {
              "label_panel": {
                "type": "panel",
                "size": [ "100%c", "100%" ],
                "controls": [
                  {
                    "label": {
                      "type": "label",
                      "text": "contentlog.history.copyToClipboard",
                      "color": "$text_color"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "copy_button@common_buttons.light_content_button": {
    "size": [ "50% - 1px", 30 ],
    "$pressed_button_name": "button.copy_to_clipboard",
    "$button_content": "dev_console.clipboard_button_content"
  },

  "clear_icon": {
    "layer": 1,
    "type": "image",
    "texture": "textures/ui/crossout",
    "size": [ 10, 10 ]
  },

  "clear_button_content": {
    "type": "panel",
    "size": [ "100% - 2px", "100% - 2px" ],
    "controls": [
      {
        "stack_panel": {
          "type": "stack_panel",
          "orientation": "horizontal",
          "controls": [
            {
              "icon_panel": {
                "type": "panel",
                "size": [ "100%c", "100%" ],
                "controls": [
                  { "icon@dev_console.clear_icon": {} }
                ]
              }
            },
            {
              "offset": {
                "type": "panel",
                "size": [ 4, "100%" ]
              }
            },
            {
              "label_panel": {
                "type": "panel",
                "size": [ "100%c", "100%" ],
                "controls": [
                  {
                    "label": {
                      "type": "label",
                      "text": "contentlog.history.clear",
                      "color": "$text_color"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "clear_button@common_buttons.light_content_button": {
    "size": [ "50% - 1px", 30 ],
    "$pressed_button_name": "button.clear_dev_console",
    "$button_content": "dev_console.clear_button_content"
  },

  "button_bar": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "controls": [
      { "copy_button@dev_console.copy_button": {} },
      { "clear_button@dev_console.clear_button": {} }
    ]
  },

  "dev_console_dialog_panel": {
    "type": "panel",
    "$dialog_control|default": "common_dialogs.main_panel_no_buttons",
    "variables": [
      {
        "requires": "$supports_clipboard_set",
        "$dialog_control": "common_dialogs.main_panel_one_button"
      }
    ],
    "controls": [
      {
        "dev_console_dialog@$dialog_control": {
          "$child_control": "dev_console.main_with_intellisense",
          "$button_panel": "dev_console.button_bar",
          "$text_name": "chat.title",
          "size": [ "100%", "75%" ],
          "anchor_from": "top_middle",
          "anchor_to": "top_middle"
        }
      }
    ]
  },

  "dev_console_screen@common.base_screen": {
    "$screen_content": "dev_console.dev_console_dialog_panel",
    "force_render_below": true,
    "button_mappings": [
      {
        "from_button_id": "button.menu_exit",
        "to_button_id": "button.chat_menu_cancel",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.chat_menu_cancel",
        "mapping_type": "global"
      }
    ]
  }
}