Option Strict On
Option Explicit On

Namespace Nexamas.UI.Components

    ''' <summary>
    ''' Friend-only readiness evidence for MASDashboardGrid. It records that this
    ''' surface is a visual dashboard widget grid with layout snapshot/reorder/resize
    ''' evidence, while data refresh, chart engines, external storage, providers, and
    ''' shell-layout ownership remain outside this control.
    ''' </summary>
    Friend NotInheritable Class MASDashboardGridReadinessManifest
        Friend Sub New(status As MASDashboardGridReadinessStatus,
                       officialSurfaceRoute As Boolean,
                       noDataRefreshPath As Boolean,
                       noChartEnginePath As Boolean,
                       noStoragePath As Boolean,
                       noProviderPath As Boolean,
                       noResponsiveShellOwnershipPath As Boolean,
                       hasLayoutSnapshotPersistencePath As Boolean,
                       hasWidgetReorderResizePath As Boolean,
                       hasLargeLayoutWindowingProofPath As Boolean,
                       hasWidgetHostingContractPath As Boolean,
                       hasWidgetProviderRefreshContractPath As Boolean,
                       hasProviderAdapterPolicyPath As Boolean,
                       hasKeyboardResizeThresholdPath As Boolean,
                       mouseFocusRingSuppressed As Boolean)
            Me.Status = status
            Me.OfficialSurfaceRoute = officialSurfaceRoute
            Me.NoDataRefreshPath = noDataRefreshPath
            Me.NoChartEnginePath = noChartEnginePath
            Me.NoStoragePath = noStoragePath
            Me.NoProviderPath = noProviderPath
            Me.NoResponsiveShellOwnershipPath = noResponsiveShellOwnershipPath
            Me.HasLayoutSnapshotPersistencePath = hasLayoutSnapshotPersistencePath
            Me.HasWidgetReorderResizePath = hasWidgetReorderResizePath
            Me.HasLargeLayoutWindowingProofPath = hasLargeLayoutWindowingProofPath
            Me.HasWidgetHostingContractPath = hasWidgetHostingContractPath
            Me.HasWidgetProviderRefreshContractPath = hasWidgetProviderRefreshContractPath
            Me.HasProviderAdapterPolicyPath = hasProviderAdapterPolicyPath
            Me.HasKeyboardResizeThresholdPath = hasKeyboardResizeThresholdPath
            Me.MouseFocusRingSuppressed = mouseFocusRingSuppressed
        End Sub

        Friend ReadOnly Property Status As MASDashboardGridReadinessStatus
        Friend ReadOnly Property OfficialSurfaceRoute As Boolean
        Friend ReadOnly Property NoDataRefreshPath As Boolean
        Friend ReadOnly Property NoChartEnginePath As Boolean
        Friend ReadOnly Property NoStoragePath As Boolean
        Friend ReadOnly Property NoProviderPath As Boolean
        Friend ReadOnly Property NoResponsiveShellOwnershipPath As Boolean
        Friend ReadOnly Property HasLayoutSnapshotPersistencePath As Boolean
        Friend ReadOnly Property HasWidgetReorderResizePath As Boolean
        Friend ReadOnly Property HasLargeLayoutWindowingProofPath As Boolean
        Friend ReadOnly Property HasWidgetHostingContractPath As Boolean
        Friend ReadOnly Property HasWidgetProviderRefreshContractPath As Boolean
        Friend ReadOnly Property HasProviderAdapterPolicyPath As Boolean
        Friend ReadOnly Property HasKeyboardResizeThresholdPath As Boolean
        Friend ReadOnly Property MouseFocusRingSuppressed As Boolean

        Friend ReadOnly Property IsReady As Boolean
            Get
                Return Status = MASDashboardGridReadinessStatus.Ready AndAlso
                       OfficialSurfaceRoute AndAlso
                       NoDataRefreshPath AndAlso
                       NoChartEnginePath AndAlso
                       NoStoragePath AndAlso
                       NoProviderPath AndAlso
                       NoResponsiveShellOwnershipPath AndAlso
                       HasLayoutSnapshotPersistencePath AndAlso
                       HasWidgetReorderResizePath AndAlso
                       HasLargeLayoutWindowingProofPath AndAlso
                       HasWidgetHostingContractPath AndAlso
                       HasWidgetProviderRefreshContractPath AndAlso
                       HasProviderAdapterPolicyPath AndAlso
                       HasKeyboardResizeThresholdPath AndAlso
                       MouseFocusRingSuppressed
            End Get
        End Property

        Friend ReadOnly Property CommercialReadinessFamily As String
            Get
                Return "DashboardProductControls"
            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 final promotion closure: layout snapshot restore, widget reorder/span resize, bounded widget-window proof, Friend-only hosted-widget lifecycle, internal provider-refresh/error-state proof, internal-only provider adapter non-exposure, keyboard/a11y resize thresholds, benchmark baseline/threshold policy, documentation/sample boundary, and release-freeze evidence are governed."
            End Get
        End Property

        Friend Shared Function CreateDefault() As MASDashboardGridReadinessManifest
            Dim officialSurface As Boolean = True
            Dim noRefresh As Boolean = MASDashboardGridPolicy.HasNoDataRefreshPath()
            Dim noChart As Boolean = MASDashboardGridPolicy.HasNoChartEnginePath()
            Dim noStorage As Boolean = MASDashboardGridPolicy.HasNoStoragePath()
            Dim noProvider As Boolean = MASDashboardGridPolicy.HasNoProviderPath()
            Dim noShell As Boolean = MASDashboardGridPolicy.HasNoResponsiveShellOwnershipPath()
            Dim hasSnapshot As Boolean = MASDashboardGridPolicy.HasLayoutSnapshotPersistencePath()
            Dim hasReorderResize As Boolean = MASDashboardGridPolicy.HasWidgetReorderResizePath()
            Dim hasLargeLayoutProof As Boolean = MASDashboardGridPolicy.HasLargeLayoutWindowingProofPath()
            Dim hasWidgetHosting As Boolean = MASDashboardGridPolicy.HasWidgetHostingContractPath()
            Dim hasProviderRefresh As Boolean = MASDashboardGridPolicy.HasWidgetProviderRefreshContractPath()
            Dim providerAdapterPolicy As Boolean = MASDashboardGridPolicy.HasProviderAdapterPolicyPath()
            Dim keyboardResizeThreshold As Boolean = MASDashboardGridPolicy.HasKeyboardResizeThresholdPath()
            Dim focusSuppressed As Boolean = MASDashboardGridPolicy.HasMouseFocusRingSuppressed()
            Dim status As MASDashboardGridReadinessStatus = MASDashboardGridReadinessStatus.Ready
            If Not officialSurface OrElse Not hasSnapshot OrElse Not hasReorderResize OrElse Not hasLargeLayoutProof OrElse Not hasWidgetHosting OrElse Not hasProviderRefresh OrElse Not providerAdapterPolicy OrElse Not keyboardResizeThreshold Then status = MASDashboardGridReadinessStatus.IncompleteEvidence
            If Not noRefresh Then status = MASDashboardGridReadinessStatus.BlockedByDataRefreshLeak
            If Not noChart Then status = MASDashboardGridReadinessStatus.BlockedByChartEngineLeak
            If Not noStorage Then status = MASDashboardGridReadinessStatus.BlockedByStorageLeak
            If Not noProvider Then status = MASDashboardGridReadinessStatus.BlockedByProviderLeak
            If Not noShell Then status = MASDashboardGridReadinessStatus.BlockedByResponsiveShellLeak
            If Not focusSuppressed Then status = MASDashboardGridReadinessStatus.BlockedByMouseFocusRingLeak
            Return New MASDashboardGridReadinessManifest(status, officialSurface, noRefresh, noChart, noStorage, noProvider, noShell, hasSnapshot, hasReorderResize, hasLargeLayoutProof, hasWidgetHosting, hasProviderRefresh, providerAdapterPolicy, keyboardResizeThreshold, focusSuppressed)
        End Function
    End Class

End Namespace
