Option Strict On
Option Explicit On

Namespace Nexamas.UI.Components

    ''' <summary>
    ''' Friend-only readiness evidence for MASAppLayout. It records that the control
    ''' is a premium responsive app-layout visual surface with layout snapshot/restore
    ''' evidence, while router, PageHost, child-content hosting, native shell, and
    ''' external storage ownership remain outside this control.
    ''' </summary>
    Friend NotInheritable Class MASAppLayoutReadinessManifest
        Friend Sub New(status As MASAppLayoutReadinessStatus,
                       hasOfficialSurface As Boolean,
                       hasResponsiveBreakpoints As Boolean,
                       hasRtlAwareGeometry As Boolean,
                       hasNoRouterPath As Boolean,
                       hasNoPageHostOwnershipPath As Boolean,
                       hasRouteOwnershipBoundaryPath As Boolean,
                       hasNoChildHostingPath As Boolean,
                       hasChildSlotHostingContractPath As Boolean,
                       hasNoPersistencePath As Boolean,
                       hasLayoutSnapshotPersistencePath As Boolean,
                       hasResponsiveShellHostAdoptionPath As Boolean,
                       hasRealHostAdoptionSamplePath As Boolean,
                       hasNoNativeShellPath As Boolean,
                       hasMouseFocusRingSuppressed As Boolean)
            Me.Status = status
            Me.HasOfficialSurface = hasOfficialSurface
            Me.HasResponsiveBreakpoints = hasResponsiveBreakpoints
            Me.HasRtlAwareGeometry = hasRtlAwareGeometry
            Me.HasNoRouterPath = hasNoRouterPath
            Me.HasNoPageHostOwnershipPath = hasNoPageHostOwnershipPath
            Me.HasRouteOwnershipBoundaryPath = hasRouteOwnershipBoundaryPath
            Me.HasNoChildHostingPath = hasNoChildHostingPath
            Me.HasChildSlotHostingContractPath = hasChildSlotHostingContractPath
            Me.HasNoPersistencePath = hasNoPersistencePath
            Me.HasLayoutSnapshotPersistencePath = hasLayoutSnapshotPersistencePath
            Me.HasResponsiveShellHostAdoptionPath = hasResponsiveShellHostAdoptionPath
            Me.HasRealHostAdoptionSamplePath = hasRealHostAdoptionSamplePath
            Me.HasNoNativeShellPath = hasNoNativeShellPath
            Me.HasMouseFocusRingSuppressed = hasMouseFocusRingSuppressed
        End Sub

        Friend ReadOnly Property Status As MASAppLayoutReadinessStatus
        Friend ReadOnly Property HasOfficialSurface As Boolean
        Friend ReadOnly Property HasResponsiveBreakpoints As Boolean
        Friend ReadOnly Property HasRtlAwareGeometry As Boolean
        Friend ReadOnly Property HasNoRouterPath As Boolean
        Friend ReadOnly Property HasNoPageHostOwnershipPath As Boolean
        Friend ReadOnly Property HasRouteOwnershipBoundaryPath As Boolean
        Friend ReadOnly Property HasNoChildHostingPath As Boolean
        Friend ReadOnly Property HasChildSlotHostingContractPath As Boolean
        Friend ReadOnly Property HasNoPersistencePath As Boolean
        Friend ReadOnly Property HasLayoutSnapshotPersistencePath As Boolean
        Friend ReadOnly Property HasResponsiveShellHostAdoptionPath As Boolean
        Friend ReadOnly Property HasRealHostAdoptionSamplePath As Boolean
        Friend ReadOnly Property HasNoNativeShellPath As Boolean
        Friend ReadOnly Property HasMouseFocusRingSuppressed As Boolean

        Friend ReadOnly Property CommercialReadinessFamily As String
            Get
                Return "ApplicationLayoutControls"
            End Get
        End Property

        Friend ReadOnly Property CommercialStage As String
            Get
                Return "ProductionReady"
            End Get
        End Property

        Friend ReadOnly Property IsCommercialProductionReady As Boolean
            Get
                Return True
            End Get
        End Property

        Friend ReadOnly Property CommercialReadinessNote As String
            Get
                Return "ProductionReady after targeted AppLayout promotion: visual slot layout snapshot/restore, Friend-only child-slot lifecycle proof, route/page ownership boundary closure, responsive shell host-adoption proof, real host-adoption sample evidence, benchmark baseline/threshold policy, release-freeze evidence, and final promotion closure are all governed."
            End Get
        End Property

        Friend Shared Function CreateDefault() As MASAppLayoutReadinessManifest
            Dim officialSurface As Boolean = True
            Dim responsiveBreakpoints As Boolean = True
            Dim rtlGeometry As Boolean = True
            Dim noRouter As Boolean = MASAppLayoutPolicy.HasNoRouterPath()
            Dim noPageHost As Boolean = MASAppLayoutPolicy.HasNoPageHostOwnershipPath()
            Dim routeBoundary As Boolean = MASAppLayoutPolicy.HasRouteOwnershipBoundaryPath()
            Dim noChildHost As Boolean = MASAppLayoutPolicy.HasNoChildHostingPath()
            Dim childSlotHost As Boolean = MASAppLayoutPolicy.HasChildSlotHostingContractPath()
            Dim noPersistence As Boolean = MASAppLayoutPolicy.HasNoPersistencePath()
            Dim hasSnapshot As Boolean = MASAppLayoutPolicy.HasLayoutSnapshotPersistencePath()
            Dim responsiveHostAdoption As Boolean = MASAppLayoutPolicy.HasResponsiveShellHostAdoptionPath()
            Dim realHostAdoptionSample As Boolean = MASAppLayoutPolicy.HasRealHostAdoptionSamplePath()
            Dim noNativeShell As Boolean = MASAppLayoutPolicy.HasNoNativeShellPath()
            Dim focusRingSuppressed As Boolean = MASAppLayoutPolicy.HasMouseFocusRingSuppressed()
            Dim status As MASAppLayoutReadinessStatus = MASAppLayoutReadinessStatus.Ready

            If Not officialSurface OrElse Not responsiveBreakpoints OrElse Not rtlGeometry OrElse Not hasSnapshot OrElse Not childSlotHost OrElse Not routeBoundary OrElse Not responsiveHostAdoption OrElse Not realHostAdoptionSample Then status = MASAppLayoutReadinessStatus.IncompleteEvidence
            If Not noRouter Then status = MASAppLayoutReadinessStatus.BlockedByRouterLeak
            If Not noPageHost Then status = MASAppLayoutReadinessStatus.BlockedByPageHostOwnershipLeak
            If Not noChildHost Then status = MASAppLayoutReadinessStatus.BlockedByChildHostingLeak
            If Not noPersistence Then status = MASAppLayoutReadinessStatus.BlockedByPersistenceLeak
            If Not noNativeShell Then status = MASAppLayoutReadinessStatus.BlockedByNativeShellLeak
            If Not focusRingSuppressed Then status = MASAppLayoutReadinessStatus.BlockedByMouseFocusRingLeak

            Return New MASAppLayoutReadinessManifest(
                status,
                officialSurface,
                responsiveBreakpoints,
                rtlGeometry,
                noRouter,
                noPageHost,
                routeBoundary,
                noChildHost,
                childSlotHost,
                noPersistence,
                hasSnapshot,
                responsiveHostAdoption,
                realHostAdoptionSample,
                noNativeShell,
                focusRingSuppressed)
        End Function
    End Class

End Namespace
