@extends('layouts.app') @section('content')

{{ __('Call analysis') }} {{ __('The AI summary stored for this call') }}

{{ $direction === 'outbound' ? __('Outbound call') : __('Inbound call') }} {{ $facts['call_time'] ?? $linkedid }}

{{ __('Call id') }}

{{ $linkedid }}

@if(!empty($facts['call_time']))
{{ __('Time') }}

{{ $facts['call_time'] }}

@endif @if(!empty($facts['agent']))
{{ __('Agent') }}

{{ $facts['agent'] }}

@endif @if(!empty($facts['caller']))
{{ $direction === 'outbound' ? __('Called number') : __('Caller number') }}

{{ $facts['caller'] }}

@endif @if(!empty($facts['queue']))
{{ __('Queue') }}

{{ $facts['queue'] }}

@endif @if(!empty($facts['talktime']))
{{ __('Talk time') }}

{{ gmdate('H:i:s', (int) $facts['talktime']) }}

@endif
{{ __('Recording') }}

{{ __('Listen') }}

@if($analysis)
{{ __('Provider') }}

{{ $analysis->provider->name ?? $analysis->provider_driver }} @if($analysis->isCompleted()) {{ $analysis->statusLabel() }} @elseif($analysis->isFailed()) {{ $analysis->statusLabel() }} @else {{ $analysis->statusLabel() }} @endif

{{ __('Requested') }}

{{ optional($analysis->created_at)->format('Y-m-d H:i:s') }}

{{ __('Finished') }}

{{ optional($analysis->completed_at)->format('Y-m-d H:i:s') ?: '-' }}

@if($analysis->audio_seconds)
{{ __('Audio analysed') }}

{{ gmdate('H:i:s', (int) $analysis->audio_seconds) }}

@endif @if(!empty($analysis->meta['transcription_model']) || !empty($analysis->meta['analysis_model']))
{{ __('Models') }}

{{ $analysis->meta['transcription_model'] ?? '-' }} → {{ $analysis->meta['analysis_model'] ?? __('provider summarizer') }}

@endif
@csrf
@endif @if(!$analysis)

{{ __('This call has not been submitted for analysis yet.') }}

@if($activeProvider)
@csrf {{ __('Provider:') }} {{ $activeProvider->name }}
@else
{{ __('No AI voice provider is ready. An administrator has to open Settings - AI Voice Analysis, save an API key and select a provider.') }}
@endif
@endif @if($analysis && $analysis->isInFlight())
hourglass_empty {{ __('The call is being transcribed and summarized. This page refreshes itself when the analysis is ready.') }}
@endif @if($analysis && $analysis->isFailed())
{{ __('The analysis failed.') }}
{{ $analysis->error }}
@endif @if($analysis && $analysis->isCompleted())

{{ __('Summary') }}

{{-- dir="auto": an Arabic summary must align right-to-left, an English one left-to-right, without us guessing. --}}
{!! nl2br(e($analysis->summary)) !!}
@if($analysis->transcript)

{{ __('Transcript') }} {{ __('As returned by the provider') }}

{!! nl2br(e($analysis->transcript)) !!}
@endif @endif @endsection @if($analysis && $analysis->isInFlight()) @push('scripts') @endpush @endif