(() => { 'use strict'; let api,esc,formatDate; const labels={exhausted:'次数已耗尽',pending:'待发送',blocked:'受阻',reserved:'处理中',sent:'已提交邮件服务器',unknown:'结果待核实',prepared:'已准备',sending:'发送中',failed:'失败',cancelled:'已取消'}; async function history(container,isActive=()=>true){const data=await api('/notifications');if(!isActive())return;container.innerHTML=`

旧通知历史(只读)

旧通知已退役,历史内容保留供查阅。
${(data.items||[]).map(i=>``).join('')||''}
来源 / 分类通知正文状态
${esc(i.sourceId)}
${esc(i.industry)}
${esc(i.subject)}
${esc(i.brief)}
${esc(labels[i.status]||i.status)}
${esc(i.error||'')}
暂无旧通知记录

旧发送批次

${(data.batches||[]).map(b=>`
${esc(b.subject||b.industry)}
${esc(labels[b.status]||b.status)} · ${formatDate(b.created_at||b.createdAt)}
${esc((b.to||[]).join('、'))}
`).join('')||'
暂无旧批次记录
'}
`;} window.NotificationViews={configure:options=>({api,esc,formatDate}=options),history}; })();