@extends('layouts.admin') @section('title', __('research.progress')) @section('content')
status,['queued','running','retrying']) || $children->contains(fn ($child) => in_array($child->status,['queued','running','retrying']))) data-task-watch="{{ route('admin.ai-parks.status',$task) }}" @endif>

{{ __('operations.status.'.$pipelineStatus) }}

@if(in_array($task->status,['queued','running','retrying']))

{{ __('operations.wait_hint') }}

@endif @if($task->error)

{{ __($task->error) }}

@endif @if(data_get($task->result,'not_found'))

{{ __('research.not_found') }}

@endif @if(data_get($task->result,'needs_identity'))

{{ __('research.resolve_identity') }}

@endif @if(data_get($task->result,'park_id'))

{{ __('research.open_park') }}

{{ __('research.content_integrated') }}{{ data_get($task->result,'content_count',0) }}
{{ __('research.values_integrated') }}{{ data_get($task->result,'accepted',0) + $children->sum(fn ($child) => (int) data_get($child->result,'accepted',0)) }}
{{ __('research.exceptions') }}{{ data_get($task->result,'review',0) + $children->sum(fn ($child) => (int) data_get($child->result,'review',0)) }}
@endif
@foreach(array_filter([data_get($task->result,'batch_id'),data_get($task->result,'content_batch_id')]) as $id){{ __('research.open_batch') }} #{{ $id }}@endforeach{{ __('research.exceptions') }}
@if(auth()->user()->role !== 'reader') @if(in_array($task->status,['failed','partial']))
@csrf
@endif @if(data_get($task->result,'batch_id') && in_array($task->status,['success','partial','failed']))
@csrf
@endif @endif
@if($batch || $contentBatch)

{{ __('research.entities') }}

@foreach(collect($batch?->candidates ?? [])->merge($contentBatch?->candidates ?? []) as $candidate)@endforeach
{{ __('admin.labels.name') }}{{ __('admin.labels.type') }}{{ __('admin.labels.status') }}{{ __('research.sources') }}
{{ $candidate->name }}{{ __('excel.types.'.$candidate->entity_type) }}{{ __('admin.ingestion.status.'.$candidate->status) }}@foreach(data_get($candidate->normalized_payload,'research.sources',[]) as $url){{ parse_url($url,PHP_URL_HOST) }}@endforeach
@endif @if($exceptions->isNotEmpty() || data_get($task->result,'rejected_content'))

{{ __('research.exceptions') }}

@if(data_get($task->result,'rejected_content'))

{{ __('research.rejected_content',['count'=>$task->result['rejected_content']]) }}

@endif
@foreach($exceptions as $exception)@endforeach
{{ __('admin.labels.name') }}{{ __('research.field') }}{{ __('research.reason') }}
{{ $exception['candidate']->name }}{{ $exception['value']?->field_key ?? '—' }}{{ __('research.reasons.'.$exception['reason']) }}
@endif @if($children->isNotEmpty())

{{ __('research.detail_progress') }}

@foreach($children as $child)@endforeach
{{ __('research.task') }}{{ __('admin.labels.status') }}{{ __('research.values_integrated') }}{{ __('research.exceptions') }}
#{{ $child->id }}{{ __('operations.status.'.$child->status) }}{{ data_get($child->result,'accepted',0) }}{{ data_get($child->result,'review',0) }}
@if(data_get($task->result,'detail_remaining'))

{{ __('research.detail_remaining',['count'=>$task->result['detail_remaining']]) }}

@endif
@endif @if(count(data_get($task->result,'sources',[])))

{{ __('research.sources') }}

@foreach($task->result['sources'] as $url)

{{ $url }}

@endforeach
@endif @endsection