<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.RadioButton?>
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<?import org.cryptomator.ui.controls.FontAwesome5Spinner?>
<VBox xmlns:fx="http://javafx.com/fxml"
	  xmlns="http://javafx.com/javafx"
	  fx:controller="org.cryptomator.ui.addvaultwizard.CreateNewVaultPasswordController"
	  prefWidth="450"
	  prefHeight="450"
	  spacing="12"
	  alignment="CENTER_LEFT">
	<fx:define>
		<ToggleGroup fx:id="recoveryKeyChoice"/>
	</fx:define>
	<padding>
		<Insets topRightBottomLeft="24"/>
	</padding>
	<children>
		<fx:include fx:id="newPasswordScene" source="new_password.fxml"/>

		<Region VBox.vgrow="ALWAYS"/>

		<VBox spacing="6">
			<Label text="%addvaultwizard.new.generateRecoveryKeyChoice" wrapText="true"/>
			<RadioButton fx:id="showRecoveryKey" toggleGroup="${recoveryKeyChoice}" text="%addvaultwizard.new.generateRecoveryKeyChoice.yes"/>
			<RadioButton fx:id="skipRecoveryKey" toggleGroup="${recoveryKeyChoice}" text="%addvaultwizard.new.generateRecoveryKeyChoice.no"/>
		</VBox>

		<Region VBox.vgrow="ALWAYS"/>

		<ButtonBar buttonMinWidth="120" buttonOrder="B+X">
			<buttons>
				<Button text="%generic.button.back" ButtonBar.buttonData="BACK_PREVIOUS" onAction="#back"/>
				<Button text="%addvaultwizard.new.createVaultBtn" ButtonBar.buttonData="NEXT_FORWARD" onAction="#next" defaultButton="true" disable="${!controller.readyToCreateVault}"
						contentDisplay="${controller.createVaultButtonState}">
					<graphic>
						<FontAwesome5Spinner fx:id="spinner" glyphSize="12" />
					</graphic>
				</Button>
			</buttons>
		</ButtonBar>
	</children>
</VBox>
