{
  "namespace": "common_tabs",

  "empty_tab_content": {
    "type": "panel",
    "size": [ 0, 0 ]
  },

  "tab_image": {
    "type": "image",
    "texture": "$tab_texture"
  },

  "tab_panel": {
    "type": "panel",
    "$tab_content|default": "common_tabs.empty_tab_content",
    "$tab_image|default": "common_tabs.tab_image",

    "controls": [
      {
        "tab_image@$tab_image": {
          "size": [ "100%", "100%" ], // We need to explicitly set the size here.
          "layer": 2
        }
      },
      {
        "tab_content_sizer": {
          "type": "panel",
          "$tab_content_size|default": [ "100% - 4px", "100% - 4px" ],
          "size": "$tab_content_size",
          "controls": [
            {
              "tab_content@$tab_content": {
                "layer": 3
              }
            }
          ]
        }
      }
    ]
  },

  "base_tab": {
    "type": "panel",
    "$unchecked_text_color": "$tab_unchecked_text_color",
    "$unchecked_hover_text_color": "$tab_unchecked_hover_text_color",
    "$unchecked_locked_text_color": "$tab_unchecked_locked_text_color",
    "$unchecked_locked_hover_text_color": "$tab_unchecked_locked_hover_text_color",
    "$checked_text_color": "$tab_checked_text_color",
    "$checked_hover_text_color": "$tab_checked_hover_text_color",
    "$checked_locked_text_color": "$tab_checked_locked_text_color",
    "$checked_locked_hover_text_color": "$tab_checked_locked_hover_text_color",

    "$unchecked_secondary_text_color": "$tab_secondary_unchecked_text_color",
    "$unchecked_hover_secondary_text_color": "$tab_secondary_unchecked_hover_text_color",
    "$unchecked_locked_secondary_text_color": "$tab_secondary_unchecked_locked_text_color",
    "$unchecked_locked_hover_secondary_text_color": "$tab_secondary_unchecked_locked_hover_text_color",
    "$checked_secondary_text_color": "$tab_secondary_checked_text_color",
    "$checked_hover_secondary_text_color": "$tab_secondary_checked_hover_text_color",
    "$checked_locked_secondary_text_color": "$tab_secondary_checked_locked_text_color",
    "$checked_locked_hover_secondary_text_color": "$tab_secondary_checked_locked_hover_text_color",

    "$unchecked_glyph_color": "$tab_unchecked_glyph_color",
    "$unchecked_hover_glyph_color": "$tab_unchecked_hover_glyph_color",
    "$unchecked_locked_glyph_color": "$tab_unchecked_locked_glyph_color",
    "$unchecked_locked_hover_glyph_color": "$tab_unchecked_locked_hover_glyph_color",
    "$checked_glyph_color": "$tab_checked_glyph_color",
    "$checked_hover_glyph_color": "$tab_checked_hover_glyph_color",
    "$checked_locked_glyph_color": "$tab_checked_locked_glyph_color",
    "$checked_locked_hover_glyph_color": "$tab_checked_locked_hover_glyph_color",

    "$tab_view_binding_name|default": "tab",
    "$tab_panel|default": "common_tabs.tab_panel",
    "$is_checked_state|default": false,

    "controls": [
      {
        "$tab_view_binding_name@common.toggle": {
          "$toggle_tts_name": "accessibility.tab.tts.title",
          "$toggle_tts_enabled_binding_type": "global",

          "controls": [
            {
              "unchecked@$tab_panel": {
                "$text_color": "$unchecked_text_color",
                "$secondary_text_color": "$unchecked_secondary_text_color",
                "$glyph_color": "$unchecked_glyph_color",
                "$tab_texture": "$unchecked_default_image",
                "$tab_state": "unchecked",
                "layer": 1
              }
            },
            {
              "unchecked_hover@$tab_panel": {
                "$text_color": "$unchecked_hover_text_color",
                "$secondary_text_color": "$unchecked_hover_secondary_text_color",
                "$glyph_color": "$unchecked_hover_glyph_color",
                "$tab_texture": "$unchecked_hover_image",
                "$tab_state": "unchecked_hover",
                "layer": 1
              }
            },
            {
              "unchecked_locked@$tab_panel": {
                "$text_color": "$unchecked_locked_text_color",
                "$secondary_text_color": "$unchecked_locked_secondary_text_color",
                "$glyph_color": "$unchecked_locked_glyph_color",
                "$tab_texture": "$unchecked_locked_image",
                "$tab_state": "unchecked_locked",
                "layer": 1
              }
            },
            {
              "unchecked_locked_hover@$tab_panel": {
                "$text_color": "$unchecked_locked_hover_text_color",
                "$secondary_text_color": "$unchecked_locked_hover_secondary_text_color",
                "$glyph_color": "$unchecked_locked_hover_glyph_color",
                "$tab_texture": "$unchecked_locked_hover_image",
                "$tab_state": "unchecked_locked_hover",
                "layer": 1
              }
            },
            {
              "checked@$tab_panel": {
                "$text_color": "$checked_text_color",
                "$secondary_text_color": "$checked_secondary_text_color",
                "$glyph_color": "$checked_glyph_color",
                "$tab_texture": "$checked_default_image",
                "$tab_state": "checked",
                "$is_checked_state": true,
                "layer": 2
              }
            },
            {
              "checked_hover@$tab_panel": {
                "$text_color": "$checked_hover_text_color",
                "$secondary_text_color": "$checked_hover_secondary_text_color",
                "$glyph_color": "$checked_hover_glyph_color",
                "$tab_texture": "$checked_hover_image",
                "$tab_state": "checked_hover",
                "$is_checked_state": true,
                "layer": 2
              }
            },
            {
              "checked_locked@$tab_panel": {
                "$text_color": "$checked_locked_text_color",
                "$secondary_text_color": "$checked_locked_secondary_text_color",
                "$glyph_color": "$checked_locked_glyph_color",
                "$tab_texture": "$checked_locked_image",
                "$tab_state": "checked_locked",
                "$is_checked_state": true,
                "layer": 2
              }
            },
            {
              "checked_locked_hover@$tab_panel": {
                "$text_color": "$checked_locked_hover_text_color",
                "$secondary_text_color": "$checked_locked_hover_secondary_text_color",
                "$glyph_color": "$checked_locked_hover_glyph_color",
                "$tab_texture": "$checked_locked_hover_image",
                "$tab_state": "checked_locked_hover",
                "$is_checked_state": true,
                "layer": 2
              }
            }
          ]
        }
      }
    ]
  },

  "tab_top@common_tabs.base_tab": {
    "$is_left_most_tab|default": false,
    "$is_right_most_tab|default": false,

    "variables": [
      {
        "requires": "($is_left_most_tab and not $is_right_most_tab)",
        "$unchecked_default_image": "textures/ui/TabTopBackLeftMost",
        "$unchecked_hover_image": "textures/ui/TabTopBackLeftMost",
        "$unchecked_locked_image": "textures/ui/TabTopBackLeftMost",
        "$unchecked_locked_hover_image": "textures/ui/TabTopBackLeftMost",

        "$checked_default_image": "textures/ui/TabTopFrontLeftMost",
        "$checked_hover_image": "textures/ui/TabTopFrontLeftMost",
        "$checked_locked_image": "textures/ui/TabTopFrontLeftMost",
        "$checked_locked_hover_image": "textures/ui/TabTopFrontLeftMost"
      },
      {
        "requires": "($is_right_most_tab and not $is_left_most_tab)",
        "$unchecked_default_image": "textures/ui/TabTopBackRightMost",
        "$unchecked_hover_image": "textures/ui/TabTopBackRightMost",
        "$unchecked_locked_image": "textures/ui/TabTopBackRightMost",
        "$unchecked_locked_hover_image": "textures/ui/TabTopBackRightMost",

        "$checked_default_image": "textures/ui/TabTopFrontRightMost",
        "$checked_hover_image": "textures/ui/TabTopFrontRightMost",
        "$checked_locked_image": "textures/ui/TabTopFrontRightMost",
        "$checked_locked_hover_image": "textures/ui/TabTopFrontRightMost"
      }
    ],

    "$unchecked_default_image": "textures/ui/TabTopBack",
    "$unchecked_hover_image": "textures/ui/TabTopBack",
    "$unchecked_locked_image": "textures/ui/TabTopBack",
    "$unchecked_locked_hover_image": "textures/ui/TabTopBack",

    "$checked_default_image|default": "textures/ui/TabTopFront",
    "$checked_hover_image|default": "textures/ui/TabTopFront",
    "$checked_locked_image|default": "textures/ui/TabTopFront",
    "$checked_locked_hover_image|default": "textures/ui/TabTopFront"
  },

  "tab_left@common_tabs.base_tab": {
    "$is_bottom_most_tab|default": false,
    "$is_top_most_tab|default": false,

    "variables": [
      {
        "requires": "($is_bottom_most_tab and not $is_top_most_tab)",
        "$unchecked_default_image": "textures/ui/TabLeftBackBottomMost",
        "$unchecked_hover_image": "textures/ui/TabLeftBackBottomMost",
        "$unchecked_locked_image": "textures/ui/TabLeftBackBottomMost",
        "$unchecked_locked_hover_image": "textures/ui/TabLeftBackBottomMost",

        "$checked_default_image": "textures/ui/TabLeftFrontBottomMost",
        "$checked_hover_image": "textures/ui/TabLeftFrontBottomMost",
        "$checked_locked_image": "textures/ui/TabLeftFrontBottomMost",
        "$checked_locked_hover_image": "textures/ui/TabLeftFrontBottomMost"
      },
      {
        "requires": "($is_top_most_tab and not $is_bottom_most_tab)",
        "$unchecked_default_image": "textures/ui/TabLeftBackTopMost",
        "$unchecked_hover_image": "textures/ui/TabLeftBackTopMost",
        "$unchecked_locked_image": "textures/ui/TabLeftBackTopMost",
        "$unchecked_locked_hover_image": "textures/ui/TabLeftBackTopMost",

        "$checked_default_image": "textures/ui/TabLeftFrontTopMost",
        "$checked_hover_image": "textures/ui/TabLeftFrontTopMost",
        "$checked_locked_image": "textures/ui/TabLeftFrontTopMost",
        "$checked_locked_hover_image": "textures/ui/TabLeftFrontTopMost"
      }
    ],


    "$unchecked_default_image": "textures/ui/TabLeftBack",
    "$unchecked_hover_image": "textures/ui/TabLeftBack",
    "$unchecked_locked_image": "textures/ui/TabLeftBack",
    "$unchecked_locked_hover_image": "textures/ui/TabLeftBack",

    "$checked_default_image|default": "textures/ui/TabLeftFront",
    "$checked_hover_image|default": "textures/ui/TabLeftFront",
    "$checked_locked_image|default": "textures/ui/TabLeftFront",
    "$checked_locked_hover_image|default": "textures/ui/TabLeftFront"
  },

  "tab_right@common_tabs.base_tab": {
    "$is_bottom_most_tab|default": false,
    "$is_top_most_tab|default": false,

    "variables": [
      {
        "requires": "($is_bottom_most_tab and not $is_top_most_tab)",
        "$unchecked_default_image": "textures/ui/TabRightBackBottomMost",
        "$unchecked_hover_image": "textures/ui/TabRightBackBottomMost",
        "$unchecked_locked_image": "textures/ui/TabRightBackBottomMost",
        "$unchecked_locked_hover_image": "textures/ui/TabRightBackBottomMost",

        "$checked_default_image": "textures/ui/TabRightFrontBottomMost",
        "$checked_hover_image": "textures/ui/TabRightFrontBottomMost",
        "$checked_locked_image": "textures/ui/TabRightFrontBottomMost",
        "$checked_locked_hover_image": "textures/ui/TabRightFrontBottomMost"
      },
      {
        "requires": "($is_top_most_tab and not $is_bottom_most_tab)",
        "$unchecked_default_image": "textures/ui/TabRightBackTopMost",
        "$unchecked_hover_image": "textures/ui/TabRightBackTopMost",
        "$unchecked_locked_image": "textures/ui/TabRightBackTopMost",
        "$unchecked_locked_hover_image": "textures/ui/TabRightBackTopMost",

        "$checked_default_image": "textures/ui/TabRightFrontTopMost",
        "$checked_hover_image": "textures/ui/TabRightFrontTopMost",
        "$checked_locked_image": "textures/ui/TabRightFrontTopMost",
        "$checked_locked_hover_image": "textures/ui/TabRightFrontTopMost"
      }
    ],

    "$unchecked_default_image": "textures/ui/TabRightBack",
    "$unchecked_hover_image": "textures/ui/TabRightBack",
    "$unchecked_locked_image": "textures/ui/TabRightBack",
    "$unchecked_locked_hover_image": "textures/ui/TabRightBack",

    "$checked_default_image|default": "textures/ui/TabRightFront",
    "$checked_hover_image|default": "textures/ui/TabRightFront",
    "$checked_locked_image|default": "textures/ui/TabRightFront",
    "$checked_locked_hover_image|default": "textures/ui/TabRightFront"
  },

  //---------------------------------------------------------------------------
  // Pocket Tabs
  //---------------------------------------------------------------------------

  "pocket_tab_left@common_tabs.tab_left": {
    "size": [ "100%", 33 ],
    "$toggle_focus_enabled": false,
    "$toggle_name": "left_navigation_tab"
  },

  "pocket_tab_right@common_tabs.tab_right": {
    "size": [ "100%", 33 ],
    "$toggle_focus_enabled": false,
    "$toggle_name": "right_navigation_tab"
  },

  "pocket_tab_close_button": {
    "type": "image",
    "size": [ "100%", 33 ],
    "texture": "textures/ui/TabRightBackTopMost",

    "controls": [
      {
        "close_button@common.light_close_button": {
          "anchor_from": "center",
          "anchor_to": "center",
          "offset": [ 0, 0 ]
        }
      }
    ]
  },

  "pocket_tab_help_button": {
    "type": "image",
    "size": [ "100%", 33 ],
    "texture": "textures/ui/TabRightBackTopMost",

    "controls": [
      {
        "help_button@common.help_button": {
          "anchor_from": "center",
          "anchor_to": "center",
          "offset": [ 0, 0 ]
        }
      }
    ]
  },

  "pocket_tab_close_and_help_button": {
    "type": "image",
    "size": [ "100%", 51 ],
    "texture": "textures/ui/TabRightBackTopMost",

    "controls": [
      {
        "close_button@common.light_close_button": {
          "anchor_from": "top_middle",
          "anchor_to": "top_middle",
          "offset": [ 0, 6 ]
        }
      },
      {
        "help_button@common.help_button": {
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "offset": [ 0, -8 ]
        }
      }
    ]
  },

  "tab_close_and_help_button": {
    "type": "image",
    "size": [ "100%", "100%c + 7px" ],
    "texture": "textures/ui/TabRightBackTopMost",

    "controls": [
      {
        "close_button@common.light_close_button": {
          "anchor_from": "top_middle",
          "anchor_to": "top_middle",
          "offset": [ 0, 4 ]
        }
      },
      {
        "help_button@common.help_button": {
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "offset": [ 0, -6 ],
          "visible": "(not $education_edition_china)"
        }
      }
    ]
  }
}