"use strict";exports.id=1321,exports.ids=[1321],exports.modules={4859:(a,b,c)=>{function d(a){if(!a||a.length>254||/[\r\n\0<>]/.test(a)||!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a))return!1;let[b,c]=a.split("@");return!(b.length>64||c.length>255||c.startsWith(".")||c.endsWith(".")||c.includes(".."))}function e(a){if(!a?.trim())return{valid:!0,invalidEmails:[]};let b=a.split(",").map(a=>a.trim()).filter(Boolean).filter(a=>!d(a));return{valid:0===b.length,invalidEmails:b}}function f(a){return a?.trim()?a.length>254?"Email address is too long (max 254 characters)":/[\r\n\0<>]/.test(a)?"Email address contains invalid characters":d(a)?null:"Please enter a valid email address":"Email address is required"}function g(a){if(!a?.trim())return!1;if(a.startsWith("mailto:"))return d(a.substring(7).split("?")[0]);try{let b=new URL(a);return["http:","https:"].includes(b.protocol)}catch{return!1}}function h(a){if(!a?.trim())return{};let b=a.match(/<([^>]+)>/g);if(!b)return{};let c=b.map(a=>a.slice(1,-1).trim()),d=c.find(a=>(a.startsWith("http://")||a.startsWith("https://"))&&g(a)),e=c.find(a=>a.startsWith("mailto:")&&g(a));return{http:d,mailto:e,preferred:d?"http":e?"mailto":void 0}}function i(a){let b,c;if(!a?.startsWith("mailto:"))return null;let e=a.slice(7),f=e.indexOf("?"),g=-1===f?e:e.slice(0,f),h=-1===f?"":e.slice(f+1),i=a=>{try{return decodeURIComponent(a)}catch{return a}},j=g.split(",").map(a=>i(a).trim()).filter(a=>d(a));for(let a of h.split("&")){let e=a.indexOf("=");if(-1===e)continue;let f=a.slice(0,e).toLowerCase(),g=i(a.slice(e+1));"subject"===f?b=g:"body"===f?c=g:"to"===f&&d(g.trim())&&j.push(g.trim())}return j.length>0?{to:j,subject:b,body:c}:null}c.d(b,{B9:()=>d,Hs:()=>i,Mn:()=>f,Tc:()=>g,ZY:()=>e,z4:()=>h})},71321:(a,b,c)=>{c.d(b,{TQ:()=>i,UJ:()=>k,dL:()=>f,parseAuthenticationResults:()=>g,parseSpamLLM:()=>j,parseSpamScore:()=>h});var d=c(4859);let e={fail:6,softfail:5,permerror:4,temperror:3,neutral:2,none:1,pass:0};function f(a){return!!a&&(a.dmarc?.result==="fail"||a.spf?.result==="fail"&&a.dkim?.result!=="pass")}function g(a){let b,c={},d=/spf=(\w+)(?:\s+\([^)]*\))?(?:\s+smtp\.(mailfrom|helo)=([^\s;]+))?/g,f=[];for(;null!==(b=d.exec(a));)f.push({result:b[1],identity:b[2],domain:b[3]});if(f.length>0){let a=a=>e[a]??-1,b=f.reduce((b,c)=>a(c.result)>a(b.result)||a(c.result)===a(b.result)&&"mailfrom"!==b.identity&&"mailfrom"===c.identity?c:b);c.spf={result:b.result,domain:b.domain,...f.length>1?{all:f}:{}}}let g=a.match(/dkim=(\w+)(?:\s+header\.d=([^\s]+))?(?:\s+header\.s=([^\s]+))?/);g&&(c.dkim={result:g[1],domain:g[2],selector:g[3]});let h=a.match(/dmarc=(\w+)(?:\s+header\.from=([^\s]+))?(?:\s+policy\.dmarc=(\w+))?/);h&&(c.dmarc={result:h[1],domain:h[2],policy:h[3]});let i=a.match(/iprev=(\w+)(?:\s+policy\.iprev=([\d.]+))?/);return i&&(c.iprev={result:i[1],ip:i[2]}),c}function h(a){let b=a.match(/^(Yes|No|spam|ham),?\s+score=([-\d.]+)/i);if(b)return{status:b[1].toLowerCase(),score:parseFloat(b[2])};let c=a.match(/score[=:]?\s*([-\d.]+)/i);if(c){let a=parseFloat(c[1]);return{score:a,status:a>5?"spam":"ham"}}return null}function i(a){switch(a){case"pass":return{color:"text-green-700 dark:text-green-400",icon:"check",bgColor:"bg-gray-50 dark:bg-gray-800",borderColor:"border-l-4 border-green-600 dark:border-green-500"};case"fail":case"permerror":return{color:"text-red-700 dark:text-red-400",icon:"x",bgColor:"bg-gray-50 dark:bg-gray-800",borderColor:"border-l-4 border-red-600 dark:border-red-500"};case"softfail":case"neutral":case"temperror":return{color:"text-warning",icon:"alert",bgColor:"bg-gray-50 dark:bg-gray-800",borderColor:"border-l-4 border-warning"};default:return{color:"text-gray-700 dark:text-gray-400",icon:"minus",bgColor:"bg-gray-50 dark:bg-gray-800",borderColor:"border-l-4 border-gray-400 dark:border-gray-600"}}}function j(a){let b=a.trim().match(/^(LEGITIMATE|SPAM|SUSPICIOUS)\s*\((.+)\)\s*$/i);return b?{verdict:b[1].toUpperCase(),explanation:b[2].trim()}:null}function k(a){let b={};if(a["List-Id"]&&(b.listId=Array.isArray(a["List-Id"])?a["List-Id"][0]:a["List-Id"]),a["List-Unsubscribe"]){let c=Array.isArray(a["List-Unsubscribe"])?a["List-Unsubscribe"][0]:a["List-Unsubscribe"],e=(0,d.z4)(c);e.preferred&&(b.listUnsubscribe=e)}return a["List-Help"]&&(b.listHelp=Array.isArray(a["List-Help"])?a["List-Help"][0]:a["List-Help"]),a["List-Post"]&&(b.listPost=Array.isArray(a["List-Post"])?a["List-Post"][0]:a["List-Post"]),b}}};