@php $menuUser = $wsMember->customer; $menuInitials = collect(preg_split('/\s+/', trim($menuUser->name ?: $menuUser->email)))->filter()->take(2)->map(fn ($part) => mb_strtoupper(mb_substr($part, 0, 1)))->implode(''); $menuManager = $wsCompany->accountManager; $menuSections = [ 'Your account' => array_values(array_filter([ ['user-round-pen', 'Personal profile', 'Name, phone and email', route('wholesale.account').'#security', null], ['key-round', 'Password & security', $menuUser->password ? 'Change your password' : 'Set a password', route('wholesale.account').'#security', null], ['building-2', 'Company details', $wsMember->canManageTeam() ? 'Trading name, ABN, website' : 'View company profile', route('wholesale.account').'#company', null], ['map-pin', 'Delivery locations', 'Warehouses and venues', route('wholesale.account').'#locations', null], ['users-round', 'Team & permissions', $wsMember->canManageTeam() ? 'Invite buyers, set limits' : 'See who has access', route('wholesale.team.index'), null], ])), 'Orders & billing' => array_values(array_filter([ ['package-check', 'Order history', 'Track, reorder, invoices', route('wholesale.orders.index'), null], $wsMember->canApprove() ? ['shield-check', 'Approvals queue', 'Carts waiting for sign-off', route('wholesale.approvals.index'), $wsPendingApprovals ?: null] : null, ['receipt-text', 'Statements', 'Balance, aging, due dates', route('wholesale.statements'), null], ['list-checks', 'Saved order lists', 'Reorder in one click', route('wholesale.lists.index'), null], ['crown', 'Tier & trade terms', 'Discounts and volume breaks', route('wholesale.account'), null], ])), 'Tools' => array_values(array_filter([ $wsSettings['price_sheet_enabled'] ? ['download', 'Download price sheet', 'Your prices as CSV', route('wholesale.catalog.price-sheet'), null] : null, $wsSettings['quotes_enabled'] ? ['file-pen-line', 'Request a custom quote', 'Branded or bulk work', route('wholesale.quotes.index').'#request', null] : null, ])), ]; @endphp