{
  "namespace": "csb",

  "csb_pdp_screen@common.base_screen": {
    "$ignore_inventory_button": "$is_sidebar_navigation_enabled",
    "$screen_content": "csb.csb_main_panel",
    "$header_safezone_control": "common_store.store_top_bar_filler",
    "$header_bar_control": "common_store.store_top_bar",
    "$screen_background_control": "csb.csb_background",
    "variables": [
      {
        "requires": "(not $use_animation)",
        "$screen_animations": [
          "@common.screen_exit_animation_no_offset"
        ],
        "$background_animations": []
      },
      {
        "requires": "($use_animation or (not $is_sidebar_navigation_enabled))",
        "$screen_animations": [
          "@common.screen_exit_animation_pop_offset",
          "@common.screen_exit_animation_pop_fade"
        ],
        "$background_animations": []
      }
    ],
    "$is_full_screen_layout": true,
    "$fill_alpha": 1,

    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "to_button_id": "button.search",
        "mapping_type": "global",
        "ignored": "$is_on_3p_server"
      },
      {
        "from_button_id": "button.controller_select",
        "to_button_id": "button.coin_wallet",
        "mapping_type": "global"
      }
    ]
  },

  "csb_upgrade_notice_screen@common.base_screen": {
    "$ignore_inventory_button": "$is_sidebar_navigation_enabled",
    "$screen_content": "csb.csb_main_panel",
    "$header_safezone_control": "common_store.store_top_bar_filler",
    "$header_bar_control": "common_store.store_top_bar",
    "$screen_background_control": "csb.csb_background",
    "$is_full_screen_layout": true,
    "$fill_alpha": 1,
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "to_button_id": "button.search",
        "mapping_type": "global",
        "ignored": "$is_on_3p_server"
      },
      {
        "from_button_id": "button.controller_select",
        "to_button_id": "button.coin_wallet",
        "mapping_type": "global"
      }
    ]
  },

  "csb_background": {
    "type": "image",
    "texture": "textures/ui/White",
    "color": "$csb_panel_background"
  },

  "gradient_image_stack": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "gradient": {
          "type": "image",
          "size": [ "fill", "100%" ],
          "tiled": "y",
          "texture": "textures/ui/csbBannerBackground"
        }
      }
    ]
  },

  "gradient_content_panel": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "$gradient_content|default": "common.empty_panel",
    "controls": [
      {
        "gradient@csb.gradient_image_stack": {
          "size": [ "100% + 4px", "100%" ]
        }
      },
      {
        "particles": {
          "layer": 2,
          "type": "image",
          "size": [ "100%y", "100%" ],
          "texture": "textures/ui/csb_particles",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "offset": [ "90%", 0 ]
        }
      },
      {
        "content_panel@$gradient_content": {
          "layer": 3
        }
      }
    ]
  },

  "csb_screen_main_panel@sidebar_navigation.sidebar_view": {
    "$sidebar_main_view_content": "csb.dialog_content"
  },

  "csb_main_panel": {
    "type": "panel",
    "controls": [
      {
        "root_panel": {
          "type": "panel",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "controls": [
            {
              "main_panel@common_store.store_header_with_coins": {
                "$child_control": "csb.csb_screen_main_panel",
                "$back_button_has_title": true,
                "$sidebar_ignore_page_loading": true,
                "$button_text": "store.csb"
              }
            }
          ]
        }
      }
    ]
  },

  "dialog_content": {
    "type": "stack_panel",
    "size": [ "100%", "100%" ],
    "orientation": "horizontal",
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "controls": [
      { "selector_area@csb.selector_area": {} },
      {
        "padding_1": {
          "type": "panel",
          "size": [ "3px", "100%" ]
        }
      },
      {
        "allow_divider_offset_panel": {
          "type": "panel",
          "size": [ "100%c", "100%" ],
          "controls": [
            { "left_right_pane_divider@csb.left_right_pane_divider": {} }
          ]
        }
      },
      {
        "padding_2": {
          "type": "panel",
          "size": [ "2px", "100%" ]
        }
      },
      { "content_area@csb.content_area": {} },
      {
        "padding_3": {
          "type": "panel",
          "size": [ "2px", "100%" ]
        }
      }
    ]
  },

  "selector_area": {
    "type": "panel",
    "size": [ "30% - 3px", "100%" ],
    "min_size": [ "105px", "100%" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "layer": 2,
    "focus_container": true,
    "use_last_focus": true,
    "$focus_navigation_mode_override_down|default": "contained",
    "$focus_navigation_mode_override_up|default": "contained",
    "$focus_navigation_mode_override_left|default": "",
    "$focus_navigation_mode_override_right|default": "",
    "focus_navigation_mode_down": "$focus_navigation_mode_override_down",
    "focus_navigation_mode_up": "$focus_navigation_mode_override_up",
    "focus_navigation_mode_left": "$focus_navigation_mode_override_left",
    "focus_navigation_mode_right": "$focus_navigation_mode_override_right",
    "controls": [
      {
        "scrolling_panel@common.scrolling_panel": {
          "$scrolling_content": "csb.scrollable_selector_area_content",
          "$show_background": false,
          "$scroll_size": [ "5px", "100% - 4px" ],
          "$scroll_bar_left_padding_size": [ 1, 0 ]
        }
      }
    ]
  },

  "scrollable_selector_area_content": {
    "type": "stack_panel",
    "offset": [ 4, 4 ],
    "size": [ "100% - 4px", "100%c" ],
    "controls": [
      {
        //hack for controller input so the buy now button can change which tab is focused without triggering the tab change on focus logic when we switch focus from the content area to the selector area
        "focus_reset_input_panel": {
          "type": "input_panel",
          "focus_enabled": true,
          "size": [ "100%", 4 ]
        }
      },
      { "csb_toggle@csb.csb_toggle": {} },
      { "content_toggle@csb.content_toggle": {} },
      { "faq_toggle@csb.faq_toggle": {} },
      {
        "toggle_section_divider@common.section_divider": {
          "$top_padding_size|default": [ "100%", 0 ],
          "$bottom_padding_size|default": [ "100%", 4 ]
        }
      },
      {
        "buy_now_toggle@csb.buy_now_toggle": {
          "ignored": "$pre_release",
          "$focus_override_down": "FOCUS_OVERRIDE_STOP"
        }
      },
      {
        "xbl_btn_panel": {
          "type": "panel",
          "size": [ "100%", 20 ],
          "controls": [
            {
              "xbl_btn@common_buttons.light_text_button": {
                "$button_text": "xbox.signin",
                "$pressed_button_name": "button.signin",
                "$font_type": "MinecraftTen",
                "$anchor": "top_left",

                "$default_button_texture": "textures/ui/csb_button_borderless_default",
                "$hover_button_texture": "textures/ui/csb_button_borderless_hover",
                "$pressed_button_texture": "textures/ui/csb_button_borderless_hover_pressed",
                "$locked_button_texture": "textures/ui/csb_button_borderless_pressed"
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#sign_in_visible",
              "binding_name_override": "#visible"
            }
          ]
        }
      }
    ]
  },

  "section_toggle_base@common_toggles.light_text_toggle_collection": {
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", 20 ],
    "$button_size_override": [ "100%", "100% + 1px" ],
    "$button_type_panel": "csb.tab_button_text",

    "$radio_toggle_group": true,
    "$toggle_name": "navigation_tab",
    "$toggle_group_default_selected": "$csb_toggle_index",

    "$toggle_tab_focus_binding_type": "global",
    "$toggle_tab_focus_binding_name": "#navigation_tab_focus_precedence",
    "$toggle_on_hover_binding_type": "global",
    "$toggle_on_hover_binding_name": "#toggle_on_hover"
  },

  "tab_button_text@common.minecraftTenLabel": {
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "size": [ "100% - 4px", "default" ],
    "max_size": [ "100% - 4px", "100%" ],
    "text": "$button_text",
    "layer": 3,
    "color": "$text_color",
    "alpha": "$content_alpha",

    "$button_text_binding_type|default": "none",
    "$button_text_grid_collection_name|default": "",
    "$button_text_binding_condition|default": "none",

    "variables": [
      {
        "requires": "(not $is_low_memory_device and not $is_ps4)", // We don't load MinecraftTen in these cases so we need to revert to Mojangles.
        "font_scale_factor": 1.2,
        "offset": [ 0, -4 ] // Because of how the font is rendered it looks like it is offset down from the center of the render area
      }
    ],

    "bindings": [
      {
        "binding_type": "$button_text_binding_type",
        "binding_condition": "$button_text_binding_condition",
        "binding_collection_name": "$button_text_grid_collection_name",
        "binding_name": "$button_text"
      }
    ]
  },

  "toggle_base": {
    "type": "stack_panel",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "toggle@csb.section_toggle_base": {
          "$toggle_view_binding_name|default": "",
          "$toggle_group_forced_index|default": "",
          "$button_text|default": ""
        }
      },
      {
        "padding": {
          "type": "panel",
          "size": [ "100%", 4 ]
        }
      }
    ]
  },

  "csb_toggle@csb.toggle_base": {
    "$toggle_view_binding_name": "csb_toggle",
    "$toggle_group_forced_index": "$csb_toggle_index",
    "$button_text": "store.csb",
    "$focus_override_up": "search_header_text_box"
  },

  "content_toggle@csb.toggle_base": {
    "$toggle_view_binding_name": "content_toggle",
    "$toggle_group_forced_index": "$content_toggle_index",
    "$button_text": "store.csb.content"
  },

  "faq_toggle@csb.toggle_base": {
    "$toggle_view_binding_name": "faq_toggle",
    "$toggle_group_forced_index": "$faq_toggle_index",
    "$button_text": "store.csb.faq",
    "$focus_id": "faq_toggle_focus"
  },

  "buy_now_toggle@csb.toggle_base": {
    "$toggle_view_binding_name": "buy_now_toggle",
    "$toggle_group_forced_index": "$buy_now_toggle_index",
    "$button_text": "store.csb.buyNow",

    "$default_texture": "textures/ui/csb_button_borderless_default",
    "$hover_texture": "textures/ui/csb_button_borderless_hover",
    "$pressed_texture": "textures/ui/csb_button_borderless_hover_pressed",
    "$pressed_no_hover_texture": "textures/ui/csb_button_borderless_pressed",

    "$default_checked_text_color": "$dark_toggle_hover_text_color",

    "bindings": [
      {
        "binding_name": "#buy_now_tab_visible",
        "binding_name_override": "#visible"
      }
    ]
  },

  "left_right_pane_divider": {
    "type": "image",
    "offset": [ 0, -1 ],
    "size": [ "4px", "100% + 2px" ],
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "layer": 3,
    "texture": "textures/ui/Banners"
  },

  // right side
  "content_area": {
    "type": "panel",
    "size": [ "fill", "100%" ],
    "anchor_from": "top_right",
    "anchor_to": "top_right",
    "layer": 1,

    "focus_container": true,
    "use_last_focus": false,
    "$focus_navigation_mode_override_down|default": "contained",
    "$focus_navigation_mode_override_up|default": "contained",
    "$focus_navigation_mode_override_left|default": "",
    "$focus_navigation_mode_override_right|default": "",
    "focus_navigation_mode_down": "$focus_navigation_mode_override_down",
    "focus_navigation_mode_up": "$focus_navigation_mode_override_up",
    "focus_navigation_mode_left": "$focus_navigation_mode_override_left",
    "focus_navigation_mode_right": "$focus_navigation_mode_override_right",

    "controls": [
      {
        "control": {
          "type": "stack_panel",
          "size": [ "100%", "100%" ],
          "anchor_from": "top_right",
          "anchor_to": "top_right",
          "controls": [
            {
              "scrolling_panel_csb@common.scrolling_panel": {
                "size": [ "100%", "fill" ],
                "$scrolling_content": "csb.section_content_panels",
                "$show_background": false,
                "$scroll_size": [ "5px", "100% - 8px" ],
                "$scroll_bar_left_padding_size": [ 4, 0 ]
              }
            }
          ]
        }
      }
    ]
  },

  "section_content_panels": {
    "type": "stack_panel",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "size": [ "100%", "100%c" ],
    "factory": {
      "name": "toggle_section_factory",
      "control_ids": {
        "csb_tab": "@csb_landing.landing_content_section",
        "content_tab": "@csb_content.csb_content_section",
        "faq_tab": "@csb_faq.faq_content_section",
        "buy_now_tab": "@csb.buy_now_content_section"
      }
    },
    "bindings": [
      {
        "binding_name": "#section_content",
        "binding_name_override": "#collection_length"
      }
    ]
  },

  "vertical_padding_4px": {
    "type": "panel",
    "size": [ "100%", 4 ]
  },

  "section_base": {
    "type": "stack_panel",
    "size": [ "100%", "100%c" ]
  },

  "buy_now_content_section@csb.section_base": {
    "controls": [
      {
        "vertical_padding@csb.vertical_padding_4px": {}
      },
      {
        "content@csb_buy.buy_now_content": {}
      }
    ]
  },

  "csb_default_animation": {
    "anim_type": "flip_book",
    "initial_uv": [ 0, 0 ],
    "frame_count": 16,
    "frame_step": 19,
    "fps": 10,
    "reversible": false
  },

  "csb_hover_animation": {
    "anim_type": "flip_book",
    "initial_uv": [ 0, 0 ],
    "frame_count": 16,
    "frame_step": 19,
    "fps": 8,
    "reversible": false
  },

  "csb_static_single_frame_animation": {
    "anim_type": "flip_book",
    "initial_uv": [ 0, 0 ],
    "frame_count": 1,
    "frame_step": 19,
    "fps": 1,
    "reversible": false
  },

  "markdown_background_animated": {
    "type": "panel",
    "size": [ "100%c", "100%" ],
    "anchor_from": "left_middle",
    "anchor_to": "left_middle",
    "controls": [
      {
        "csb_chevron": {
          "type": "image",
          "texture": "textures/ui/csbChevronArrowLarge",
          "size": [ 25, 19 ],
          "anchor_from": "bottom_left",
          "anchor_to": "bottom_left",
          "layer": 15
        }
      }
    ]
  },

  "markdown_background": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%c", "100%" ],
    "anchor_from": "bottom_left",
    "anchor_to": "bottom_left",
    "$banner_size|default": [ 10, "100%" ],
    "$pack_icon_size|default": [ 8, 10 ],
    "$icon_color": "$store_sales_banner_text_color",
    "$default_state|default": false,
    "$hover_state|default": false,
    "$pressed_state|default": false,
    "$banner_texture": "textures/ui/realmflagSmooth",
    "$triangle_texture": "textures/ui/realmflagtriangleSmooth",
    "$triangle_offset": [ -1, 0 ],
    "variables": [
      {
        "requires": "$pressed_state",
        "$banner_offset": [ 0, -1 ],
        "$triangle_offset": [ -1, -1 ]
      }
    ],
    "controls": [
      {
        "banner_panel": {
          "type": "panel",
          "size": [ "100%c", "100%" ],
          "controls": [
            {
              "banner@common_store.markdown_banner": {
                "size": [ "100%c", "100%" ],
                "$banner_offset|default": [ 0, 0 ],
                "offset": "$banner_offset",
                "$use_animated_icon|default": false,
                "layer": 1,
                "controls": [
                  {
                    "banner_stack_panel": {
                      "type": "stack_panel",
                      "orientation": "horizontal",
                      "size": "$banner_size",
                      "layer": 2,
                      "controls": "$banner_content"
                    }
                  }
                ],
                "$banner_content|default": [
                  {
                    "csb_icon_panel": {
                      "type": "panel",
                      "size": "$banner_size",
                      "layer": 1,
                      "controls": [
                        {
                          "csb_icon": {
                            "type": "image",
                            "ignored": "$use_animated_icon",
                            "texture": "textures/ui/csbChevronArrowLarge",
                            "size": "$pack_icon_size",
                            "layer": 1
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "triangle_panel": {
          "type": "panel",
          "size": [ "100%c", "100%" ],
          "controls": [
            {
              "triangle@common_store.markdown_triangle": {
                "size": [ "50%y", "100%" ],
                "offset": "$triangle_offset",
                "layer": 2
              }
            }
          ]
        }
      }
    ]
  },

  "empty_label": {
    "type": "panel",
    "size": [ 0, "100%" ]
  },

  "full_width_section_divider@common.section_divider": {
    "$divider_size": [ "100%", 1 ]
  }
}
