/********************************************************
+*   (c) Mojang. All rights reserved                       *
+*   (c) Microsoft. All rights reserved.                   *
+*********************************************************/

{
    "namespace": "realms_settings",

    "settings_screen@settings_common.screen_base": {
        "$selector_stack_panel": "realms_settings.selector_panel",
        "$section_content_panels": "realms_settings.section_content_panels",
        "$section_header_panels": "common.empty_panel",
        "$section_footer_panels": "common.empty_panel"
    },

    "generic_section": {
        "type": "stack_panel",
        "size": [ "100%", "100%c" ],
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "bindings": [
            {
                "binding_type": "view",
                "source_control_name": "$section_button_name",
                "source_property_name": "#toggle_state",
                "target_property_name": "#visible"
            }
        ],
        "controls": [
            { "$section_content_name@$section_content_name": {} }
        ]
    },

    "generic_section_wrapper": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "offset": [ 2, 0 ],
        "size": [ "100% - 4px", "100%c" ],
        "$section_button_name|default": "name of selection toggle button",
        "$section_content_name|default": "name of class defining the content",
        "controls": [
            { "generic_section@realms_settings.generic_section": {} }
        ]
    },

    // checkboxes
    "checkbox_image": {
        "type": "image",
        "size": [ 10, 10 ]
    },

    "checkbox_unchecked_state@checkbox_image": {
        "texture": "textures/ui/checkbox_space"
    },

    "checkbox_checked_state@checkbox_image": {
        "texture": "textures/ui/checkbox_check"
    },

    "checkbox_unchecked_hover_state@checkbox_image": {
        "texture": "textures/ui/checkbox_spaceHover"
    },

    "checkbox_checked_hover_state@checkbox_image": {
        "texture": "textures/ui/checkbox_checkHover"
    },

    "checkbox_unchecked_locked_state@checkbox_image": {
        "texture": "textures/ui/checkbox_space_locked"
    },

    "checkbox_checked_locked_state@checkbox_image": {
        "texture": "textures/ui/checkbox_check_locked"
    },

    // Subscription content

    "player_count_label@settings_common.option_info_label": {
        "$option_label": "realmsSettingsScreen.playerCountLabel",
        "$container_size": [ "100%", "30px" ],
        "$container_text_binding_name": "#realm_player_count"
    },

    "realm_duration_label@settings_common.option_info_label": {
        "$option_label": "realmsSettingsScreen.realmDurationLabel",
        "$container_size": [ "100%", "30px" ],
        "$container_text_binding_name": "#realm_duration_label"
    },

    "realm_subscription_origin_label@settings_common.option_info_label_with_bulb": {
        "$container_size": [ "100%", "60px" ],
        "$container_text_binding_name": "#realm_subscription_origin",
        "$container_text_secondary_binding_name": "#realm_subscription_origin_addendum",
        "$second_info_panel_visible": true,
        "$show_option_label": false,
        "bindings": [
            {
                "binding_name": "#realm_subscription_origin_visibility",
                "binding_name_override": "#visible"
            }
        ]
    },

    "realm_consumable_to_subscription_info_label@settings_common.option_info_label": {
        "$container_size": [ "100%", "60px" ],
        "$container_text_binding_name": "#realm_consumable_to_subscription_info",
        "$show_option_label": false,
        "bindings": [
            {
                "binding_name": "#realm_consumable_to_subscription_visibility",
                "binding_name_override": "#visible"
            }
        ]
    },

    "manage_subscriptions_button@settings_common.action_button": {
        "$button_text": "realmsSettingsScreen.manageSubscriptionsButton",
        "$pressed_button_name": "menu_realms_manage_subscriptions"
    },

    "delete_realm_button@settings_common.action_button": {
        "$button_text": "realmsSettingsScreen.deleteRealmButton",
        "$pressed_button_name": "menu_realms_delete_realm",
        "bindings": [
            {
                "binding_name": "#delete_realm_button_visible",
                "binding_name_override": "#visible"
            }
        ]
    },

    "open_realm_button@settings_common.action_button": {
        "$button_text": "realmsSettingsScreen.openRealmButton",
        "$pressed_button_name": "menu_open_realm",
        "bindings": [
            {
                "binding_name": "#open_realm_button_visible",
                "binding_name_override": "#visible"
            }
        ]
    },

    "close_realm_button@settings_common.action_button": {
        "$button_text": "realmsSettingsScreen.closeRealmButton",
        "$pressed_button_name": "menu_close_realm",
        "bindings": [
            {
                "binding_name": "#close_realm_button_visible",
                "binding_name_override": "#visible"
            }
        ]
    },

    "subscriptions_section": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "loading_view": {
                    "type": "label",
                    "color": "$body_text_color",
                    "size": [ "default", "80px" ],
                    "offset": [ 0, 10 ],
                    "text": "realmsSettingsScreen.LoadingSubscription",
                    "bindings": [
                        {
                            "binding_name": "#realms_subscription_loading_message_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loading_failed_view": {
                    "type": "label",
                    "color": "$body_text_color",
                    "size": [ "default", "80px" ],
                    "offset": [ 0, 10 ],
                    "text": "realmsSettingsScreen.failedLoadingSubscription",
                    "bindings": [
                        {
                            "binding_name": "#realms_subscription_loading_failed_message_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loaded_view": {
                    "type": "stack_panel",
                    "anchor_from": "top_left",
                    "anchor_to": "top_left",
                    "controls": [
                        { "player_count_label@realms_settings.player_count_label": {} },
                        { "realm_duration_label@realms_settings.realm_duration_label": {} },
                        {
                            "possible_store_mismatch@general_section.possible_store_mismatch": {
                                "$realm_collection_name": "",
                                "$tooltip_button_collection_name": "additional_realms_subscriptions_collection",

                                "$tooltip_text_binding_name": "#realms_purchased_store",
                                "$tooltip_button_binding_type": "global",

                                "$tooltip_panel_offset": [ 0, "-100%y - 2px" ],

                                "bindings": [
                                    {
                                        "binding_name": "#realm_consumable_to_subscription_visibility",
                                        "binding_name_override": "#visible",
                                        "binding_condition": "visible"
                                    }
                                ]
                            }
                        },
                        { "realm_subscription_origin_label@realms_settings.realm_subscription_origin_label": {} },
                        { "realm_consumable_to_subscription_info_label@realms_settings.realm_consumable_to_subscription_info_label": {} },
                        {
                            "_0": {
                                "type": "panel",
                                "size": [ 0, 2 ]
                            }
                        },
                        { "delete_realm_button@realms_settings.delete_realm_button": {} },
                        { "open_realm_button@realms_settings.open_realm_button": {} },
                        { "close_realm_button@realms_settings.close_realm_button": {} },
                        {
                            "_1": {
                                "type": "panel",
                                "size": [ 0, 2 ]
                            }
                        },
                        {
                            "manage_subscriptions_button@realms_settings.manage_subscriptions_button": {
                                "ignored": "$pre_release"
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#realms_subscription_info_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }

            }
        ]
    },

    // Invite links content

    "invite_link_item_content": {
        "type": "stack_panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "orientation": "horizontal",
        "size": [ "100%", 30 ],
        "offset": [ 2, 2 ],
        "controls": [
            {
                "invite_link_item_name_and_expiry_text": {
                    "type": "stack_panel",
                    "size": [ "75%", "100%" ],
                    "controls": [
                        {
                            "name_text@realms_settings.label_text": {
                                "text": "#link_name",
                                "size": [ "100% - 8px", 10 ],
                                "color": "$text_color",
                                "tts_override_control_value": "#link_name_TTS",
                                "bindings": [
                                    {
                                        "binding_name": "#link_name",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    },
                                    {
                                        "binding_name": "#link_name_TTS",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        },
                        {
                            "spacing_gap": {
                                "type": "panel",
                                "size": [ "100%", 2 ]
                            }
                        },
                        {
                            "expiry_text@realms_settings.label_text": {
                                "text": "#link_expiry",
                                "size": [ "100% - 8px", 10 ],
                                "color": "$light_button_secondary_default_text_color",
                                "tts_override_control_value": "#link_expiry_TTS",
                                "bindings": [
                                    {
                                        "binding_name": "#link_expiry",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    },
                                    {
                                        "binding_name": "#link_expiry_TTS",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "invite_link_item_state_text": {
                    "type": "panel",
                    "size": [ "fill", "100%" ],
                    "controls": [
                        {
                            "state_text@realms_settings.label_text": {
                                "text": "#link_state",
                                "text_alignment": "right",
                                "offset": [ 0, 6 ],
                                "size": [ "100%", 10 ],
                                "color": "$light_button_secondary_default_text_color",
                                "tts_override_control_value": " ", // state gets narrated with expiry in #link_expiry_TTS
                                "bindings": [
                                    {
                                        "binding_name": "#link_state",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "spacing_gap": {
                    "type": "panel",
                    "size": [ 6, "100%" ]
                }
            }
        ]
    },

    "invite_link_item_template": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", 30 ],
        "controls": [
            {
                "invite_link_item_button@common_buttons.dark_content_button": {
                    "$pressed_button_name": "open_invite_link_settings_screen",
                    "size": [ "100%", 30 ],
                    "$button_content": "realms_settings.invite_link_item_content",
                    "bindings": [
                        {
                            "binding_type": "collection_details",
                            "binding_collection_name": "$collection_binding_name"
                        }
                    ]
                }
            }
        ]
    },

    "invite_links_section": {
        "type": "panel",
        "$panel_size|default": [ "100%", "100%c" ],
        "size": "$panel_size",
        "controls": [
            {
                "loading_view": {
                    "type": "label",
                    "color": "$body_text_color",
                    "size": [ "default", "80px" ],
                    "offset": [ 0, 10 ],
                    "text": "realmsSettingsScreen.LoadingInviteLinks",
                    "bindings": [
                        {
                            "binding_name": "#realms_invite_links_loading_message_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loading_failed_view": {
                    "type": "label",
                    "color": "$body_text_color",
                    "size": [ "default", "80px" ],
                    "offset": [ 0, 10 ],
                    "text": "realmsSettingsScreen.failedLoadingInviteLinks",
                    "bindings": [
                        {
                            "binding_name": "#realms_invite_links_loading_failed_message_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loaded_view": {
                    "type": "stack_panel",
                    "controls": [
                        {
                            "spacing_gap_0": {
                                "type": "panel",
                                "size": [ "100%", 8 ]
                            }
                        },
                        {
                            "invite_links_info@settings_common.option_info_label": {
                                "$option_label": "realmsSettingsScreen.inviteLinkLabel",
                                "$button_tts_header": "realmsSettingsScreen.inviteLinkLabelTTS",
                                "$container_size": [ "100%", "30px" ],
                                "$container_text_binding_name": "#realm_invite_links_description"
                            }
                        },
                        {
                            "invite_links_grid": {
                                "type": "stack_panel",
                                "size": [ "100%", "default" ],
                                "factory": {
                                    "name": "invite_links_factory",
                                    "control_name": "realms_settings.invite_link_item_template"
                                },
                                "collection_name": "realms_invite_links_collection",
                                "$collection_binding_name": "realms_invite_links_collection",
                                "bindings": [
                                    {
                                        "binding_name": "#realms_invite_links_collection_length",
                                        "binding_name_override": "#collection_length"
                                    }
                                ]
                            }
                        },
                        {
                            "spacing_gap_1": {
                                "type": "panel",
                                "size": [ "100%", 4 ]
                            }
                        },
                        {
                            "add_invite_link_button@settings_common.action_button": {
                                "$button_text": "realmsSettingsScreen.inviteLinkAddButton",
                                "$pressed_button_name": "create_and_open_invite_link_settings_screen",
                                "bindings": [
                                    {
                                        "binding_name": "#add_invite_link_button_visible",
                                        "binding_name_override": "#visible"
                                    },
                                    {
                                        "binding_name": "#add_invite_link_button_enabled",
                                        "binding_name_override": "#enabled"
                                    }
                                ]
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#realms_invite_links_info_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            }
        ]
    },

    //advanced tab content

    "advanced_section": {
        "type": "panel",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "loading_view": {
                    "type": "label",
                    "color": "$body_text_color",
                    "size": [ "default", "80px" ],
                    "offset": [ 0, 10 ],
                    "text": "realmsSettingsScreen.advancedLoading",
                    "bindings": [
                        {
                            "binding_name": "#realms_advanced_loading_message_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loading_failed_view": {
                    "type": "label",
                    "color": "$body_text_color",
                    "size": [ "default", "80px" ],
                    "offset": [ 0, 10 ],
                    "text": "realmsSettingsScreen.advancedLoadingFailed",
                    "bindings": [
                        {
                            "binding_name": "#realms_advanced_loading_failed_message_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loaded_view": {
                    "type": "stack_panel",
                    "controls": [
                        {
                            "spacing_gap_0": {
                                "type": "panel",
                                "size": [ "100%", 8 ]
                            }
                        },
                        {
                            "server_preference@settings_common.option_icon_label": {
                                "$option_label": "realmsSettingsScreen.serverRegionPreferenceTitle",
                                "$button_tts_header": "realmsSettingsScreen.serverRegionPreferenceTitle",
                                "$container_text_binding_name": "#realm_selected_preference",
                                "$container_icon_binding_name": "#realm_selected_preference_icon",
                                "$container_tts_binding_name": "#realm_selected_preference_tts"
                            }
                        },
                        {
                            "set_region_content@realms_settings.set_region_dropdown": {}
                        },
                        {
                            "changes_not_applied_panel": {
                                "type": "stack_panel",
                                "size": [ "100%", "100%c" ],
                                "controls": [
                                    {
                                        "changes_not_applied_label": {
                                            "type": "label",
                                            "color": "$light_button_secondary_default_text_color",
                                            "size": [ "100%", "default" ],
                                            "text": "realmsSettingsScreen.changesNotApplied"
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "spacing_gap_1": {
                                "type": "panel",
                                "size": [ "100%", 16 ]
                            }
                        },
                        {
                            "region_help_button@common_buttons.light_content_button": {
                                "$pressed_button_name": "region_help_button",
                                "size": [ "100%", 29 ],
                                "$button_content": "realms_settings.region_help_button_content"
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#realms_advanced_info_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            }
        ]
    },

    "set_region_dropdown@settings_common.option_dropdown": {
        "$dropdown_content": "realms_settings.region_dropdown_content",
        "$dropdown_area": "content_area",
        "$dropdown_name": "preferred_region_dropdown",
        "$toggle_binding_type": "collection",
        "$toggle_grid_collection_name": "region_collection",
        "$options_dropdown_toggle_label_binding": "#dropdown_option_text",
        "$options_dropdown_toggle_label_binding_type": "collection",
        "$options_dropdown_toggle_label_binding_collection_name": "region_collection",
        "$dropdown_scroll_content_size": [ "100%", "400%" ],
        "$focus_override_right": "FOCUS_OVERRIDE_STOP",
        "$tts_override_control_value": "#dropdown_option_text_tts"
    },

    "region_dropdown_content@settings_common.option_radio_dropdown_group": {
        "$radio_buttons": [],

        "$radio_factory": {
            "name": "buttons",
            "control_name": "realms_settings.region_dropdown_radio"
        },

        "$radio_collection_name": "region_dropdown",
        "$radio_bindings": [
            {
                "binding_name": "#region_dropdown_length",
                "binding_type": "collection",
                "binding_name_override": "#collection_length",
                "binding_collection_name": "region_collection"
            }
        ]
    },

    "region_dropdown_radio@settings_common.radio_with_label_and_icon": {
        "$toggle_name": "region_dropdown_radio_toggle",
        "$toggle_state_binding_name": "#region_radio_toggled",
        "$toggle_binding_type": "collection",
        "$toggle_grid_collection_name": "region_dropdown",
        "$toggle_collection_details_type": "collection_details",

        "$tts_override_control_value": "#region_dropdown_tts_hint",
        "$radio_label_text": "#region_radio_text",
        "$radio_label_bindings": [
            {
                "binding_name": "#region_radio_text",
                "binding_type": "collection",
                "binding_collection_name": "region_dropdown"
            },
            {
                "binding_name": "#region_dropdown_tts_hint",
                "binding_type": "collection",
                "binding_collection_name": "region_dropdown"
            },
            {
                "binding_type": "collection_details"
            }
        ],

        "$icon_texture": "#server_region_ping_icon",
        "$icon_texture_bindings": [
            {
                "binding_name": "#server_region_ping_icon",
                "binding_name_override": "#texture",
                "binding_type": "collection",
                "binding_collection_name": "region_dropdown"
            },
            {
                "binding_type": "collection_details"
            }
        ]
    },

    "region_help_button_content": {
        "type": "stack_panel",
        "anchor_from": "center",
        "anchor_to": "center",
        "orientation": "horizontal",
        "size": [ "100%c", "100%c" ],
        "offset": [ 0, 4 ],
        "controls": [
            {
                "external_link_icon": {
                    "type": "image",
                    "texture": "textures/ui/external_link",
                    "size": [ 9, 9 ],
                    "color": "$text_color"
                }
            },
            {
                "spacing_gap_1": {
                    "type": "panel",
                    "size": [ 4, 0 ]
                }
            },
            {
                "help_text@label_text": {
                    "text": "realmsSettingsScreen.setRegionHelp",
                    "size": [ "default", "default" ],
                    "color": "$text_color"
                }
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Focus Border
    //---------------------------------------------------------------------------
    "tts_focus_border@common.non_interact_focus_border_button": {
        "anchor_from": "left_middle",
        "anchor_to": "left_middle",
        "size": [ "100%sm + 3px", "100%sm + 3px" ],
        "offset": [ -2, 0 ],
        "tts_inherit_siblings": true,
        "default_focus_precedence": 0,
        "$focus_border_visible_binding|default": "#tts_enabled",
        "$focus_border_visible_binding_override|default": "#visible",
        "$focus_border_visible_binding_type|default": "global",
        "$tts_tooltip_header|default": " ",
        "tts_control_header": "$tts_tooltip_header",
        "consume_hover_events": true,
        "bindings": [
            {
                "binding_type": "$focus_border_visible_binding_type",
                "binding_name": "$focus_border_visible_binding",
                "binding_name_override": "$focus_border_visible_binding_override"
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Saves Section
    //---------------------------------------------------------------------------
    "saves_section": {
        "type": "stack_panel",
        "$panel_size|default": [ "100%", "100%c" ],
        "$panel_offset|default": [ 0, 0 ],
        "size": "$panel_size",
        "offset": "$panel_offset",
        "controls": [
            {
                "padding_saves_section_top@common.empty_panel": {
                    "size": [ "100%", 8 ]
                }
            },
            {
                "loaded_view": {
                    "type": "stack_panel",
                    "controls": [
                        {
                            "storage_bar_header_panel": {
                                "type": "panel",
                                "size": [ "100%", "100%cm" ],
                                "controls": [
                                    {
                                        "storage_bar_with_header@realms_settings.storage_bar_panel_with_header": {
                                            "$text_left_binding_name": "#storage_bar_label_text"
                                        }
                                    },
                                    {
                                        "focus_border@realms_settings.tts_focus_border": {
                                            "$tts_tooltip_header": "realmsSettingsScreen.savesStorageBar.name"
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "padding3@common.empty_panel": {
                                "size": [ "100%", 8 ]
                            }
                        },
                        {
                            "save_active_world_button@settings_common.action_button": {
                                "$button_text": "realmsSettingsScreen.saveActiveWorld",
                                "$pressed_button_name": "button.save_active_world_button",
                                "$button_focus_precedence": 10,
                                "$focus_id": "save_active_world_button",
                                "size": [ "100%", 30 ],
                                "bindings": [
                                    {
                                        "binding_name": "#save_active_world_button_tts"
                                    }
                                ]
                            }
                        },
                        {
                            "padding4@common.empty_panel": {
                                "size": [ "100%", 8 ]
                            }
                        },
                        {
                            "active_world_info@realms_settings.active_world_info_panel": {}
                        },
                        {
                            "padding5@common.empty_panel": {
                                "size": [ "100%", 8 ]
                            }
                        },
                        {
                            "storage_warning": {
                                "type": "panel",
                                "size": [ "100%", "100%cm" ],
                                "controls": [
                                    {
                                        "warning_text_panel@realms_settings.warning_text_panel": {
                                            "$text_content": "realmsSettingsScreen.savesStorageWarning",
                                            "$text_color": "$realms_neutral_dimmer_text_color",
                                            "bindings": [
                                                {
                                                    "binding_name": "#storage_warning_visible",
                                                    "binding_name_override": "#visible"
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "focus_border@realms_settings.tts_focus_border": {}
                                    }
                                ]
                            }
                        },
                        {
                            "padding6@common.empty_panel": {
                                "size": [ "100%", 8 ],
                                "bindings": [
                                    {
                                        "binding_name": "#storage_warning_visible",
                                        "binding_name_override": "#visible"
                                    }
                                ]
                            }
                        },
                        {
                            "save_list_container": {
                                "type": "panel",
                                "anchor_to": "top_left",
                                "anchor_from": "top_left",
                                "size": [ "100%", "100%c" ],
                                "controls": [
                                    {
                                        "tab_buttons@realms_settings.button_tabs_container": {}
                                    },
                                    {
                                        "tab_content_panel@realms_settings.tab_content_panel": {
                                            "offset": [ 0, 28 ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "padding_loaded_view_bottom@common.empty_panel": {
                                "size": [ "100%", 4 ]
                            }
                        },
                        {
                            "restore_info@settings_common.option_info_label": {
                                "$container_text_binding_name": "#restore_world",
                                "$show_option_label": false
                            }
                        },
                        {
                            "saves_help_panel@realms_settings.saves_help_panel": {}
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#saves_loaded_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loading_indicator": {
                    "type": "stack_panel",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "restore_info@settings_common.option_info_label": {
                                "$container_text_binding_name": "#restore_world",
                                "$show_option_label": false
                            }
                        },
                        {
                            "loading_text_panel": {
                                "type": "panel",
                                "size": [ "100%", "100%c" ],
                                "controls": [
                                    {
                                        "loading_text": {
                                            "type": "label",
                                            "anchor_from": "center",
                                            "anchor_to": "center",
                                            "color": "$body_text_color",
                                            "size": [ "default", "default" ],
                                            "text": "#realms_settings_loading_modal_title",
                                            "bindings": [
                                                {
                                                    "binding_name": "#realms_settings_loading_modal_title"
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "loading_text_padding@common.empty_panel": {
                                            "size": [ "100%", 8 ]
                                        }
                                    }
                                ],
                                "bindings": [
                                    {
                                        "binding_name": "#saves_loading_text_visible",
                                        "binding_name_override": "#visible"
                                    }
                                ]
                            }
                        },
                        {
                            "loading_bars": {
                                "type": "panel",
                                "size": [ "100%", 20 ],
                                "controls": [
                                    {
                                        "progress_loading_bars@feed_common.progress_loading_bars": {}
                                    }
                                ]
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#saves_loading_indicator_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "loading_failed_panel": {
                    "type": "stack_panel",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "restore_info@settings_common.option_info_label": {
                                "$container_text_binding_name": "#restore_world",
                                "$show_option_label": false
                            }
                        },
                        {
                            "saves_help_panel@realms_settings.saves_help_panel": {}
                        },
                        {
                            "loading_failed_message@settings_common.option_info_label": {
                                "$container_text_binding_name": "#saves_loading_failed_message",
                                "$show_option_label": false
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#saves_loading_failed_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            }
        ]
    },

    "saves_help_panel": {
        "type": "stack_panel",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "padding_help_button_top@common.empty_panel": {
                    "size": [ "100%", 4 ]
                }
            },
            {
                "saves_help_button@common_buttons.light_content_button": {
                    "$pressed_button_name": "saves_help_button",
                    "size": [ "100%", 30 ],
                    "$button_content": "realms_settings.saves_help_button_content"
                }
            },
            {
                "padding_help_button_bottom@common.empty_panel": {
                    "size": [ "100%", 8 ]
                }
            }
        ]
    },

    "saves_help_button_content": {
        "type": "stack_panel",
        "anchor_from": "center",
        "anchor_to": "center",
        "orientation": "horizontal",
        "size": [ "100%c", "100%c" ],
        "offset": [ 0, 4 ],
        "controls": [
            {
                "external_link_icon": {
                    "type": "image",
                    "texture": "textures/ui/external_link",
                    "size": [ 9, 9 ],
                    "color": "$text_color"
                }
            },
            {
                "spacing_gap_1": {
                    "type": "panel",
                    "size": [ 4, 0 ]
                }
            },
            {
                "help_text@label_text": {
                    "text": "realmsSettingsScreen.learnMore",
                    "size": [ "default", "default" ],
                    "color": "$text_color"
                }
            }
        ]
    },

    "storage_bar_label_stack_panel": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "size": [ "100%", 9 ],
        "$hide_text_right|default": true,
        "$text_left_binding_name|default": "#storage_bar_label_text_left",
        "$text_right_binding_name|default": "#storage_bar_label_text_right",
        "controls": [
            {
                "text_left": {
                    "type": "label",
                    "text": "#text",
                    "color": "$realms_neutral_dimmer_text_color",
                    "size": [ "default", "default" ],
                    "bindings": [
                        {
                            "binding_name": "$text_left_binding_name",
                            "binding_name_override": "#text"
                        }
                    ]
                }
            },
            {
                "padding@common.empty_panel": {
                    "ignored": "$hide_text_right",
                    "size": [ "fill", "100%" ]
                }
            },
            {
                "text_right": {
                    "ignored": "$hide_text_right",
                    "type": "label",
                    "text": "#text",
                    "color": "$realms_neutral_dimmer_text_color",
                    "size": [ "default", "default" ],
                    "bindings": [
                        {
                            "binding_name": "$text_right_binding_name",
                            "binding_name_override": "#text"
                        }
                    ]
                }
            }
        ]
    },

    "storage_bar_panel_with_header": {
        "type": "stack_panel",
        "$heading_label|default": "realms_settings.realm_storage_heading_label",
        "controls": [
            {
                "label_panel": {
                    "type": "panel",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "heading_label@$heading_label": {}
                        }
                    ]
                }
            },
            {
                "padding2@common.empty_panel": {
                    "size": [ "100%", 8 ]
                }
            },
            {
                "storage_bar_panel@realms_settings.storage_bar_panel": {}
            }
        ]
    },

    "realm_storage_heading_label": {
        "type": "label",
        "color": "$main_header_text_color",
        "size": [ "100%", "default" ],
        "text": "realmsSettingsScreen.savesStorageTitle"
    },

    "storage_bar_panel": {
        "type": "stack_panel",
        "anchor_from": "center",
        "anchor_to": "center",
        "orientation": "vertical",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "storage_bar_label@realms_settings.storage_bar_label_stack_panel": {}
            },
            {
                "padding@common.empty_panel": {
                    "size": [ 0, 4 ]
                }
            },
            {
                "storage_bar@realms_settings.storage_bar": {}
            }
        ]
    },

    "storage_bar_panel_with_tts_focus_border": {
        "type": "panel",
        "size": [ "100% - 4px", "100%cm" ],
        "controls": [
            {
                "storage_bar_panel@realms_settings.storage_bar_panel": {}
            },
            {
                "focus_border@realms_settings.tts_focus_border": {}
            }
        ]
    },

    "storage_bar": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", 4 ],
        "$storage_bar_fill_color_binding_name|default": "#storage_bar_fill_color",
        "$fill_percent_binding_name|default": "#percent_storage_used",
        "controls": [
            {
                "empty_progress_bar_beveled@common.empty_progress_bar_beveled": {
                    "layer": 1
                }
            },
            {
                "storage_fill": {
                    "type": "image",
                    "texture": "textures/ui/white_background",
                    "clip_direction": "left",
                    "clip_pixelperfect": false,
                    "fill": true,
                    "color": "#color",
                    "layer": 2,
                    "bindings": [
                        {
                            "binding_name": "$fill_percent_binding_name",
                            "binding_name_override": "#clip_ratio"
                        },
                        {
                            "binding_name": "$storage_bar_fill_color_binding_name",
                            "binding_name_override": "#color"
                        }
                    ]
                }
            },
            {
                "storage_bar_beveled_overlay@common.progress_bar_beveled_overlay": {
                    "layer": 3,
                    "clip_pixelperfect": false,
                    "$progress_percentage_binding_name": "$fill_percent_binding_name"
                }
            }
        ]
    },

    "active_world_info_panel": {
        "type": "panel",
        "size": [ "100%", "100%cm" ],
        "controls": [
            {
                "active_world_info_label_stack_panel": {
                    "type": "stack_panel",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "active_world_name_label": {
                                "type": "label",
                                "color": "$body_text_color",
                                "size": [ "100%", "default" ],
                                "text": "#active_world_name",
                                "bindings": [
                                    {
                                        "binding_name": "#active_world_name"
                                    }
                                ]
                            }
                        },
                        {
                            "active_world_size_label": {
                                "type": "label",
                                "color": "$body_text_color",
                                "size": [ "100%", "default" ],
                                "text": "#active_world_size",
                                "bindings": [
                                    {
                                        "binding_name": "#active_world_size"
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "focus_border@realms_settings.tts_focus_border": {}
            }
        ]
    },

    "warning_text_panel": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "size": [ "100%", "100%cm" ],
        "$text_content|default": "",
        "$text_color|default": "$main_header_text_color",
        "$text_fontsize|default": "normal",
        "$text_fonttype|default": "default",
        "controls": [
            {
                "warning_panel": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "size": [ "100%c", "100%sm" ],
                    "controls": [
                        {
                            "padding1@common.empty_panel": {
                                "size": [ 0, "fill" ]
                            }
                        },
                        {
                            "warning_image": {
                                "type": "image",
                                "size": [ 13, 20 ],
                                "bilinear": true,
                                "texture": "textures/ui/WarningGlyph",
                                "layer": 1
                            }
                        },
                        {
                            "padding2@common.empty_panel": {
                                "size": [ 0, "fill" ]
                            }
                        }
                    ]
                }
            },
            {
                "padding1@common.empty_panel": {
                    "size": [ 4, 0 ]
                }
            },
            {
                "text_label": {
                    "type": "label",
                    "color": "$text_color",
                    "size": [ "100% - 12px", "default" ],
                    "layer": 1,
                    "text": "$text_content",
                    "font_size": "$text_fontsize",
                    "font_type": "$text_fonttype"
                }
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Free Up Space Modal
    //---------------------------------------------------------------------------
    "popup_dialog_background": {
        "type": "image",
        "texture": "textures/ui/control",
        "size": [ "100% - 4px", "100% - 4px" ],
        "alpha": 1.0,
        "anchor_from": "center",
        "anchor_to": "center"
    },

    "popup_dialog_label": {
        "size": [ "100% - 8px", "default" ],
        "type": "label",
        "color": "$main_header_text_color",
        "localize": false,
        "text": "#body_text",
        "bindings": [
            {
                "binding_name": "#body_text",
                "binding_condition": "once"
            }
        ]
    },

    "delete_selected_saves_button@common_buttons.light_text_button": {
        "$pressed_button_name": "button.delete_selected_saves",
        "button_mappings": [
            {
                "from_button_id": "button.menu_select",
                "to_button_id": "$pressed_button_name",
                "mapping_type": "pressed"
            },
            {
                "from_button_id": "button.menu_ok",
                "to_button_id": "$pressed_button_name",
                "mapping_type": "focused"
            },
            {
                "from_button_id": "button.menu_cancel",
                "to_button_id": "$modal_escape_button_name",
                "mapping_type": "global"
            }
        ],
        "bindings": [
            {
                "binding_name": "#delete_selected_saves_button_enabled",
                "binding_name_override": "#enabled"
            }
        ],
        "$button_text": "#delete_selected_saves_button_text",
        "$button_text_binding_type": "global"
    },

    "cancel_popup_button@common_buttons.light_text_button": {
        "button_mappings": [
            {
                "from_button_id": "button.menu_select",
                "to_button_id": "$pressed_button_name",
                "mapping_type": "pressed"
            },
            {
                "from_button_id": "button.menu_ok",
                "to_button_id": "$pressed_button_name",
                "mapping_type": "focused"
            },
            {
                "from_button_id": "button.menu_cancel",
                "to_button_id": "$modal_escape_button_name",
                "mapping_type": "global"
            }
        ],
        "$button_text": "gui.cancel"
    },

    "free_up_space_popup_content": {
        "type": "panel",
        "size": [ "100%", "100%" ],
        "anchor_from": "center",
        "anchor_to": "center",
        "$text_name": "realmsSettingsScreen.freeUpSpace.title",
        "$child_control|default": "realms_settings.free_up_space_popup_scrolling_panel",
        "controls": [
            {
                "common_panel@common.common_panel": {
                    "$show_close_button": false,
                    "$dialog_background": "dialog_background_hollow_2"
                }
            },
            {
                "title_label@common_dialogs.title_label": {
                    "$title_offset": [ 0, 7 ]
                }
            },
            {
                "panel_indent": {
                    "type": "panel",
                    // Fit to the hole in dialog_background_hollow_1 exactly
                    "size": [ "100% - 16px", "100% - 99px" ],
                    "offset": [ 0, 42 ],
                    "anchor_from": "top_middle",
                    "anchor_to": "top_middle",
                    "controls": [
                        { "inside_header_panel@$child_control": {} }
                    ]
                }
            },
            {
                "button_panel": {
                    "type": "stack_panel",
                    "orientation": "horizontal",
                    "size": [ "100% - 14px", 30 ],
                    "anchor_from": "bottom_middle",
                    "anchor_to": "bottom_middle",
                    "offset": [ 0, -7 ],
                    "controls": [
                        {
                            "left_button_panel@realms_settings.cancel_popup_button": {
                                "$pressed_button_name": "$modal_escape_button_name",
                                "size": [ "fill", "100%" ]
                            }
                        },
                        {
                            "pad": {
                                "type": "panel",
                                "size": [ 6, "100%" ]
                            }
                        },
                        {
                            "right_button_panel@realms_settings.delete_selected_saves_button": {
                                "size": [ "fill", "100%" ]
                            }
                        }
                    ]
                }
            }
        ]
    },

    "free_up_space_popup_scrolling_panel@common.scrolling_panel": {
        "layer": 1,
        "size": [ "100%", 130 ],
        "$show_background": false,
        "$scroll_track_offset": [ 0, -2 ],
        "$scrolling_content": "realms_settings.free_up_space_popup_content_stack_panel"
    },

    "free_up_space_text_description": {
        "type": "label",
        "size": [ "100%", "default" ],
        "text": "realmsSettingsScreen.freeUpSpace.description",
        "color": "$main_header_text_color"
    },

    "free_up_space_popup_content_stack_panel": {
        "type": "stack_panel",
        "orientation": "vertical",
        "offset": [ 4, 0 ],
        "size": [ "100% - 6px", "100%c" ],
        "layer": 5,
        "controls": [
            {
                "free_up_space_description_label@common.tts_label_focus_wrapper": {
                    "$tts_label_panel": "realms_settings.free_up_space_text_description"
                }
            },
            {
                "padding1@common.empty_panel": {
                    "size": [ "100%", 8 ]
                }
            },
            {
                "free_up_space_storage_bar_panel@realms_settings.storage_bar_panel_with_tts_focus_border": {
                    "$text_left_binding_name": "#free_up_space_storage_bar_text_left",
                    "$text_right_binding_name": "#free_up_space_storage_bar_text_right",
                    "$storage_bar_fill_color_binding_name": "#free_up_space_storage_bar_fill_color",
                    "$fill_percent_binding_name": "#free_up_space_storage_bar_percent_filled",
                    "$hide_text_right": false
                }
            },
            {
                "padding2@common.empty_panel": {
                    "size": [ "100%", 6 ]
                }
            },
            {
                "free_up_space_manual_save_list_stack_panel@realms_settings.manual_save_list_stack_panel": {
                    "$ignore_checkbox": false,
                    "$ignore_info_label": true,
                    "$ignore_options_button": true,
                    "$dropdown_tts_toggle_on": "realmsSettingsScreen.dropdown.opened.tts",
                    "$dropdown_tts_toggle_off": "realmsSettingsScreen.dropdown.closed.tts"
                }
            }
        ]
    },

    "popup_dialog__free_up_space@popup_dialog.popup_dialog": {
        "size": [ 282, 200 ],
        "ttsSectionContainer": true,
        "$modal_escape_button_name": "free_up_space_modal_escape",
        "controls": [
            {
                "free_up_space_popup_background@realms_settings.popup_dialog_background": {
                    "layer": 0
                }
            },
            {
                "free_up_space_popup_content@realms_settings.free_up_space_popup_content": {
                    "layer": 1
                }
            }
        ],
        "button_mappings": [
            {
                "from_button_id": "button.menu_up",
                "to_button_id": "button.menu_up",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_down",
                "to_button_id": "button.menu_down",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_left",
                "to_button_id": "button.menu_left",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_right",
                "to_button_id": "button.menu_right",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_cancel",
                "to_button_id": "$modal_escape_button_name",
                "mapping_type": "global"
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Main navigation tabs
    //---------------------------------------------------------------------------

    "top_tab@common_tabs.tab_top": {
        "$radio_toggle_group": true,
        "$toggle_name": "saves_navigation_tab",
        "$toggle_reset_on_focus_lost": false,
        "$toggle_tts_toggle_on_text": "accessibility.state.selected",
        "$toggle_tts_toggle_off_text": "",
        "$ignore_tts_enabled_bind": true,
        "$toggle_focus_bind": "#focus_enabled"
    },

    "tab_content": {
        "type": "panel",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "text@play.common_button_text": {
                    "layer": 3,
                    "text": "$tab_text_name",
                    "anchor_from": "center",
                    "anchor_to": "center",
                    "color": "$text_color"
                }
            }
        ]
    },

    "manual_navigation_tab@realms_settings.top_tab": {
        "$is_left_most_tab": true,
        "$toggle_default_state": true,
        "$tab_view_binding_name": "manual_navigation_tab_toggle",
        "$tab_text_name": "realmsSettingsScreen.manualTab",
        "$tab_content": "realms_settings.tab_content",
        "$toggle_group_forced_index": 0,
        "$toggle_tts_toggle_on_text": "realmsSettingsScreen.tab.active.tts",
        "$toggle_tts_toggle_off_text": "realmsSettingsScreen.manualTab.inactive.tts"
    },

    "automatic_navigation_tab@realms_settings.top_tab": {
        "$is_right_most_tab": true,
        "$tab_view_binding_name": "automatic_navigation_tab_toggle",
        "$tab_text_name": "realmsSettingsScreen.automaticTab",
        "$tab_content": "realms_settings.tab_content",
        "$toggle_group_forced_index": 1,
        "$toggle_tts_toggle_on_text": "realmsSettingsScreen.tab.active.tts",
        "$toggle_tts_toggle_off_text": "realmsSettingsScreen.automaticTab.inactive.tts"
    },

    "tab_navigation_panel_layout": {
        "type": "panel",
        "anchor_to": "top_middle",
        "anchor_from": "top_middle",
        "size": [ "100%", 30 ],
        "controls": [
            {
                "content@$navigation_tab": {
                    "anchor_to": "top_left",
                    "anchor_from": "top_left"
                }
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Save lists
    //---------------------------------------------------------------------------
    "button_tabs_container": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "anchor_to": "top_left",
        "anchor_from": "top_left",
        "size": [ "100%", 32 ],
        "controls": [
            {
                "manual_navigation_tab@realms_settings.manual_navigation_tab": {
                    "size": [ "50%", "100%" ]
                }
            },
            {
                "automatic_navigation_tab@realms_settings.automatic_navigation_tab": {
                    "size": [ "50%", "100%" ]
                }
            }
        ]
    },

    "tab_content_panel@common.dialog_background_hollow_4": {
        "anchor_to": "top_left",
        "anchor_from": "top_left",
        "size": [ "100%", "100%c + 16px" ],
        "controls": [
            {
                "background": {
                    "type": "image",
                    "texture": "textures/ui/Black",
                    "size": [ "100% - 16px", "100%c + 4px" ],
                    "controls": [
                        {
                            "manual_save_list@realms_settings.manual_save_list_panel": {}
                        },
                        {
                            "automatic_save_list@realms_settings.automatic_save_list_panel": {}
                        }
                    ]
                }
            }
        ]
    },

    "save_list_panel": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%-12px", "100%c" ],
        "offset": [ 8, 2 ],
        "controls": [
            {
                "save_list@$save_list_content": {}
            }
        ]
    },

    "manual_save_list_panel@realms_settings.save_list_panel": {
        "$save_list_content": "realms_settings.manual_save_list_stack_panel",
        "$dropdown_tts_toggle_on": "realmsSettingsScreen.dropdown.opened.tts",
        "$dropdown_tts_toggle_off": "realmsSettingsScreen.dropdown.closed.tts",
        "bindings": [
            {
                "binding_name": "(not #is_automatic_saves)",
                "binding_name_override": "#visible"
            }
        ]
    },

    "manual_tab_info_panel": {
        "type": "panel",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "info_label": {
                    "type": "label",
                    "color": "$main_header_text_color",
                    "size": [ "100%", "default" ],
                    "text": "realmsSettingsScreen.manualLabel"
                }
            }
        ]
    },

    "manual_save_list_stack_panel": {
        "type": "stack_panel",
        "orientation": "vertical",
        "$ignore_info_label|default": false,
        "$ignore_options_button|default": false,
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "padding1@common.empty_panel": {
                    "ignored": "$ignore_info_label",
                    "size": [ "100%", 6 ]
                }
            },
            {
                "save_tab_info_label@common.tts_label_focus_wrapper": {
                    "ignored": "$ignore_info_label",
                    "$tts_label_panel": "realms_settings.manual_tab_info_panel"
                }
            },
            {
                "padding2@common.empty_panel": {
                    "ignored": "$ignore_info_label",
                    "size": [ "100%", 8 ]
                }
            },
            {
                "stack_panel": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "size": [ "100%", "100%c" ],
                    "$ignore_checkbox|default": true,
                    "$checkbox_pressed_button_name": "button.manual_save_checkbox",
                    "factory": {
                        "name": "manual_saves_factory",
                        "control_name": "realms_settings.saves_info_accordian",
                        "factory_variables": [
                            "$ignore_checkbox",
                            "$checkbox_pressed_button_name",
                            "$ignore_options_button",
                            "$dropdown_tts_toggle_on",
                            "$dropdown_tts_toggle_off"
                        ]
                    },
                    "$collection_binding_name": "manual_saves_collection",
                    "collection_name": "manual_saves_collection",
                    "bindings": [
                        {
                            "binding_name": "#manual_saves_length",
                            "binding_name_override": "#collection_length"
                        }
                    ]
                }
            },
            {
                "padding3@common.empty_panel": {
                    "size": [ "100%", 6 ]
                }
            }
        ]
    },

    "automatic_save_list_panel@realms_settings.save_list_panel": {
        "$save_list_content": "realms_settings.automatic_save_list_stack_panel",
        "bindings": [
            {
                "binding_name": "#is_automatic_saves",
                "binding_name_override": "#visible"
            }
        ]
    },

    "automatic_tab_info_panel": {
        "type": "panel",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "info_label": {
                    "type": "label",
                    "color": "$main_header_text_color",
                    "size": [ "100%", "default" ],
                    "text": "realmsSettingsScreen.automaticLabel"
                }
            }
        ]
    },

    "automatic_save_list_stack_panel": {
        "type": "stack_panel",
        "orientation": "vertical",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "padding1@common.empty_panel": {
                    "size": [ "100%", 6 ]
                }
            },
            {
                "save_tab_info_label@common.tts_label_focus_wrapper": {
                    "$tts_label_panel": "realms_settings.automatic_tab_info_panel"
                }
            },
            {
                "padding2@common.empty_panel": {
                    "size": [ "100%", 8 ]
                }
            },
            {
                "stack_panel": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "size": [ "100%", "100%c" ],

                    "factory": {
                        "name": "automatic_saves_factory",
                        "control_name": "realms_settings.saves_info_accordian"
                    },
                    "$collection_binding_name": "automatic_saves_collection",
                    "collection_name": "automatic_saves_collection",
                    "bindings": [
                        {
                            "binding_name": "#automatic_saves_length",
                            "binding_name_override": "#collection_length"
                        }
                    ]
                }
            },
            {
                "padding3@common.empty_panel": {
                    "size": [ "100%", 6 ]
                }
            }
        ]
    },

    "options_icon": {
        "type": "image",
        "texture": "textures/ui/union",
        "size": [ 2, 8 ],
        "color": "$text_color"
    },

    //---------------------------------------------------------------------------
    // Saves Info Accordian
    //---------------------------------------------------------------------------

    "saves_info_accordian": {
        "type": "stack_panel",
        "orientation": "vertical",
        "size": [ "100%-4px", "100%c" ],
        "$ignore_checkbox|default": true,
        "$ignore_options_button|default": false,
        "$checkbox_pressed_button_name|default": "",
        "$dropdown_tts_toggle_on|default": "",
        "$dropdown_tts_toggle_off|default": "",
        "controls": [
            {
                "main_content_panel": {
                    "type": "stack_panel",
                    "orientation": "horizontal",
                    "size": [ "100%", 30 ],
                    "controls": [
                        {
                            "checkbox_button@common_buttons.dark_content_button": {
                                "ignored": "$ignore_checkbox",
                                "$pressed_button_name": "$checkbox_pressed_button_name",
                                "size": [ 29, "100%" ],
                                "$button_content": "realms_settings.saves_info_accordion_checkbox",
                                "$button_tts_header": "#save_checkbox_button_tts_header",
                                "tts_override_control_value": "#save_checkbox_button_tts_override",
                                "consume_hover_events": false,
                                "tts_name": "accessibility.checkbox.tts.title",
                                "bindings": [
                                    {
                                        "binding_type": "collection_details",
                                        "binding_collection_name": "$collection_binding_name"
                                    },
                                    {
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name",
                                        "binding_name": "#save_checkbox_button_tts_header"
                                    },
                                    {
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name",
                                        "binding_name": "#save_checkbox_button_tts_override"
                                    }
                                ]
                            }
                        },
                        {
                            "main_item_toggle@common_toggles.dark_ui_toggle": {
                                "size": [ "fill", "100%" ],
                                "$button_content_size": [ "100%", "100%" ],
                                "$button_type_panel": "realms_settings.main_item_content",

                                "$toggle_name": "save_item_toggle",
                                "$toggle_tts_name": "accessibility.dropdown.tts.title",
                                "$toggle_tts_toggle_on_text": "$dropdown_tts_toggle_on",
                                "$toggle_tts_toggle_off_text": "$dropdown_tts_toggle_off",

                                "bindings": [
                                    {
                                        "binding_type": "collection_details",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        },
                        {
                            "options_button@common_buttons.dark_content_button": {
                                "ignored": "$ignore_options_button",
                                "$pressed_button_name": "button.select_save_options",
                                "size": [ 29, "100%" ],
                                "$button_content": "realms_settings.options_icon",
                                "$button_tts_header": "realmsSettingsScreen.optionsTitle",
                                "bindings": [
                                    {
                                        "binding_type": "collection_details",
                                        "binding_collection_name": "$collection_binding_name"
                                    },
                                    {
                                        "binding_type": "collection",
                                        "binding_name": "#save_options_button_focus_id",
                                        "binding_name_override": "#focus_identifier",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "sub_content_panel": {
                    "type": "panel",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "saves_content@realms_settings.option_saves_info_label": {
                                "bindings": [
                                    {
                                        "binding_type": "collection_details",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_type": "view",
                            "source_control_name": "this_toggle",
                            "source_property_name": "#toggle_state",
                            "target_property_name": "#visible",
                            "resolve_sibling_scope": true
                        }
                    ]
                }
            }
        ]
    },

    "saves_info_accordion_checkbox": {
        "type": "panel",
        "size": [ "100%", "100%" ],

        "$unchecked_control": "realms_settings.checkbox_unchecked_state",
        "$checked_control": "realms_settings.checkbox_checked_state",
        "$unchecked_hover_control": "realms_settings.checkbox_unchecked_hover_state",
        "$checked_hover_control": "realms_settings.checkbox_checked_hover_state",

        "$save_accordion_checkbox_toggle_state": "#save_accordion_checkbox_toggle_state",

        "controls": [
            {
                "unchecked_control@$unchecked_control": {
                    "ignored": "$hover_state",
                    "bindings": [
                        {
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name",
                            "binding_name": "(not $save_accordion_checkbox_toggle_state)",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "checked_control@$checked_control": {
                    "ignored": "$hover_state",
                    "bindings": [
                        {
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name",
                            "binding_name": "$save_accordion_checkbox_toggle_state",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "unchecked_hover_control@$unchecked_hover_control": {
                    "ignored": "(not $hover_state)",
                    "bindings": [
                        {
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name",
                            "binding_name": "(not $save_accordion_checkbox_toggle_state)",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "checked__hover_control@$checked_hover_control": {
                    "ignored": "(not $hover_state)",
                    "bindings": [
                        {
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name",
                            "binding_name": "$save_accordion_checkbox_toggle_state",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            }
        ]
    },

    "main_item_content": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "size": [ "100%-12px", "100%-10px" ],
        "controls": [
            {
                "date_and_name": {
                    "type": "panel",
                    "size": [ "fill", "100%" ],
                    "controls": [
                        {
                            "date_saved_label": {
                                "type": "label",
                                "anchor_to": "top_left",
                                "anchor_from": "top_left",
                                "size": [ "100%", 10 ],
                                "text": "#save_date_text",
                                "color": "$text_color",
                                "bindings": [
                                    {
                                        "binding_name": "#save_date_text",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        },
                        {
                            "world_name_label": {
                                "type": "label",
                                "anchor_to": "bottom_left",
                                "anchor_from": "bottom_left",
                                "size": [ "100%", 10 ],
                                "text": "#save_world_name",
                                "color": "$dark_button_secondary_default_text_color",
                                "bindings": [
                                    {
                                        "binding_name": "#save_world_name",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "time_and_size": {
                    "type": "panel",
                    "size": [ "100%cm", "100%" ],
                    "controls": [
                        {
                            "save_data_time_label": {
                                "type": "label",
                                "anchor_to": "top_right",
                                "anchor_from": "top_right",
                                "size": [ "default", 10 ],
                                "text": "#save_time_text",
                                "color": "$dark_button_secondary_default_text_color",
                                "bindings": [
                                    {
                                        "binding_name": "#save_time_text",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        },
                        {
                            "save_data_size_label": {
                                "type": "label",
                                "anchor_to": "bottom_right",
                                "anchor_from": "bottom_right",
                                "size": [ "default", 10 ],
                                "text": "#save_data_size",
                                "color": "$dark_button_secondary_default_text_color",
                                "bindings": [
                                    {
                                        "binding_name": "#save_data_size",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "padding_left_down_icon@common.empty_panel": {
                    "size": [ 8, "100%" ]
                }
            },
            {
                "down_icon": {
                    "type": "panel",
                    "size": [ "100%c", "100%" ],
                    "controls": [
                        {
                            "options_icon": {
                                "type": "image",
                                "texture": "textures/ui/white_pixel_chevron_down",
                                "size": [ 7, 7 ],
                                "color": "$text_color"
                            }
                        }
                    ]
                }
            },
            {
                "padding_right_down_icon@common.empty_panel": {
                    "size": [ 8, "100%" ]
                }
            }
        ]
    },

    "option_saves_info_label@common.tts_label_focus_wrapper": {
        "$tts_label_panel": "realms_settings.saves_info_container"
    },

    "saves_info_container": {
        "type": "image",
        "texture": "textures/ui/text_label_box",
        "size": [ "100%", "100%c + 10px" ],
        "$used_fontsize|default": "normal",
        "$used_fonttype|default": "default",
        "controls": [
            {
                "saves_info_content@realms_settings.saves_info_content": {}
            }
        ]
    },

    "saves_info_content": {
        "type": "stack_panel",
        "orientation": "vertical",
        "size": [ "100% - 4px", "100%c" ],
        "offset": [ 2, 0 ],
        "controls": [
            {
                "version_panel@realms_settings.version_panel": {}
            },
            {
                "pack_header_panel@realms_settings.pack_header_panel": {
                    "bindings": [
                        {
                            "binding_name": "#has_packs",
                            "binding_name_override": "#visible",
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name"
                        }
                    ]
                }
            },
            {
                "world_packs_label": {
                    "type": "label",
                    "color": "$main_header_text_color",
                    "size": [ "100%", "default" ],
                    "layer": 1,
                    "text": "#world_pack_text",
                    "font_size": "$used_fontsize",
                    "font_type": "$used_fonttype",
                    "bindings": [
                        {
                            "binding_name": "#world_pack_text",
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name"
                        },
                        {
                            "binding_name": "#has_packs",
                            "binding_name_override": "#visible",
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name"
                        }
                    ]
                }
            }
        ]
    },

    "version_panel": {
        "type": "panel",
        "size": [ "100%", 10 ],
        "controls": [
            {
                "left_content": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "anchor_to": "left_middle",
                    "anchor_from": "left_middle",
                    "size": [ "fill", "100%" ],
                    "controls": [
                        {
                            "save_version_label": {
                                "type": "label",
                                "size": [ "default", "100%" ],
                                "color": "$main_header_text_color",
                                "layer": 1,
                                "text": "#save_version",
                                "font_size": "$used_fontsize",
                                "font_type": "$used_fonttype",
                                "bindings": [
                                    {
                                        "binding_name": "#save_version",
                                        "binding_type": "collection",
                                        "binding_collection_name": "$collection_binding_name"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    },

    "pack_header_panel": {
        "type": "panel",
        "size": [ "100%", 10 ],
        "controls": [
            {
                "left_content": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "anchor_to": "left_middle",
                    "anchor_from": "left_middle",
                    "size": [ "fill", "100%" ],
                    "controls": [
                        {
                            "packs_label": {
                                "type": "label",
                                "size": [ "default", "100%" ],
                                "color": "$main_header_text_color",
                                "layer": 1,
                                "text": "realmsSettingsScreen.packs",
                                "font_size": "$used_fontsize",
                                "font_type": "$used_fonttype"
                            }
                        }
                    ]
                }
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Branches Section
    //---------------------------------------------------------------------------
    "label_text": {
        "type": "label",
        "color": "$light_button_default_text_color",
        "text": "",
        "font_size": "normal",
        "anchor_to": "top_left",
        "anchor_from": "top_left",
        "layer": 2
    },

    "branch_grid_item_content": {
        "type": "stack_panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "orientation": "vertical",
        "size": [ "100%", 29 ],
        "offset": [ 5, 4 ],
        "controls": [
            {
                "branch_text@realms_settings.label_text": {
                    "text": "#branch_name",
                    "size": [ "100% - 8px", 10 ],
                    "color": "$text_color",
                    "bindings": [
                        {
                            "binding_name": "#branch_name",
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name"
                        }
                    ]
                }
            },
            {
                "commit_text@realms_settings.label_text": {
                    "text": "#commit_id",
                    "size": [ "100% - 8px", 10 ],
                    "color": "$text_color",
                    "bindings": [
                        {
                            "binding_name": "#commit_id",
                            "binding_type": "collection",
                            "binding_collection_name": "$collection_binding_name"
                        }
                    ]
                }
            }
        ]
    },

    "matching_item_button_content": {
        "type": "stack_panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "orientation": "vertical",
        "size": [ "100%", 29 ],
        "offset": [ 5, 4 ],
        "controls": [
            {
                "branch_text@label_text": {
                    "text": "#matching_branch_name",
                    "size": [ "100% - 8px", 10 ],
                    "color": "$text_color",
                    "bindings": [
                        {
                            "binding_name": "#matching_branch_name"
                        }
                    ]
                }
            },
            {
                "commit_text@label_text": {
                    "text": "#matching_commit_id",
                    "size": [ "100% - 8px", 10 ],
                    "color": "$text_color",
                    "bindings": [
                        {
                            "binding_name": "#matching_commit_id"
                        }
                    ]
                }
            }
        ]
    },

    "branch_item_template": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", 29 ],
        "controls": [
            {
                "branch_item_button@common_buttons.light_content_button": {
                    "$pressed_button_name": "select_realm_branch",
                    "size": [ "100%", 29 ],
                    "$button_content": "realms_settings.branch_grid_item_content",
                    "bindings": [
                        {
                            "binding_type": "collection_details",
                            "binding_collection_name": "$collection_binding_name"
                        }
                    ]
                }
            }
        ]
    },

    "branches_grid": {
        "type": "grid",
        "size": [ "100%", "default" ],
        "grid_item_template": "realms_settings.branch_item_template",
        "grid_dimension_binding": "#realms_branch_grid_dimension",
        "$collection_binding_name": "realms_branch_collection",
        "collection_name": "realms_branch_collection",
        "anchor_to": "top_left",
        "anchor_from": "top_left",
        "bindings": [
            {
                "binding_name": "#realms_branch_grid_dimension"
            }
        ]
    },

    "branch_set_panel": {
        "type": "stack_panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "orientation": "vertical",
        "size": "$branch_panel_size",
        "controls": [
            {
                "set_branch_id_label@realms_settings.label_text": {
                    "text": "#selected_branch_commit_id",
                    "color": "$main_header_text_color",
                    "size": [ "100% - 8px", 10 ],
                    "bindings": [
                        {
                            "binding_name": "#selected_branch_commit_id"
                        }
                    ]
                }
            }
        ]
    },

    "version_filter_text_box@common.text_edit_box": {
        "size": [ "100%", 25 ],
        "$text_box_name": "#version_filter_text_box",
        "max_length": 30
    },

    "branch_page_panel": {
        "type": "panel",
        "size": [ "100%", 20 ],
        "controls": [
            {
                "prev_button@settings_common.action_button": {
                    "$button_text": "realmsSettingsScreen.dev_prev_page_label",
                    "$pressed_button_name": "prev_page_button",
                    "anchor_from": "top_left",
                    "anchor_to": "top_left",
                    "size": [ 70, "100%" ],
                    "bindings": [
                        {
                            "binding_name": "#prev_button_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "page_text@realms_settings.label_text": {
                    "text": "#page_index_text",
                    "color": "$sub_header_text_color",
                    "anchor_from": "center",
                    "anchor_to": "center",
                    "size": [ "default", "50%" ],
                    "bindings": [
                        {
                            "binding_name": "#page_index_text"
                        }
                    ]
                }
            },
            {
                "next_button@settings_common.action_button": {
                    "$button_text": "realmsSettingsScreen.dev_next_page_label",
                    "$pressed_button_name": "next_page_button",
                    "anchor_from": "top_right",
                    "anchor_to": "top_right",
                    "size": [ 70, "100%" ],
                    "bindings": [
                        {
                            "binding_name": "#next_button_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            }
        ]
    },

    "branches_panel": {
        "type": "stack_panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "orientation": "vertical",
        "size": "$branch_panel_size",
        "controls": [
            {
                "branch_label@settings_common.selector_group_label": {
                    "offset": [ 2, 0 ],
                    "text": "realmsSettingsScreen.dev_branch_label",
                    "layer": 2
                }
            },
            {
                "spacing_gap_1": {
                    "type": "panel",
                    "size": [ "100%", 10 ]
                }
            },
            {
                "set_branch_version_label@label_text": {
                    "text": "realmsSettingsScreen.dev_current_version_label",
                    "color": "$main_header_text_color",
                    "size": [ "100% - 8px", 10 ]
                }
            },
            { "branch_set_panel@branch_set_panel": {} },
            {
                "spacing_gap_2": {
                    "type": "panel",
                    "size": [ "100%", 10 ]
                }
            },
            {
                "matching_version_label@settings_common.selector_group_label": {
                    "offset": [ 2, 0 ],
                    "text": "realmsSettingsScreen.dev_matching_version_label",
                    "layer": 2
                }
            },
            {
                "matching_item_button@common_buttons.light_content_button": {
                    "$pressed_button_name": "select_matching_realm_ref",
                    "size": [ "100%", 29 ],
                    "$button_content": "realms_settings.matching_item_button_content"
                }
            },
            {
                "spacing_gap_3": {
                    "type": "panel",
                    "size": [ "100%", 10 ]
                }
            },
            {
                "all_commits_label@settings_common.selector_group_label": {
                    "offset": [ 2, 0 ],
                    "text": "realmsSettingsScreen.dev_all_commits_label",
                    "layer": 2
                }
            },
            { "version_filter_text_box@version_filter_text_box": {} },
            { "branches_grid@branches_grid": {} },
            {
                "spacing_gap": {
                    "type": "panel",
                    "size": [ "100%", 10 ]
                }
            },
            { "branch_page_panel@branch_page_panel": {} }
        ]
    },

    "branch_section": {
        "type": "stack_panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "orientation": "vertical",
        "$branch_panel_size": [ "100% - 1px", "100%c" ],
        "size": [ "100%", "100%c" ],
        "controls": [
            { "branches_panel@branches_panel": {} }
        ]
    },

    // test content
    "test_content": {
        "type": "panel",
        "controls": [
            { "realms_allowlist_content_panel@realms_allowlist.realms_allowlist_content_panel": { "layer": 1 } },
            { "gamepad_helpers@realms_allowlist.gamepad_helpers": {} }
        ]
    },

    // Left side
    "selector_panel": {
        "type": "stack_panel",
        "orientation": "vertical",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", "100%c + 4px" ],
        "$default_selector_toggle_index": 1,
        "$world_toggle_index|default": 1,

        // Manage Realm Toggle Indexes //
        "$members_toggle_index|default": 2,
        "$saves_toggle_index|default": 3,
        "$subscription_toggle_index|default": 4,
        "$invite_links_toggle_index|default": 5,
        "$advanced_toggle_index|default": 6,

        // Edit World Toggle Indexes //
        "$dev_options_toggle_index|default": 1,

        "controls": [
            {
                "play_button@settings_common.action_button_dark_text": {
                    "variables": {
                        "requires": "$realm_no_world_edit",
                        "ignored": "$is_realm_slot",
                        "$button_text": "realmsSettingsScreen.playRealmButton",
                        "$pressed_button_name": "play_world_button",
                        "$default_button_texture": "textures/ui/button_borderless_light",
                        "$hover_button_texture": "textures/ui/button_borderless_lighthover",
                        "$pressed_button_texture": "textures/ui/button_borderless_lightpressed",
                        "bindings": [
                            {
                                "binding_name": "#play_button_visible",
                                "binding_name_override": "#visible"
                            }
                        ]
                    },
                    "size": [ "100%", "30px" ],
                    "default_focus_precedence": 1,
                    "$focus_override_up": "FOCUS_OVERRIDE_STOP",
                    "$button_text": "createWorldScreen.create",
                    "$pressed_button_name": "create_world_button",
                    "$default_button_texture": "textures/ui/realmsContent",
                    "$hover_button_texture": "textures/ui/realmsContentHover",
                    "$pressed_button_texture": "textures/ui/realmsContentPressed",
                    "bindings": [
                        {
                            "binding_name": "#create_button_visible",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "disabled_play_button@settings_common.action_button": {
                    "$button_text": "realmsSettingsScreen.playDisabledRealmButton",
                    "$pressed_button_name": "play_world_button",
                    "size": [ "100%", "30px" ],
                    "bindings": [
                        {
                            "binding_name": "#disabled_play_button_visible",
                            "binding_name_override": "#visible"
                        },
                        {
                            "binding_name": "#play_button_visible", // a hack: you cannot set "enabled":false directly on a ui control
                            "binding_name_override": "#enabled"
                        }
                    ]
                }
            },
            {
                "expired_play_button@settings_common.action_button": {
                    "$button_text": "realmsSettingsScreen.playExpiredRealmButton",
                    "$pressed_button_name": "play_world_button",
                    "size": [ "100%", "30px" ],
                    "bindings": [
                        {
                            "binding_name": "#is_realm_expired",
                            "binding_name_override": "#visible"
                        },
                        {
                            "binding_name": "#play_button_visible", // a hack: you cannot set "enabled":false directly on a ui control
                            "binding_name_override": "#enabled"
                        }
                    ]
                }
            },
            {
                "padding": {
                    "type": "panel",
                    "size": [ "100%", 6 ]
                }
            },
            {
                "selector_group_label@settings_common.selector_group_label": {
                    "$group_label_text|default": "realmsSettingsScreen.selectorSectionLabelRealm",
                    "variables": [
                        {
                            "requires": "$is_realm_slot",
                            "$group_label_text": "realmsSettingsScreen.worldSectionTitle"
                        }
                    ],
                    "text": "$group_label_text",
                    "offset": [ 2, 0 ],
                    "layer": 2
                }
            },
            {
                "world_button@settings_common.section_toggle_base": {
                    "variables": {
                        "requires": "$is_realm_slot",
                        "$button_text": "realmsSlotsScreen.gamesettings"
                    },
                    "$toggle_view_binding_name": "world_button_toggle",
                    "$toggle_group_forced_index": "$world_toggle_index",
                    "$glyph_texture": "textures/ui/world_glyph",
                    "$glyph_color_texture": "textures/ui/world_glyph_color",
                    "$glyph_size": [ 16, 17 ],
                    "layer": 1,
                    "$button_text": "realmsSettingsScreen.gameSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.gameSectionTitle"
                    }
                }
            },
            {
                "members_button@settings_common.section_toggle_base": {
                    "ignored": "$is_realm_slot",
                    "$toggle_view_binding_name": "members_button_toggle",
                    "$toggle_group_forced_index": "$members_toggle_index",
                    "$glyph_texture": "textures/ui/multiplayer_glyph",
                    "$glyph_color_texture": "textures/ui/multiplayer_glyph_color",
                    "$glyph_size": [ 22, 12 ],
                    "layer": 2,
                    "$button_text": "realmsSettingsScreen.membersSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.membersSectionTitle"
                    }
                }
            },
            {
                "saves_button@settings_common.section_toggle_base": {
                    "ignored": "$is_realm_slot",
                    "$toggle_view_binding_name": "saves_button_toggle",
                    "$toggle_group_forced_index": "$saves_toggle_index",
                    "$glyph_texture": "textures/ui/backup_outline",
                    "$glyph_color_texture": "textures/ui/backup_noline",
                    "$glyph_size": [ 23, 23 ],
                    "layer": 6,
                    "$button_text": "realmsSettingsScreen.savesSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.savesSectionTitle"
                    }
                }
            },
            {
                "subscription_button@settings_common.section_toggle_base": {
                    "ignored": "$is_realm_slot",
                    "$toggle_view_binding_name": "subscription_button_toggle",
                    "$toggle_group_forced_index": "$subscription_toggle_index",
                    "$glyph_texture": "textures/ui/subscription_glyph",
                    "$glyph_color_texture": "textures/ui/subscription_glyph_color",
                    "$glyph_size": [ 15, 13 ],
                    "layer": 3,
                    "$button_text": "realmsSettingsScreen.subscriptionSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.subscriptionSectionTitle"
                    },
                    "bindings": [
                        {
                          "binding_name": "#show_realms_subscription_tab",
                          "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "dev_options_button@settings_common.section_toggle_base": {
                    "ignored": "($non_config_realms_env or $realm_no_world_edit)",
                    "$toggle_view_binding_name": "dev_options_button_toggle",
                    "$toggle_group_forced_index": "$dev_options_toggle_index",
                    "$glyph_texture": "textures/ui/dev_glyph",
                    "$glyph_color_texture": "textures/ui/dev_glyph_color",
                    "$glyph_size": [ 14, 14 ],
                    "layer": 5,
                    "$button_text": "realmsSettingsScreen.devOptionsSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.devOptionsSectionTitle"
                    }
                }
            },
            {
                "invite_links_button@settings_common.section_toggle_base": {
                    "ignored": "$is_realm_slot",
                    "$toggle_view_binding_name": "invite_links_button_toggle",
                    "$toggle_group_forced_index": "$invite_links_toggle_index",
                    "$glyph_texture": "textures/ui/share_google_glyph",
                    "$glyph_color_texture": "textures/ui/share_google_glyph_color",
                    "$glyph_size": [ 14, 13 ],
                    "layer": 6,
                    "$button_text": "realmsSettingsScreen.inviteLinksSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.inviteLinksSectionTitle"
                    }
                }
            },
            {
                "advanced_button@settings_common.section_toggle_base": {
                    "ignored": "$is_realm_slot",
                    "$toggle_view_binding_name": "advanced_button_toggle",
                    "$toggle_group_forced_index": "$advanced_toggle_index",
                    "$glyph_texture": "textures/ui/advanced_glyph",
                    "$glyph_color_texture": "textures/ui/advanced_glyph_color",
                    "$glyph_size": [ 16, 16 ],
                    "layer": 6,
                    "$button_text": "realmsSettingsScreen.advancedSectionTitle",
                    "$toggle_property_bag": {
                        "#panel_title": "realmsSettingsScreen.advancedSectionTitle"
                    }
                }
            }
        ]
    },

    // right side
    "section_content_panels": {
        "type": "panel",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", "100%c" ],
        "controls": [
            {
                "world_section@realms_settings.generic_section_wrapper": {
                    "$section_button_name|default": "world_button_toggle",
                    "$section_content_name|default": "realms_world_section.panel_content"
                }
            },
            {
                "players_section@realms_settings.generic_section_wrapper": {
                    "ignored": "$is_realm_slot",
                    "$section_button_name|default": "members_button_toggle",
                    "$section_content_name|default": "realms_allowlist.friends_containing_panel",
                    "$friend_panel_size": [ "100%", "100%c" ]
                }
            },
            {
                "subscription_section@realms_settings.generic_section_wrapper": {
                    "ignored": "$is_realm_slot",
                    "$section_button_name|default": "subscription_button_toggle",
                    "$section_content_name|default": "realms_settings.subscriptions_section"
                }
            },
            {
                "invite_links_section@realms_settings.generic_section_wrapper": {
                    "ignored": "$is_realm_slot",
                    "$section_button_name|default": "invite_links_button_toggle",
                    "$section_content_name|default": "realms_settings.invite_links_section"
                }
            },
            {
                "advanced_section@realms_settings.generic_section_wrapper": {
                    "ignored": "$is_realm_slot",
                    "$section_button_name|default": "advanced_button_toggle",
                    "$section_content_name|default": "realms_settings.advanced_section"
                }
            },
            {
                "dev_options_section@realms_settings.generic_section_wrapper": {
                    "ignored": "($non_config_realms_env or $realm_no_world_edit)",
                    "$section_button_name|default": "dev_options_button_toggle",
                    "$section_content_name|default": "branch_section"
                }
            },
            {
                "saves_section@realms_settings.generic_section_wrapper": {
                    "ignored": "$is_realm_slot",
                    "$section_button_name|default": "saves_button_toggle",
                    "$section_content_name|default": "realms_settings.saves_section"
                }
            }
        ]
    },

    //--------------------------------------------------------------------------------
    // Options Dialog Popup
    //--------------------------------------------------------------------------------
    "popup_dialog__save_options@popup_dialog.form_fit_modal_dialog_popup": {
        "$modal_title": "realmsSettingsScreen.optionsTitle",
        "$popup_dialog_escape_button_name": "saves_modal_escape",
        "$no_close_button": false,
        "$modal_contents": "realms_settings.save_options_popup_content",
        "$modal_contents_padding": [ 6, 6 ],
        "$screen_background_alpha": 0,
        "$fill_alpha": 1,
        "button_mappings": [
            {
                "from_button_id": "button.menu_up",
                "to_button_id": "button.menu_up",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_down",
                "to_button_id": "button.menu_down",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_left",
                "to_button_id": "button.menu_left",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_right",
                "to_button_id": "button.menu_right",
                "mapping_type": "global",
                "scope": "view"
            },
            {
                "from_button_id": "button.menu_cancel",
                "to_button_id": "$popup_dialog_escape_button_name",
                "mapping_type": "global"
            }
        ]
    },

    "save_options_popup_content": {
        "type": "stack_panel",
        "orientation": "vertical",
        "size": [ 282, "100%c" ],
        "controls": [
            {
                "restore_button@common_buttons.light_text_button": {
                    "size": [ "100%", 24 ],
                    "$pressed_button_name": "button.restore_save",
                    "$button_text": "realmsSettingsScreen.restoreSave"
                }
            },
            {
                "spacing_1": {
                    "type": "panel",
                    "size": [ "100%", 4 ]
                }
            },
            {
                "download_button@common_buttons.light_text_button": {
                    "size": [ "100%", 24 ],
                    "$pressed_button_name": "button.download_save",
                    "$button_text": "realmsSettingsScreen.downloadSave"
                }
            },
            {
                "spacing_2": {
                    "type": "panel",
                    "size": [ "100%", 4 ]
                }
            },
            {
                "save_button_container": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "save_button@common_buttons.light_text_button": {
                                "size": [ "100%", 24 ],
                                "$pressed_button_name": "button.save_to_storage",
                                "$button_text": "#save_to_realm_storage",
                                "$button_text_binding_type": "global"
                            }
                        },
                        {
                            "spacing_3": {
                                "type": "panel",
                                "size": [ "100%", 4 ]
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "#is_automatic_saves",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            },
            {
                "delete_button_container": {
                    "type": "stack_panel",
                    "orientation": "vertical",
                    "size": [ "100%", "100%c" ],
                    "controls": [
                        {
                            "delete_button@common_buttons.light_text_button": {
                                "size": [ "100%", 24 ],
                                "$pressed_button_name": "button.delete_save",
                                "$button_text": "realmsSettingsScreen.deleteSave"
                            }
                        }
                    ],
                    "bindings": [
                        {
                            "binding_name": "(not #is_automatic_saves)",
                            "binding_name_override": "#visible"
                        }
                    ]
                }
            }
        ]
    },

    //---------------------------------------------------------------------------
    // Standalone Settings Screens (No Selector Area)
    //---------------------------------------------------------------------------

    "standalone_dialog_title": {
        "type": "stack_panel",
        "orientation": "horizontal",
        "anchor_from": "top_left",
        "anchor_to": "top_left",
        "size": [ "100%", 15 ],
        "offset": [ 0, 3.5 ],
        "controls": [
            {
                "left_padding": {
                    "type": "panel",
                    "size": [ 18, "100%" ]
                }
            },
            {
                "dialog_title_label": {
                    "type": "label",
                    "size": [ "40% - 3px", "100%" ],
                    "anchor_from": "top_left",
                    "anchor_to": "top_left",
                    "layer": 2,
                    "color": "$title_text_color",
                    "$dialog_text|default": "dialog title label text",
                    "text": "$dialog_text"
                }
            },
            {
                "right_padding": {
                    "type": "panel",
                    "size": [ "fill", "100%" ]
                }
            }
        ]
    },

    "standalone_dialog_content": {
        "type": "panel",
        "anchor_from": "top_middle",
        "anchor_to": "top_middle",
        "controls": [
            { "dialog_title@realms_settings.standalone_dialog_title": {} },
            { "content_area@realms_settings.standalone_content_area": {} }
        ]
    },

    "standalone_content_area": {
        "type": "panel",
        "offset": [ "-1px", "21px" ],
        "size": [ "100% - 8px", "100% - 19px" ],
        "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",
        "ttsSectionContainer": true,

        "controls": [
            {
                "control": {
                    "type": "stack_panel",
                    "size": [ "100%", "100%" ],
                    "anchor_from": "top_right",
                    "anchor_to": "top_right",
                    "controls": [
                        {
                            "scrolling_panel@common.scrolling_panel": {
                                "size": [ "100%", "fill" ],
                                "$scrolling_content": "$section_content_panels",
                                "$show_background": false,
                                "$scroll_size": [ "5px", "100% - 4px" ],
                                "$scroll_bar_left_padding_size": [ 1, 0 ]
                            }
                        }
                    ]
                }
            }
        ]
    },

    "realms_settings_screen_base_no_selector_area@settings_common.dynamic_dialog_screen": {
        "$section_content_panels|default": "common.empty_panel",
        "$section_header_panels|default": "common.empty_panel",
        "$section_footer_panels|default": "common.empty_panel",
        "$dialog_content": "realms_settings.standalone_dialog_content",
        "$realm_no_world_edit|default": true,
        "$is_realm_slot|default": false
    },

    "screen_realm_hub_manage_members@realms_settings.realms_settings_screen_base_no_selector_area": {
        "$section_content_panels": "realms_allowlist.friends_containing_panel",
        "$friends_containing_panel_size": [ "100% - 4px", "100%c" ],
        "$friend_panel_size": [ "100%", "100%c" ],
        "$dialog_text": "realmsSettingsScreen.manageMembers.title",
        "$show_invite_links_button": true
    },

    "screen_realm_hub_invite_links@realms_settings.realms_settings_screen_base_no_selector_area": {
        "$section_content_panels": "realms_settings.invite_links_section",
        "$panel_size": [ "100% - 4px", "100%c" ],
        "$dialog_text": "realmsSettingsScreen.inviteLinksSectionTitle"
    },

    "screen_realm_hub_saves@realms_settings.realms_settings_screen_base_no_selector_area": {
        "$section_content_panels": "realms_settings.saves_section",
        "$panel_size": [ "100% - 4px", "100%c" ],
        "$panel_offset": [ 2, 0 ],
        "$dialog_text": "realmsSettingsScreen.savesSectionTitle"
    }
}
