<%

var _a       = locals || {};
var _url     = _a.url || '';
var _name    = _a.name || '';
var _init    = _a.initials || (_name ? _name.trim().charAt(0).toUpperCase() : 'U');
var _color   = _a.color || 'var(--navy)';
var _cls     = _a.cls || 'fav';
var _size    = _a.size ? Number(_a.size) : 0;
var _pres    = _a.presence || '';
var _presCls = _pres === 'online' ? 'on' : (_pres === 'away' ? 'away' : 'off');

var _style = '';
if (_size) _style += 'width:' + _size + 'px;height:' + _size + 'px;font-size:' + Math.max(9, Math.round(_size * 0.4)) + 'px;';

_style += _url ? 'padding:0;background:var(--surface-2);' : ('background:' + _color + ';');
if (_pres) _style += 'position:relative;';
if (_a.style) _style += _a.style;
%><span class="<%= _cls %>" style="<%= _style %>"<% if (_name) { %> title="<%= _name %>"<% } %>><%
if (_url) { %><img class="ava-img" src="<%= _url %>" alt="<%= _name %>"><% } else if (!/[\p{L}\p{N}]/u.test(_init)) { %><svg class="ava-ic" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8.5 1.5L3.5 9h4l-1 5.5L13 6.5H9z" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/></svg><% } else { %><%= _init %><% }
if (_pres) { %><span class="presence <%= _presCls %>"></span><% }
%></span>