| 4944 | } |
| 4945 | |
| 4946 | function sortedProfilePairs(profile, raw, summaryKey, rawKey) { |
| 4947 | const summaryItems = Array.isArray(profile?.[summaryKey]) ? profile[summaryKey] : []; |
| 4948 | if (summaryItems.length) return summaryItems.map(pairLabel).filter(Boolean); |
| 4949 | return Object.entries(raw?.[rawKey] || profile?.[rawKey] || {}) |
| 4950 | .sort((a, b) => Number(b[1]) - Number(a[1])) |
| 4951 | .map(([key]) => key) |
| 4952 | .filter(Boolean); |
| 4953 | } |
| 4954 | |
| 4955 | function profileMustReadValues(profile, raw) { |
| 4956 | const mustRead = raw?.must_read || profile?.must_read || {}; |