@php
$badge = function (\App\Support\Badges\BadgeDomain $domain, ?string $state): ?\App\Support\Badges\BadgeSpec {
return filled($state) ? \App\Support\Badges\BadgeRenderer::spec($domain, $state) : null;
};
$badges = [
'Coverage' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2CoverageLevel, $details['coverage_level'] ?? null),
'Evidence' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2EvidenceState, $details['evidence_state'] ?? null),
'Identity' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2IdentityState, $details['identity_state'] ?? null),
'Claim' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2ClaimState, $details['claim_state'] ?? null),
'Source' => $badge(\App\Support\Badges\BadgeDomain::CoverageV2SourceClass, $details['source_class'] ?? null),
];
$safeFields = [
'Resource type' => $details['resource_type'] ?? null,
'Canonical type' => $details['canonical_type'] ?? null,
'Canonical key' => $details['canonical_resource_key'] ?? null,
'Provider connection' => $details['provider_connection'] ?? null,
'Evidence hash' => $details['evidence_hash'] ?? null,
'Last captured' => $details['last_captured'] ?? null,
'Source contract' => $details['source_contract_key'] ?? null,
'Source version' => $details['source_version'] ?? null,
'Source schema hash' => $details['source_schema_hash'] ?? null,
'Capture outcome' => $details['capture_outcome'] ?? null,
'Identity reason' => $details['identity_reason_code'] ?? null,
];
$typedSummary = $details['typed_render_summary'] ?? null;
$compareSummary = is_array($typedSummary) && is_array($typedSummary['compare_summary'] ?? null)
? $typedSummary['compare_summary']
: null;
@endphp
@foreach ($badges as $label => $spec)
@if ($spec)
{{ $label }}: {{ $spec->label }}
@endif
@endforeach
@if (($details['blockers'] ?? []) !== [])
Activation blockers
@foreach ($details['blockers'] as $blocker)
{{ $blocker }}
@endforeach
@endif
@if (is_array($typedSummary))
{{ $typedSummary['resource_type'] ?? 'Typed summary' }}
@foreach ([
'Display name' => $typedSummary['display_name'] ?? null,
'State' => $typedSummary['state'] ?? null,
'Grant controls' => $typedSummary['grant_controls'] ?? null,
'Session controls' => $typedSummary['session_controls'] ?? null,
'Claim state' => $typedSummary['claim_state'] ?? null,
'Identity state' => $typedSummary['identity_state'] ?? null,
'Last captured' => $typedSummary['last_captured'] ?? null,
] as $label => $value)
@if (filled($value))
-
{{ $label }}
-
{{ $value }}
@endif
@endforeach
@foreach (['targets' => 'Targets', 'conditions' => 'Conditions'] as $summaryKey => $heading)
@if (($typedSummary[$summaryKey] ?? []) !== [])
{{ $heading }}
@foreach ($typedSummary[$summaryKey] as $row)
@if (is_array($row) && filled($row['value'] ?? null))
-
{{ $row['label'] ?? 'Summary' }}
-
{{ $row['value'] }}
@endif
@endforeach
@endif
@endforeach
@if ($compareSummary !== null)
Compare summary
{{ $compareSummary['status'] ?? 'Compare summary unavailable' }}
@if (filled($compareSummary['previous_captured'] ?? null))
Previous comparable evidence: {{ $compareSummary['previous_captured'] }}
@endif
@if (($compareSummary['changes'] ?? []) !== [])
@foreach ($compareSummary['changes'] as $change)
@if (is_array($change))
-
{{ $change['label'] ?? 'Changed field' }}
-
{{ str((string) ($change['classification'] ?? 'changed'))->replace('_', ' ')->headline() }}
ยท
{{ str((string) ($change['importance'] ?? 'informational'))->replace('_', ' ')->headline() }}
@endif
@endforeach
@endif
@endif
@foreach ([
'unsupported_fields' => ['Unsupported fields', 'warning', 'heroicon-m-exclamation-triangle'],
'redacted_fields' => ['Redacted fields', 'gray', 'heroicon-m-shield-check'],
] as $summaryKey => [$heading, $color, $icon])
@if (($typedSummary[$summaryKey] ?? []) !== [])
{{ $heading }}
@foreach ($typedSummary[$summaryKey] as $field)
{{ $field }}
@endforeach
@endif
@endforeach
@endif
@foreach ($safeFields as $label => $value)
@if (filled($value))
-
{{ $label }}
-
{{ $value }}
@endif
@endforeach
@if (filled($details['operation_run_url'] ?? null))
{{ $details['operation_run_label'] ?? 'Open operation' }}
@endif