@php $key = $row['key'] ?? ''; $defaultDisplay = $row['display'] ?? ($row['value'] ?? ''); // Prefer merchant override, else current auto/display value for filled rows. $current = old( 'metafield_manual.'.$key, $mfManual[$key] ?? (($mode ?? '') === 'filled' ? $defaultDisplay : ($row['value'] ?? '')) ); $choices = is_array($row['choices'] ?? null) ? $row['choices'] : []; $guideHint = trim((string) ($row['guide_hint'] ?? '')); $isFilled = ($mode ?? '') === 'filled'; @endphp