{{-- Inline brand graphic from public/brand/.svg (mark, logo, wave-divider, icon-apartment, icon-sea, icon-terrace, icon-location). Inline, so the colours follow the CSS variables --brand-navy/-teal/-wave/-sun (theme-base.css maps navy to the text colour, so it stays visible in dark appearances). Variables: $name, $class (optional), $label (optional; without it the graphic is decorative). --}} @php static $brandSvgs = []; $brandSvgs[$name] ??= is_file(public_path("brand/{$name}.svg")) ? file_get_contents(public_path("brand/{$name}.svg")) : ''; $brandUid = 'b'.\Illuminate\Support\Str::lower(\Illuminate\Support\Str::random(6)); $brandSvg = preg_replace(['/\s(role|aria-label)="[^"]*"/', '/.*?<\/title>/s'], '', $brandSvgs[$name]); $brandSvg = preg_replace(['/id="([^"]+)"/', '/url\(#([^)]+)\)/'], ['id="$1-'.$brandUid.'"', 'url(#$1-'.$brandUid.')'], $brandSvg); $brandAttributes = 'class="'.e($class ?? '').'" '.(isset($label) ? 'role="img" aria-label="'.e($label).'"' : 'aria-hidden="true" focusable="false"'); $brandSvg = preg_replace('/<svg\s/', '<svg '.$brandAttributes.' ', $brandSvg, 1); @endphp {!! $brandSvg !!}