#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HyperTwistSimulation/HyperTwistSimulationTypes.h"
#include "HyperTwistTraining/HyperTwistTrainingMagic120CellLibrary.h"
#include "HyperTwistTraining/HyperTwistTrainingMagicCube5DLibrary.h"
#include "HyperTwistTrainingHigherDimensionalRuntimeLibrary.generated.h"

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeActivationProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Summary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeStrategyId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeAnchorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	EHyperTwistPuzzleFamily PuzzleFamily = EHyperTwistPuzzleFamily::Other;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 Dimension = 4;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DefinitionVersion = TEXT("2026.06");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NotationProfile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<int32> SizeVector;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Variant;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresExternalProcess = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryRuntimeProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryPersistenceBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryViewProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryAttributionBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> DefaultSelectionTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> RequiredPackageIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> CapabilityTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> RequiredNoticeActions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ExplicitExclusions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistTrainingSourceAttribution SourceAttribution;

	bool IsStructurallyValid() const
	{
		return !ActivationProfileId.IsEmpty()
			&& !Title.IsEmpty()
			&& !PuzzleId.IsEmpty()
			&& !RuntimeModeId.IsEmpty()
			&& !RuntimeStrategyId.IsEmpty()
			&& !RuntimeAnchorId.IsEmpty()
			&& Dimension > 0
			&& !DefinitionVersion.IsEmpty()
			&& !NotationProfile.IsEmpty()
			&& !PrimaryRuntimeProfileContractId.IsEmpty()
			&& !PrimaryPersistenceBoundaryId.IsEmpty()
			&& !PrimaryViewProfileContractId.IsEmpty()
			&& !PrimaryAttributionBoundaryId.IsEmpty()
			&& RequiredPackageIds.Num() > 0
			&& SourceAttribution.IsStructurallyValid();
	}

	bool MatchesActivationProfileId(const FString& CandidateId) const
	{
		return !CandidateId.IsEmpty()
			&& CandidateId.Equals(ActivationProfileId, ESearchCase::IgnoreCase);
	}

	bool MatchesPuzzleId(const FString& CandidatePuzzleId) const
	{
		return !CandidatePuzzleId.IsEmpty()
			&& CandidatePuzzleId.Equals(PuzzleId, ESearchCase::IgnoreCase);
	}

	bool MatchesRuntimeModeId(const FString& CandidateRuntimeModeId) const
	{
		return !CandidateRuntimeModeId.IsEmpty()
			&& CandidateRuntimeModeId.Equals(RuntimeModeId, ESearchCase::IgnoreCase);
	}

	FHyperTwistPuzzleDefinitionRef ToDefinitionRef() const
	{
		FHyperTwistPuzzleDefinitionRef Definition;
		Definition.PuzzleId = PuzzleId;
		Definition.PuzzleFamily = PuzzleFamily;
		Definition.Dimension = Dimension;
		Definition.DefinitionVersion = DefinitionVersion;
		Definition.NotationProfile = NotationProfile;
		Definition.SizeVector = SizeVector;
		Definition.Variant = Variant;
		return Definition;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeActivationCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogId = TEXT("phase6c/higher-dimensional-runtime-activation");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogVersion = TEXT("2026.06.13");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingHigherDimensionalRuntimeActivationProfile> Profiles;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeHostSurface
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Summary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreferredHostMapPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreferredHostMapRouteId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreferredHostMapLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EffectiveHostMapPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EffectiveHostMapRouteId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EffectiveHostMapLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bDedicatedFamilyHostMapAuthored = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesSharedTrainingMapFallback = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> HostTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistTrainingSourceAttribution SourceAttribution;

	bool IsStructurallyValid() const
	{
		return !HostSurfaceId.IsEmpty()
			&& !ActivationProfileId.IsEmpty()
			&& !Title.IsEmpty()
			&& !Summary.IsEmpty()
			&& !PreferredHostMapPath.IsEmpty()
			&& !PreferredHostMapRouteId.IsEmpty()
			&& !PreferredHostMapLabel.IsEmpty()
			&& !EffectiveHostMapPath.IsEmpty()
			&& !EffectiveHostMapRouteId.IsEmpty()
			&& !EffectiveHostMapLabel.IsEmpty()
			&& SourceAttribution.IsStructurallyValid();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeHostCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogId = TEXT("phase6c/higher-dimensional-runtime-host");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogVersion = TEXT("2026.06.17");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingHigherDimensionalRuntimeHostSurface> HostSurfaces;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeLaunchSurface
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LaunchSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Summary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapRouteId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesSharedTrainingMapFallback = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DeckId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SeedCaseId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SeedPromptLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SurfaceKind = TEXT("generated-mode");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SurfaceLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString GeneratorType;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryPersistenceBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> PersistenceSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> InteractionSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ViewSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> LaunchTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> RequiredNoticeActions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingImportedRuntimeSelector> Selectors;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingImportedRuntimeSelectorChoice> DefaultSelectorChoices;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistTrainingSourceAttribution SourceAttribution;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeLaunchCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogId = TEXT("phase6c/higher-dimensional-runtime-launch");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogVersion = TEXT("2026.06.17");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingHigherDimensionalRuntimeLaunchSurface> LaunchSurfaces;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeViewContextSurface
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ViewContextSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LaunchSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Summary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapRouteId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesSharedTrainingMapFallback = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryViewProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ProjectionSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ContextSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> FocusSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ViewTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingImportedRuntimeSelector> Selectors;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingImportedRuntimeSelectorChoice> DefaultSelectorChoices;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistTrainingSourceAttribution SourceAttribution;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeViewContextCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogId = TEXT("phase6c/higher-dimensional-runtime-view-context");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogVersion = TEXT("2026.06.18");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingHigherDimensionalRuntimeViewContextSurface> ViewContextSurfaces;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeSessionSurface
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LaunchSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ViewContextSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Summary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapRouteId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesSharedTrainingMapFallback = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryPersistenceBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryViewProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> PersistenceSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> InteractionSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ViewSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SessionTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingImportedRuntimeSelector> Selectors;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingImportedRuntimeSelectorChoice> DefaultSelectorChoices;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistTrainingSourceAttribution SourceAttribution;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalRuntimeSessionCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogId = TEXT("phase6c/higher-dimensional-runtime-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogVersion = TEXT("2026.06.18");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingHigherDimensionalRuntimeSessionSurface> SessionSurfaces;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalInteractiveSceneSurface
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SceneSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LaunchSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ViewContextSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Summary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapRouteId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HostMapLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesSharedTrainingMapFallback = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryPersistenceBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryViewProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StateSemanticsId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesPlaceholderStateEnvelope = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSimulationSceneContext SceneContext;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> InteractionSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ViewSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SceneTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistTrainingSourceAttribution SourceAttribution;

	bool IsStructurallyValid() const
	{
		return !SceneSurfaceId.IsEmpty()
			&& !SessionSurfaceId.IsEmpty()
			&& !ActivationProfileId.IsEmpty()
			&& !HostSurfaceId.IsEmpty()
			&& !LaunchSurfaceId.IsEmpty()
			&& !ViewContextSurfaceId.IsEmpty()
			&& !Title.IsEmpty()
			&& !Summary.IsEmpty()
			&& !HostMapPath.IsEmpty()
			&& !HostMapRouteId.IsEmpty()
			&& !HostMapLabel.IsEmpty()
			&& !RuntimeModeId.IsEmpty()
			&& !PrimaryPersistenceBoundaryId.IsEmpty()
			&& !PrimaryViewProfileContractId.IsEmpty()
			&& !StateSemanticsId.IsEmpty()
			&& SceneContext.IsStructurallyValid()
			&& SourceAttribution.IsStructurallyValid();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingHigherDimensionalInteractiveSceneCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogId = TEXT("phase6c/higher-dimensional-interactive-scene");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CatalogVersion = TEXT("2026.06.18");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistTrainingHigherDimensionalInteractiveSceneSurface> SceneSurfaces;

	bool IsStructurallyValid() const;
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingMagic120CellInteractiveSceneStateEnvelope
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EnvelopeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SchemaVersion = TEXT("phase6c/magic120cell-interactive-scene-state/v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PersistenceBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ViewProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProjectionProfile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ProjectionDepth = 4.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleTypeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SymmetryPresetId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VisibilityPresetId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FocusPresetId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PersistenceFormatId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TwistHistoryFormatId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ViewRotationPolicyId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> VisibleGroupIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> PersistenceSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSolved = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bScrambled = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCenterCellPinned = true;

	bool IsStructurallyValid() const
	{
		return !EnvelopeId.IsEmpty()
			&& !SchemaVersion.IsEmpty()
			&& !SessionSurfaceId.IsEmpty()
			&& !ActivationProfileId.IsEmpty()
			&& !PuzzleId.IsEmpty()
			&& !RuntimeModeId.IsEmpty()
			&& !PersistenceBoundaryId.IsEmpty()
			&& !ViewProfileContractId.IsEmpty()
			&& !ProjectionProfile.IsEmpty()
			&& ProjectionDepth > 0.0f
			&& !PuzzleTypeModeId.IsEmpty()
			&& !SymmetryPresetId.IsEmpty()
			&& !VisibilityPresetId.IsEmpty()
			&& !FocusPresetId.IsEmpty()
			&& !PersistenceFormatId.IsEmpty()
			&& !TwistHistoryFormatId.IsEmpty()
			&& !ViewRotationPolicyId.IsEmpty()
			&& VisibleGroupIds.Num() > 0
			&& PersistenceSurfaceTags.Num() > 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistTrainingMagicCube5DInteractiveSceneStateEnvelope
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EnvelopeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SchemaVersion = TEXT("phase6c/magiccube5d-interactive-scene-state/v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionSurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActivationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RuntimeModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PersistenceBoundaryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ViewProfileContractId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProjectionProfile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ProjectionDepth = 5.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PuzzleOrder = 3;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StereoModeId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VisibilityPresetId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FocusPresetId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AccentProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PersistenceFormatId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TwistHistoryFormatId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MacroFormatId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> VisibleFaceIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SolvedProgressSurfaceTags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSolved = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bScrambled = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStereoEnabled = false;

	bool IsStructurallyValid() const
	{
		return !EnvelopeId.IsEmpty()
			&& !SchemaVersion.IsEmpty()
			&& !SessionSurfaceId.IsEmpty()
			&& !ActivationProfileId.IsEmpty()
			&& !PuzzleId.IsEmpty()
			&& !RuntimeModeId.IsEmpty()
			&& !PersistenceBoundaryId.IsEmpty()
			&& !ViewProfileContractId.IsEmpty()
			&& !ProjectionProfile.IsEmpty()
			&& ProjectionDepth > 0.0f
			&& PuzzleOrder > 0
			&& !StereoModeId.IsEmpty()
			&& !VisibilityPresetId.IsEmpty()
			&& !FocusPresetId.IsEmpty()
			&& !AccentProfileId.IsEmpty()
			&& !PersistenceFormatId.IsEmpty()
			&& !TwistHistoryFormatId.IsEmpty()
			&& !MacroFormatId.IsEmpty()
			&& VisibleFaceIds.Num() > 0
			&& SolvedProgressSurfaceTags.Num() > 0;
	}
};

UCLASS()
class UNREALHYPERTWIST_API UHyperTwistTrainingHigherDimensionalRuntimeLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|HigherDimensional")
	static FHyperTwistTrainingHigherDimensionalRuntimeActivationCatalog
	BuildBundledHigherDimensionalRuntimeActivationCatalog();

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeActivationProfileById(
		const FHyperTwistTrainingHigherDimensionalRuntimeActivationCatalog& Catalog,
		const FString& ActivationProfileId,
		FHyperTwistTrainingHigherDimensionalRuntimeActivationProfile& OutProfile
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeActivationProfileByPuzzleId(
		const FHyperTwistTrainingHigherDimensionalRuntimeActivationCatalog& Catalog,
		const FString& PuzzleId,
		FHyperTwistTrainingHigherDimensionalRuntimeActivationProfile& OutProfile
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeActivationProfileByRuntimeModeId(
		const FHyperTwistTrainingHigherDimensionalRuntimeActivationCatalog& Catalog,
		const FString& RuntimeModeId,
		FHyperTwistTrainingHigherDimensionalRuntimeActivationProfile& OutProfile
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryResolvePuzzleDefinition(
		const FHyperTwistTrainingHigherDimensionalRuntimeActivationCatalog& Catalog,
		const FString& ActivationProfileIdOrPuzzleId,
		FHyperTwistPuzzleDefinitionRef& OutDefinition
	);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|HigherDimensional")
	static FHyperTwistTrainingHigherDimensionalRuntimeHostCatalog
	BuildBundledHigherDimensionalRuntimeHostCatalog();

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeHostSurfaceByActivationProfileId(
		const FHyperTwistTrainingHigherDimensionalRuntimeHostCatalog& Catalog,
		const FString& ActivationProfileId,
		FHyperTwistTrainingHigherDimensionalRuntimeHostSurface& OutHostSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeHostSurfaceByPuzzleId(
		const FHyperTwistTrainingHigherDimensionalRuntimeHostCatalog& Catalog,
		const FString& PuzzleId,
		FHyperTwistTrainingHigherDimensionalRuntimeHostSurface& OutHostSurface
	);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|HigherDimensional")
	static FHyperTwistTrainingHigherDimensionalRuntimeLaunchCatalog
	BuildBundledHigherDimensionalRuntimeLaunchCatalog();

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeLaunchSurfaceByActivationProfileId(
		const FHyperTwistTrainingHigherDimensionalRuntimeLaunchCatalog& Catalog,
		const FString& ActivationProfileId,
		FHyperTwistTrainingHigherDimensionalRuntimeLaunchSurface& OutLaunchSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeLaunchSurfaceByPuzzleId(
		const FHyperTwistTrainingHigherDimensionalRuntimeLaunchCatalog& Catalog,
		const FString& PuzzleId,
		FHyperTwistTrainingHigherDimensionalRuntimeLaunchSurface& OutLaunchSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryBuildTrainingDeckFromRuntimeLaunchSurface(
		const FHyperTwistTrainingHigherDimensionalRuntimeLaunchSurface& LaunchSurface,
		FHyperTwistTrainingDeck& OutDeck
	);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|HigherDimensional")
	static FHyperTwistTrainingHigherDimensionalRuntimeViewContextCatalog
	BuildBundledHigherDimensionalRuntimeViewContextCatalog();

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeViewContextSurfaceByActivationProfileId(
		const FHyperTwistTrainingHigherDimensionalRuntimeViewContextCatalog& Catalog,
		const FString& ActivationProfileId,
		FHyperTwistTrainingHigherDimensionalRuntimeViewContextSurface& OutViewContextSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeViewContextSurfaceByPuzzleId(
		const FHyperTwistTrainingHigherDimensionalRuntimeViewContextCatalog& Catalog,
		const FString& PuzzleId,
		FHyperTwistTrainingHigherDimensionalRuntimeViewContextSurface& OutViewContextSurface
	);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|HigherDimensional")
	static FHyperTwistTrainingHigherDimensionalRuntimeSessionCatalog
	BuildBundledHigherDimensionalRuntimeSessionCatalog();

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeSessionSurfaceByActivationProfileId(
		const FHyperTwistTrainingHigherDimensionalRuntimeSessionCatalog& Catalog,
		const FString& ActivationProfileId,
		FHyperTwistTrainingHigherDimensionalRuntimeSessionSurface& OutSessionSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetRuntimeSessionSurfaceByPuzzleId(
		const FHyperTwistTrainingHigherDimensionalRuntimeSessionCatalog& Catalog,
		const FString& PuzzleId,
		FHyperTwistTrainingHigherDimensionalRuntimeSessionSurface& OutSessionSurface
	);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|HigherDimensional")
	static FHyperTwistTrainingHigherDimensionalInteractiveSceneCatalog
	BuildBundledHigherDimensionalInteractiveSceneCatalog();

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetInteractiveSceneSurfaceBySessionSurfaceId(
		const FHyperTwistTrainingHigherDimensionalInteractiveSceneCatalog& Catalog,
		const FString& SessionSurfaceId,
		FHyperTwistTrainingHigherDimensionalInteractiveSceneSurface& OutSceneSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetInteractiveSceneSurfaceByActivationProfileId(
		const FHyperTwistTrainingHigherDimensionalInteractiveSceneCatalog& Catalog,
		const FString& ActivationProfileId,
		FHyperTwistTrainingHigherDimensionalInteractiveSceneSurface& OutSceneSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryGetInteractiveSceneSurfaceByPuzzleId(
		const FHyperTwistTrainingHigherDimensionalInteractiveSceneCatalog& Catalog,
		const FString& PuzzleId,
		FHyperTwistTrainingHigherDimensionalInteractiveSceneSurface& OutSceneSurface
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryDecodeMagic120CellInteractiveSceneStateEnvelope(
		const FHyperTwistSimulationSceneContext& SceneContext,
		FHyperTwistTrainingMagic120CellInteractiveSceneStateEnvelope& OutEnvelope
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|HigherDimensional")
	static bool TryDecodeMagicCube5DInteractiveSceneStateEnvelope(
		const FHyperTwistSimulationSceneContext& SceneContext,
		FHyperTwistTrainingMagicCube5DInteractiveSceneStateEnvelope& OutEnvelope
	);
};
