var e=[`verification`,`dkim`,`spf`,`dmarc`,`sender-a`],t={ok:{key:`success`,label:`已通过`,color:`success`},verified:{key:`success`,label:`已通过`,color:`success`},pending:{key:`pending`,label:`等待生效`,color:`warning`},warn:{key:`error`,label:`配置错误`,color:`error`},failed:{key:`error`,label:`配置错误`,color:`error`},error:{key:`error`,label:`配置错误`,color:`error`},missing:{key:`idle`,label:`未配置`,color:`default`},idle:{key:`idle`,label:`未配置`,color:`default`}};function n(e={}){return t[String(e.status||``).toLowerCase()]||t.missing}function r(e={}){return Array.isArray(e.current)?e.current.filter(e=>e):e.current?[e.current]:n(e).key===`success`&&e.value?[e.value]:[]}function i(t={}){let n=Array.isArray(t.status?.records)?t.status.records:[],r=new Map(n.map(e=>[e.key,e]));return e.map(e=>r.get(e)).filter(Boolean)}function a(t=[]){let n=new Map(e.map((e,t)=>[e,t]));return[...t].filter(e=>n.has(e.key)).sort((e,t)=>n.get(e.key)-n.get(t.key))}function o(t={}){let r=i(t),a=e.length,o=r.filter(e=>n(e).key===`success`).length,s=r.filter(e=>{let t=n(e).key;return t===`error`||t===`idle`}).length+Math.max(0,a-r.length),c=a?Math.round(o/a*100):0,l=s>0?`error`:o===a?`success`:`warning`;return{status:l,label:l===`success`?`健康`:l===`warning`?`等待 DNS 生效`:`需要处理`,passed:o,total:a,percent:c,dnsIssues:s,checkedAt:t.status?.checkedAt||``}}export{a as i,r as n,n as r,o as t};