@nocobase/plugin-notification-email 1.4.0-alpha.20240928155737

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE.txt +123 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/ConfigForm.d.ts +10 -0
  6. package/dist/client/MessageConfigForm.d.ts +12 -0
  7. package/dist/client/hooks/useTranslation.d.ts +9 -0
  8. package/dist/client/index.d.ts +15 -0
  9. package/dist/client/index.js +16 -0
  10. package/dist/constant.d.ts +10 -0
  11. package/dist/constant.js +39 -0
  12. package/dist/externalVersion.js +17 -0
  13. package/dist/index.d.ts +10 -0
  14. package/dist/index.js +48 -0
  15. package/dist/locale/en-US.json +22 -0
  16. package/dist/locale/zh-CN.json +22 -0
  17. package/dist/node_modules/nodemailer/.gitattributes +6 -0
  18. package/dist/node_modules/nodemailer/.ncurc.js +7 -0
  19. package/dist/node_modules/nodemailer/.prettierrc.js +8 -0
  20. package/dist/node_modules/nodemailer/LICENSE +16 -0
  21. package/dist/node_modules/nodemailer/SECURITY.txt +22 -0
  22. package/dist/node_modules/nodemailer/lib/addressparser/index.js +313 -0
  23. package/dist/node_modules/nodemailer/lib/base64/index.js +142 -0
  24. package/dist/node_modules/nodemailer/lib/dkim/index.js +251 -0
  25. package/dist/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  26. package/dist/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  27. package/dist/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  28. package/dist/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  29. package/dist/node_modules/nodemailer/lib/fetch/index.js +274 -0
  30. package/dist/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  31. package/dist/node_modules/nodemailer/lib/mail-composer/index.js +565 -0
  32. package/dist/node_modules/nodemailer/lib/mailer/index.js +427 -0
  33. package/dist/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
  34. package/dist/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  35. package/dist/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
  36. package/dist/node_modules/nodemailer/lib/mime-node/index.js +1305 -0
  37. package/dist/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  38. package/dist/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  39. package/dist/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  40. package/dist/node_modules/nodemailer/lib/nodemailer.js +1 -0
  41. package/dist/node_modules/nodemailer/lib/qp/index.js +219 -0
  42. package/dist/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  43. package/dist/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
  44. package/dist/node_modules/nodemailer/lib/shared/index.js +638 -0
  45. package/dist/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  46. package/dist/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  47. package/dist/node_modules/nodemailer/lib/smtp-connection/index.js +1812 -0
  48. package/dist/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
  49. package/dist/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
  50. package/dist/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
  51. package/dist/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  52. package/dist/node_modules/nodemailer/lib/well-known/index.js +47 -0
  53. package/dist/node_modules/nodemailer/lib/well-known/services.json +338 -0
  54. package/dist/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
  55. package/dist/node_modules/nodemailer/package.json +1 -0
  56. package/dist/server/index.d.ts +9 -0
  57. package/dist/server/index.js +42 -0
  58. package/dist/server/mail-server.d.ts +14 -0
  59. package/dist/server/mail-server.js +78 -0
  60. package/dist/server/plugin.d.ts +19 -0
  61. package/dist/server/plugin.js +69 -0
  62. package/package.json +23 -0
  63. package/server.d.ts +2 -0
  64. package/server.js +1 -0
  65. package/tsconfig.json +7 -0
@@ -0,0 +1 @@
1
+ (function(){"use strict";var e={382:function(e){function _handleAddress(e){let t;let i=false;let a="text";let s;let n=[];let o={address:[],comment:[],group:[],text:[]};let r;let p;for(r=0,p=e.length;r<p;r++){t=e[r];if(t.type==="operator"){switch(t.value){case"<":a="address";break;case"(":a="comment";break;case":":a="group";i=true;break;default:a="text"}}else if(t.value){if(a==="address"){t.value=t.value.replace(/^[^<]*<\s*/,"")}o[a].push(t.value)}}if(!o.text.length&&o.comment.length){o.text=o.comment;o.comment=[]}if(i){o.text=o.text.join(" ");n.push({name:o.text||s&&s.name,group:o.group.length?addressparser(o.group.join(",")):[]})}else{if(!o.address.length&&o.text.length){for(r=o.text.length-1;r>=0;r--){if(o.text[r].match(/^[^@\s]+@[^@\s]+$/)){o.address=o.text.splice(r,1);break}}let _regexHandler=function(e){if(!o.address.length){o.address=[e.trim()];return" "}else{return e}};if(!o.address.length){for(r=o.text.length-1;r>=0;r--){o.text[r]=o.text[r].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,_regexHandler).trim();if(o.address.length){break}}}}if(!o.text.length&&o.comment.length){o.text=o.comment;o.comment=[]}if(o.address.length>1){o.text=o.text.concat(o.address.splice(1))}o.text=o.text.join(" ");o.address=o.address.join(" ");if(!o.address&&i){return[]}else{s={address:o.address||o.text||"",name:o.text||o.address||""};if(s.address===s.name){if((s.address||"").match(/@/)){s.name=""}else{s.address=""}}n.push(s)}}return n}class Tokenizer{constructor(e){this.str=(e||"").toString();this.operatorCurrent="";this.operatorExpecting="";this.node=null;this.escaped=false;this.list=[];this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e,t=[];for(let t=0,i=this.str.length;t<i;t++){e=this.str.charAt(t);this.checkChar(e)}this.list.forEach((e=>{e.value=(e.value||"").toString().trim();if(e.value){t.push(e)}}));return t}checkChar(e){if(this.escaped){}else if(e===this.operatorExpecting){this.node={type:"operator",value:e};this.list.push(this.node);this.node=null;this.operatorExpecting="";this.escaped=false;return}else if(!this.operatorExpecting&&e in this.operators){this.node={type:"operator",value:e};this.list.push(this.node);this.node=null;this.operatorExpecting=this.operators[e];this.escaped=false;return}else if(['"',"'"].includes(this.operatorExpecting)&&e==="\\"){this.escaped=true;return}if(!this.node){this.node={type:"text",value:""};this.list.push(this.node)}if(e==="\n"){e=" "}if(e.charCodeAt(0)>=33||[" ","\t"].includes(e)){this.node.value+=e}this.escaped=false}}function addressparser(e,t){t=t||{};let i=new Tokenizer(e);let a=i.tokenize();let s=[];let n=[];let o=[];a.forEach((e=>{if(e.type==="operator"&&(e.value===","||e.value===";")){if(n.length){s.push(n)}n=[]}else{n.push(e)}}));if(n.length){s.push(n)}s.forEach((e=>{e=_handleAddress(e);if(e.length){o=o.concat(e)}}));if(t.flatten){let e=[];let walkAddressList=t=>{t.forEach((t=>{if(t.group){return walkAddressList(t.group)}else{e.push(t)}}))};walkAddressList(o);return e}return o}e.exports=addressparser},10:function(e,t,i){const a=i(781).Transform;function encode(e){if(typeof e==="string"){e=Buffer.from(e,"utf-8")}return e.toString("base64")}function wrap(e,t){e=(e||"").toString();t=t||76;if(e.length<=t){return e}let i=[];let a=0;let s=t*1024;while(a<e.length){let n=e.substr(a,s).replace(new RegExp(".{"+t+"}","g"),"$&\r\n").trim();i.push(n);a+=s}return i.join("\r\n").trim()}class Encoder extends a{constructor(e){super();this.options=e||{};if(this.options.lineLength!==false){this.options.lineLength=this.options.lineLength||76}this._curLine="";this._remainingBytes=false;this.inputBytes=0;this.outputBytes=0}_transform(e,t,i){if(t!=="buffer"){e=Buffer.from(e,t)}if(!e||!e.length){return setImmediate(i)}this.inputBytes+=e.length;if(this._remainingBytes&&this._remainingBytes.length){e=Buffer.concat([this._remainingBytes,e],this._remainingBytes.length+e.length);this._remainingBytes=false}if(e.length%3){this._remainingBytes=e.slice(e.length-e.length%3);e=e.slice(0,e.length-e.length%3)}else{this._remainingBytes=false}let a=this._curLine+encode(e);if(this.options.lineLength){a=wrap(a,this.options.lineLength);let e=a.lastIndexOf("\n");if(e<0){this._curLine=a;a=""}else if(e===a.length-1){this._curLine=""}else{this._curLine=a.substr(e+1);a=a.substr(0,e+1)}}if(a){this.outputBytes+=a.length;this.push(Buffer.from(a,"ascii"))}setImmediate(i)}_flush(e){if(this._remainingBytes&&this._remainingBytes.length){this._curLine+=encode(this._remainingBytes)}if(this._curLine){this._curLine=wrap(this._curLine,this.options.lineLength);this.outputBytes+=this._curLine.length;this.push(this._curLine,"ascii");this._curLine=""}e()}}e.exports={encode:encode,wrap:wrap,Encoder:Encoder}},757:function(e,t,i){const a=i(196);const s=i(412);const n=i(475);const o=i(781).PassThrough;const r=i(147);const p=i(17);const l=i(113);const c="sha256";const d=128*1024;class DKIMSigner{constructor(e,t,i,a){this.options=e||{};this.keys=t;this.cacheTreshold=Number(this.options.cacheTreshold)||d;this.hashAlgo=this.options.hashAlgo||c;this.cacheDir=this.options.cacheDir||false;this.chunks=[];this.chunklen=0;this.readPos=0;this.cachePath=this.cacheDir?p.join(this.cacheDir,"message."+Date.now()+"-"+l.randomBytes(14).toString("hex")):false;this.cache=false;this.headers=false;this.bodyHash=false;this.parser=false;this.relaxedBody=false;this.input=i;this.output=a;this.output.usingCache=false;this.hasErrored=false;this.input.on("error",(e=>{this.hasErrored=true;this.cleanup();a.emit("error",e)}))}cleanup(){if(!this.cache||!this.cachePath){return}r.unlink(this.cachePath,(()=>false))}createReadCache(){this.cache=r.createReadStream(this.cachePath);this.cache.once("error",(e=>{this.cleanup();this.output.emit("error",e)}));this.cache.once("close",(()=>{this.cleanup()}));this.cache.pipe(this.output)}sendNextChunk(){if(this.hasErrored){return}if(this.readPos>=this.chunks.length){if(!this.cache){return this.output.end()}return this.createReadCache()}let e=this.chunks[this.readPos++];if(this.output.write(e)===false){return this.output.once("drain",(()=>{this.sendNextChunk()}))}setImmediate((()=>this.sendNextChunk()))}sendSignedOutput(){let e=0;let signNextKey=()=>{if(e>=this.keys.length){this.output.write(this.parser.rawHeaders);return setImmediate((()=>this.sendNextChunk()))}let t=this.keys[e++];let i=n(this.headers,this.hashAlgo,this.bodyHash,{domainName:t.domainName,keySelector:t.keySelector,privateKey:t.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields});if(i){this.output.write(Buffer.from(i+"\r\n"))}return setImmediate(signNextKey)};if(this.bodyHash&&this.headers){return signNextKey()}this.output.write(this.parser.rawHeaders);this.sendNextChunk()}createWriteCache(){this.output.usingCache=true;this.cache=r.createWriteStream(this.cachePath);this.cache.once("error",(e=>{this.cleanup();this.relaxedBody.unpipe(this.cache);this.relaxedBody.on("readable",(()=>{while(this.relaxedBody.read()!==null){}}));this.hasErrored=true;this.output.emit("error",e)}));this.cache.once("close",(()=>{this.sendSignedOutput()}));this.relaxedBody.removeAllListeners("readable");this.relaxedBody.pipe(this.cache)}signStream(){this.parser=new a;this.relaxedBody=new s({hashAlgo:this.hashAlgo});this.parser.on("headers",(e=>{this.headers=e}));this.relaxedBody.on("hash",(e=>{this.bodyHash=e}));this.relaxedBody.on("readable",(()=>{let e;if(this.cache){return}while((e=this.relaxedBody.read())!==null){this.chunks.push(e);this.chunklen+=e.length;if(this.chunklen>=this.cacheTreshold&&this.cachePath){return this.createWriteCache()}}}));this.relaxedBody.on("end",(()=>{if(this.cache){return}this.sendSignedOutput()}));this.parser.pipe(this.relaxedBody);setImmediate((()=>this.input.pipe(this.parser)))}}class DKIM{constructor(e){this.options=e||{};this.keys=[].concat(this.options.keys||{domainName:e.domainName,keySelector:e.keySelector,privateKey:e.privateKey})}sign(e,t){let i=new o;let a=e;let s=false;if(Buffer.isBuffer(e)){s=e;a=new o}else if(typeof e==="string"){s=Buffer.from(e);a=new o}let n=this.options;if(t&&Object.keys(t).length){n={};Object.keys(this.options||{}).forEach((e=>{n[e]=this.options[e]}));Object.keys(t||{}).forEach((e=>{if(!(e in n)){n[e]=t[e]}}))}let r=new DKIMSigner(n,this.keys,a,i);setImmediate((()=>{r.signStream();if(s){setImmediate((()=>{a.end(s)}))}}));return i}}e.exports=DKIM},196:function(e,t,i){const a=i(781).Transform;class MessageParser extends a{constructor(e){super(e);this.lastBytes=Buffer.alloc(4);this.headersParsed=false;this.headerBytes=0;this.headerChunks=[];this.rawHeaders=false;this.bodySize=0}updateLastBytes(e){let t=this.lastBytes.length;let i=Math.min(e.length,t);for(let e=0,a=t-i;e<a;e++){this.lastBytes[e]=this.lastBytes[e+i]}for(let a=1;a<=i;a++){this.lastBytes[t-a]=e[e.length-a]}}checkHeaders(e){if(this.headersParsed){return true}let t=this.lastBytes.length;let i=0;this.curLinePos=0;for(let a=0,s=this.lastBytes.length+e.length;a<s;a++){let s;if(a<t){s=this.lastBytes[a]}else{s=e[a-t]}if(s===10&&a){let s=a-1<t?this.lastBytes[a-1]:e[a-1-t];let n=a>1?a-2<t?this.lastBytes[a-2]:e[a-2-t]:false;if(s===10){this.headersParsed=true;i=a-t+1;this.headerBytes+=i;break}else if(s===13&&n===10){this.headersParsed=true;i=a-t+1;this.headerBytes+=i;break}}}if(this.headersParsed){this.headerChunks.push(e.slice(0,i));this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes);this.headerChunks=null;this.emit("headers",this.parseHeaders());if(e.length-1>i){let t=e.slice(i);this.bodySize+=t.length;setImmediate((()=>this.push(t)))}return false}else{this.headerBytes+=e.length;this.headerChunks.push(e)}this.updateLastBytes(e);return false}_transform(e,t,i){if(!e||!e.length){return i()}if(typeof e==="string"){e=Buffer.from(e,t)}let a;try{a=this.checkHeaders(e)}catch(e){return i(e)}if(a){this.bodySize+=e.length;this.push(e)}setImmediate(i)}_flush(e){if(this.headerChunks){let e=Buffer.concat(this.headerChunks,this.headerBytes);this.bodySize+=e.length;this.push(e);this.headerChunks=null}e()}parseHeaders(){let e=(this.rawHeaders||"").toString().split(/\r?\n/);for(let t=e.length-1;t>0;t--){if(/^\s/.test(e[t])){e[t-1]+="\n"+e[t];e.splice(t,1)}}return e.filter((e=>e.trim())).map((e=>({key:e.substr(0,e.indexOf(":")).trim().toLowerCase(),line:e})))}}e.exports=MessageParser},412:function(e,t,i){const a=i(781).Transform;const s=i(113);class RelaxedBody extends a{constructor(e){super();e=e||{};this.chunkBuffer=[];this.chunkBufferLen=0;this.bodyHash=s.createHash(e.hashAlgo||"sha1");this.remainder="";this.byteLength=0;this.debug=e.debug;this._debugBody=e.debug?[]:false}updateHash(e){let t;let i="";let a="file";for(let t=e.length-1;t>=0;t--){let s=e[t];if(a==="file"&&(s===10||s===13)){}else if(a==="file"&&(s===9||s===32)){a="line"}else if(a==="line"&&(s===9||s===32)){}else if(a==="file"||a==="line"){a="body";if(t===e.length-1){break}}if(t===0){if(a==="file"&&(!this.remainder||/[\r\n]$/.test(this.remainder))||a==="line"&&(!this.remainder||/[ \t]$/.test(this.remainder))){this.remainder+=e.toString("binary");return}else if(a==="line"||a==="file"){i=e.toString("binary");e=false;break}}if(a!=="body"){continue}i=e.slice(t+1).toString("binary");e=e.slice(0,t+1);break}let s=!!this.remainder;if(e&&!s){for(let t=0,i=e.length;t<i;t++){if(t&&e[t]===10&&e[t-1]!==13){s=true;break}else if(t&&e[t]===13&&e[t-1]===32){s=true;break}else if(t&&e[t]===32&&e[t-1]===32){s=true;break}else if(e[t]===9){s=true;break}}}if(s){t=this.remainder+(e?e.toString("binary"):"");this.remainder=i;t=t.replace(/\r?\n/g,"\n").replace(/[ \t]*$/gm,"").replace(/[ \t]+/gm," ").replace(/\n/g,"\r\n");e=Buffer.from(t,"binary")}else if(i){this.remainder=i}if(this.debug){this._debugBody.push(e)}this.bodyHash.update(e)}_transform(e,t,i){if(!e||!e.length){return i()}if(typeof e==="string"){e=Buffer.from(e,t)}this.updateHash(e);this.byteLength+=e.length;this.push(e);i()}_flush(e){if(/[\r\n]$/.test(this.remainder)&&this.byteLength>2){this.bodyHash.update(Buffer.from("\r\n"))}if(!this.byteLength){this.push(Buffer.from("\r\n"))}this.emit("hash",this.bodyHash.digest("base64"),this.debug?Buffer.concat(this._debugBody):false);e()}}e.exports=RelaxedBody},475:function(e,t,i){const a=i(477);const s=i(994);const n=i(113);e.exports=(e,t,i,a)=>{a=a||{};let s="From:Sender:Reply-To:Subject:Date:Message-ID:To:"+"Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:"+"Content-Description:Resent-Date:Resent-From:Resent-Sender:"+"Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:"+"List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:"+"List-Owner:List-Archive";let o=a.headerFieldNames||s;let r=relaxedHeaders(e,o,a.skipFields);let p=generateDKIMHeader(a.domainName,a.keySelector,r.fieldNames,t,i);let l,c;r.headers+="dkim-signature:"+relaxedHeaderLine(p);l=n.createSign(("rsa-"+t).toUpperCase());l.update(r.headers);try{c=l.sign(a.privateKey,"base64")}catch(e){return false}return p+c.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,"$&\r\n ").trim()};e.exports.relaxedHeaders=relaxedHeaders;function generateDKIMHeader(e,t,i,n,o){let r=["v=1","a=rsa-"+n,"c=relaxed/relaxed","d="+a.toASCII(e),"q=dns/txt","s="+t,"bh="+o,"h="+i].join("; ");return s.foldLines("DKIM-Signature: "+r,76)+";\r\n b="}function relaxedHeaders(e,t,i){let a=new Set;let s=new Set;let n=new Map;(i||"").toLowerCase().split(":").forEach((e=>{s.add(e.trim())}));(t||"").toLowerCase().split(":").filter((e=>!s.has(e.trim()))).forEach((e=>{a.add(e.trim())}));for(let t=e.length-1;t>=0;t--){let i=e[t];if(a.has(i.key)&&!n.has(i.key)){n.set(i.key,relaxedHeaderLine(i.line))}}let o=[];let r=[];a.forEach((e=>{if(n.has(e)){r.push(e);o.push(e+":"+n.get(e))}}));return{headers:o.join("\r\n")+"\r\n",fieldNames:r.join(":")}}function relaxedHeaderLine(e){return e.substr(e.indexOf(":")+1).replace(/\r?\n/g,"").replace(/\s+/g," ").trim()}},322:function(e,t,i){const a=i(310);const s=1800;class Cookies{constructor(e){this.options=e||{};this.cookies=[]}set(e,t){let i=a.parse(t||"");let n=this.parse(e);let o;if(n.domain){o=n.domain.replace(/^\./,"");if(i.hostname.length<o.length||("."+i.hostname).substr(-o.length+1)!=="."+o){n.domain=i.hostname}}else{n.domain=i.hostname}if(!n.path){n.path=this.getPath(i.pathname)}if(!n.expires){n.expires=new Date(Date.now()+(Number(this.options.sessionTimeout||s)||s)*1e3)}return this.add(n)}get(e){return this.list(e).map((e=>e.name+"="+e.value)).join("; ")}list(e){let t=[];let i;let a;for(i=this.cookies.length-1;i>=0;i--){a=this.cookies[i];if(this.isExpired(a)){this.cookies.splice(i,i);continue}if(this.match(a,e)){t.unshift(a)}}return t}parse(e){let t={};(e||"").toString().split(";").forEach((e=>{let i=e.split("=");let a=i.shift().trim().toLowerCase();let s=i.join("=").trim();let n;if(!a){return}switch(a){case"expires":s=new Date(s);if(s.toString()!=="Invalid Date"){t.expires=s}break;case"path":t.path=s;break;case"domain":n=s.toLowerCase();if(n.length&&n.charAt(0)!=="."){n="."+n}t.domain=n;break;case"max-age":t.expires=new Date(Date.now()+(Number(s)||0)*1e3);break;case"secure":t.secure=true;break;case"httponly":t.httponly=true;break;default:if(!t.name){t.name=a;t.value=s}}}));return t}match(e,t){let i=a.parse(t||"");if(i.hostname!==e.domain&&(e.domain.charAt(0)!=="."||("."+i.hostname).substr(-e.domain.length)!==e.domain)){return false}let s=this.getPath(i.pathname);if(s.substr(0,e.path.length)!==e.path){return false}if(e.secure&&i.protocol!=="https:"){return false}return true}add(e){let t;let i;if(!e||!e.name){return false}for(t=0,i=this.cookies.length;t<i;t++){if(this.compare(this.cookies[t],e)){if(this.isExpired(e)){this.cookies.splice(t,1);return false}this.cookies[t]=e;return true}}if(!this.isExpired(e)){this.cookies.push(e)}return true}compare(e,t){return e.name===t.name&&e.path===t.path&&e.domain===t.domain&&e.secure===t.secure&&e.httponly===e.httponly}isExpired(e){return e.expires&&e.expires<new Date||!e.value}getPath(e){let t=(e||"/").split("/");t.pop();t=t.join("/").trim();if(t.charAt(0)!=="/"){t="/"+t}if(t.substr(-1)!=="/"){t+="/"}return t}}e.exports=Cookies},106:function(e,t,i){const a=i(685);const s=i(687);const n=i(310);const o=i(796);const r=i(781).PassThrough;const p=i(322);const l=i(129);const c=i(808);const d=5;e.exports=function(e,t){return nmfetch(e,t)};e.exports.Cookies=p;function nmfetch(e,t){t=t||{};t.fetchRes=t.fetchRes||new r;t.cookies=t.cookies||new p;t.redirects=t.redirects||0;t.maxRedirects=isNaN(t.maxRedirects)?d:t.maxRedirects;if(t.cookie){[].concat(t.cookie||[]).forEach((i=>{t.cookies.set(i,e)}));t.cookie=false}let i=t.fetchRes;let m=n.parse(e);let h=(t.method||"").toString().trim().toUpperCase()||"GET";let u=false;let f;let x;let g=m.protocol==="https:"?s:a;let v={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+l.version};Object.keys(t.headers||{}).forEach((e=>{v[e.toLowerCase().trim()]=t.headers[e]}));if(t.userAgent){v["user-agent"]=t.userAgent}if(m.auth){v.Authorization="Basic "+Buffer.from(m.auth).toString("base64")}if(f=t.cookies.get(e)){v.cookie=f}if(t.body){if(t.contentType!==false){v["Content-Type"]=t.contentType||"application/x-www-form-urlencoded"}if(typeof t.body.pipe==="function"){v["Transfer-Encoding"]="chunked";x=t.body;x.on("error",(t=>{if(u){return}u=true;t.type="FETCH";t.sourceUrl=e;i.emit("error",t)}))}else{if(t.body instanceof Buffer){x=t.body}else if(typeof t.body==="object"){try{x=Buffer.from(Object.keys(t.body).map((e=>{let i=t.body[e].toString().trim();return encodeURIComponent(e)+"="+encodeURIComponent(i)})).join("&"))}catch(t){if(u){return}u=true;t.type="FETCH";t.sourceUrl=e;i.emit("error",t);return}}else{x=Buffer.from(t.body.toString().trim())}v["Content-Type"]=t.contentType||"application/x-www-form-urlencoded";v["Content-Length"]=x.length}h=(t.method||"").toString().trim().toUpperCase()||"POST"}let b;let w={method:h,host:m.hostname,path:m.path,port:m.port?m.port:m.protocol==="https:"?443:80,headers:v,rejectUnauthorized:false,agent:false};if(t.tls){Object.keys(t.tls).forEach((e=>{w[e]=t.tls[e]}))}if(m.protocol==="https:"&&m.hostname&&m.hostname!==w.host&&!c.isIP(m.hostname)&&!w.servername){w.servername=m.hostname}try{b=g.request(w)}catch(t){u=true;setImmediate((()=>{t.type="FETCH";t.sourceUrl=e;i.emit("error",t)}));return i}if(t.timeout){b.setTimeout(t.timeout,(()=>{if(u){return}u=true;b.abort();let t=new Error("Request Timeout");t.type="FETCH";t.sourceUrl=e;i.emit("error",t)}))}b.on("error",(t=>{if(u){return}u=true;t.type="FETCH";t.sourceUrl=e;i.emit("error",t)}));b.on("response",(a=>{let s;if(u){return}switch(a.headers["content-encoding"]){case"gzip":case"deflate":s=o.createUnzip();break}if(a.headers["set-cookie"]){[].concat(a.headers["set-cookie"]||[]).forEach((i=>{t.cookies.set(i,e)}))}if([301,302,303,307,308].includes(a.statusCode)&&a.headers.location){t.redirects++;if(t.redirects>t.maxRedirects){u=true;let t=new Error("Maximum redirect count exceeded");t.type="FETCH";t.sourceUrl=e;i.emit("error",t);b.abort();return}t.method="GET";t.body=false;return nmfetch(n.resolve(e,a.headers.location),t)}i.statusCode=a.statusCode;i.headers=a.headers;if(a.statusCode>=300&&!t.allowErrorResponse){u=true;let t=new Error("Invalid status code "+a.statusCode);t.type="FETCH";t.sourceUrl=e;i.emit("error",t);b.abort();return}a.on("error",(t=>{if(u){return}u=true;t.type="FETCH";t.sourceUrl=e;i.emit("error",t);b.abort()}));if(s){a.pipe(s).pipe(i);s.on("error",(t=>{if(u){return}u=true;t.type="FETCH";t.sourceUrl=e;i.emit("error",t);b.abort()}))}else{a.pipe(i)}}));setImmediate((()=>{if(x){try{if(typeof x.pipe==="function"){return x.pipe(b)}else{b.write(x)}}catch(t){u=true;t.type="FETCH";t.sourceUrl=e;i.emit("error",t);return}}b.end()}));return i}},819:function(e,t,i){const a=i(129);const s=i(673);class JSONTransport{constructor(e){e=e||{};this.options=e||{};this.name="JSONTransport";this.version=a.version;this.logger=s.getLogger(this.options,{component:this.options.component||"json-transport"})}send(e,t){e.message.keepBcc=true;let i=e.data.envelope||e.message.getEnvelope();let a=e.message.messageId();let s=[].concat(i.to||[]);if(s.length>3){s.push("...and "+s.splice(2).length+" more")}this.logger.info({tnx:"send",messageId:a},"Composing JSON structure of %s to <%s>",a,s.join(", "));setImmediate((()=>{e.normalize(((e,s)=>{if(e){this.logger.error({err:e,tnx:"send",messageId:a},"Failed building JSON structure for %s. %s",a,e.message);return t(e)}delete s.envelope;delete s.normalizedHeaders;return t(null,{envelope:i,messageId:a,message:this.options.skipEncoding?s:JSON.stringify(s)})}))}))}}e.exports=JSONTransport},694:function(e,t,i){const a=i(509);const s=i(994);class MailComposer{constructor(e){this.mail=e||{};this.message=false}compile(){this._alternatives=this.getAlternatives();this._htmlNode=this._alternatives.filter((e=>/^text\/html\b/i.test(e.contentType))).pop();this._attachments=this.getAttachments(!!this._htmlNode);this._useRelated=!!(this._htmlNode&&this._attachments.related.length);this._useAlternative=this._alternatives.length>1;this._useMixed=this._attachments.attached.length>1||this._alternatives.length&&this._attachments.attached.length===1;if(this.mail.raw){this.message=new a("message/rfc822",{newline:this.mail.newline}).setRaw(this.mail.raw)}else if(this._useMixed){this.message=this._createMixed()}else if(this._useAlternative){this.message=this._createAlternative()}else if(this._useRelated){this.message=this._createRelated()}else{this.message=this._createContentNode(false,[].concat(this._alternatives||[]).concat(this._attachments.attached||[]).shift()||{contentType:"text/plain",content:""})}if(this.mail.headers){this.message.addHeader(this.mail.headers)}["from","sender","to","cc","bcc","reply-to","in-reply-to","references","subject","message-id","date"].forEach((e=>{let t=e.replace(/-(\w)/g,((e,t)=>t.toUpperCase()));if(this.mail[t]){this.message.setHeader(e,this.mail[t])}}));if(this.mail.envelope){this.message.setEnvelope(this.mail.envelope)}this.message.messageId();return this.message}getAttachments(e){let t,i;let a=[].concat(this.mail.attachments||[]).map(((e,t)=>{let i;let a=/^message\//i.test(e.contentType);if(/^data:/i.test(e.path||e.href)){e=this._processDataUrl(e)}let n=e.contentType||s.detectMimeType(e.filename||e.path||e.href||"bin");let o=/^image\//i.test(n);let r=e.contentDisposition||(a||o&&e.cid?"inline":"attachment");i={contentType:n,contentDisposition:r,contentTransferEncoding:"contentTransferEncoding"in e?e.contentTransferEncoding:"base64"};if(e.filename){i.filename=e.filename}else if(!a&&e.filename!==false){i.filename=(e.path||e.href||"").split("/").pop().split("?").shift()||"attachment-"+(t+1);if(i.filename.indexOf(".")<0){i.filename+="."+s.detectExtension(i.contentType)}}if(/^https?:\/\//i.test(e.path)){e.href=e.path;e.path=undefined}if(e.cid){i.cid=e.cid}if(e.raw){i.raw=e.raw}else if(e.path){i.content={path:e.path}}else if(e.href){i.content={href:e.href,httpHeaders:e.httpHeaders}}else{i.content=e.content||""}if(e.encoding){i.encoding=e.encoding}if(e.headers){i.headers=e.headers}return i}));if(this.mail.icalEvent){if(typeof this.mail.icalEvent==="object"&&(this.mail.icalEvent.content||this.mail.icalEvent.path||this.mail.icalEvent.href||this.mail.icalEvent.raw)){t=this.mail.icalEvent}else{t={content:this.mail.icalEvent}}i={};Object.keys(t).forEach((e=>{i[e]=t[e]}));i.contentType="application/ics";if(!i.headers){i.headers={}}i.filename=i.filename||"invite.ics";i.headers["Content-Disposition"]="attachment";i.headers["Content-Transfer-Encoding"]="base64"}if(!e){return{attached:a.concat(i||[]),related:[]}}else{return{attached:a.filter((e=>!e.cid)).concat(i||[]),related:a.filter((e=>!!e.cid))}}}getAlternatives(){let e=[],t,i,a,n,o,r;if(this.mail.text){if(typeof this.mail.text==="object"&&(this.mail.text.content||this.mail.text.path||this.mail.text.href||this.mail.text.raw)){t=this.mail.text}else{t={content:this.mail.text}}t.contentType="text/plain; charset=utf-8"}if(this.mail.watchHtml){if(typeof this.mail.watchHtml==="object"&&(this.mail.watchHtml.content||this.mail.watchHtml.path||this.mail.watchHtml.href||this.mail.watchHtml.raw)){a=this.mail.watchHtml}else{a={content:this.mail.watchHtml}}a.contentType="text/watch-html; charset=utf-8"}if(this.mail.amp){if(typeof this.mail.amp==="object"&&(this.mail.amp.content||this.mail.amp.path||this.mail.amp.href||this.mail.amp.raw)){n=this.mail.amp}else{n={content:this.mail.amp}}n.contentType="text/x-amp-html; charset=utf-8"}if(this.mail.icalEvent){if(typeof this.mail.icalEvent==="object"&&(this.mail.icalEvent.content||this.mail.icalEvent.path||this.mail.icalEvent.href||this.mail.icalEvent.raw)){o=this.mail.icalEvent}else{o={content:this.mail.icalEvent}}r={};Object.keys(o).forEach((e=>{r[e]=o[e]}));if(r.content&&typeof r.content==="object"){r.content._resolve=true}r.filename=false;r.contentType="text/calendar; charset=utf-8; method="+(r.method||"PUBLISH").toString().trim().toUpperCase();if(!r.headers){r.headers={}}}if(this.mail.html){if(typeof this.mail.html==="object"&&(this.mail.html.content||this.mail.html.path||this.mail.html.href||this.mail.html.raw)){i=this.mail.html}else{i={content:this.mail.html}}i.contentType="text/html; charset=utf-8"}[].concat(t||[]).concat(a||[]).concat(n||[]).concat(i||[]).concat(r||[]).concat(this.mail.alternatives||[]).forEach((t=>{let i;if(/^data:/i.test(t.path||t.href)){t=this._processDataUrl(t)}i={contentType:t.contentType||s.detectMimeType(t.filename||t.path||t.href||"txt"),contentTransferEncoding:t.contentTransferEncoding};if(t.filename){i.filename=t.filename}if(/^https?:\/\//i.test(t.path)){t.href=t.path;t.path=undefined}if(t.raw){i.raw=t.raw}else if(t.path){i.content={path:t.path}}else if(t.href){i.content={href:t.href}}else{i.content=t.content||""}if(t.encoding){i.encoding=t.encoding}if(t.headers){i.headers=t.headers}e.push(i)}));return e}_createMixed(e){let t;if(!e){t=new a("multipart/mixed",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}else{t=e.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}if(this._useAlternative){this._createAlternative(t)}else if(this._useRelated){this._createRelated(t)}[].concat(!this._useAlternative&&this._alternatives||[]).concat(this._attachments.attached||[]).forEach((e=>{if(!this._useRelated||e!==this._htmlNode){this._createContentNode(t,e)}}));return t}_createAlternative(e){let t;if(!e){t=new a("multipart/alternative",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}else{t=e.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}this._alternatives.forEach((e=>{if(this._useRelated&&this._htmlNode===e){this._createRelated(t)}else{this._createContentNode(t,e)}}));return t}_createRelated(e){let t;if(!e){t=new a('multipart/related; type="text/html"',{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}else{t=e.createChild('multipart/related; type="text/html"',{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}this._createContentNode(t,this._htmlNode);this._attachments.related.forEach((e=>this._createContentNode(t,e)));return t}_createContentNode(e,t){t=t||{};t.content=t.content||"";let i;let s=(t.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!e){i=new a(t.contentType,{filename:t.filename,baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}else{i=e.createChild(t.contentType,{filename:t.filename,textEncoding:this.mail.textEncoding,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline})}if(t.headers){i.addHeader(t.headers)}if(t.cid){i.setHeader("Content-Id","<"+t.cid.replace(/[<>]/g,"")+">")}if(t.contentTransferEncoding){i.setHeader("Content-Transfer-Encoding",t.contentTransferEncoding)}else if(this.mail.encoding&&/^text\//i.test(t.contentType)){i.setHeader("Content-Transfer-Encoding",this.mail.encoding)}if(!/^text\//i.test(t.contentType)||t.contentDisposition){i.setHeader("Content-Disposition",t.contentDisposition||(t.cid&&/^image\//i.test(t.contentType)?"inline":"attachment"))}if(typeof t.content==="string"&&!["utf8","usascii","ascii"].includes(s)){t.content=Buffer.from(t.content,s)}if(t.raw){i.setRaw(t.raw)}else{i.setContent(t.content)}return i}_processDataUrl(e){let t=(e.path||e.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);if(!t){return e}e.content=/\bbase64$/i.test(t[1])?Buffer.from(t[2],"base64"):Buffer.from(decodeURIComponent(t[2]));if("path"in e){e.path=false}if("href"in e){e.href=false}t[1].split(";").forEach((t=>{if(/^\w+\/[^/]+$/i.test(t)){e.contentType=e.contentType||t.toLowerCase()}}));return e}}e.exports=MailComposer},833:function(e,t,i){const a=i(361);const s=i(673);const n=i(730);const o=i(694);const r=i(757);const p=i(643);const l=i(837);const c=i(310);const d=i(129);const m=i(399);const h=i(808);const u=i(523);const f=i(113);class Mail extends a{constructor(e,t,i){super();this.options=t||{};this._defaults=i||{};this._defaultPlugins={compile:[(...e)=>this._convertDataImages(...e)],stream:[]};this._userPlugins={compile:[],stream:[]};this.meta=new Map;this.dkim=this.options.dkim?new r(this.options.dkim):false;this.transporter=e;this.transporter.mailer=this;this.logger=s.getLogger(this.options,{component:this.options.component||"mail"});this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString());if(typeof this.transporter.on==="function"){this.transporter.on("log",(e=>{this.logger.debug({tnx:"transport"},"%s: %s",e.type,e.message)}));this.transporter.on("error",(e=>{this.logger.error({err:e,tnx:"transport"},"Transport Error: %s",e.message);this.emit("error",e)}));this.transporter.on("idle",((...e)=>{this.emit("idle",...e)}))}["close","isIdle","verify"].forEach((e=>{this[e]=(...t)=>{if(typeof this.transporter[e]==="function"){if(e==="verify"&&typeof this.getSocket==="function"){this.transporter.getSocket=this.getSocket;this.getSocket=false}return this.transporter[e](...t)}else{this.logger.warn({tnx:"transport",methodName:e},"Non existing method %s called for transport",e);return false}}}));if(this.options.proxy&&typeof this.options.proxy==="string"){this.setupProxy(this.options.proxy)}}use(e,t){e=(e||"").toString();if(!this._userPlugins.hasOwnProperty(e)){this._userPlugins[e]=[t]}else{this._userPlugins[e].push(t)}return this}sendMail(e,t=null){let i;if(!t){i=new Promise(((e,i)=>{t=s.callbackPromise(e,i)}))}if(typeof this.getSocket==="function"){this.transporter.getSocket=this.getSocket;this.getSocket=false}let a=new m(this,e);this.logger.debug({tnx:"transport",name:this.transporter.name,version:this.transporter.version,action:"send"},"Sending mail using %s/%s",this.transporter.name,this.transporter.version);this._processPlugins("compile",a,(e=>{if(e){this.logger.error({err:e,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",e.message);return t(e)}a.message=new o(a.data).compile();a.setMailerHeader();a.setPriorityHeaders();a.setListHeaders();this._processPlugins("stream",a,(e=>{if(e){this.logger.error({err:e,tnx:"plugin",action:"stream"},"PluginStream Error: %s",e.message);return t(e)}if(a.data.dkim||this.dkim){a.message.processFunc((e=>{let t=a.data.dkim?new r(a.data.dkim):this.dkim;this.logger.debug({tnx:"DKIM",messageId:a.message.messageId(),dkimDomains:t.keys.map((e=>e.keySelector+"."+e.domainName)).join(", ")},"Signing outgoing message with %s keys",t.keys.length);return t.sign(e,a.data._dkim)}))}this.transporter.send(a,((...e)=>{if(e[0]){this.logger.error({err:e[0],tnx:"transport",action:"send"},"Send Error: %s",e[0].message)}t(...e)}))}))}));return i}getVersionString(){return l.format("%s (%s; +%s; %s/%s)",d.name,d.version,d.homepage,this.transporter.name,this.transporter.version)}_processPlugins(e,t,i){e=(e||"").toString();if(!this._userPlugins.hasOwnProperty(e)){return i()}let a=this._userPlugins[e]||[];let s=this._defaultPlugins[e]||[];if(a.length){this.logger.debug({tnx:"transaction",pluginCount:a.length,step:e},"Using %s plugins for %s",a.length,e)}if(a.length+s.length===0){return i()}let n=0;let o="default";let processPlugins=()=>{let e=o==="default"?s:a;if(n>=e.length){if(o==="default"&&a.length){o="user";n=0;e=a}else{return i()}}let r=e[n++];r(t,(e=>{if(e){return i(e)}processPlugins()}))};processPlugins()}setupProxy(e){let t=c.parse(e);this.getSocket=(e,i)=>{let a=t.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+a)){return this.meta.get("proxy_handler_"+a)(t,e,i)}switch(a){case"http":case"https":p(t.href,e.port,e.host,((e,t)=>{if(e){return i(e)}return i(null,{connection:t})}));return;case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module")){return i(new Error("Socks module not loaded"))}let connect=a=>{let s=!!this.meta.get("proxy_socks_module").SocksClient;let n=s?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module");let o=Number(t.protocol.replace(/\D/g,""))||5;let r={proxy:{ipaddress:a,port:Number(t.port),type:o},[s?"destination":"target"]:{host:e.host,port:e.port},command:"connect"};if(t.auth){let e=decodeURIComponent(t.auth.split(":").shift());let i=decodeURIComponent(t.auth.split(":").pop());if(s){r.proxy.userId=e;r.proxy.password=i}else if(o===4){r.userid=e}else{r.authentication={username:e,password:i}}}n.createConnection(r,((e,t)=>{if(e){return i(e)}return i(null,{connection:t.socket||t})}))};if(h.isIP(t.hostname)){return connect(t.hostname)}return u.resolve(t.hostname,((e,t)=>{if(e){return i(e)}connect(Array.isArray(t)?t[0]:t)}))}}i(new Error("Unknown proxy configuration"))}}_convertDataImages(e,t){if(!this.options.attachDataUrls&&!e.data.attachDataUrls||!e.data.html){return t()}e.resolveContent(e.data,"html",((i,a)=>{if(i){return t(i)}let s=0;a=(a||"").toString().replace(/(<img\b[^>]* src\s*=[\s"']*)(data:([^;]+);[^"'>\s]+)/gi,((t,i,a,o)=>{let r=f.randomBytes(10).toString("hex")+"@localhost";if(!e.data.attachments){e.data.attachments=[]}if(!Array.isArray(e.data.attachments)){e.data.attachments=[].concat(e.data.attachments||[])}e.data.attachments.push({path:a,cid:r,filename:"image-"+ ++s+"."+n.detectExtension(o)});return i+"cid:"+r}));e.data.html=a;t()}))}set(e,t){return this.meta.set(e,t)}get(e){return this.meta.get(e)}}e.exports=Mail},399:function(e,t,i){const a=i(673);const s=i(509);const n=i(994);class MailMessage{constructor(e,t){this.mailer=e;this.data={};this.message=null;t=t||{};let i=e.options||{};let a=e._defaults||{};Object.keys(t).forEach((e=>{this.data[e]=t[e]}));this.data.headers=this.data.headers||{};Object.keys(a).forEach((e=>{if(!(e in this.data)){this.data[e]=a[e]}else if(e==="headers"){Object.keys(a.headers).forEach((e=>{if(!(e in this.data.headers)){this.data.headers[e]=a.headers[e]}}))}}));["disableFileAccess","disableUrlAccess","normalizeHeaderKey"].forEach((e=>{if(e in i){this.data[e]=i[e]}}))}resolveContent(...e){return a.resolveContent(...e)}resolveAll(e){let t=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];if(this.data.alternatives&&this.data.alternatives.length){this.data.alternatives.forEach(((e,i)=>{t.push([this.data.alternatives,i])}))}if(this.data.attachments&&this.data.attachments.length){this.data.attachments.forEach(((e,i)=>{if(!e.filename){e.filename=(e.path||e.href||"").split("/").pop().split("?").shift()||"attachment-"+(i+1);if(e.filename.indexOf(".")<0){e.filename+="."+n.detectExtension(e.contentType)}}if(!e.contentType){e.contentType=n.detectMimeType(e.filename||e.path||e.href||"bin")}t.push([this.data.attachments,i])}))}let i=new s;let o=["from","to","cc","bcc","sender","replyTo"];o.forEach((e=>{let t;if(this.message){t=[].concat(i._parseAddresses(this.message.getHeader(e==="replyTo"?"reply-to":e))||[])}else if(this.data[e]){t=[].concat(i._parseAddresses(this.data[e])||[])}if(t&&t.length){this.data[e]=t}else if(e in this.data){this.data[e]=null}}));let r=["from","sender"];r.forEach((e=>{if(this.data[e]){this.data[e]=this.data[e].shift()}}));let p=0;let resolveNext=()=>{if(p>=t.length){return e(null,this.data)}let i=t[p++];if(!i[0]||!i[0][i[1]]){return resolveNext()}a.resolveContent(...i,((t,a)=>{if(t){return e(t)}let s={content:a};if(i[0][i[1]]&&typeof i[0][i[1]]==="object"&&!Buffer.isBuffer(i[0][i[1]])){Object.keys(i[0][i[1]]).forEach((e=>{if(!(e in s)&&!["content","path","href","raw"].includes(e)){s[e]=i[0][i[1]][e]}}))}i[0][i[1]]=s;resolveNext()}))};setImmediate((()=>resolveNext()))}normalize(e){let t=this.data.envelope||this.message.getEnvelope();let i=this.message.messageId();this.resolveAll(((a,s)=>{if(a){return e(a)}s.envelope=t;s.messageId=i;["html","text","watchHtml","amp"].forEach((e=>{if(s[e]&&s[e].content){if(typeof s[e].content==="string"){s[e]=s[e].content}else if(Buffer.isBuffer(s[e].content)){s[e]=s[e].content.toString()}}}));if(s.icalEvent&&Buffer.isBuffer(s.icalEvent.content)){s.icalEvent.content=s.icalEvent.content.toString("base64");s.icalEvent.encoding="base64"}if(s.alternatives&&s.alternatives.length){s.alternatives.forEach((e=>{if(e&&e.content&&Buffer.isBuffer(e.content)){e.content=e.content.toString("base64");e.encoding="base64"}}))}if(s.attachments&&s.attachments.length){s.attachments.forEach((e=>{if(e&&e.content&&Buffer.isBuffer(e.content)){e.content=e.content.toString("base64");e.encoding="base64"}}))}s.normalizedHeaders={};Object.keys(s.headers||{}).forEach((e=>{let t=[].concat(s.headers[e]||[]).shift();t=t&&t.value||t;if(t){if(["references","in-reply-to","message-id","content-id"].includes(e)){t=this.message._encodeHeaderValue(e,t)}s.normalizedHeaders[e]=t}}));if(s.list&&typeof s.list==="object"){let e=this._getListHeaders(s.list);e.forEach((e=>{s.normalizedHeaders[e.key]=e.value.map((e=>e&&e.value||e)).join(", ")}))}if(s.references){s.normalizedHeaders.references=this.message._encodeHeaderValue("references",s.references)}if(s.inReplyTo){s.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",s.inReplyTo)}return e(null,s)}))}setMailerHeader(){if(!this.message||!this.data.xMailer){return}this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(!this.message||!this.data.priority){return}switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)");this.message.setHeader("X-MSMail-Priority","High");this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)");this.message.setHeader("X-MSMail-Priority","Low");this.message.setHeader("Importance","Low");break;default:}}setListHeaders(){if(!this.message||!this.data.list||typeof this.data.list!=="object"){return}if(this.data.list&&typeof this.data.list==="object"){this._getListHeaders(this.data.list).forEach((e=>{e.value.forEach((t=>{this.message.addHeader(e.key,t)}))}))}}_getListHeaders(e){return Object.keys(e).map((t=>({key:"list-"+t.toLowerCase().trim(),value:[].concat(e[t]||[]).map((e=>({prepared:true,foldLines:true,value:[].concat(e||[]).map((e=>{if(typeof e==="string"){e={url:e}}if(e&&e.url){if(t.toLowerCase().trim()==="id"){let t=e.comment||"";if(n.isPlainText(t)){t='"'+t+'"'}else{t=n.encodeWord(t)}return(e.comment?t+" ":"")+this._formatListUrl(e.url).replace(/^<[^:]+\/{,2}/,"")}let i=e.comment||"";if(!n.isPlainText(i)){i=n.encodeWord(i)}return this._formatListUrl(e.url)+(e.comment?" ("+i+")":"")}return""})).filter((e=>e)).join(", ")})))})))}_formatListUrl(e){e=e.replace(/[\s<]+|[\s>]+/g,"");if(/^(https?|mailto|ftp):/.test(e)){return"<"+e+">"}if(/^[^@]+@[^@]+$/.test(e)){return"<mailto:"+e+">"}return"<http://"+e+">"}}e.exports=MailMessage},994:function(e,t,i){const a=i(10);const s=i(716);const n=i(730);e.exports={isPlainText(e,t){const i=t?/[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;if(typeof e!=="string"||i.test(e)){return false}else{return true}},hasLongerLines(e,t){if(e.length>128*1024){return true}return new RegExp("^.{"+(t+1)+",}","m").test(e)},encodeWord(e,t,i){t=(t||"Q").toString().toUpperCase().trim().charAt(0);i=i||0;let n;let o="UTF-8";if(i&&i>7+o.length){i-=7+o.length}if(t==="Q"){n=s.encode(e).replace(/[^a-z0-9!*+\-/=]/gi,(e=>{let t=e.charCodeAt(0).toString(16).toUpperCase();if(e===" "){return"_"}else{return"="+(t.length===1?"0"+t:t)}}))}else if(t==="B"){n=typeof e==="string"?e:a.encode(e);i=i?Math.max(3,(i-i%4)/4*3):0}if(i&&(t!=="B"?n:a.encode(e)).length>i){if(t==="Q"){n=this.splitMimeEncodedString(n,i).join("?= =?"+o+"?"+t+"?")}else{let e=[];let s="";for(let t=0,o=n.length;t<o;t++){let r=n.charAt(t);if(/[\ud83c\ud83d\ud83e]/.test(r)&&t<o-1){r+=n.charAt(++t)}if(Buffer.byteLength(s+r)<=i||t===0){s+=r}else{e.push(a.encode(s));s=r}}if(s){e.push(a.encode(s))}if(e.length>1){n=e.join("?= =?"+o+"?"+t+"?")}else{n=e.join("")}}}else if(t==="B"){n=a.encode(e)}return"=?"+o+"?"+t+"?"+n+(n.substr(-2)==="?="?"":"?=")},encodeWords(e,t,i,a){i=i||0;let s;let n=e.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!n){return e}if(a){return this.encodeWord(e,t,i)}let o=e.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!o){return e}let r=n.index+(n[0].match(/[^\s]/)||{index:0}).index;let p=o.index+(o[1]||"").length;s=(r?e.substr(0,r):"")+this.encodeWord(e.substring(r,p),t||"Q",i)+(p<e.length?e.substr(p):"");return s},buildHeaderValue(e){let t=[];Object.keys(e.params||{}).forEach((i=>{let a=e.params[i];if(!this.isPlainText(a,true)||a.length>=75){this.buildHeaderParam(i,a,50).forEach((e=>{if(!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(e.value)||e.key.substr(-1)==="*"){t.push(e.key+"="+e.value)}else{t.push(e.key+"="+JSON.stringify(e.value))}}))}else if(/[\s'"\\;:/=(),<>@[\]?]|^-/.test(a)){t.push(i+"="+JSON.stringify(a))}else{t.push(i+"="+a)}}));return e.value+(t.length?"; "+t.join("; "):"")},buildHeaderParam(e,t,i){let a=[];let s=typeof t==="string"?t:(t||"").toString();let n;let o,r;let p;let l=0;let c,d;i=i||50;if(this.isPlainText(t,true)){if(s.length<=i){return[{key:e,value:s}]}s=s.replace(new RegExp(".{"+i+"}","g"),(e=>{a.push({line:e});return""}));if(s){a.push({line:s})}}else{if(/[\uD800-\uDBFF]/.test(s)){n=[];for(c=0,d=s.length;c<d;c++){o=s.charAt(c);r=o.charCodeAt(0);if(r>=55296&&r<=56319&&c<d-1){o+=s.charAt(c+1);n.push(o);c++}else{n.push(o)}}s=n}p="utf-8''";let e=true;l=0;for(c=0,d=s.length;c<d;c++){o=s[c];if(e){o=this.safeEncodeURIComponent(o)}else{o=o===" "?o:this.safeEncodeURIComponent(o);if(o!==s[c]){if((this.safeEncodeURIComponent(p)+o).length>=i){a.push({line:p,encoded:e});p="";l=c-1}else{e=true;c=l;p="";continue}}}if((p+o).length>=i){a.push({line:p,encoded:e});p=o=s[c]===" "?" ":this.safeEncodeURIComponent(s[c]);if(o===s[c]){e=false;l=c-1}else{e=true}}else{p+=o}}if(p){a.push({line:p,encoded:e})}}return a.map(((t,i)=>({key:e+"*"+i+(t.encoded?"*":""),value:t.line})))},parseHeaderValue(e){let t={value:false,params:{}};let i=false;let a="";let s="value";let n=false;let o=false;let r;for(let p=0,l=e.length;p<l;p++){r=e.charAt(p);if(s==="key"){if(r==="="){i=a.trim().toLowerCase();s="value";a="";continue}a+=r}else{if(o){a+=r}else if(r==="\\"){o=true;continue}else if(n&&r===n){n=false}else if(!n&&r==='"'){n=r}else if(!n&&r===";"){if(i===false){t.value=a.trim()}else{t.params[i]=a.trim()}s="key";a=""}else{a+=r}o=false}}if(s==="value"){if(i===false){t.value=a.trim()}else{t.params[i]=a.trim()}}else if(a.trim()){t.params[a.trim().toLowerCase()]=""}Object.keys(t.params).forEach((e=>{let i,a,s,n;if(s=e.match(/(\*(\d+)|\*(\d+)\*|\*)$/)){i=e.substr(0,s.index);a=Number(s[2]||s[3])||0;if(!t.params[i]||typeof t.params[i]!=="object"){t.params[i]={charset:false,values:[]}}n=t.params[e];if(a===0&&s[0].substr(-1)==="*"&&(s=n.match(/^([^']*)'[^']*'(.*)$/))){t.params[i].charset=s[1]||"iso-8859-1";n=s[2]}t.params[i].values[a]=n;delete t.params[e]}}));Object.keys(t.params).forEach((e=>{let i;if(t.params[e]&&Array.isArray(t.params[e].values)){i=t.params[e].values.map((e=>e||"")).join("");if(t.params[e].charset){t.params[e]="=?"+t.params[e].charset+"?Q?"+i.replace(/[=?_\s]/g,(e=>{let t=e.charCodeAt(0).toString(16);if(e===" "){return"_"}else{return"%"+(t.length<2?"0":"")+t}})).replace(/%/g,"=")+"?="}else{t.params[e]=i}}}));return t},detectExtension:e=>n.detectExtension(e),detectMimeType:e=>n.detectMimeType(e),foldLines(e,t,i){e=(e||"").toString();t=t||76;let a=0,s=e.length,n="",o,r;while(a<s){o=e.substr(a,t);if(o.length<t){n+=o;break}if(r=o.match(/^[^\n\r]*(\r?\n|\r)/)){o=r[0];n+=o;a+=o.length;continue}else if((r=o.match(/(\s+)[^\s]*$/))&&r[0].length-(i?(r[1]||"").length:0)<o.length){o=o.substr(0,o.length-(r[0].length-(i?(r[1]||"").length:0)))}else if(r=e.substr(a+o.length).match(/^[^\s]+(\s*)/)){o=o+r[0].substr(0,r[0].length-(!i?(r[1]||"").length:0))}n+=o;a+=o.length;if(a<s){n+="\r\n"}}return n},splitMimeEncodedString:(e,t)=>{let i,a,s,n,o=[];t=Math.max(t||0,12);while(e.length){i=e.substr(0,t);if(a=i.match(/[=][0-9A-F]?$/i)){i=i.substr(0,a.index)}n=false;while(!n){n=true;if(a=e.substr(i.length).match(/^[=]([0-9A-F]{2})/i)){s=parseInt(a[1],16);if(s<194&&s>127){i=i.substr(0,i.length-3);n=false}}}if(i.length){o.push(i)}e=e.substr(i.length)}return o},encodeURICharComponent:e=>{let t="";let i=e.charCodeAt(0).toString(16).toUpperCase();if(i.length%2){i="0"+i}if(i.length>2){for(let e=0,a=i.length/2;e<a;e++){t+="%"+i.substr(e,2)}}else{t+="%"+i}return t},safeEncodeURIComponent(e){e=(e||"").toString();try{e=encodeURIComponent(e)}catch(t){return e.replace(/[^\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]+/g,"")}return e.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,(e=>this.encodeURICharComponent(e)))}}},730:function(e,t,i){const a=i(17);const s="application/octet-stream";const n="bin";const o=new Map([["application/acad","dwg"],["application/applixware","aw"],["application/arj","arj"],["application/atom+xml","xml"],["application/atomcat+xml","atomcat"],["application/atomsvc+xml","atomsvc"],["application/base64",["mm","mme"]],["application/binhex","hqx"],["application/binhex4","hqx"],["application/book",["book","boo"]],["application/ccxml+xml,","ccxml"],["application/cdf","cdf"],["application/cdmi-capability","cdmia"],["application/cdmi-container","cdmic"],["application/cdmi-domain","cdmid"],["application/cdmi-object","cdmio"],["application/cdmi-queue","cdmiq"],["application/clariscad","ccad"],["application/commonground","dp"],["application/cu-seeme","cu"],["application/davmount+xml","davmount"],["application/drafting","drw"],["application/dsptype","tsp"],["application/dssc+der","dssc"],["application/dssc+xml","xdssc"],["application/dxf","dxf"],["application/ecmascript",["js","es"]],["application/emma+xml","emma"],["application/envoy","evy"],["application/epub+zip","epub"],["application/excel",["xls","xl","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/exi","exi"],["application/font-tdpfr","pfr"],["application/fractals","fif"],["application/freeloader","frl"],["application/futuresplash","spl"],["application/gnutar","tgz"],["application/groupwise","vew"],["application/hlp","hlp"],["application/hta","hta"],["application/hyperstudio","stk"],["application/i-deas","unv"],["application/iges",["iges","igs"]],["application/inf","inf"],["application/internet-property-stream","acx"],["application/ipfix","ipfix"],["application/java","class"],["application/java-archive","jar"],["application/java-byte-code","class"],["application/java-serialized-object","ser"],["application/java-vm","class"],["application/javascript","js"],["application/json","json"],["application/lha","lha"],["application/lzx","lzx"],["application/mac-binary","bin"],["application/mac-binhex","hqx"],["application/mac-binhex40","hqx"],["application/mac-compactpro","cpt"],["application/macbinary","bin"],["application/mads+xml","mads"],["application/marc","mrc"],["application/marcxml+xml","mrcx"],["application/mathematica","ma"],["application/mathml+xml","mathml"],["application/mbedlet","mbd"],["application/mbox","mbox"],["application/mcad","mcd"],["application/mediaservercontrol+xml","mscml"],["application/metalink4+xml","meta4"],["application/mets+xml","mets"],["application/mime","aps"],["application/mods+xml","mods"],["application/mp21","m21"],["application/mp4","mp4"],["application/mspowerpoint",["ppt","pot","pps","ppz"]],["application/msword",["doc","dot","w6w","wiz","word"]],["application/mswrite","wri"],["application/mxf","mxf"],["application/netmc","mcp"],["application/octet-stream",["*"]],["application/oda","oda"],["application/oebps-package+xml","opf"],["application/ogg","ogx"],["application/olescript","axs"],["application/onenote","onetoc"],["application/patch-ops-error+xml","xer"],["application/pdf","pdf"],["application/pgp-encrypted","asc"],["application/pgp-signature","pgp"],["application/pics-rules","prf"],["application/pkcs-12","p12"],["application/pkcs-crl","crl"],["application/pkcs10","p10"],["application/pkcs7-mime",["p7c","p7m"]],["application/pkcs7-signature","p7s"],["application/pkcs8","p8"],["application/pkix-attr-cert","ac"],["application/pkix-cert",["cer","crt"]],["application/pkix-crl","crl"],["application/pkix-pkipath","pkipath"],["application/pkixcmp","pki"],["application/plain","text"],["application/pls+xml","pls"],["application/postscript",["ps","ai","eps"]],["application/powerpoint","ppt"],["application/pro_eng",["part","prt"]],["application/prs.cww","cww"],["application/pskc+xml","pskcxml"],["application/rdf+xml","rdf"],["application/reginfo+xml","rif"],["application/relax-ng-compact-syntax","rnc"],["application/resource-lists+xml","rl"],["application/resource-lists-diff+xml","rld"],["application/ringing-tones","rng"],["application/rls-services+xml","rs"],["application/rsd+xml","rsd"],["application/rss+xml","xml"],["application/rtf",["rtf","rtx"]],["application/sbml+xml","sbml"],["application/scvp-cv-request","scq"],["application/scvp-cv-response","scs"],["application/scvp-vp-request","spq"],["application/scvp-vp-response","spp"],["application/sdp","sdp"],["application/sea","sea"],["application/set","set"],["application/set-payment-initiation","setpay"],["application/set-registration-initiation","setreg"],["application/shf+xml","shf"],["application/sla","stl"],["application/smil",["smi","smil"]],["application/smil+xml","smi"],["application/solids","sol"],["application/sounder","sdr"],["application/sparql-query","rq"],["application/sparql-results+xml","srx"],["application/srgs","gram"],["application/srgs+xml","grxml"],["application/sru+xml","sru"],["application/ssml+xml","ssml"],["application/step",["step","stp"]],["application/streamingmedia","ssm"],["application/tei+xml","tei"],["application/thraud+xml","tfi"],["application/timestamped-data","tsd"],["application/toolbook","tbk"],["application/vda","vda"],["application/vnd.3gpp.pic-bw-large","plb"],["application/vnd.3gpp.pic-bw-small","psb"],["application/vnd.3gpp.pic-bw-var","pvb"],["application/vnd.3gpp2.tcap","tcap"],["application/vnd.3m.post-it-notes","pwn"],["application/vnd.accpac.simply.aso","aso"],["application/vnd.accpac.simply.imp","imp"],["application/vnd.acucobol","acu"],["application/vnd.acucorp","atc"],["application/vnd.adobe.air-application-installer-package+zip","air"],["application/vnd.adobe.fxp","fxp"],["application/vnd.adobe.xdp+xml","xdp"],["application/vnd.adobe.xfdf","xfdf"],["application/vnd.ahead.space","ahead"],["application/vnd.airzip.filesecure.azf","azf"],["application/vnd.airzip.filesecure.azs","azs"],["application/vnd.amazon.ebook","azw"],["application/vnd.americandynamics.acc","acc"],["application/vnd.amiga.ami","ami"],["application/vnd.android.package-archive","apk"],["application/vnd.anser-web-certificate-issue-initiation","cii"],["application/vnd.anser-web-funds-transfer-initiation","fti"],["application/vnd.antix.game-component","atx"],["application/vnd.apple.installer+xml","mpkg"],["application/vnd.apple.mpegurl","m3u8"],["application/vnd.aristanetworks.swi","swi"],["application/vnd.audiograph","aep"],["application/vnd.blueice.multipass","mpm"],["application/vnd.bmi","bmi"],["application/vnd.businessobjects","rep"],["application/vnd.chemdraw+xml","cdxml"],["application/vnd.chipnuts.karaoke-mmd","mmd"],["application/vnd.cinderella","cdy"],["application/vnd.claymore","cla"],["application/vnd.cloanto.rp9","rp9"],["application/vnd.clonk.c4group","c4g"],["application/vnd.cluetrust.cartomobile-config","c11amc"],["application/vnd.cluetrust.cartomobile-config-pkg","c11amz"],["application/vnd.commonspace","csp"],["application/vnd.contact.cmsg","cdbcmsg"],["application/vnd.cosmocaller","cmc"],["application/vnd.crick.clicker","clkx"],["application/vnd.crick.clicker.keyboard","clkk"],["application/vnd.crick.clicker.palette","clkp"],["application/vnd.crick.clicker.template","clkt"],["application/vnd.crick.clicker.wordbank","clkw"],["application/vnd.criticaltools.wbs+xml","wbs"],["application/vnd.ctc-posml","pml"],["application/vnd.cups-ppd","ppd"],["application/vnd.curl.car","car"],["application/vnd.curl.pcurl","pcurl"],["application/vnd.data-vision.rdz","rdz"],["application/vnd.denovo.fcselayout-link","fe_launch"],["application/vnd.dna","dna"],["application/vnd.dolby.mlp","mlp"],["application/vnd.dpgraph","dpg"],["application/vnd.dreamfactory","dfac"],["application/vnd.dvb.ait","ait"],["application/vnd.dvb.service","svc"],["application/vnd.dynageo","geo"],["application/vnd.ecowin.chart","mag"],["application/vnd.enliven","nml"],["application/vnd.epson.esf","esf"],["application/vnd.epson.msf","msf"],["application/vnd.epson.quickanime","qam"],["application/vnd.epson.salt","slt"],["application/vnd.epson.ssf","ssf"],["application/vnd.eszigno3+xml","es3"],["application/vnd.ezpix-album","ez2"],["application/vnd.ezpix-package","ez3"],["application/vnd.fdf","fdf"],["application/vnd.fdsn.seed","seed"],["application/vnd.flographit","gph"],["application/vnd.fluxtime.clip","ftc"],["application/vnd.framemaker","fm"],["application/vnd.frogans.fnc","fnc"],["application/vnd.frogans.ltf","ltf"],["application/vnd.fsc.weblaunch","fsc"],["application/vnd.fujitsu.oasys","oas"],["application/vnd.fujitsu.oasys2","oa2"],["application/vnd.fujitsu.oasys3","oa3"],["application/vnd.fujitsu.oasysgp","fg5"],["application/vnd.fujitsu.oasysprs","bh2"],["application/vnd.fujixerox.ddd","ddd"],["application/vnd.fujixerox.docuworks","xdw"],["application/vnd.fujixerox.docuworks.binder","xbd"],["application/vnd.fuzzysheet","fzs"],["application/vnd.genomatix.tuxedo","txd"],["application/vnd.geogebra.file","ggb"],["application/vnd.geogebra.tool","ggt"],["application/vnd.geometry-explorer","gex"],["application/vnd.geonext","gxt"],["application/vnd.geoplan","g2w"],["application/vnd.geospace","g3w"],["application/vnd.gmx","gmx"],["application/vnd.google-earth.kml+xml","kml"],["application/vnd.google-earth.kmz","kmz"],["application/vnd.grafeq","gqf"],["application/vnd.groove-account","gac"],["application/vnd.groove-help","ghf"],["application/vnd.groove-identity-message","gim"],["application/vnd.groove-injector","grv"],["application/vnd.groove-tool-message","gtm"],["application/vnd.groove-tool-template","tpl"],["application/vnd.groove-vcard","vcg"],["application/vnd.hal+xml","hal"],["application/vnd.handheld-entertainment+xml","zmm"],["application/vnd.hbci","hbci"],["application/vnd.hhe.lesson-player","les"],["application/vnd.hp-hpgl",["hgl","hpg","hpgl"]],["application/vnd.hp-hpid","hpid"],["application/vnd.hp-hps","hps"],["application/vnd.hp-jlyt","jlt"],["application/vnd.hp-pcl","pcl"],["application/vnd.hp-pclxl","pclxl"],["application/vnd.hydrostatix.sof-data","sfd-hdstx"],["application/vnd.hzn-3d-crossword","x3d"],["application/vnd.ibm.minipay","mpy"],["application/vnd.ibm.modcap","afp"],["application/vnd.ibm.rights-management","irm"],["application/vnd.ibm.secure-container","sc"],["application/vnd.iccprofile","icc"],["application/vnd.igloader","igl"],["application/vnd.immervision-ivp","ivp"],["application/vnd.immervision-ivu","ivu"],["application/vnd.insors.igm","igm"],["application/vnd.intercon.formnet","xpw"],["application/vnd.intergeo","i2g"],["application/vnd.intu.qbo","qbo"],["application/vnd.intu.qfx","qfx"],["application/vnd.ipunplugged.rcprofile","rcprofile"],["application/vnd.irepository.package+xml","irp"],["application/vnd.is-xpr","xpr"],["application/vnd.isac.fcs","fcs"],["application/vnd.jam","jam"],["application/vnd.jcp.javame.midlet-rms","rms"],["application/vnd.jisp","jisp"],["application/vnd.joost.joda-archive","joda"],["application/vnd.kahootz","ktz"],["application/vnd.kde.karbon","karbon"],["application/vnd.kde.kchart","chrt"],["application/vnd.kde.kformula","kfo"],["application/vnd.kde.kivio","flw"],["application/vnd.kde.kontour","kon"],["application/vnd.kde.kpresenter","kpr"],["application/vnd.kde.kspread","ksp"],["application/vnd.kde.kword","kwd"],["application/vnd.kenameaapp","htke"],["application/vnd.kidspiration","kia"],["application/vnd.kinar","kne"],["application/vnd.koan","skp"],["application/vnd.kodak-descriptor","sse"],["application/vnd.las.las+xml","lasxml"],["application/vnd.llamagraphics.life-balance.desktop","lbd"],["application/vnd.llamagraphics.life-balance.exchange+xml","lbe"],["application/vnd.lotus-1-2-3","123"],["application/vnd.lotus-approach","apr"],["application/vnd.lotus-freelance","pre"],["application/vnd.lotus-notes","nsf"],["application/vnd.lotus-organizer","org"],["application/vnd.lotus-screencam","scm"],["application/vnd.lotus-wordpro","lwp"],["application/vnd.macports.portpkg","portpkg"],["application/vnd.mcd","mcd"],["application/vnd.medcalcdata","mc1"],["application/vnd.mediastation.cdkey","cdkey"],["application/vnd.mfer","mwf"],["application/vnd.mfmp","mfm"],["application/vnd.micrografx.flo","flo"],["application/vnd.micrografx.igx","igx"],["application/vnd.mif","mif"],["application/vnd.mobius.daf","daf"],["application/vnd.mobius.dis","dis"],["application/vnd.mobius.mbk","mbk"],["application/vnd.mobius.mqy","mqy"],["application/vnd.mobius.msl","msl"],["application/vnd.mobius.plc","plc"],["application/vnd.mobius.txf","txf"],["application/vnd.mophun.application","mpn"],["application/vnd.mophun.certificate","mpc"],["application/vnd.mozilla.xul+xml","xul"],["application/vnd.ms-artgalry","cil"],["application/vnd.ms-cab-compressed","cab"],["application/vnd.ms-excel",["xls","xla","xlc","xlm","xlt","xlw","xlb","xll"]],["application/vnd.ms-excel.addin.macroenabled.12","xlam"],["application/vnd.ms-excel.sheet.binary.macroenabled.12","xlsb"],["application/vnd.ms-excel.sheet.macroenabled.12","xlsm"],["application/vnd.ms-excel.template.macroenabled.12","xltm"],["application/vnd.ms-fontobject","eot"],["application/vnd.ms-htmlhelp","chm"],["application/vnd.ms-ims","ims"],["application/vnd.ms-lrm","lrm"],["application/vnd.ms-officetheme","thmx"],["application/vnd.ms-outlook","msg"],["application/vnd.ms-pki.certstore","sst"],["application/vnd.ms-pki.pko","pko"],["application/vnd.ms-pki.seccat","cat"],["application/vnd.ms-pki.stl","stl"],["application/vnd.ms-pkicertstore","sst"],["application/vnd.ms-pkiseccat","cat"],["application/vnd.ms-pkistl","stl"],["application/vnd.ms-powerpoint",["ppt","pot","pps","ppa","pwz"]],["application/vnd.ms-powerpoint.addin.macroenabled.12","ppam"],["application/vnd.ms-powerpoint.presentation.macroenabled.12","pptm"],["application/vnd.ms-powerpoint.slide.macroenabled.12","sldm"],["application/vnd.ms-powerpoint.slideshow.macroenabled.12","ppsm"],["application/vnd.ms-powerpoint.template.macroenabled.12","potm"],["application/vnd.ms-project","mpp"],["application/vnd.ms-word.document.macroenabled.12","docm"],["application/vnd.ms-word.template.macroenabled.12","dotm"],["application/vnd.ms-works",["wks","wcm","wdb","wps"]],["application/vnd.ms-wpl","wpl"],["application/vnd.ms-xpsdocument","xps"],["application/vnd.mseq","mseq"],["application/vnd.musician","mus"],["application/vnd.muvee.style","msty"],["application/vnd.neurolanguage.nlu","nlu"],["application/vnd.noblenet-directory","nnd"],["application/vnd.noblenet-sealer","nns"],["application/vnd.noblenet-web","nnw"],["application/vnd.nokia.configuration-message","ncm"],["application/vnd.nokia.n-gage.data","ngdat"],["application/vnd.nokia.n-gage.symbian.install","n-gage"],["application/vnd.nokia.radio-preset","rpst"],["application/vnd.nokia.radio-presets","rpss"],["application/vnd.nokia.ringing-tone","rng"],["application/vnd.novadigm.edm","edm"],["application/vnd.novadigm.edx","edx"],["application/vnd.novadigm.ext","ext"],["application/vnd.oasis.opendocument.chart","odc"],["application/vnd.oasis.opendocument.chart-template","otc"],["application/vnd.oasis.opendocument.database","odb"],["application/vnd.oasis.opendocument.formula","odf"],["application/vnd.oasis.opendocument.formula-template","odft"],["application/vnd.oasis.opendocument.graphics","odg"],["application/vnd.oasis.opendocument.graphics-template","otg"],["application/vnd.oasis.opendocument.image","odi"],["application/vnd.oasis.opendocument.image-template","oti"],["application/vnd.oasis.opendocument.presentation","odp"],["application/vnd.oasis.opendocument.presentation-template","otp"],["application/vnd.oasis.opendocument.spreadsheet","ods"],["application/vnd.oasis.opendocument.spreadsheet-template","ots"],["application/vnd.oasis.opendocument.text","odt"],["application/vnd.oasis.opendocument.text-master","odm"],["application/vnd.oasis.opendocument.text-template","ott"],["application/vnd.oasis.opendocument.text-web","oth"],["application/vnd.olpc-sugar","xo"],["application/vnd.oma.dd2+xml","dd2"],["application/vnd.openofficeorg.extension","oxt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx"],["application/vnd.openxmlformats-officedocument.presentationml.slide","sldx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsx"],["application/vnd.openxmlformats-officedocument.presentationml.template","potx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","xltx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","dotx"],["application/vnd.osgeo.mapguide.package","mgp"],["application/vnd.osgi.dp","dp"],["application/vnd.palm","pdb"],["application/vnd.pawaafile","paw"],["application/vnd.pg.format","str"],["application/vnd.pg.osasli","ei6"],["application/vnd.picsel","efif"],["application/vnd.pmi.widget","wg"],["application/vnd.pocketlearn","plf"],["application/vnd.powerbuilder6","pbd"],["application/vnd.previewsystems.box","box"],["application/vnd.proteus.magazine","mgz"],["application/vnd.publishare-delta-tree","qps"],["application/vnd.pvi.ptid1","ptid"],["application/vnd.quark.quarkxpress","qxd"],["application/vnd.realvnc.bed","bed"],["application/vnd.recordare.musicxml","mxl"],["application/vnd.recordare.musicxml+xml","musicxml"],["application/vnd.rig.cryptonote","cryptonote"],["application/vnd.rim.cod","cod"],["application/vnd.rn-realmedia","rm"],["application/vnd.rn-realplayer","rnx"],["application/vnd.route66.link66+xml","link66"],["application/vnd.sailingtracker.track","st"],["application/vnd.seemail","see"],["application/vnd.sema","sema"],["application/vnd.semd","semd"],["application/vnd.semf","semf"],["application/vnd.shana.informed.formdata","ifm"],["application/vnd.shana.informed.formtemplate","itp"],["application/vnd.shana.informed.interchange","iif"],["application/vnd.shana.informed.package","ipk"],["application/vnd.simtech-mindmapper","twd"],["application/vnd.smaf","mmf"],["application/vnd.smart.teacher","teacher"],["application/vnd.solent.sdkm+xml","sdkm"],["application/vnd.spotfire.dxp","dxp"],["application/vnd.spotfire.sfs","sfs"],["application/vnd.stardivision.calc","sdc"],["application/vnd.stardivision.draw","sda"],["application/vnd.stardivision.impress","sdd"],["application/vnd.stardivision.math","smf"],["application/vnd.stardivision.writer","sdw"],["application/vnd.stardivision.writer-global","sgl"],["application/vnd.stepmania.stepchart","sm"],["application/vnd.sun.xml.calc","sxc"],["application/vnd.sun.xml.calc.template","stc"],["application/vnd.sun.xml.draw","sxd"],["application/vnd.sun.xml.draw.template","std"],["application/vnd.sun.xml.impress","sxi"],["application/vnd.sun.xml.impress.template","sti"],["application/vnd.sun.xml.math","sxm"],["application/vnd.sun.xml.writer","sxw"],["application/vnd.sun.xml.writer.global","sxg"],["application/vnd.sun.xml.writer.template","stw"],["application/vnd.sus-calendar","sus"],["application/vnd.svd","svd"],["application/vnd.symbian.install","sis"],["application/vnd.syncml+xml","xsm"],["application/vnd.syncml.dm+wbxml","bdm"],["application/vnd.syncml.dm+xml","xdm"],["application/vnd.tao.intent-module-archive","tao"],["application/vnd.tmobile-livetv","tmo"],["application/vnd.trid.tpt","tpt"],["application/vnd.triscape.mxs","mxs"],["application/vnd.trueapp","tra"],["application/vnd.ufdl","ufd"],["application/vnd.uiq.theme","utz"],["application/vnd.umajin","umj"],["application/vnd.unity","unityweb"],["application/vnd.uoml+xml","uoml"],["application/vnd.vcx","vcx"],["application/vnd.visio","vsd"],["application/vnd.visionary","vis"],["application/vnd.vsf","vsf"],["application/vnd.wap.wbxml","wbxml"],["application/vnd.wap.wmlc","wmlc"],["application/vnd.wap.wmlscriptc","wmlsc"],["application/vnd.webturbo","wtb"],["application/vnd.wolfram.player","nbp"],["application/vnd.wordperfect","wpd"],["application/vnd.wqd","wqd"],["application/vnd.wt.stf","stf"],["application/vnd.xara",["web","xar"]],["application/vnd.xfdl","xfdl"],["application/vnd.yamaha.hv-dic","hvd"],["application/vnd.yamaha.hv-script","hvs"],["application/vnd.yamaha.hv-voice","hvp"],["application/vnd.yamaha.openscoreformat","osf"],["application/vnd.yamaha.openscoreformat.osfpvg+xml","osfpvg"],["application/vnd.yamaha.smaf-audio","saf"],["application/vnd.yamaha.smaf-phrase","spf"],["application/vnd.yellowriver-custom-menu","cmp"],["application/vnd.zul","zir"],["application/vnd.zzazz.deck+xml","zaz"],["application/vocaltec-media-desc","vmd"],["application/vocaltec-media-file","vmf"],["application/voicexml+xml","vxml"],["application/widget","wgt"],["application/winhlp","hlp"],["application/wordperfect",["wp","wp5","wp6","wpd"]],["application/wordperfect6.0",["w60","wp5"]],["application/wordperfect6.1","w61"],["application/wsdl+xml","wsdl"],["application/wspolicy+xml","wspolicy"],["application/x-123","wk1"],["application/x-7z-compressed","7z"],["application/x-abiword","abw"],["application/x-ace-compressed","ace"],["application/x-aim","aim"],["application/x-authorware-bin","aab"],["application/x-authorware-map","aam"],["application/x-authorware-seg","aas"],["application/x-bcpio","bcpio"],["application/x-binary","bin"],["application/x-binhex40","hqx"],["application/x-bittorrent","torrent"],["application/x-bsh",["bsh","sh","shar"]],["application/x-bytecode.elisp","elc"],["application/x-bytecode.python","pyc"],["application/x-bzip","bz"],["application/x-bzip2",["boz","bz2"]],["application/x-cdf","cdf"],["application/x-cdlink","vcd"],["application/x-chat",["cha","chat"]],["application/x-chess-pgn","pgn"],["application/x-cmu-raster","ras"],["application/x-cocoa","cco"],["application/x-compactpro","cpt"],["application/x-compress","z"],["application/x-compressed",["tgz","gz","z","zip"]],["application/x-conference","nsc"],["application/x-cpio","cpio"],["application/x-cpt","cpt"],["application/x-csh","csh"],["application/x-debian-package","deb"],["application/x-deepv","deepv"],["application/x-director",["dir","dcr","dxr"]],["application/x-doom","wad"],["application/x-dtbncx+xml","ncx"],["application/x-dtbook+xml","dtb"],["application/x-dtbresource+xml","res"],["application/x-dvi","dvi"],["application/x-elc","elc"],["application/x-envoy",["env","evy"]],["application/x-esrehber","es"],["application/x-excel",["xls","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/x-font-bdf","bdf"],["application/x-font-ghostscript","gsf"],["application/x-font-linux-psf","psf"],["application/x-font-otf","otf"],["application/x-font-pcf","pcf"],["application/x-font-snf","snf"],["application/x-font-ttf","ttf"],["application/x-font-type1","pfa"],["application/x-font-woff","woff"],["application/x-frame","mif"],["application/x-freelance","pre"],["application/x-futuresplash","spl"],["application/x-gnumeric","gnumeric"],["application/x-gsp","gsp"],["application/x-gss","gss"],["application/x-gtar","gtar"],["application/x-gzip",["gz","gzip"]],["application/x-hdf","hdf"],["application/x-helpfile",["help","hlp"]],["application/x-httpd-imap","imap"],["application/x-ima","ima"],["application/x-internet-signup",["ins","isp"]],["application/x-internett-signup","ins"],["application/x-inventor","iv"],["application/x-ip2","ip"],["application/x-iphone","iii"],["application/x-java-class","class"],["application/x-java-commerce","jcm"],["application/x-java-jnlp-file","jnlp"],["application/x-javascript","js"],["application/x-koan",["skd","skm","skp","skt"]],["application/x-ksh","ksh"],["application/x-latex",["latex","ltx"]],["application/x-lha","lha"],["application/x-lisp","lsp"],["application/x-livescreen","ivy"],["application/x-lotus","wq1"],["application/x-lotusscreencam","scm"],["application/x-lzh","lzh"],["application/x-lzx","lzx"],["application/x-mac-binhex40","hqx"],["application/x-macbinary","bin"],["application/x-magic-cap-package-1.0","mc$"],["application/x-mathcad","mcd"],["application/x-meme","mm"],["application/x-midi",["mid","midi"]],["application/x-mif","mif"],["application/x-mix-transfer","nix"],["application/x-mobipocket-ebook","prc"],["application/x-mplayer2","asx"],["application/x-ms-application","application"],["application/x-ms-wmd","wmd"],["application/x-ms-wmz","wmz"],["application/x-ms-xbap","xbap"],["application/x-msaccess","mdb"],["application/x-msbinder","obd"],["application/x-mscardfile","crd"],["application/x-msclip","clp"],["application/x-msdownload",["exe","dll"]],["application/x-msexcel",["xls","xla","xlw"]],["application/x-msmediaview",["mvb","m13","m14"]],["application/x-msmetafile","wmf"],["application/x-msmoney","mny"],["application/x-mspowerpoint","ppt"],["application/x-mspublisher","pub"],["application/x-msschedule","scd"],["application/x-msterminal","trm"],["application/x-mswrite","wri"],["application/x-navi-animation","ani"],["application/x-navidoc","nvd"],["application/x-navimap","map"],["application/x-navistyle","stl"],["application/x-netcdf",["cdf","nc"]],["application/x-newton-compatible-pkg","pkg"],["application/x-nokia-9000-communicator-add-on-software","aos"],["application/x-omc","omc"],["application/x-omcdatamaker","omcd"],["application/x-omcregerator","omcr"],["application/x-pagemaker",["pm4","pm5"]],["application/x-pcl","pcl"],["application/x-perfmon",["pma","pmc","pml","pmr","pmw"]],["application/x-pixclscript","plx"],["application/x-pkcs10","p10"],["application/x-pkcs12",["p12","pfx"]],["application/x-pkcs7-certificates",["p7b","spc"]],["application/x-pkcs7-certreqresp","p7r"],["application/x-pkcs7-mime",["p7m","p7c"]],["application/x-pkcs7-signature",["p7s","p7a"]],["application/x-pointplus","css"],["application/x-portable-anymap","pnm"],["application/x-project",["mpc","mpt","mpv","mpx"]],["application/x-qpro","wb1"],["application/x-rar-compressed","rar"],["application/x-rtf","rtf"],["application/x-sdp","sdp"],["application/x-sea","sea"],["application/x-seelogo","sl"],["application/x-sh","sh"],["application/x-shar",["shar","sh"]],["application/x-shockwave-flash","swf"],["application/x-silverlight-app","xap"],["application/x-sit","sit"],["application/x-sprite",["spr","sprite"]],["application/x-stuffit","sit"],["application/x-stuffitx","sitx"],["application/x-sv4cpio","sv4cpio"],["application/x-sv4crc","sv4crc"],["application/x-tar","tar"],["application/x-tbook",["sbk","tbk"]],["application/x-tcl","tcl"],["application/x-tex","tex"],["application/x-tex-tfm","tfm"],["application/x-texinfo",["texi","texinfo"]],["application/x-troff",["roff","t","tr"]],["application/x-troff-man","man"],["application/x-troff-me","me"],["application/x-troff-ms","ms"],["application/x-troff-msvideo","avi"],["application/x-ustar","ustar"],["application/x-visio",["vsd","vst","vsw"]],["application/x-vnd.audioexplosion.mzz","mzz"],["application/x-vnd.ls-xpix","xpix"],["application/x-vrml","vrml"],["application/x-wais-source",["src","wsrc"]],["application/x-winhelp","hlp"],["application/x-wintalk","wtk"],["application/x-world",["wrl","svr"]],["application/x-wpwin","wpd"],["application/x-wri","wri"],["application/x-x509-ca-cert",["cer","crt","der"]],["application/x-x509-user-cert","crt"],["application/x-xfig","fig"],["application/x-xpinstall","xpi"],["application/x-zip-compressed","zip"],["application/xcap-diff+xml","xdf"],["application/xenc+xml","xenc"],["application/xhtml+xml","xhtml"],["application/xml","xml"],["application/xml-dtd","dtd"],["application/xop+xml","xop"],["application/xslt+xml","xslt"],["application/xspf+xml","xspf"],["application/xv+xml","mxml"],["application/yang","yang"],["application/yin+xml","yin"],["application/ynd.ms-pkipko","pko"],["application/zip","zip"],["audio/adpcm","adp"],["audio/aiff",["aiff","aif","aifc"]],["audio/basic",["snd","au"]],["audio/it","it"],["audio/make",["funk","my","pfunk"]],["audio/make.my.funk","pfunk"],["audio/mid",["mid","rmi"]],["audio/midi",["midi","kar","mid"]],["audio/mod","mod"],["audio/mp4","mp4a"],["audio/mpeg",["mpga","mp3","m2a","mp2","mpa","mpg"]],["audio/mpeg3","mp3"],["audio/nspaudio",["la","lma"]],["audio/ogg","oga"],["audio/s3m","s3m"],["audio/tsp-audio","tsi"],["audio/tsplayer","tsp"],["audio/vnd.dece.audio","uva"],["audio/vnd.digital-winds","eol"],["audio/vnd.dra","dra"],["audio/vnd.dts","dts"],["audio/vnd.dts.hd","dtshd"],["audio/vnd.lucent.voice","lvp"],["audio/vnd.ms-playready.media.pya","pya"],["audio/vnd.nuera.ecelp4800","ecelp4800"],["audio/vnd.nuera.ecelp7470","ecelp7470"],["audio/vnd.nuera.ecelp9600","ecelp9600"],["audio/vnd.qcelp","qcp"],["audio/vnd.rip","rip"],["audio/voc","voc"],["audio/voxware","vox"],["audio/wav","wav"],["audio/webm","weba"],["audio/x-aac","aac"],["audio/x-adpcm","snd"],["audio/x-aiff",["aiff","aif","aifc"]],["audio/x-au","au"],["audio/x-gsm",["gsd","gsm"]],["audio/x-jam","jam"],["audio/x-liveaudio","lam"],["audio/x-mid",["mid","midi"]],["audio/x-midi",["midi","mid"]],["audio/x-mod","mod"],["audio/x-mpeg","mp2"],["audio/x-mpeg-3","mp3"],["audio/x-mpegurl","m3u"],["audio/x-mpequrl","m3u"],["audio/x-ms-wax","wax"],["audio/x-ms-wma","wma"],["audio/x-nspaudio",["la","lma"]],["audio/x-pn-realaudio",["ra","ram","rm","rmm","rmp"]],["audio/x-pn-realaudio-plugin",["ra","rmp","rpm"]],["audio/x-psid","sid"],["audio/x-realaudio","ra"],["audio/x-twinvq","vqf"],["audio/x-twinvq-plugin",["vqe","vql"]],["audio/x-vnd.audioexplosion.mjuicemediafile","mjf"],["audio/x-voc","voc"],["audio/x-wav","wav"],["audio/xm","xm"],["chemical/x-cdx","cdx"],["chemical/x-cif","cif"],["chemical/x-cmdf","cmdf"],["chemical/x-cml","cml"],["chemical/x-csml","csml"],["chemical/x-pdb",["pdb","xyz"]],["chemical/x-xyz","xyz"],["drawing/x-dwf","dwf"],["i-world/i-vrml","ivr"],["image/bmp",["bmp","bm"]],["image/cgm","cgm"],["image/cis-cod","cod"],["image/cmu-raster",["ras","rast"]],["image/fif","fif"],["image/florian",["flo","turbot"]],["image/g3fax","g3"],["image/gif","gif"],["image/ief",["ief","iefs"]],["image/jpeg",["jpeg","jpe","jpg","jfif","jfif-tbnl"]],["image/jutvision","jut"],["image/ktx","ktx"],["image/naplps",["nap","naplps"]],["image/pict",["pic","pict"]],["image/pipeg","jfif"],["image/pjpeg",["jfif","jpe","jpeg","jpg"]],["image/png",["png","x-png"]],["image/prs.btif","btif"],["image/svg+xml","svg"],["image/tiff",["tif","tiff"]],["image/vasa","mcf"],["image/vnd.adobe.photoshop","psd"],["image/vnd.dece.graphic","uvi"],["image/vnd.djvu","djvu"],["image/vnd.dvb.subtitle","sub"],["image/vnd.dwg",["dwg","dxf","svf"]],["image/vnd.dxf","dxf"],["image/vnd.fastbidsheet","fbs"],["image/vnd.fpx","fpx"],["image/vnd.fst","fst"],["image/vnd.fujixerox.edmics-mmr","mmr"],["image/vnd.fujixerox.edmics-rlc","rlc"],["image/vnd.ms-modi","mdi"],["image/vnd.net-fpx",["fpx","npx"]],["image/vnd.rn-realflash","rf"],["image/vnd.rn-realpix","rp"],["image/vnd.wap.wbmp","wbmp"],["image/vnd.xiff","xif"],["image/webp","webp"],["image/x-cmu-raster","ras"],["image/x-cmx","cmx"],["image/x-dwg",["dwg","dxf","svf"]],["image/x-freehand","fh"],["image/x-icon","ico"],["image/x-jg","art"],["image/x-jps","jps"],["image/x-niff",["niff","nif"]],["image/x-pcx","pcx"],["image/x-pict",["pct","pic"]],["image/x-portable-anymap","pnm"],["image/x-portable-bitmap","pbm"],["image/x-portable-graymap","pgm"],["image/x-portable-greymap","pgm"],["image/x-portable-pixmap","ppm"],["image/x-quicktime",["qif","qti","qtif"]],["image/x-rgb","rgb"],["image/x-tiff",["tif","tiff"]],["image/x-windows-bmp","bmp"],["image/x-xbitmap","xbm"],["image/x-xbm","xbm"],["image/x-xpixmap",["xpm","pm"]],["image/x-xwd","xwd"],["image/x-xwindowdump","xwd"],["image/xbm","xbm"],["image/xpm","xpm"],["message/rfc822",["eml","mht","mhtml","nws","mime"]],["model/iges",["iges","igs"]],["model/mesh","msh"],["model/vnd.collada+xml","dae"],["model/vnd.dwf","dwf"],["model/vnd.gdl","gdl"],["model/vnd.gtw","gtw"],["model/vnd.mts","mts"],["model/vnd.vtu","vtu"],["model/vrml",["vrml","wrl","wrz"]],["model/x-pov","pov"],["multipart/x-gzip","gzip"],["multipart/x-ustar","ustar"],["multipart/x-zip","zip"],["music/crescendo",["mid","midi"]],["music/x-karaoke","kar"],["paleovu/x-pv","pvu"],["text/asp","asp"],["text/calendar","ics"],["text/css","css"],["text/csv","csv"],["text/ecmascript","js"],["text/h323","323"],["text/html",["html","htm","stm","acgi","htmls","htx","shtml"]],["text/iuls","uls"],["text/javascript","js"],["text/mcf","mcf"],["text/n3","n3"],["text/pascal","pas"],["text/plain",["txt","bas","c","h","c++","cc","com","conf","cxx","def","f","f90","for","g","hh","idc","jav","java","list","log","lst","m","mar","pl","sdml","text"]],["text/plain-bas","par"],["text/prs.lines.tag","dsc"],["text/richtext",["rtx","rt","rtf"]],["text/scriplet","wsc"],["text/scriptlet","sct"],["text/sgml",["sgm","sgml"]],["text/tab-separated-values","tsv"],["text/troff","t"],["text/turtle","ttl"],["text/uri-list",["uni","unis","uri","uris"]],["text/vnd.abc","abc"],["text/vnd.curl","curl"],["text/vnd.curl.dcurl","dcurl"],["text/vnd.curl.mcurl","mcurl"],["text/vnd.curl.scurl","scurl"],["text/vnd.fly","fly"],["text/vnd.fmi.flexstor","flx"],["text/vnd.graphviz","gv"],["text/vnd.in3d.3dml","3dml"],["text/vnd.in3d.spot","spot"],["text/vnd.rn-realtext","rt"],["text/vnd.sun.j2me.app-descriptor","jad"],["text/vnd.wap.wml","wml"],["text/vnd.wap.wmlscript","wmls"],["text/webviewhtml","htt"],["text/x-asm",["asm","s"]],["text/x-audiosoft-intra","aip"],["text/x-c",["c","cc","cpp"]],["text/x-component","htc"],["text/x-fortran",["for","f","f77","f90"]],["text/x-h",["h","hh"]],["text/x-java-source",["java","jav"]],["text/x-java-source,java","java"],["text/x-la-asf","lsx"],["text/x-m","m"],["text/x-pascal","p"],["text/x-script","hlb"],["text/x-script.csh","csh"],["text/x-script.elisp","el"],["text/x-script.guile","scm"],["text/x-script.ksh","ksh"],["text/x-script.lisp","lsp"],["text/x-script.perl","pl"],["text/x-script.perl-module","pm"],["text/x-script.phyton","py"],["text/x-script.rexx","rexx"],["text/x-script.scheme","scm"],["text/x-script.sh","sh"],["text/x-script.tcl","tcl"],["text/x-script.tcsh","tcsh"],["text/x-script.zsh","zsh"],["text/x-server-parsed-html",["shtml","ssi"]],["text/x-setext","etx"],["text/x-sgml",["sgm","sgml"]],["text/x-speech",["spc","talk"]],["text/x-uil","uil"],["text/x-uuencode",["uu","uue"]],["text/x-vcalendar","vcs"],["text/x-vcard","vcf"],["text/xml","xml"],["video/3gpp","3gp"],["video/3gpp2","3g2"],["video/animaflex","afl"],["video/avi","avi"],["video/avs-video","avs"],["video/dl","dl"],["video/fli","fli"],["video/gl","gl"],["video/h261","h261"],["video/h263","h263"],["video/h264","h264"],["video/jpeg","jpgv"],["video/jpm","jpm"],["video/mj2","mj2"],["video/mp4","mp4"],["video/mpeg",["mpeg","mp2","mpa","mpe","mpg","mpv2","m1v","m2v","mp3"]],["video/msvideo","avi"],["video/ogg","ogv"],["video/quicktime",["mov","qt","moov"]],["video/vdo","vdo"],["video/vivo",["viv","vivo"]],["video/vnd.dece.hd","uvh"],["video/vnd.dece.mobile","uvm"],["video/vnd.dece.pd","uvp"],["video/vnd.dece.sd","uvs"],["video/vnd.dece.video","uvv"],["video/vnd.fvt","fvt"],["video/vnd.mpegurl","mxu"],["video/vnd.ms-playready.media.pyv","pyv"],["video/vnd.rn-realvideo","rv"],["video/vnd.uvvu.mp4","uvu"],["video/vnd.vivo",["viv","vivo"]],["video/vosaic","vos"],["video/webm","webm"],["video/x-amt-demorun","xdr"],["video/x-amt-showrun","xsr"],["video/x-atomic3d-feature","fmf"],["video/x-dl","dl"],["video/x-dv",["dif","dv"]],["video/x-f4v","f4v"],["video/x-fli","fli"],["video/x-flv","flv"],["video/x-gl","gl"],["video/x-isvideo","isu"],["video/x-la-asf",["lsf","lsx"]],["video/x-m4v","m4v"],["video/x-motion-jpeg","mjpg"],["video/x-mpeg",["mp3","mp2"]],["video/x-mpeq2a","mp2"],["video/x-ms-asf",["asf","asr","asx"]],["video/x-ms-asf-plugin","asx"],["video/x-ms-wm","wm"],["video/x-ms-wmv","wmv"],["video/x-ms-wmx","wmx"],["video/x-ms-wvx","wvx"],["video/x-msvideo","avi"],["video/x-qtc","qtc"],["video/x-scm","scm"],["video/x-sgi-movie",["movie","mv"]],["windows/metafile","wmf"],["www/mime","mime"],["x-conference/x-cooltalk","ice"],["x-music/x-midi",["mid","midi"]],["x-world/x-3dmf",["3dm","3dmf","qd3","qd3d"]],["x-world/x-svr","svr"],["x-world/x-vrml",["flr","vrml","wrl","wrz","xaf","xof"]],["x-world/x-vrt","vrt"],["xgl/drawing","xgz"],["xgl/movie","xmz"]]);const r=new Map([["123","application/vnd.lotus-1-2-3"],["323","text/h323"],["*","application/octet-stream"],["3dm","x-world/x-3dmf"],["3dmf","x-world/x-3dmf"],["3dml","text/vnd.in3d.3dml"],["3g2","video/3gpp2"],["3gp","video/3gpp"],["7z","application/x-7z-compressed"],["a","application/octet-stream"],["aab","application/x-authorware-bin"],["aac","audio/x-aac"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abc","text/vnd.abc"],["abw","application/x-abiword"],["ac","application/pkix-attr-cert"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acgi","text/html"],["acu","application/vnd.acucobol"],["acx","application/internet-property-stream"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afl","video/animaflex"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/postscript"],["aif",["audio/aiff","audio/x-aiff"]],["aifc",["audio/aiff","audio/x-aiff"]],["aiff",["audio/aiff","audio/x-aiff"]],["aim","application/x-aim"],["aip","text/x-audiosoft-intra"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["ani","application/x-navi-animation"],["aos","application/x-nokia-9000-communicator-add-on-software"],["apk","application/vnd.android.package-archive"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["aps","application/mime"],["arc","application/octet-stream"],["arj",["application/arj","application/octet-stream"]],["art","image/x-jg"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asp","text/asp"],["asr","video/x-ms-asf"],["asx",["video/x-ms-asf","application/x-mplayer2","video/x-ms-asf-plugin"]],["atc","application/vnd.acucorp"],["atomcat","application/atomcat+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au",["audio/basic","audio/x-au"]],["avi",["video/avi","video/msvideo","application/x-troff-msvideo","video/x-msvideo"]],["avs","video/avs-video"],["aw","application/applixware"],["axs","application/olescript"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azw","application/vnd.amazon.ebook"],["bas","text/plain"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin",["application/octet-stream","application/mac-binary","application/macbinary","application/x-macbinary","application/x-binary"]],["bm","image/bmp"],["bmi","application/vnd.bmi"],["bmp",["image/bmp","image/x-windows-bmp"]],["boo","application/book"],["book","application/book"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bsh","application/x-bsh"],["btif","image/prs.btif"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c",["text/plain","text/x-c"]],["c++","text/plain"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["c4g","application/vnd.clonk.c4group"],["cab","application/vnd.ms-cab-compressed"],["car","application/vnd.curl.car"],["cat",["application/vnd.ms-pkiseccat","application/vnd.ms-pki.seccat"]],["cc",["text/plain","text/x-c"]],["ccad","application/clariscad"],["cco","application/x-cocoa"],["ccxml","application/ccxml+xml,"],["cdbcmsg","application/vnd.contact.cmsg"],["cdf",["application/cdf","application/x-cdf","application/x-netcdf"]],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer",["application/pkix-cert","application/x-x509-ca-cert"]],["cgm","image/cgm"],["cha","application/x-chat"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cla","application/vnd.claymore"],["class",["application/octet-stream","application/java","application/java-byte-code","application/java-vm","application/x-java-class"]],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod",["image/cis-cod","application/vnd.rim.cod"]],["com",["application/octet-stream","text/plain"]],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt",["application/mac-compactpro","application/x-compactpro","application/x-cpt"]],["crd","application/x-mscardfile"],["crl",["application/pkix-crl","application/pkcs-crl"]],["crt",["application/pkix-cert","application/x-x509-user-cert","application/x-x509-ca-cert"]],["cryptonote","application/vnd.rig.cryptonote"],["csh",["text/x-script.csh","application/x-csh"]],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["css",["text/css","application/x-pointplus"]],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxx","text/plain"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["davmount","application/davmount+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["deb","application/x-debian-package"],["deepv","application/x-deepv"],["def","text/plain"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dif","video/x-dv"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["djvu","image/vnd.djvu"],["dl",["video/dl","video/x-dl"]],["dll","application/x-msdownload"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.document.macroenabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroenabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp",["application/commonground","application/vnd.osgi.dp"]],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drw","application/drafting"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dv","video/x-dv"],["dvi","application/x-dvi"],["dwf",["model/vnd.dwf","drawing/x-dwf"]],["dwg",["application/acad","image/vnd.dwg","image/x-dwg"]],["dxf",["application/dxf","image/vnd.dwg","image/vnd.dxf","image/x-dwg"]],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["el","text/x-script.elisp"],["elc",["application/x-elc","application/x-bytecode.elisp"]],["eml","message/rfc822"],["emma","application/emma+xml"],["env","application/x-envoy"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es",["application/ecmascript","application/x-esrehber"]],["es3","application/vnd.eszigno3+xml"],["esf","application/vnd.epson.esf"],["etx","text/x-setext"],["evy",["application/envoy","application/x-envoy"]],["exe",["application/octet-stream","application/x-msdownload"]],["exi","application/exi"],["ext","application/vnd.novadigm.ext"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f",["text/plain","text/x-fortran"]],["f4v","video/x-f4v"],["f77","text/x-fortran"],["f90",["text/plain","text/x-fortran"]],["fbs","image/vnd.fastbidsheet"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fh","image/x-freehand"],["fif",["application/fractals","image/fif"]],["fig","application/x-xfig"],["fli",["video/fli","video/x-fli"]],["flo",["image/florian","application/vnd.micrografx.flo"]],["flr","x-world/x-vrml"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fmf","video/x-atomic3d-feature"],["fnc","application/vnd.frogans.fnc"],["for",["text/plain","text/x-fortran"]],["fpx",["image/vnd.fpx","image/vnd.net-fpx"]],["frl","application/freeloader"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["funk","audio/make"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g","text/plain"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gdl","model/vnd.gdl"],["geo","application/vnd.dynageo"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["gl",["video/gl","video/x-gl"]],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gph","application/vnd.flographit"],["gqf","application/vnd.grafeq"],["gram","application/srgs"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsd","audio/x-gsm"],["gsf","application/x-font-ghostscript"],["gsm","audio/x-gsm"],["gsp","application/x-gsp"],["gss","application/x-gss"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxt","application/vnd.geonext"],["gz",["application/x-gzip","application/x-compressed"]],["gzip",["multipart/x-gzip","application/x-gzip"]],["h",["text/plain","text/x-h"]],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hdf","application/x-hdf"],["help","application/x-helpfile"],["hgl","application/vnd.hp-hpgl"],["hh",["text/plain","text/x-h"]],["hlb","text/x-script"],["hlp",["application/winhlp","application/hlp","application/x-helpfile","application/x-winhelp"]],["hpg","application/vnd.hp-hpgl"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx",["application/mac-binhex40","application/binhex","application/binhex4","application/mac-binhex","application/x-binhex40","application/x-mac-binhex40"]],["hta","application/hta"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["htmls","text/html"],["htt","text/webviewhtml"],["htx","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["ico","image/x-icon"],["ics","text/calendar"],["idc","text/plain"],["ief","image/ief"],["iefs","image/ief"],["ifm","application/vnd.shana.informed.formdata"],["iges",["application/iges","model/iges"]],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs",["application/iges","model/iges"]],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["iii","application/x-iphone"],["ima","application/x-ima"],["imap","application/x-httpd-imap"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["inf","application/inf"],["ins",["application/x-internet-signup","application/x-internett-signup"]],["ip","application/x-ip2"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["isp","application/x-internet-signup"],["isu","video/x-isvideo"],["it","audio/it"],["itp","application/vnd.shana.informed.formtemplate"],["iv","application/x-inventor"],["ivp","application/vnd.immervision-ivp"],["ivr","i-world/i-vrml"],["ivu","application/vnd.immervision-ivu"],["ivy","application/x-livescreen"],["jad","text/vnd.sun.j2me.app-descriptor"],["jam",["application/vnd.jam","audio/x-jam"]],["jar","application/java-archive"],["jav",["text/plain","text/x-java-source"]],["java",["text/plain","text/x-java-source,java","text/x-java-source"]],["jcm","application/x-java-commerce"],["jfif",["image/pipeg","image/jpeg","image/pjpeg"]],["jfif-tbnl","image/jpeg"],["jisp","application/vnd.jisp"],["jlt","application/vnd.hp-jlyt"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jpe",["image/jpeg","image/pjpeg"]],["jpeg",["image/jpeg","image/pjpeg"]],["jpg",["image/jpeg","image/pjpeg"]],["jpgv","video/jpeg"],["jpm","video/jpm"],["jps","image/x-jps"],["js",["application/javascript","application/ecmascript","text/javascript","text/ecmascript","application/x-javascript"]],["json","application/json"],["jut","image/jutvision"],["kar",["audio/midi","music/x-karaoke"]],["karbon","application/vnd.kde.karbon"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["ksh",["application/x-ksh","text/x-script.ksh"]],["ksp","application/vnd.kde.kspread"],["ktx","image/ktx"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["la",["audio/nspaudio","audio/x-nspaudio"]],["lam","audio/x-liveaudio"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["lha",["application/octet-stream","application/lha","application/x-lha"]],["lhx","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["lma",["audio/nspaudio","audio/x-nspaudio"]],["log","text/plain"],["lrm","application/vnd.ms-lrm"],["lsf","video/x-la-asf"],["lsp",["application/x-lisp","text/x-script.lisp"]],["lst","text/plain"],["lsx",["video/x-la-asf","text/x-la-asf"]],["ltf","application/vnd.frogans.ltf"],["ltx","application/x-latex"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh",["application/octet-stream","application/x-lzh"]],["lzx",["application/lzx","application/octet-stream","application/x-lzx"]],["m",["text/plain","text/x-m"]],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m1v","video/mpeg"],["m21","application/mp21"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3u",["audio/x-mpegurl","audio/x-mpequrl"]],["m3u8","application/vnd.apple.mpegurl"],["m4v","video/x-m4v"],["ma","application/mathematica"],["mads","application/mads+xml"],["mag","application/vnd.ecowin.chart"],["man","application/x-troff-man"],["map","application/x-navimap"],["mar","text/plain"],["mathml","application/mathml+xml"],["mbd","application/mbedlet"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc$","application/x-magic-cap-package-1.0"],["mc1","application/vnd.medcalcdata"],["mcd",["application/mcad","application/vnd.mcd","application/x-mathcad"]],["mcf",["image/vasa","text/mcf"]],["mcp","application/netmc"],["mcurl","text/vnd.curl.mcurl"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["me","application/x-troff-me"],["meta4","application/metalink4+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mht","message/rfc822"],["mhtml","message/rfc822"],["mid",["audio/mid","audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["midi",["audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["mif",["application/vnd.mif","application/x-mif","application/x-frame"]],["mime",["message/rfc822","www/mime"]],["mj2","video/mj2"],["mjf","audio/x-vnd.audioexplosion.mjuicemediafile"],["mjpg","video/x-motion-jpeg"],["mlp","application/vnd.dolby.mlp"],["mm",["application/base64","application/x-meme"]],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mme","application/base64"],["mmf","application/vnd.smaf"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mny","application/x-msmoney"],["mod",["audio/mod","audio/x-mod"]],["mods","application/mods+xml"],["moov","video/quicktime"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2",["video/mpeg","audio/mpeg","video/x-mpeg","audio/x-mpeg","video/x-mpeq2a"]],["mp3",["audio/mpeg","audio/mpeg3","video/mpeg","audio/x-mpeg-3","video/x-mpeg"]],["mp4",["video/mp4","application/mp4"]],["mp4a","audio/mp4"],["mpa",["video/mpeg","audio/mpeg"]],["mpc",["application/vnd.mophun.certificate","application/x-project"]],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg",["video/mpeg","audio/mpeg"]],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/x-project"],["mpv","application/x-project"],["mpv2","video/mpeg"],["mpx","application/x-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","application/x-troff-ms"],["mscml","application/mediaservercontrol+xml"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msl","application/vnd.mobius.msl"],["msty","application/vnd.muvee.style"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musicxml","application/vnd.recordare.musicxml+xml"],["mv","video/x-sgi-movie"],["mvb","application/x-msmediaview"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["my","audio/make"],["mzz","application/x-vnd.audioexplosion.mzz"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nap","image/naplps"],["naplps","image/naplps"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncm","application/vnd.nokia.configuration-message"],["ncx","application/x-dtbncx+xml"],["ngdat","application/vnd.nokia.n-gage.data"],["nif","image/x-niff"],["niff","image/x-niff"],["nix","application/x-mix-transfer"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nvd","application/x-navidoc"],["nws","message/rfc822"],["o","application/octet-stream"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omc","application/x-omc"],["omcd","application/x-omcdatamaker"],["omcr","application/x-omcregerator"],["onetoc","application/onenote"],["opf","application/oebps-package+xml"],["org","application/vnd.lotus-organizer"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","application/x-font-otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p10",["application/pkcs10","application/x-pkcs10"]],["p12",["application/pkcs-12","application/x-pkcs12"]],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7m",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7r","application/x-pkcs7-certreqresp"],["p7s",["application/pkcs7-signature","application/x-pkcs7-signature"]],["p8","application/pkcs8"],["par","text/plain-bas"],["part","application/pro_eng"],["pas","text/pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcf","application/x-font-pcf"],["pcl",["application/vnd.hp-pcl","application/x-pcl"]],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb",["application/vnd.palm","chemical/x-pdb"]],["pdf","application/pdf"],["pfa","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfunk",["audio/make","audio/make.my.funk"]],["pfx","application/x-pkcs12"],["pgm",["image/x-portable-graymap","image/x-portable-greymap"]],["pgn","application/x-chess-pgn"],["pgp","application/pgp-signature"],["pic",["image/pict","image/x-pict"]],["pict","image/pict"],["pkg","application/x-newton-compatible-pkg"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pko",["application/ynd.ms-pkipko","application/vnd.ms-pki.pko"]],["pl",["text/plain","text/x-script.perl"]],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["plx","application/x-pixclscript"],["pm",["text/x-script.perl-module","image/x-xpixmap"]],["pm4","application/x-pagemaker"],["pm5","application/x-pagemaker"],["pma","application/x-perfmon"],["pmc","application/x-perfmon"],["pml",["application/vnd.ctc-posml","application/x-perfmon"]],["pmr","application/x-perfmon"],["pmw","application/x-perfmon"],["png","image/png"],["pnm",["application/x-portable-anymap","image/x-portable-anymap"]],["portpkg","application/vnd.macports.portpkg"],["pot",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["potm","application/vnd.ms-powerpoint.template.macroenabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["pov","model/x-pov"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt",["application/vnd.ms-powerpoint","application/mspowerpoint","application/powerpoint","application/x-mspowerpoint"]],["pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["ppz","application/mspowerpoint"],["prc","application/x-mobipocket-ebook"],["pre",["application/vnd.lotus-freelance","application/x-freelance"]],["prf","application/pics-rules"],["prt","application/pro_eng"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd",["application/octet-stream","image/vnd.adobe.photoshop"]],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pvu","paleovu/x-pv"],["pwn","application/vnd.3m.post-it-notes"],["pwz","application/vnd.ms-powerpoint"],["py","text/x-script.phyton"],["pya","audio/vnd.ms-playready.media.pya"],["pyc","application/x-bytecode.python"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qcp","audio/vnd.qcelp"],["qd3","x-world/x-3dmf"],["qd3d","x-world/x-3dmf"],["qfx","application/vnd.intu.qfx"],["qif","image/x-quicktime"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qtc","video/x-qtc"],["qti","image/x-quicktime"],["qtif","image/x-quicktime"],["qxd","application/vnd.quark.quarkxpress"],["ra",["audio/x-realaudio","audio/x-pn-realaudio","audio/x-pn-realaudio-plugin"]],["ram","audio/x-pn-realaudio"],["rar","application/x-rar-compressed"],["ras",["image/cmu-raster","application/x-cmu-raster","image/x-cmu-raster"]],["rast","image/cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rexx","text/x-script.rexx"],["rf","image/vnd.rn-realflash"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm",["application/vnd.rn-realmedia","audio/x-pn-realaudio"]],["rmi","audio/mid"],["rmm","audio/x-pn-realaudio"],["rmp",["audio/x-pn-realaudio-plugin","audio/x-pn-realaudio"]],["rms","application/vnd.jcp.javame.midlet-rms"],["rnc","application/relax-ng-compact-syntax"],["rng",["application/ringing-tones","application/vnd.nokia.ringing-tone"]],["rnx","application/vnd.rn-realplayer"],["roff","application/x-troff"],["rp","image/vnd.rn-realpix"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsd","application/rsd+xml"],["rt",["text/richtext","text/vnd.rn-realtext"]],["rtf",["application/rtf","text/richtext","application/x-rtf"]],["rtx",["text/richtext","application/rtf"]],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["saveme","application/octet-stream"],["sbk","application/x-tbook"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm",["application/vnd.lotus-screencam","video/x-scm","text/x-script.guile","application/x-lotusscreencam","text/x-script.scheme"]],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["sct","text/scriptlet"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkm","application/vnd.solent.sdkm+xml"],["sdml","text/plain"],["sdp",["application/sdp","application/x-sdp"]],["sdr","application/sounder"],["sdw","application/vnd.stardivision.writer"],["sea",["application/sea","application/x-sea"]],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["ser","application/java-serialized-object"],["set","application/set"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sgl","application/vnd.stardivision.writer-global"],["sgm",["text/sgml","text/x-sgml"]],["sgml",["text/sgml","text/x-sgml"]],["sh",["application/x-shar","application/x-bsh","application/x-sh","text/x-script.sh"]],["shar",["application/x-bsh","application/x-shar"]],["shf","application/shf+xml"],["shtml",["text/html","text/x-server-parsed-html"]],["sid","audio/x-psid"],["sis","application/vnd.symbian.install"],["sit",["application/x-stuffit","application/x-sit"]],["sitx","application/x-stuffitx"],["skd","application/x-koan"],["skm","application/x-koan"],["skp",["application/vnd.koan","application/x-koan"]],["skt","application/x-koan"],["sl","application/x-seelogo"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi",["application/smil","application/smil+xml"]],["smil","application/smil"],["snd",["audio/basic","audio/x-adpcm"]],["snf","application/x-font-snf"],["sol","application/solids"],["spc",["text/x-speech","application/x-pkcs7-certificates"]],["spf","application/vnd.yamaha.smaf-phrase"],["spl",["application/futuresplash","application/x-futuresplash"]],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spr","application/x-sprite"],["sprite","application/x-sprite"],["src","application/x-wais-source"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssi","text/x-server-parsed-html"],["ssm","application/streamingmedia"],["ssml","application/ssml+xml"],["sst",["application/vnd.ms-pkicertstore","application/vnd.ms-pki.certstore"]],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["step","application/step"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl",["application/vnd.ms-pkistl","application/sla","application/vnd.ms-pki.stl","application/x-navistyle"]],["stm","text/html"],["stp","application/step"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["sub","image/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svf",["image/vnd.dwg","image/x-dwg"]],["svg","image/svg+xml"],["svr",["x-world/x-svr","application/x-world"]],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t",["text/troff","application/x-troff"]],["talk","text/x-speech"],["tao","application/vnd.tao.intent-module-archive"],["tar","application/x-tar"],["tbk",["application/toolbook","application/x-tbook"]],["tcap","application/vnd.3gpp2.tcap"],["tcl",["text/x-script.tcl","application/x-tcl"]],["tcsh","text/x-script.tcsh"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text",["application/plain","text/plain"]],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tgz",["application/gnutar","application/x-compressed"]],["thmx","application/vnd.ms-officetheme"],["tif",["image/tiff","image/x-tiff"]],["tiff",["image/tiff","image/x-tiff"]],["tmo","application/vnd.tmobile-livetv"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","application/x-troff"],["tra","application/vnd.trueapp"],["trm","application/x-msterminal"],["tsd","application/timestamped-data"],["tsi","audio/tsp-audio"],["tsp",["application/dsptype","audio/tsplayer"]],["tsv","text/tab-separated-values"],["ttf","application/x-font-ttf"],["ttl","text/turtle"],["turbot","image/florian"],["twd","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["ufd","application/vnd.ufdl"],["uil","text/x-uil"],["uls","text/iuls"],["umj","application/vnd.umajin"],["uni","text/uri-list"],["unis","text/uri-list"],["unityweb","application/vnd.unity"],["unv","application/i-deas"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["ustar",["application/x-ustar","multipart/x-ustar"]],["utz","application/vnd.uiq.theme"],["uu",["application/octet-stream","text/x-uuencode"]],["uue","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vda","application/vda"],["vdo","video/vdo"],["vew","application/groupwise"],["vis","application/vnd.visionary"],["viv",["video/vivo","video/vnd.vivo"]],["vivo",["video/vivo","video/vnd.vivo"]],["vmd","application/vocaltec-media-desc"],["vmf","application/vocaltec-media-file"],["voc",["audio/voc","audio/x-voc"]],["vos","video/vosaic"],["vox","audio/voxware"],["vqe","audio/x-twinvq-plugin"],["vqf","audio/x-twinvq"],["vql","audio/x-twinvq-plugin"],["vrml",["model/vrml","x-world/x-vrml","application/x-vrml"]],["vrt","x-world/x-vrt"],["vsd",["application/vnd.visio","application/x-visio"]],["vsf","application/vnd.vsf"],["vst","application/x-visio"],["vsw","application/x-visio"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w60","application/wordperfect6.0"],["w61","application/wordperfect6.1"],["w6w","application/msword"],["wad","application/x-doom"],["wav",["audio/wav","audio/x-wav"]],["wax","audio/x-ms-wax"],["wb1","application/x-qpro"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/vnd.wap.wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["web","application/vnd.xara"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wiz","application/msword"],["wk1","application/x-123"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf",["windows/metafile","application/x-msmetafile"]],["wml","text/vnd.wap.wml"],["wmlc","application/vnd.wap.wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-ms-wmz"],["woff","application/x-font-woff"],["word","application/msword"],["wp","application/wordperfect"],["wp5",["application/wordperfect","application/wordperfect6.0"]],["wp6","application/wordperfect"],["wpd",["application/wordperfect","application/vnd.wordperfect","application/x-wpwin"]],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wq1","application/x-lotus"],["wqd","application/vnd.wqd"],["wri",["application/mswrite","application/x-wri","application/x-mswrite"]],["wrl",["model/vrml","x-world/x-vrml","application/x-world"]],["wrz",["model/vrml","x-world/x-vrml"]],["wsc","text/scriplet"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wsrc","application/x-wais-source"],["wtb","application/vnd.webturbo"],["wtk","application/x-wintalk"],["wvx","video/x-ms-wvx"],["x-png","image/png"],["x3d","application/vnd.hzn-3d-crossword"],["xaf","x-world/x-vrml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm",["image/xbm","image/x-xbm","image/x-xbitmap"]],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdr","video/x-amt-demorun"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xgz","xgl/drawing"],["xhtml","application/xhtml+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlam","application/vnd.ms-excel.addin.macroenabled.12"],["xlb",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlc",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xld",["application/excel","application/x-excel"]],["xlk",["application/excel","application/x-excel"]],["xll",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlm",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xls",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroenabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xltm","application/vnd.ms-excel.template.macroenabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlv",["application/excel","application/x-excel"]],["xlw",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xm","audio/xm"],["xml",["application/xml","text/xml","application/atom+xml","application/rss+xml"]],["xmz","xgl/movie"],["xo","application/vnd.olpc-sugar"],["xof","x-world/x-vrml"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpix","application/x-vnd.ls-xpix"],["xpm",["image/xpm","image/x-xpixmap"]],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xsr","video/x-amt-showrun"],["xul","application/vnd.mozilla.xul+xml"],["xwd",["image/x-xwd","image/x-xwindowdump"]],["xyz",["chemical/x-xyz","chemical/x-pdb"]],["yang","application/yang"],["yin","application/yin+xml"],["z",["application/x-compressed","application/x-compress"]],["zaz","application/vnd.zzazz.deck+xml"],["zip",["application/zip","multipart/x-zip","application/x-zip-compressed","application/x-compressed"]],["zir","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zoo","application/octet-stream"],["zsh","text/x-script.zsh"]]);e.exports={detectMimeType(e){if(!e){return s}let t=a.parse(e);let i=(t.ext.substr(1)||t.name||"").split("?").shift().trim().toLowerCase();let n=s;if(r.has(i)){n=r.get(i)}if(Array.isArray(n)){return n[0]}return n},detectExtension(e){if(!e){return n}let t=(e||"").toLowerCase().trim().split("/");let i=t.shift().trim();let a=t.join("/").trim();if(o.has(i+"/"+a)){let e=o.get(i+"/"+a);if(Array.isArray(e)){return e[0]}return e}switch(i){case"text":return"txt";default:return"bin"}}}},509:function(e,t,i){const a=i(113);const s=i(147);const n=i(477);const o=i(781).PassThrough;const r=i(673);const p=i(994);const l=i(716);const c=i(10);const d=i(382);const m=i(106);const h=i(368);const u=i(304);const f=i(827);class MimeNode{constructor(e,t){this.nodeCounter=0;t=t||{};this.baseBoundary=t.baseBoundary||a.randomBytes(8).toString("hex");this.boundaryPrefix=t.boundaryPrefix||"--_NmP";this.disableFileAccess=!!t.disableFileAccess;this.disableUrlAccess=!!t.disableUrlAccess;this.normalizeHeaderKey=t.normalizeHeaderKey;this.date=new Date;this.rootNode=t.rootNode||this;this.keepBcc=!!t.keepBcc;if(t.filename){this.filename=t.filename;if(!e){e=p.detectMimeType(this.filename.split(".").pop())}}this.textEncoding=(t.textEncoding||"").toString().trim().charAt(0).toUpperCase();this.parentNode=t.parentNode;this.hostname=t.hostname;this.newline=t.newline;this.childNodes=[];this._nodeId=++this.rootNode.nodeCounter;this._headers=[];this._isPlainText=false;this._hasLongLines=false;this._envelope=false;this._raw=false;this._transforms=[];this._processFuncs=[];if(e){this.setHeader("Content-Type",e)}}createChild(e,t){if(!t&&typeof e==="object"){t=e;e=undefined}let i=new MimeNode(e,t);this.appendChild(i);return i}appendChild(e){if(e.rootNode!==this.rootNode){e.rootNode=this.rootNode;e._nodeId=++this.rootNode.nodeCounter}e.parentNode=this;this.childNodes.push(e);return e}replace(e){if(e===this){return this}this.parentNode.childNodes.forEach(((t,i)=>{if(t===this){e.rootNode=this.rootNode;e.parentNode=this.parentNode;e._nodeId=this._nodeId;this.rootNode=this;this.parentNode=undefined;e.parentNode.childNodes[i]=e}}));return e}remove(){if(!this.parentNode){return this}for(let e=this.parentNode.childNodes.length-1;e>=0;e--){if(this.parentNode.childNodes[e]===this){this.parentNode.childNodes.splice(e,1);this.parentNode=undefined;this.rootNode=this;return this}}}setHeader(e,t){let i=false,a;if(!t&&e&&typeof e==="object"){if(e.key&&"value"in e){this.setHeader(e.key,e.value)}else if(Array.isArray(e)){e.forEach((e=>{this.setHeader(e.key,e.value)}))}else{Object.keys(e).forEach((t=>{this.setHeader(t,e[t])}))}return this}e=this._normalizeHeaderKey(e);a={key:e,value:t};for(let t=0,s=this._headers.length;t<s;t++){if(this._headers[t].key===e){if(!i){this._headers[t]=a;i=true}else{this._headers.splice(t,1);t--;s--}}}if(!i){this._headers.push(a)}return this}addHeader(e,t){if(!t&&e&&typeof e==="object"){if(e.key&&e.value){this.addHeader(e.key,e.value)}else if(Array.isArray(e)){e.forEach((e=>{this.addHeader(e.key,e.value)}))}else{Object.keys(e).forEach((t=>{this.addHeader(t,e[t])}))}return this}else if(Array.isArray(t)){t.forEach((t=>{this.addHeader(e,t)}));return this}this._headers.push({key:this._normalizeHeaderKey(e),value:t});return this}getHeader(e){e=this._normalizeHeaderKey(e);for(let t=0,i=this._headers.length;t<i;t++){if(this._headers[t].key===e){return this._headers[t].value}}}setContent(e){this.content=e;if(typeof this.content.pipe==="function"){this._contentErrorHandler=e=>{this.content.removeListener("error",this._contentErrorHandler);this.content=e};this.content.once("error",this._contentErrorHandler)}else if(typeof this.content==="string"){this._isPlainText=p.isPlainText(this.content);if(this._isPlainText&&p.hasLongerLines(this.content,76)){this._hasLongLines=true}}return this}build(e){let t;if(!e){t=new Promise(((t,i)=>{e=r.callbackPromise(t,i)}))}let i=this.createReadStream();let a=[];let s=0;let n=false;i.on("readable",(()=>{let e;while((e=i.read())!==null){a.push(e);s+=e.length}}));i.once("error",(t=>{if(n){return}n=true;return e(t)}));i.once("end",(t=>{if(n){return}n=true;if(t&&t.length){a.push(t);s+=t.length}return e(null,Buffer.concat(a,s))}));return t}getTransferEncoding(){let e=false;let t=(this.getHeader("Content-Type")||"").toString().toLowerCase().trim();if(this.content){e=(this.getHeader("Content-Transfer-Encoding")||"").toString().toLowerCase().trim();if(!e||!["base64","quoted-printable"].includes(e)){if(/^text\//i.test(t)){if(this._isPlainText&&!this._hasLongLines){e="7bit"}else if(typeof this.content==="string"||this.content instanceof Buffer){e=this._getTextEncoding(this.content)==="Q"?"quoted-printable":"base64"}else{e=this.textEncoding==="B"?"base64":"quoted-printable"}}else if(!/^(multipart|message)\//i.test(t)){e=e||"base64"}}}return e}buildHeaders(){let e=this.getTransferEncoding();let t=[];if(e){this.setHeader("Content-Transfer-Encoding",e)}if(this.filename&&!this.getHeader("Content-Disposition")){this.setHeader("Content-Disposition","attachment")}if(this.rootNode===this){if(!this.getHeader("Date")){this.setHeader("Date",this.date.toUTCString().replace(/GMT/,"+0000"))}this.messageId();if(!this.getHeader("MIME-Version")){this.setHeader("MIME-Version","1.0")}}this._headers.forEach((e=>{let i=e.key;let a=e.value;let s;let n;let o={};let r=["From","Sender","To","Cc","Bcc","Reply-To","Date","References"];if(a&&typeof a==="object"&&!r.includes(i)){Object.keys(a).forEach((e=>{if(e!=="value"){o[e]=a[e]}}));a=(a.value||"").toString();if(!a.trim()){return}}if(o.prepared){if(o.foldLines){t.push(p.foldLines(i+": "+a))}else{t.push(i+": "+a)}return}switch(e.key){case"Content-Disposition":s=p.parseHeaderValue(a);if(this.filename){s.params.filename=this.filename}a=p.buildHeaderValue(s);break;case"Content-Type":s=p.parseHeaderValue(a);this._handleContentType(s);if(s.value.match(/^text\/plain\b/)&&typeof this.content==="string"&&/[\u0080-\uFFFF]/.test(this.content)){s.params.charset="utf-8"}a=p.buildHeaderValue(s);if(this.filename){n=this._encodeWords(this.filename);if(n!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n)){n='"'+n+'"'}a+="; name="+n}break;case"Bcc":if(!this.keepBcc){return}break}a=this._encodeHeaderValue(i,a);if(!(a||"").toString().trim()){return}if(typeof this.normalizeHeaderKey==="function"){let e=this.normalizeHeaderKey(i,a);if(e&&typeof e==="string"&&e.length){i=e}}t.push(p.foldLines(i+": "+a,76))}));return t.join("\r\n")}createReadStream(e){e=e||{};let t=new o(e);let i=t;let a;this.stream(t,e,(e=>{if(e){i.emit("error",e);return}t.end()}));for(let e=0,t=this._transforms.length;e<t;e++){a=typeof this._transforms[e]==="function"?this._transforms[e]():this._transforms[e];i.once("error",(e=>{a.emit("error",e)}));i=i.pipe(a)}a=new h;i.once("error",(e=>{a.emit("error",e)}));i=i.pipe(a);for(let e=0,t=this._processFuncs.length;e<t;e++){a=this._processFuncs[e];i=a(i)}if(this.newline){const e=["win","windows","dos","\r\n"].includes(this.newline.toString().toLowerCase());const t=e?new u:new f;const a=i.pipe(t);i.on("error",(e=>a.emit("error",e)));return a}return i}transform(e){this._transforms.push(e)}processFunc(e){this._processFuncs.push(e)}stream(e,t,i){let a=this.getTransferEncoding();let s;let n;let o=false;let callback=e=>{if(o){return}o=true;i(e)};let finalize=()=>{let i=0;let processChildNode=()=>{if(i>=this.childNodes.length){e.write("\r\n--"+this.boundary+"--\r\n");return callback()}let a=this.childNodes[i++];e.write((i>1?"\r\n":"")+"--"+this.boundary+"\r\n");a.stream(e,t,(e=>{if(e){return callback(e)}setImmediate(processChildNode)}))};if(this.multipart){setImmediate(processChildNode)}else{return callback()}};let sendContent=()=>{if(this.content){if(Object.prototype.toString.call(this.content)==="[object Error]"){return callback(this.content)}if(typeof this.content.pipe==="function"){this.content.removeListener("error",this._contentErrorHandler);this._contentErrorHandler=e=>callback(e);this.content.once("error",this._contentErrorHandler)}let createStream=()=>{if(["quoted-printable","base64"].includes(a)){s=new(a==="base64"?c:l).Encoder(t);s.pipe(e,{end:false});s.once("end",finalize);s.once("error",(e=>callback(e)));n=this._getStream(this.content);n.pipe(s)}else{n=this._getStream(this.content);n.pipe(e,{end:false});n.once("end",finalize)}n.once("error",(e=>callback(e)))};if(this.content._resolve){let e=[];let t=0;let i=false;let a=this._getStream(this.content);a.on("error",(e=>{if(i){return}i=true;callback(e)}));a.on("readable",(()=>{let i;while((i=a.read())!==null){e.push(i);t+=i.length}}));a.on("end",(()=>{if(i){return}i=true;this.content._resolve=false;this.content._resolvedValue=Buffer.concat(e,t);setImmediate(createStream)}))}else{setImmediate(createStream)}return}else{return setImmediate(finalize)}};if(this._raw){setImmediate((()=>{if(Object.prototype.toString.call(this._raw)==="[object Error]"){return callback(this._raw)}if(typeof this._raw.pipe==="function"){this._raw.removeListener("error",this._contentErrorHandler)}let t=this._getStream(this._raw);t.pipe(e,{end:false});t.on("error",(t=>e.emit("error",t)));t.on("end",finalize)}))}else{e.write(this.buildHeaders()+"\r\n\r\n");setImmediate(sendContent)}}setEnvelope(e){let t;this._envelope={from:false,to:[]};if(e.from){t=[];this._convertAddresses(this._parseAddresses(e.from),t);t=t.filter((e=>e&&e.address));if(t.length&&t[0]){this._envelope.from=t[0].address}}["to","cc","bcc"].forEach((t=>{if(e[t]){this._convertAddresses(this._parseAddresses(e[t]),this._envelope.to)}}));this._envelope.to=this._envelope.to.map((e=>e.address)).filter((e=>e));let i=["to","cc","bcc","from"];Object.keys(e).forEach((t=>{if(!i.includes(t)){this._envelope[t]=e[t]}}));return this}getAddresses(){let e={};this._headers.forEach((t=>{let i=t.key.toLowerCase();if(["from","sender","reply-to","to","cc","bcc"].includes(i)){if(!Array.isArray(e[i])){e[i]=[]}this._convertAddresses(this._parseAddresses(t.value),e[i])}}));return e}getEnvelope(){if(this._envelope){return this._envelope}let e={from:false,to:[]};this._headers.forEach((t=>{let i=[];if(t.key==="From"||!e.from&&["Reply-To","Sender"].includes(t.key)){this._convertAddresses(this._parseAddresses(t.value),i);if(i.length&&i[0]){e.from=i[0].address}}else if(["To","Cc","Bcc"].includes(t.key)){this._convertAddresses(this._parseAddresses(t.value),e.to)}}));e.to=e.to.map((e=>e.address));return e}messageId(){let e=this.getHeader("Message-ID");if(!e){e=this._generateMessageId();this.setHeader("Message-ID",e)}return e}setRaw(e){this._raw=e;if(this._raw&&typeof this._raw.pipe==="function"){this._contentErrorHandler=e=>{this._raw.removeListener("error",this._contentErrorHandler);this._raw=e};this._raw.once("error",this._contentErrorHandler)}return this}_getStream(e){let t;if(e._resolvedValue){t=new o;setImmediate((()=>{try{t.end(e._resolvedValue)}catch(e){t.emit("error",e)}}));return t}else if(typeof e.pipe==="function"){return e}else if(e&&typeof e.path==="string"&&!e.href){if(this.disableFileAccess){t=new o;setImmediate((()=>t.emit("error",new Error("File access rejected for "+e.path))));return t}return s.createReadStream(e.path)}else if(e&&typeof e.href==="string"){if(this.disableUrlAccess){t=new o;setImmediate((()=>t.emit("error",new Error("Url access rejected for "+e.href))));return t}return m(e.href,{headers:e.httpHeaders})}else{t=new o;setImmediate((()=>{try{t.end(e||"")}catch(e){t.emit("error",e)}}));return t}}_parseAddresses(e){return[].concat.apply([],[].concat(e).map((e=>{if(e&&e.address){e.address=this._normalizeAddress(e.address);e.name=e.name||"";return[e]}return d(e)})))}_normalizeHeaderKey(e){e=(e||"").toString().replace(/\r?\n|\r/g," ").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,(e=>e.toUpperCase())).replace(/^Content-Features$/i,"Content-features");return e}_handleContentType(e){this.contentType=e.value.trim().toLowerCase();this.multipart=/^multipart\//i.test(this.contentType)?this.contentType.substr(this.contentType.indexOf("/")+1):false;if(this.multipart){this.boundary=e.params.boundary=e.params.boundary||this.boundary||this._generateBoundary()}else{this.boundary=false}}_generateBoundary(){return this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary+"-Part_"+this._nodeId}_encodeHeaderValue(e,t){e=this._normalizeHeaderKey(e);switch(e){case"From":case"Sender":case"To":case"Cc":case"Bcc":case"Reply-To":return this._convertAddresses(this._parseAddresses(t));case"Message-ID":case"In-Reply-To":case"Content-Id":t=(t||"").toString().replace(/\r?\n|\r/g," ");if(t.charAt(0)!=="<"){t="<"+t}if(t.charAt(t.length-1)!==">"){t=t+">"}return t;case"References":t=[].concat.apply([],[].concat(t||"").map((e=>{e=(e||"").toString().replace(/\r?\n|\r/g," ").trim();return e.replace(/<[^>]*>/g,(e=>e.replace(/\s/g,""))).split(/\s+/)}))).map((e=>{if(e.charAt(0)!=="<"){e="<"+e}if(e.charAt(e.length-1)!==">"){e=e+">"}return e}));return t.join(" ").trim();case"Date":if(Object.prototype.toString.call(t)==="[object Date]"){return t.toUTCString().replace(/GMT/,"+0000")}t=(t||"").toString().replace(/\r?\n|\r/g," ");return this._encodeWords(t);case"Content-Type":case"Content-Disposition":return(t||"").toString().replace(/\r?\n|\r/g," ");default:t=(t||"").toString().replace(/\r?\n|\r/g," ");return this._encodeWords(t)}}_convertAddresses(e,t){let i=[];t=t||[];[].concat(e||[]).forEach((e=>{if(e.address){e.address=this._normalizeAddress(e.address);if(!e.name){i.push(e.address.indexOf(" ")>=0?`<${e.address}>`:`${e.address}`)}else if(e.name){i.push(`${this._encodeAddressName(e.name)} <${e.address}>`)}if(e.address){if(!t.filter((t=>t.address===e.address)).length){t.push(e)}}}else if(e.group){let a=(e.group.length?this._convertAddresses(e.group,t):"").trim();i.push(`${this._encodeAddressName(e.name)}:${a};`)}}));return i.join(", ")}_normalizeAddress(e){e=(e||"").toString().replace(/[\x00-\x1F<>]+/g," ").trim();let t=e.lastIndexOf("@");if(t<0){return e}let i=e.substr(0,t);let a=e.substr(t+1);let s;try{s=n.toASCII(a.toLowerCase())}catch(e){}if(i.indexOf(" ")>=0){if(i.charAt(0)!=='"'){i='"'+i}if(i.substr(-1)!=='"'){i=i+'"'}}return`${i}@${s}`}_encodeAddressName(e){if(!/^[\w ']*$/.test(e)){if(/^[\x20-\x7e]*$/.test(e)){return'"'+e.replace(/([\\"])/g,"\\$1")+'"'}else{return p.encodeWord(e,this._getTextEncoding(e),52)}}return e}_encodeWords(e){return p.encodeWords(e,this._getTextEncoding(e),52,true)}_getTextEncoding(e){e=(e||"").toString();let t=this.textEncoding;let i;let a;if(!t){a=(e.match(/[\x00-\x08\x0B\x0C\x0E-\x1F\u0080-\uFFFF]/g)||[]).length;i=(e.match(/[a-z]/gi)||[]).length;t=a<i?"Q":"B"}return t}_generateMessageId(){return"<"+[2,2,2,6].reduce(((e,t)=>e+"-"+a.randomBytes(t).toString("hex")),a.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}}e.exports=MimeNode},368:function(e,t,i){const a=i(781).Transform;class LastNewline extends a{constructor(){super();this.lastByte=false}_transform(e,t,i){if(e.length){this.lastByte=e[e.length-1]}this.push(e);i()}_flush(e){if(this.lastByte===10){return e()}if(this.lastByte===13){this.push(Buffer.from("\n"));return e()}this.push(Buffer.from("\r\n"));return e()}}e.exports=LastNewline},827:function(e,t,i){const a=i(781);const s=a.Transform;class LeWindows extends s{constructor(e){super(e);this.options=e||{}}_transform(e,t,i){let a;let s=0;for(let t=0,i=e.length;t<i;t++){if(e[t]===13){a=e.slice(s,t);s=t+1;this.push(a)}}if(s&&s<e.length){a=e.slice(s);this.push(a)}else if(!s){this.push(e)}i()}}e.exports=LeWindows},304:function(e,t,i){const a=i(781);const s=a.Transform;class LeWindows extends s{constructor(e){super(e);this.options=e||{};this.lastByte=false}_transform(e,t,i){let a;let s=0;for(let t=0,i=e.length;t<i;t++){if(e[t]===10){if(t&&e[t-1]!==13||!t&&this.lastByte!==13){if(t>s){a=e.slice(s,t);this.push(a)}this.push(Buffer.from("\r\n"));s=t+1}}}if(s&&s<e.length){a=e.slice(s);this.push(a)}else if(!s){this.push(e)}this.lastByte=e[e.length-1];i()}}e.exports=LeWindows},289:function(e,t,i){const a=i(833);const s=i(673);const n=i(560);const o=i(349);const r=i(910);const p=i(888);const l=i(819);const c=i(924);const d=i(106);const m=i(129);const h=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,"");const u=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,"");const f=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase());let x=false;e.exports.createTransport=function(e,t){let i;let d;let m;if(typeof e==="object"&&typeof e.send!=="function"||typeof e==="string"&&/^(smtps?|direct):/i.test(e)){if(i=typeof e==="string"?e:e.url){d=s.parseConnectionUrl(i)}else{d=e}if(d.pool){e=new n(d)}else if(d.sendmail){e=new r(d)}else if(d.streamTransport){e=new p(d)}else if(d.jsonTransport){e=new l(d)}else if(d.SES){e=new c(d)}else{e=new o(d)}}m=new a(e,d,t);return m};e.exports.createTestAccount=function(e,t){let i;if(!t&&typeof e==="function"){t=e;e=false}if(!t){i=new Promise(((e,i)=>{t=s.callbackPromise(e,i)}))}if(f&&x){setImmediate((()=>t(null,x)));return i}e=e||h;let a=[];let n=0;let o=d(e+"/user",{contentType:"application/json",method:"POST",body:Buffer.from(JSON.stringify({requestor:m.name,version:m.version}))});o.on("readable",(()=>{let e;while((e=o.read())!==null){a.push(e);n+=e.length}}));o.once("error",(e=>t(e)));o.once("end",(()=>{let e=Buffer.concat(a,n);let i;let s;try{i=JSON.parse(e.toString())}catch(e){s=e}if(s){return t(s)}if(i.status!=="success"||i.error){return t(new Error(i.error||"Request failed"))}delete i.status;x=i;t(null,x)}));return i};e.exports.getTestMessageUrl=function(e){if(!e||!e.response){return false}let t=new Map;e.response.replace(/\[([^\]]+)\]$/,((e,i)=>{i.replace(/\b([A-Z0-9]+)=([^\s]+)/g,((e,i,a)=>{t.set(i,a)}))}));if(t.has("STATUS")&&t.has("MSGID")){return(x.web||u)+"/message/"+t.get("MSGID")}return false}},716:function(e,t,i){const a=i(781).Transform;function encode(e){if(typeof e==="string"){e=Buffer.from(e,"utf-8")}let t=[[9],[10],[13],[32,60],[62,126]];let i="";let a;for(let s=0,n=e.length;s<n;s++){a=e[s];if(checkRanges(a,t)&&!((a===32||a===9)&&(s===n-1||e[s+1]===10||e[s+1]===13))){i+=String.fromCharCode(a);continue}i+="="+(a<16?"0":"")+a.toString(16).toUpperCase()}return i}function wrap(e,t){e=(e||"").toString();t=t||76;if(e.length<=t){return e}let i=0;let a=e.length;let s,n,o;let r=Math.floor(t/3);let p="";while(i<a){o=e.substr(i,t);if(s=o.match(/\r\n/)){o=o.substr(0,s.index+s[0].length);p+=o;i+=o.length;continue}if(o.substr(-1)==="\n"){p+=o;i+=o.length;continue}else if(s=o.substr(-r).match(/\n.*?$/)){o=o.substr(0,o.length-(s[0].length-1));p+=o;i+=o.length;continue}else if(o.length>t-r&&(s=o.substr(-r).match(/[ \t.,!?][^ \t.,!?]*$/))){o=o.substr(0,o.length-(s[0].length-1))}else if(o.match(/[=][\da-f]{0,2}$/i)){if(s=o.match(/[=][\da-f]{0,1}$/i)){o=o.substr(0,o.length-s[0].length)}while(o.length>3&&o.length<a-i&&!o.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(s=o.match(/[=][\da-f]{2}$/gi))){n=parseInt(s[0].substr(1,2),16);if(n<128){break}o=o.substr(0,o.length-3);if(n>=192){break}}}if(i+o.length<a&&o.substr(-1)!=="\n"){if(o.length===t&&o.match(/[=][\da-f]{2}$/i)){o=o.substr(0,o.length-3)}else if(o.length===t){o=o.substr(0,o.length-1)}i+=o.length;o+="=\r\n"}else{i+=o.length}p+=o}return p}function checkRanges(e,t){for(let i=t.length-1;i>=0;i--){if(!t[i].length){continue}if(t[i].length===1&&e===t[i][0]){return true}if(t[i].length===2&&e>=t[i][0]&&e<=t[i][1]){return true}}return false}class Encoder extends a{constructor(e){super();this.options=e||{};if(this.options.lineLength!==false){this.options.lineLength=this.options.lineLength||76}this._curLine="";this.inputBytes=0;this.outputBytes=0}_transform(e,t,i){let a;if(t!=="buffer"){e=Buffer.from(e,t)}if(!e||!e.length){return i()}this.inputBytes+=e.length;if(this.options.lineLength){a=this._curLine+encode(e);a=wrap(a,this.options.lineLength);a=a.replace(/(^|\n)([^\n]*)$/,((e,t,i)=>{this._curLine=i;return t}));if(a){this.outputBytes+=a.length;this.push(a)}}else{a=encode(e);this.outputBytes+=a.length;this.push(a,"ascii")}i()}_flush(e){if(this._curLine){this.outputBytes+=this._curLine.length;this.push(this._curLine,"ascii")}e()}}e.exports={encode:encode,wrap:wrap,Encoder:Encoder}},910:function(e,t,i){const a=i(81).spawn;const s=i(129);const n=i(673);class SendmailTransport{constructor(e){e=e||{};this._spawn=a;this.options=e||{};this.name="Sendmail";this.version=s.version;this.path="sendmail";this.args=false;this.winbreak=false;this.logger=n.getLogger(this.options,{component:this.options.component||"sendmail"});if(e){if(typeof e==="string"){this.path=e}else if(typeof e==="object"){if(e.path){this.path=e.path}if(Array.isArray(e.args)){this.args=e.args}this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}}}send(e,t){e.message.keepBcc=true;let i=e.data.envelope||e.message.getEnvelope();let a=e.message.messageId();let s;let n;let o;const r=[].concat(i.from||[]).concat(i.to||[]).some((e=>/^-/.test(e)));if(r){return t(new Error("Can not send mail. Invalid envelope addresses."))}if(this.args){s=["-i"].concat(this.args).concat(i.to)}else{s=["-i"].concat(i.from?["-f",i.from]:[]).concat(i.to)}let callback=i=>{if(o){return}o=true;if(typeof t==="function"){if(i){return t(i)}else{return t(null,{envelope:e.data.envelope||e.message.getEnvelope(),messageId:a,response:"Messages queued for delivery"})}}};try{n=this._spawn(this.path,s)}catch(e){this.logger.error({err:e,tnx:"spawn",messageId:a},"Error occurred while spawning sendmail. %s",e.message);return callback(e)}if(n){n.on("error",(e=>{this.logger.error({err:e,tnx:"spawn",messageId:a},"Error occurred when sending message %s. %s",a,e.message);callback(e)}));n.once("exit",(e=>{if(!e){return callback()}let t;if(e===127){t=new Error("Sendmail command not found, process exited with code "+e)}else{t=new Error("Sendmail exited with code "+e)}this.logger.error({err:t,tnx:"stdin",messageId:a},"Error sending message %s to sendmail. %s",a,t.message);callback(t)}));n.once("close",callback);n.stdin.on("error",(e=>{this.logger.error({err:e,tnx:"stdin",messageId:a},"Error occurred when piping message %s to sendmail. %s",a,e.message);callback(e)}));let t=[].concat(i.to||[]);if(t.length>3){t.push("...and "+t.splice(2).length+" more")}this.logger.info({tnx:"send",messageId:a},"Sending message %s to <%s>",a,t.join(", "));let s=e.message.createReadStream();s.once("error",(e=>{this.logger.error({err:e,tnx:"stdin",messageId:a},"Error occurred when generating message %s. %s",a,e.message);n.kill("SIGINT");callback(e)}));s.pipe(n.stdin)}else{return callback(new Error("sendmail was not found"))}}}e.exports=SendmailTransport},924:function(e,t,i){const a=i(361);const s=i(129);const n=i(673);const o=i(304);class SESTransport extends a{constructor(e){super();e=e||{};this.options=e||{};this.ses=this.options.SES;this.name="SESTransport";this.version=s.version;this.logger=n.getLogger(this.options,{component:this.options.component||"ses-transport"});this.maxConnections=Number(this.options.maxConnections)||Infinity;this.connections=0;this.sendingRate=Number(this.options.sendingRate)||Infinity;this.sendingRateTTL=null;this.rateInterval=1e3;this.rateMessages=[];this.pending=[];this.idling=true;setImmediate((()=>{if(this.idling){this.emit("idle")}}))}send(e,t){if(this.connections>=this.maxConnections){this.idling=false;return this.pending.push({mail:e,callback:t})}if(!this._checkSendingRate()){this.idling=false;return this.pending.push({mail:e,callback:t})}this._send(e,((...e)=>{setImmediate((()=>t(...e)));this._sent()}))}_checkRatedQueue(){if(this.connections>=this.maxConnections||!this._checkSendingRate()){return}if(!this.pending.length){if(!this.idling){this.idling=true;this.emit("idle")}return}let e=this.pending.shift();this._send(e.mail,((...t)=>{setImmediate((()=>e.callback(...t)));this._sent()}))}_checkSendingRate(){clearTimeout(this.sendingRateTTL);let e=Date.now();let t=false;for(let i=this.rateMessages.length-1;i>=0;i--){if(this.rateMessages[i].ts>=e-this.rateInterval&&(!t||this.rateMessages[i].ts<t)){t=this.rateMessages[i].ts}if(this.rateMessages[i].ts<e-this.rateInterval&&!this.rateMessages[i].pending){this.rateMessages.splice(i,1)}}if(this.rateMessages.length<this.sendingRate){return true}let i=Math.max(t+1001,e+20);this.sendingRateTTL=setTimeout((()=>this._checkRatedQueue()),e-i);try{this.sendingRateTTL.unref()}catch(e){}return false}_sent(){this.connections--;this._checkRatedQueue()}isIdle(){return this.idling}_send(e,t){let i={ts:Date.now(),pending:true};this.connections++;this.rateMessages.push(i);let a=e.data.envelope||e.message.getEnvelope();let s=e.message.messageId();let n=[].concat(a.to||[]);if(n.length>3){n.push("...and "+n.splice(2).length+" more")}this.logger.info({tnx:"send",messageId:s},"Sending message %s to <%s>",s,n.join(", "));let getRawMessage=t=>{if(!e.data._dkim){e.data._dkim={}}if(e.data._dkim.skipFields&&typeof e.data._dkim.skipFields==="string"){e.data._dkim.skipFields+=":date:message-id"}else{e.data._dkim.skipFields="date:message-id"}let i=e.message.createReadStream();let a=i.pipe(new o);let s=[];let n=0;a.on("readable",(()=>{let e;while((e=a.read())!==null){s.push(e);n+=e.length}}));i.once("error",(e=>a.emit("error",e)));a.once("error",(e=>{t(e)}));a.once("end",(()=>t(null,Buffer.concat(s,n))))};setImmediate((()=>getRawMessage(((n,o)=>{if(n){this.logger.error({err:n,tnx:"send",messageId:s},"Failed creating message for %s. %s",s,n.message);i.pending=false;return t(n)}let r={RawMessage:{Data:o},Source:a.from,Destinations:a.to};Object.keys(e.data.ses||{}).forEach((t=>{r[t]=e.data.ses[t]}));let p=(this.ses.aws?this.ses.ses:this.ses)||{};let l=this.ses.aws||{};let getRegion=e=>{if(p.config&&typeof p.config.region==="function"){return p.config.region().then((t=>e(null,t))).catch((t=>e(t)))}return e(null,p.config&&p.config.region||"us-east-1")};getRegion(((e,n)=>{if(e||!n){n="us-east-1"}let c;if(typeof p.send==="function"&&l.SendRawEmailCommand){c=p.send(new l.SendRawEmailCommand(r))}else{c=p.sendRawEmail(r).promise()}c.then((e=>{if(n==="us-east-1"){n="email"}i.pending=false;t(null,{envelope:{from:a.from,to:a.to},messageId:"<"+e.MessageId+(!/@/.test(e.MessageId)?"@"+n+".amazonses.com":"")+">",response:e.MessageId,raw:o})})).catch((e=>{this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",s,e.message);i.pending=false;t(e)}))}))}))))}verify(e){let t;let i=(this.ses.aws?this.ses.ses:this.ses)||{};let a=this.ses.aws||{};const s={RawMessage:{Data:"From: invalid@invalid\r\nTo: invalid@invalid\r\n Subject: Invalid\r\n\r\nInvalid"},Source:"invalid@invalid",Destinations:["invalid@invalid"]};if(!e){t=new Promise(((t,i)=>{e=n.callbackPromise(t,i)}))}const cb=t=>{if(t&&(t.code||t.Code)!=="InvalidParameterValue"){return e(t)}return e(null,true)};if(typeof i.send==="function"&&a.SendRawEmailCommand){s.RawMessage.Data=Buffer.from(s.RawMessage.Data);i.send(new a.SendRawEmailCommand(s),cb)}else{i.sendRawEmail(s,cb)}return t}}e.exports=SESTransport},673:function(e,t,i){const a=i(310);const s=i(837);const n=i(147);const o=i(106);const r=i(523);const p=i(808);const l=i(37);const c=5*60*1e3;let d;try{d=l.networkInterfaces()}catch(e){}e.exports.networkInterfaces=d;const isFamilySupported=(t,i)=>{let a=e.exports.networkInterfaces;if(!a){return true}const s=Object.keys(a).map((e=>a[e])).reduce(((e,t)=>e.concat(t)),[]).filter((e=>!e.internal||i)).filter((e=>e.family==="IPv"+t||e.family===t)).length>0;return s};const resolver=(e,t,i,a)=>{i=i||{};const s=isFamilySupported(e,i.allowInternalNetworkInterfaces);if(!s){return a(null,[])}const n=r.Resolver?new r.Resolver(i):r;n["resolve"+e](t,((e,t)=>{if(e){switch(e.code){case r.NODATA:case r.NOTFOUND:case r.NOTIMP:case r.SERVFAIL:case r.CONNREFUSED:case r.REFUSED:case"EAI_AGAIN":return a(null,[])}return a(e)}return a(null,Array.isArray(t)?t:[].concat(t||[]))}))};const m=e.exports.dnsCache=new Map;const formatDNSValue=(e,t)=>{if(!e){return Object.assign({},t||{})}return Object.assign({servername:e.servername,host:!e.addresses||!e.addresses.length?null:e.addresses.length===1?e.addresses[0]:e.addresses[Math.floor(Math.random()*e.addresses.length)]},t||{})};e.exports.resolveHostname=(e,t)=>{e=e||{};if(!e.host&&e.servername){e.host=e.servername}if(!e.host||p.isIP(e.host)){let i={addresses:[e.host],servername:e.servername||false};return t(null,formatDNSValue(i,{cached:false}))}let i;if(m.has(e.host)){i=m.get(e.host);if(!i.expires||i.expires>=Date.now()){return t(null,formatDNSValue(i.value,{cached:true}))}}resolver(4,e.host,e,((a,s)=>{if(a){if(i){return t(null,formatDNSValue(i.value,{cached:true,error:a}))}return t(a)}if(s&&s.length){let i={addresses:s,servername:e.servername||e.host};m.set(e.host,{value:i,expires:Date.now()+(e.dnsTtl||c)});return t(null,formatDNSValue(i,{cached:false}))}resolver(6,e.host,e,((a,s)=>{if(a){if(i){return t(null,formatDNSValue(i.value,{cached:true,error:a}))}return t(a)}if(s&&s.length){let i={addresses:s,servername:e.servername||e.host};m.set(e.host,{value:i,expires:Date.now()+(e.dnsTtl||c)});return t(null,formatDNSValue(i,{cached:false}))}try{r.lookup(e.host,{all:true},((a,s)=>{if(a){if(i){return t(null,formatDNSValue(i.value,{cached:true,error:a}))}return t(a)}let n=s?s.filter((e=>isFamilySupported(e.family))).map((e=>e.address)).shift():false;if(s&&s.length&&!n){console.warn(`Failed to resolve IPv${s[0].family} addresses with current network`)}if(!n&&i){return t(null,formatDNSValue(i.value,{cached:true}))}let o={addresses:n?[n]:[e.host],servername:e.servername||e.host};m.set(e.host,{value:o,expires:Date.now()+(e.dnsTtl||c)});return t(null,formatDNSValue(o,{cached:false}))}))}catch(a){if(i){return t(null,formatDNSValue(i.value,{cached:true,error:a}))}return t(a)}}))}))};e.exports.parseConnectionUrl=e=>{e=e||"";let t={};[a.parse(e,true)].forEach((e=>{let i;switch(e.protocol){case"smtp:":t.secure=false;break;case"smtps:":t.secure=true;break;case"direct:":t.direct=true;break}if(!isNaN(e.port)&&Number(e.port)){t.port=Number(e.port)}if(e.hostname){t.host=e.hostname}if(e.auth){i=e.auth.split(":");if(!t.auth){t.auth={}}t.auth.user=i.shift();t.auth.pass=i.join(":")}Object.keys(e.query||{}).forEach((i=>{let a=t;let s=i;let n=e.query[i];if(!isNaN(n)){n=Number(n)}switch(n){case"true":n=true;break;case"false":n=false;break}if(i.indexOf("tls.")===0){s=i.substr(4);if(!t.tls){t.tls={}}a=t.tls}else if(i.indexOf(".")>=0){return}if(!(s in a)){a[s]=n}}))}));return t};e.exports._logFunc=(e,t,i,a,s,...n)=>{let o={};Object.keys(i||{}).forEach((e=>{if(e!=="level"){o[e]=i[e]}}));Object.keys(a||{}).forEach((e=>{if(e!=="level"){o[e]=a[e]}}));e[t](o,s,...n)};e.exports.getLogger=(t,i)=>{t=t||{};let a={};let s=["trace","debug","info","warn","error","fatal"];if(!t.logger){s.forEach((e=>{a[e]=()=>false}));return a}let n=t.logger;if(t.logger===true){n=createDefaultLogger(s)}s.forEach((t=>{a[t]=(a,s,...o)=>{e.exports._logFunc(n,t,i,a,s,...o)}}));return a};e.exports.callbackPromise=(e,t)=>function(){let i=Array.from(arguments);let a=i.shift();if(a){t(a)}else{e(...i)}};e.exports.resolveContent=(t,i,a)=>{let s;if(!a){s=new Promise(((t,i)=>{a=e.exports.callbackPromise(t,i)}))}let r=t&&t[i]&&t[i].content||t[i];let p;let l=(typeof t[i]==="object"&&t[i].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!r){return a(null,r)}if(typeof r==="object"){if(typeof r.pipe==="function"){return resolveStream(r,((e,s)=>{if(e){return a(e)}if(t[i].content){t[i].content=s}else{t[i]=s}a(null,s)}))}else if(/^https?:\/\//i.test(r.path||r.href)){p=o(r.path||r.href);return resolveStream(p,a)}else if(/^data:/i.test(r.path||r.href)){let e=(r.path||r.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);if(!e){return a(null,Buffer.from(0))}return a(null,/\bbase64$/i.test(e[1])?Buffer.from(e[2],"base64"):Buffer.from(decodeURIComponent(e[2])))}else if(r.path){return resolveStream(n.createReadStream(r.path),a)}}if(typeof t[i].content==="string"&&!["utf8","usascii","ascii"].includes(l)){r=Buffer.from(t[i].content,l)}setImmediate((()=>a(null,r)));return s};e.exports.assign=function(){let e=Array.from(arguments);let t=e.shift()||{};e.forEach((e=>{Object.keys(e||{}).forEach((i=>{if(["tls","auth"].includes(i)&&e[i]&&typeof e[i]==="object"){if(!t[i]){t[i]={}}Object.keys(e[i]).forEach((a=>{t[i][a]=e[i][a]}))}else{t[i]=e[i]}}))}));return t};e.exports.encodeXText=e=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(e)){return e}let t=Buffer.from(e);let i="";for(let e=0,a=t.length;e<a;e++){let a=t[e];if(a<33||a>126||a===43||a===61){i+="+"+(a<16?"0":"")+a.toString(16).toUpperCase()}else{i+=String.fromCharCode(a)}}return i};function resolveStream(e,t){let i=false;let a=[];let s=0;e.on("error",(e=>{if(i){return}i=true;t(e)}));e.on("readable",(()=>{let t;while((t=e.read())!==null){a.push(t);s+=t.length}}));e.on("end",(()=>{if(i){return}i=true;let e;try{e=Buffer.concat(a,s)}catch(e){return t(e)}t(null,e)}))}function createDefaultLogger(e){let t=0;let i=new Map;e.forEach((e=>{if(e.length>t){t=e.length}}));e.forEach((e=>{let a=e.toUpperCase();if(a.length<t){a+=" ".repeat(t-a.length)}i.set(e,a)}));let print=(e,t,a,...n)=>{let o="";if(t){if(t.tnx==="server"){o="S: "}else if(t.tnx==="client"){o="C: "}if(t.sid){o="["+t.sid+"] "+o}if(t.cid){o="[#"+t.cid+"] "+o}}a=s.format(a,...n);a.split(/\r?\n/).forEach((t=>{console.log("[%s] %s %s",(new Date).toISOString().substr(0,19).replace(/T/," "),i.get(e),o+t)}))};let a={};e.forEach((e=>{a[e]=print.bind(null,e)}));return a}},447:function(e,t,i){const a=i(781);const s=a.Transform;class DataStream extends s{constructor(e){super(e);this.options=e||{};this._curLine="";this.inByteCount=0;this.outByteCount=0;this.lastByte=false}_transform(e,t,i){let a=[];let s=0;let n,o,r=0;let p;if(!e||!e.length){return i()}if(typeof e==="string"){e=Buffer.from(e)}this.inByteCount+=e.length;for(n=0,o=e.length;n<o;n++){if(e[n]===46){if(n&&e[n-1]===10||!n&&(!this.lastByte||this.lastByte===10)){p=e.slice(r,n+1);a.push(p);a.push(Buffer.from("."));s+=p.length+1;r=n+1}}else if(e[n]===10){if(n&&e[n-1]!==13||!n&&this.lastByte!==13){if(n>r){p=e.slice(r,n);a.push(p);s+=p.length+2}else{s+=2}a.push(Buffer.from("\r\n"));r=n+1}}}if(s){if(r<e.length){p=e.slice(r);a.push(p);s+=p.length}this.outByteCount+=s;this.push(Buffer.concat(a,s))}else{this.outByteCount+=e.length;this.push(e)}this.lastByte=e[e.length-1];i()}_flush(e){let t;if(this.lastByte===10){t=Buffer.from(".\r\n")}else if(this.lastByte===13){t=Buffer.from("\n.\r\n")}else{t=Buffer.from("\r\n.\r\n")}this.outByteCount+=t.length;this.push(t);e()}}e.exports=DataStream},643:function(e,t,i){const a=i(808);const s=i(404);const n=i(310);function httpProxyClient(e,t,i,o){let r=n.parse(e);let p;let l;let c;p={host:r.hostname,port:Number(r.port)?Number(r.port):r.protocol==="https:"?443:80};if(r.protocol==="https:"){p.rejectUnauthorized=false;l=s.connect.bind(s)}else{l=a.connect.bind(a)}let d=false;let tempSocketErr=e=>{if(d){return}d=true;try{c.destroy()}catch(e){}o(e)};let timeoutErr=()=>{let e=new Error("Proxy socket timed out");e.code="ETIMEDOUT";tempSocketErr(e)};c=l(p,(()=>{if(d){return}let e={Host:i+":"+t,Connection:"close"};if(r.auth){e["Proxy-Authorization"]="Basic "+Buffer.from(r.auth).toString("base64")}c.write("CONNECT "+i+":"+t+" HTTP/1.1\r\n"+Object.keys(e).map((t=>t+": "+e[t])).join("\r\n")+"\r\n\r\n");let a="";let onSocketData=e=>{let t;let i;if(d){return}a+=e.toString("binary");if(t=a.match(/\r\n\r\n/)){c.removeListener("data",onSocketData);i=a.substr(t.index+t[0].length);a=a.substr(0,t.index);if(i){c.unshift(Buffer.from(i,"binary"))}d=true;t=a.match(/^HTTP\/\d+\.\d+ (\d+)/i);if(!t||(t[1]||"").charAt(0)!=="2"){try{c.destroy()}catch(e){}return o(new Error("Invalid response from proxy"+(t&&": "+t[1]||"")))}c.removeListener("error",tempSocketErr);c.removeListener("timeout",timeoutErr);c.setTimeout(0);return o(null,c)}};c.on("data",onSocketData)}));c.setTimeout(httpProxyClient.timeout||30*1e3);c.on("timeout",timeoutErr);c.once("error",tempSocketErr)}e.exports=httpProxyClient},559:function(e,t,i){const a=i(129);const s=i(361).EventEmitter;const n=i(808);const o=i(404);const r=i(37);const p=i(113);const l=i(447);const c=i(781).PassThrough;const d=i(673);const m=2*60*1e3;const h=10*60*1e3;const u=30*1e3;const f=30*1e3;class SMTPConnection extends s{constructor(e){super(e);this.id=p.randomBytes(8).toString("base64").replace(/\W/g,"");this.stage="init";this.options=e||{};this.secureConnection=!!this.options.secure;this.alreadySecured=!!this.options.secured;this.port=Number(this.options.port)||(this.secureConnection?465:587);this.host=this.options.host||"localhost";this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||false;if(typeof this.options.secure==="undefined"&&this.port===465){this.secureConnection=true}this.name=this.options.name||this._getHostname();this.logger=d.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id});this.customAuth=new Map;Object.keys(this.options.customAuth||{}).forEach((e=>{let t=(e||"").toString().trim().toUpperCase();if(!t){return}this.customAuth.set(t,this.options.customAuth[e])}));this.version=a.version;this.authenticated=false;this.destroyed=false;this.secure=!!this.secureConnection;this._remainder="";this._responseQueue=[];this.lastServerResponse=false;this._socket=false;this._supportedAuth=[];this.allowsAuth=false;this._envelope=false;this._supportedExtensions=[];this._maxAllowedSize=0;this._responseActions=[];this._recipientQueue=[];this._greetingTimeout=false;this._connectionTimeout=false;this._destroyed=false;this._closing=false;this._onSocketData=e=>this._onData(e);this._onSocketError=e=>this._onError(e,"ESOCKET",false,"CONN");this._onSocketClose=()=>this._onClose();this._onSocketEnd=()=>this._onEnd();this._onSocketTimeout=()=>this._onTimeout()}connect(e){if(typeof e==="function"){this.once("connect",(()=>{this.logger.debug({tnx:"smtp"},"SMTP handshake finished");e()}));const t=this._isDestroyedMessage("connect");if(t){return e(this._formatError(t,"ECONNECTION",false,"CONN"))}}let t={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||f};if(this.options.localAddress){t.localAddress=this.options.localAddress}let setupConnectionHandlers=()=>{this._connectionTimeout=setTimeout((()=>{this._onError("Connection timeout","ETIMEDOUT",false,"CONN")}),this.options.connectionTimeout||m);this._socket.on("error",this._onSocketError)};if(this.options.connection){this._socket=this.options.connection;if(this.secureConnection&&!this.alreadySecured){setImmediate((()=>this._upgradeConnection((e=>{if(e){this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",false,"CONN");return}this._onConnect()}))))}else{setImmediate((()=>this._onConnect()))}return}else if(this.options.socket){this._socket=this.options.socket;return d.resolveHostname(t,((e,i)=>{if(e){return setImmediate((()=>this._onError(e,"EDNS",false,"CONN")))}this.logger.debug({tnx:"dns",source:t.host,resolved:i.host,cached:!!i.cached},"Resolved %s as %s [cache %s]",t.host,i.host,i.cached?"hit":"miss");Object.keys(i).forEach((e=>{if(e.charAt(0)!=="_"&&i[e]){t[e]=i[e]}}));try{this._socket.connect(this.port,this.host,(()=>{this._socket.setKeepAlive(true);this._onConnect()}));setupConnectionHandlers()}catch(e){return setImmediate((()=>this._onError(e,"ECONNECTION",false,"CONN")))}}))}else if(this.secureConnection){if(this.options.tls){Object.keys(this.options.tls).forEach((e=>{t[e]=this.options.tls[e]}))}return d.resolveHostname(t,((e,i)=>{if(e){return setImmediate((()=>this._onError(e,"EDNS",false,"CONN")))}this.logger.debug({tnx:"dns",source:t.host,resolved:i.host,cached:!!i.cached},"Resolved %s as %s [cache %s]",t.host,i.host,i.cached?"hit":"miss");Object.keys(i).forEach((e=>{if(e.charAt(0)!=="_"&&i[e]){t[e]=i[e]}}));try{this._socket=o.connect(t,(()=>{this._socket.setKeepAlive(true);this._onConnect()}));setupConnectionHandlers()}catch(e){return setImmediate((()=>this._onError(e,"ECONNECTION",false,"CONN")))}}))}else{return d.resolveHostname(t,((e,i)=>{if(e){return setImmediate((()=>this._onError(e,"EDNS",false,"CONN")))}this.logger.debug({tnx:"dns",source:t.host,resolved:i.host,cached:!!i.cached},"Resolved %s as %s [cache %s]",t.host,i.host,i.cached?"hit":"miss");Object.keys(i).forEach((e=>{if(e.charAt(0)!=="_"&&i[e]){t[e]=i[e]}}));try{this._socket=n.connect(t,(()=>{this._socket.setKeepAlive(true);this._onConnect()}));setupConnectionHandlers()}catch(e){return setImmediate((()=>this._onError(e,"ECONNECTION",false,"CONN")))}}))}}quit(){this._sendCommand("QUIT");this._responseActions.push(this.close)}close(){clearTimeout(this._connectionTimeout);clearTimeout(this._greetingTimeout);this._responseActions=[];if(this._closing){return}this._closing=true;let e="end";if(this.stage==="init"){e="destroy"}this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',e);let t=this._socket&&this._socket.socket||this._socket;if(t&&!t.destroyed){try{this._socket[e]()}catch(e){}}this._destroy()}login(e,t){const i=this._isDestroyedMessage("login");if(i){return t(this._formatError(i,"ECONNECTION",false,"API"))}this._auth=e||{};this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||false;if(!this._authMethod&&this._auth.oauth2&&!this._auth.credentials){this._authMethod="XOAUTH2"}else if(!this._authMethod||this._authMethod==="XOAUTH2"&&!this._auth.oauth2){this._authMethod=(this._supportedAuth[0]||"PLAIN").toUpperCase().trim()}if(this._authMethod!=="XOAUTH2"&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass)){if(this._auth.user&&this._auth.pass||this.customAuth.has(this._authMethod)){this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options}}else{return t(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",false,"API"))}}if(this.customAuth.has(this._authMethod)){let e=this.customAuth.get(this._authMethod);let i;let a=false;let resolve=()=>{if(a){return}a=true;this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user));this.authenticated=true;t(null,true)};let reject=e=>{if(a){return}a=true;t(this._formatError(e,"EAUTH",i,"AUTH "+this._authMethod))};let s=e({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||false,sendCommand:(e,t)=>{let a;if(!t){a=new Promise(((e,i)=>{t=d.callbackPromise(e,i)}))}this._responseActions.push((a=>{i=a;let s=a.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/);let n={command:e,response:a};if(s){n.status=Number(s[1])||0;if(s[2]){n.code=s[2]}n.text=a.substr(s[0].length)}else{n.text=a;n.status=0}t(null,n)}));setImmediate((()=>this._sendCommand(e)));return a},resolve:resolve,reject:reject});if(s&&typeof s.catch==="function"){s.then(resolve).catch(reject)}return}switch(this._authMethod){case"XOAUTH2":this._handleXOauth2Token(false,t);return;case"LOGIN":this._responseActions.push((e=>{this._actionAUTH_LOGIN_USER(e,t)}));this._sendCommand("AUTH LOGIN");return;case"PLAIN":this._responseActions.push((e=>{this._actionAUTHComplete(e,t)}));this._sendCommand("AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+this._auth.credentials.pass,"utf-8").toString("base64"),"AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+"/* secret */","utf-8").toString("base64"));return;case"CRAM-MD5":this._responseActions.push((e=>{this._actionAUTH_CRAM_MD5(e,t)}));this._sendCommand("AUTH CRAM-MD5");return}return t(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",false,"API"))}send(e,t,i){if(!t){return i(this._formatError("Empty message","EMESSAGE",false,"API"))}const a=this._isDestroyedMessage("send message");if(a){return i(this._formatError(a,"ECONNECTION",false,"API"))}if(this._maxAllowedSize&&e.size>this._maxAllowedSize){return setImmediate((()=>{i(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",false,"MAIL FROM"))}))}let s=false;let callback=function(){if(s){return}s=true;i(...arguments)};if(typeof t.on==="function"){t.on("error",(e=>callback(this._formatError(e,"ESTREAM",false,"API"))))}let n=Date.now();this._setEnvelope(e,((e,i)=>{if(e){return callback(e)}let a=Date.now();let s=this._createSendStream(((e,t)=>{if(e){return callback(e)}i.envelopeTime=a-n;i.messageTime=Date.now()-a;i.messageSize=s.outByteCount;i.response=t;return callback(null,i)}));if(typeof t.pipe==="function"){t.pipe(s)}else{s.write(t);s.end()}}))}reset(e){this._sendCommand("RSET");this._responseActions.push((t=>{if(t.charAt(0)!=="2"){return e(this._formatError("Could not reset session state. response="+t,"EPROTOCOL",t,"RSET"))}this._envelope=false;return e(null,true)}))}_onConnect(){clearTimeout(this._connectionTimeout);this.logger.info({tnx:"network",localAddress:this._socket.localAddress,localPort:this._socket.localPort,remoteAddress:this._socket.remoteAddress,remotePort:this._socket.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",this._socket.remoteAddress,this._socket.remotePort);if(this._destroyed){this.close();return}this.stage="connected";this._socket.removeListener("data",this._onSocketData);this._socket.removeListener("timeout",this._onSocketTimeout);this._socket.removeListener("close",this._onSocketClose);this._socket.removeListener("end",this._onSocketEnd);this._socket.on("data",this._onSocketData);this._socket.once("close",this._onSocketClose);this._socket.once("end",this._onSocketEnd);this._socket.setTimeout(this.options.socketTimeout||h);this._socket.on("timeout",this._onSocketTimeout);this._greetingTimeout=setTimeout((()=>{if(this._socket&&!this._destroyed&&this._responseActions[0]===this._actionGreeting){this._onError("Greeting never received","ETIMEDOUT",false,"CONN")}}),this.options.greetingTimeout||u);this._responseActions.push(this._actionGreeting);this._socket.resume()}_onData(e){if(this._destroyed||!e||!e.length){return}let t=(e||"").toString("binary");let i=(this._remainder+t).split(/\r?\n/);let a;this._remainder=i.pop();for(let e=0,t=i.length;e<t;e++){if(this._responseQueue.length){a=this._responseQueue[this._responseQueue.length-1];if(/^\d+-/.test(a.split("\n").pop())){this._responseQueue[this._responseQueue.length-1]+="\n"+i[e];continue}}this._responseQueue.push(i[e])}if(this._responseQueue.length){a=this._responseQueue[this._responseQueue.length-1];if(/^\d+-/.test(a.split("\n").pop())){return}}this._processResponse()}_onError(e,t,i,a){clearTimeout(this._connectionTimeout);clearTimeout(this._greetingTimeout);if(this._destroyed){return}e=this._formatError(e,t,i,a);this.logger.error(i,e.message);this.emit("error",e);this.close()}_formatError(e,t,i,a){let s;if(/Error\]$/i.test(Object.prototype.toString.call(e))){s=e}else{s=new Error(e)}if(t&&t!=="Error"){s.code=t}if(i){s.response=i;s.message+=": "+i}let n=typeof i==="string"&&Number((i.match(/^\d+/)||[])[0])||false;if(n){s.responseCode=n}if(a){s.command=a}return s}_onClose(){let e=false;if(this._remainder&&this._remainder.trim()){if(this.options.debug||this.options.transactionLog){this.logger.debug({tnx:"server"},this._remainder.replace(/\r?\n$/,""))}this.lastServerResponse=e=this._remainder.trim()}this.logger.info({tnx:"network"},"Connection closed");if(this.upgrading&&!this._destroyed){return this._onError(new Error("Connection closed unexpectedly"),"ETLS",e,"CONN")}else if(![this._actionGreeting,this.close].includes(this._responseActions[0])&&!this._destroyed){return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",e,"CONN")}else if(/^[45]\d{2}\b/.test(e)){return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",e,"CONN")}this._destroy()}_onEnd(){if(this._socket&&!this._socket.destroyed){this._socket.destroy()}}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",false,"CONN")}_destroy(){if(this._destroyed){return}this._destroyed=true;this.emit("end")}_upgradeConnection(e){this._socket.removeListener("data",this._onSocketData);this._socket.removeListener("timeout",this._onSocketTimeout);let t=this._socket;let i={socket:this._socket,host:this.host};Object.keys(this.options.tls||{}).forEach((e=>{i[e]=this.options.tls[e]}));this.upgrading=true;try{this._socket=o.connect(i,(()=>{this.secure=true;this.upgrading=false;this._socket.on("data",this._onSocketData);t.removeListener("close",this._onSocketClose);t.removeListener("end",this._onSocketEnd);return e(null,true)}))}catch(t){return e(t)}this._socket.on("error",this._onSocketError);this._socket.once("close",this._onSocketClose);this._socket.once("end",this._onSocketEnd);this._socket.setTimeout(this.options.socketTimeout||h);this._socket.on("timeout",this._onSocketTimeout);t.resume()}_processResponse(){if(!this._responseQueue.length){return false}let e=this.lastServerResponse=(this._responseQueue.shift()||"").toString();if(/^\d+-/.test(e.split("\n").pop())){return}if(this.options.debug||this.options.transactionLog){this.logger.debug({tnx:"server"},e.replace(/\r?\n$/,""))}if(!e.trim()){setImmediate((()=>this._processResponse()))}let t=this._responseActions.shift();if(typeof t==="function"){t.call(this,e);setImmediate((()=>this._processResponse()))}else{return this._onError(new Error("Unexpected Response"),"EPROTOCOL",e,"CONN")}}_sendCommand(e,t){if(this._destroyed){return}if(this._socket.destroyed){return this.close()}if(this.options.debug||this.options.transactionLog){this.logger.debug({tnx:"client"},(t||e||"").toString().replace(/\r?\n$/,""))}this._socket.write(Buffer.from(e+"\r\n","utf-8"))}_setEnvelope(e,t){let i=[];let a=false;this._envelope=e||{};this._envelope.from=(this._envelope.from&&this._envelope.from.address||this._envelope.from||"").toString().trim();this._envelope.to=[].concat(this._envelope.to||[]).map((e=>(e&&e.address||e||"").toString().trim()));if(!this._envelope.to.length){return t(this._formatError("No recipients defined","EENVELOPE",false,"API"))}if(this._envelope.from&&/[\r\n<>]/.test(this._envelope.from)){return t(this._formatError("Invalid sender "+JSON.stringify(this._envelope.from),"EENVELOPE",false,"API"))}if(/[\x80-\uFFFF]/.test(this._envelope.from)){a=true}for(let e=0,i=this._envelope.to.length;e<i;e++){if(!this._envelope.to[e]||/[\r\n<>]/.test(this._envelope.to[e])){return t(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[e]),"EENVELOPE",false,"API"))}if(/[\x80-\uFFFF]/.test(this._envelope.to[e])){a=true}}this._envelope.rcptQueue=JSON.parse(JSON.stringify(this._envelope.to||[]));this._envelope.rejected=[];this._envelope.rejectedErrors=[];this._envelope.accepted=[];if(this._envelope.dsn){try{this._envelope.dsn=this._setDsnEnvelope(this._envelope.dsn)}catch(e){return t(this._formatError("Invalid DSN "+e.message,"EENVELOPE",false,"API"))}}this._responseActions.push((e=>{this._actionMAIL(e,t)}));if(a&&this._supportedExtensions.includes("SMTPUTF8")){i.push("SMTPUTF8");this._usingSmtpUtf8=true}if(this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")){i.push("BODY=8BITMIME");this._using8BitMime=true}if(this._envelope.size&&this._supportedExtensions.includes("SIZE")){i.push("SIZE="+this._envelope.size)}if(this._envelope.dsn&&this._supportedExtensions.includes("DSN")){if(this._envelope.dsn.ret){i.push("RET="+d.encodeXText(this._envelope.dsn.ret))}if(this._envelope.dsn.envid){i.push("ENVID="+d.encodeXText(this._envelope.dsn.envid))}}this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(i.length?" "+i.join(" "):""))}_setDsnEnvelope(e){let t=(e.ret||e.return||"").toString().toUpperCase()||null;if(t){switch(t){case"HDRS":case"HEADERS":t="HDRS";break;case"FULL":case"BODY":t="FULL";break}}if(t&&!["FULL","HDRS"].includes(t)){throw new Error("ret: "+JSON.stringify(t))}let i=(e.envid||e.id||"").toString()||null;let a=e.notify||null;if(a){if(typeof a==="string"){a=a.split(",")}a=a.map((e=>e.trim().toUpperCase()));let e=["NEVER","SUCCESS","FAILURE","DELAY"];let t=a.filter((t=>!e.includes(t)));if(t.length||a.length>1&&a.includes("NEVER")){throw new Error("notify: "+JSON.stringify(a.join(",")))}a=a.join(",")}let s=(e.recipient||e.orcpt||"").toString()||null;if(s&&s.indexOf(";")<0){s="rfc822;"+s}return{ret:t,envid:i,notify:a,orcpt:s}}_getDsnRcptToArgs(){let e=[];if(this._envelope.dsn&&this._supportedExtensions.includes("DSN")){if(this._envelope.dsn.notify){e.push("NOTIFY="+d.encodeXText(this._envelope.dsn.notify))}if(this._envelope.dsn.orcpt){e.push("ORCPT="+d.encodeXText(this._envelope.dsn.orcpt))}}return e.length?" "+e.join(" "):""}_createSendStream(e){let t=new l;let i;if(this.options.lmtp){this._envelope.accepted.forEach(((t,i)=>{let a=i===this._envelope.accepted.length-1;this._responseActions.push((i=>{this._actionLMTPStream(t,a,i,e)}))}))}else{this._responseActions.push((t=>{this._actionSMTPStream(t,e)}))}t.pipe(this._socket,{end:false});if(this.options.debug){i=new c;i.on("readable",(()=>{let e;while(e=i.read()){this.logger.debug({tnx:"message"},e.toString("binary").replace(/\r?\n$/,""))}}));t.pipe(i)}t.once("end",(()=>{this.logger.info({tnx:"message",inByteCount:t.inByteCount,outByteCount:t.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",t.outByteCount,t.inByteCount)}));return t}_actionGreeting(e){clearTimeout(this._greetingTimeout);if(e.substr(0,3)!=="220"){this._onError(new Error("Invalid greeting. response="+e),"EPROTOCOL",e,"CONN");return}if(this.options.lmtp){this._responseActions.push(this._actionLHLO);this._sendCommand("LHLO "+this.name)}else{this._responseActions.push(this._actionEHLO);this._sendCommand("EHLO "+this.name)}}_actionLHLO(e){if(e.charAt(0)!=="2"){this._onError(new Error("Invalid LHLO. response="+e),"EPROTOCOL",e,"LHLO");return}this._actionEHLO(e)}_actionEHLO(e){let t;if(e.substr(0,3)==="421"){this._onError(new Error("Server terminates connection. response="+e),"ECONNECTION",e,"EHLO");return}if(e.charAt(0)!=="2"){if(this.options.requireTLS){this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+e),"ECONNECTION",e,"EHLO");return}this._responseActions.push(this._actionHELO);this._sendCommand("HELO "+this.name);return}this._ehloLines=e.split(/\r?\n/).map((e=>e.replace(/^\d+[ -]/,"").trim())).filter((e=>e)).slice(1);if(!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(e)||this.options.requireTLS)){this._sendCommand("STARTTLS");this._responseActions.push(this._actionSTARTTLS);return}if(/[ -]SMTPUTF8\b/im.test(e)){this._supportedExtensions.push("SMTPUTF8")}if(/[ -]DSN\b/im.test(e)){this._supportedExtensions.push("DSN")}if(/[ -]8BITMIME\b/im.test(e)){this._supportedExtensions.push("8BITMIME")}if(/[ -]PIPELINING\b/im.test(e)){this._supportedExtensions.push("PIPELINING")}if(/[ -]AUTH\b/i.test(e)){this.allowsAuth=true}if(/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)PLAIN/i.test(e)){this._supportedAuth.push("PLAIN")}if(/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)LOGIN/i.test(e)){this._supportedAuth.push("LOGIN")}if(/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)CRAM-MD5/i.test(e)){this._supportedAuth.push("CRAM-MD5")}if(/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)XOAUTH2/i.test(e)){this._supportedAuth.push("XOAUTH2")}if(t=e.match(/[ -]SIZE(?:[ \t]+(\d+))?/im)){this._supportedExtensions.push("SIZE");this._maxAllowedSize=Number(t[1])||0}this.emit("connect")}_actionHELO(e){if(e.charAt(0)!=="2"){this._onError(new Error("Invalid HELO. response="+e),"EPROTOCOL",e,"HELO");return}this.allowsAuth=true;this.emit("connect")}_actionSTARTTLS(e){if(e.charAt(0)!=="2"){if(this.options.opportunisticTLS){this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted");return this.emit("connect")}this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",e,"STARTTLS");return}this._upgradeConnection(((e,t)=>{if(e){this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",false,"STARTTLS");return}this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS");if(t){if(this.options.lmtp){this._responseActions.push(this._actionLHLO);this._sendCommand("LHLO "+this.name)}else{this._responseActions.push(this._actionEHLO);this._sendCommand("EHLO "+this.name)}}else{this.emit("connect")}}))}_actionAUTH_LOGIN_USER(e,t){if(!/^334[ -]/.test(e)){t(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",e,"AUTH LOGIN"));return}this._responseActions.push((e=>{this._actionAUTH_LOGIN_PASS(e,t)}));this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))}_actionAUTH_CRAM_MD5(e,t){let i=e.match(/^334\s+(.+)$/);let a="";if(!i){return t(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",e,"AUTH CRAM-MD5"))}else{a=i[1]}let s=Buffer.from(a,"base64").toString("ascii"),n=p.createHmac("md5",this._auth.credentials.pass);n.update(s);let o=this._auth.credentials.user+" "+n.digest("hex");this._responseActions.push((e=>{this._actionAUTH_CRAM_MD5_PASS(e,t)}));this._sendCommand(Buffer.from(o).toString("base64"),Buffer.from(this._auth.credentials.user+" /* secret */").toString("base64"))}_actionAUTH_CRAM_MD5_PASS(e,t){if(!e.match(/^235\s+/)){return t(this._formatError('Invalid login sequence while waiting for "235"',"EAUTH",e,"AUTH CRAM-MD5"))}this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user));this.authenticated=true;t(null,true)}_actionAUTH_LOGIN_PASS(e,t){if(!/^334[ -]/.test(e)){return t(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"',"EAUTH",e,"AUTH LOGIN"))}this._responseActions.push((e=>{this._actionAUTHComplete(e,t)}));this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(e,t,i){if(!i&&typeof t==="function"){i=t;t=false}if(e.substr(0,3)==="334"){this._responseActions.push((e=>{if(t||this._authMethod!=="XOAUTH2"){this._actionAUTHComplete(e,true,i)}else{setImmediate((()=>this._handleXOauth2Token(true,i)))}}));this._sendCommand("");return}if(e.charAt(0)!=="2"){this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user));return i(this._formatError("Invalid login","EAUTH",e,"AUTH "+this._authMethod))}this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user));this.authenticated=true;i(null,true)}_actionMAIL(e,t){let i,a;if(Number(e.charAt(0))!==2){if(this._usingSmtpUtf8&&/^550 /.test(e)&&/[\x80-\uFFFF]/.test(this._envelope.from)){i="Internationalized mailbox name not allowed"}else{i="Mail command failed"}return t(this._formatError(i,"EENVELOPE",e,"MAIL FROM"))}if(!this._envelope.rcptQueue.length){return t(this._formatError("Can't send mail - no recipients defined","EENVELOPE",false,"API"))}else{this._recipientQueue=[];if(this._supportedExtensions.includes("PIPELINING")){while(this._envelope.rcptQueue.length){a=this._envelope.rcptQueue.shift();this._recipientQueue.push(a);this._responseActions.push((e=>{this._actionRCPT(e,t)}));this._sendCommand("RCPT TO:<"+a+">"+this._getDsnRcptToArgs())}}else{a=this._envelope.rcptQueue.shift();this._recipientQueue.push(a);this._responseActions.push((e=>{this._actionRCPT(e,t)}));this._sendCommand("RCPT TO:<"+a+">"+this._getDsnRcptToArgs())}}}_actionRCPT(e,t){let i,a,s=this._recipientQueue.shift();if(Number(e.charAt(0))!==2){if(this._usingSmtpUtf8&&/^553 /.test(e)&&/[\x80-\uFFFF]/.test(s)){i="Internationalized mailbox name not allowed"}else{i="Recipient command failed"}this._envelope.rejected.push(s);a=this._formatError(i,"EENVELOPE",e,"RCPT TO");a.recipient=s;this._envelope.rejectedErrors.push(a)}else{this._envelope.accepted.push(s)}if(!this._envelope.rcptQueue.length&&!this._recipientQueue.length){if(this._envelope.rejected.length<this._envelope.to.length){this._responseActions.push((e=>{this._actionDATA(e,t)}));this._sendCommand("DATA")}else{a=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",e,"RCPT TO");a.rejected=this._envelope.rejected;a.rejectedErrors=this._envelope.rejectedErrors;return t(a)}}else if(this._envelope.rcptQueue.length){s=this._envelope.rcptQueue.shift();this._recipientQueue.push(s);this._responseActions.push((e=>{this._actionRCPT(e,t)}));this._sendCommand("RCPT TO:<"+s+">"+this._getDsnRcptToArgs())}}_actionDATA(e,t){if(!/^[23]/.test(e)){return t(this._formatError("Data command failed","EENVELOPE",e,"DATA"))}let i={accepted:this._envelope.accepted,rejected:this._envelope.rejected};if(this._ehloLines&&this._ehloLines.length){i.ehlo=this._ehloLines}if(this._envelope.rejectedErrors.length){i.rejectedErrors=this._envelope.rejectedErrors}t(null,i)}_actionSMTPStream(e,t){if(Number(e.charAt(0))!==2){return t(this._formatError("Message failed","EMESSAGE",e,"DATA"))}else{return t(null,e)}}_actionLMTPStream(e,t,i,a){let s;if(Number(i.charAt(0))!==2){s=this._formatError("Message failed for recipient "+e,"EMESSAGE",i,"DATA");s.recipient=e;this._envelope.rejected.push(e);this._envelope.rejectedErrors.push(s);for(let t=0,i=this._envelope.accepted.length;t<i;t++){if(this._envelope.accepted[t]===e){this._envelope.accepted.splice(t,1)}}}if(t){return a(null,i)}}_handleXOauth2Token(e,t){this._auth.oauth2.getToken(e,((i,a)=>{if(i){this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user));return t(this._formatError(i,"EAUTH",false,"AUTH XOAUTH2"))}this._responseActions.push((i=>{this._actionAUTHComplete(i,e,t)}));this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(a),"AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token("/* secret */"))}))}_isDestroyedMessage(e){if(this._destroyed){return"Cannot "+e+" - smtp connection is already destroyed."}if(this._socket){if(this._socket.destroyed){return"Cannot "+e+" - smtp connection socket is already destroyed."}if(!this._socket.writable){return"Cannot "+e+" - smtp connection socket is already half-closed."}}}_getHostname(){let e;try{e=r.hostname()||""}catch(t){e="localhost"}if(!e||e.indexOf(".")<0){e="[127.0.0.1]"}if(e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)){e="["+e+"]"}return e}}e.exports=SMTPConnection},560:function(e,t,i){const a=i(361);const s=i(230);const n=i(559);const o=i(961);const r=i(673);const p=i(129);class SMTPPool extends a{constructor(e){super();e=e||{};if(typeof e==="string"){e={url:e}}let t;let i=e.service;if(typeof e.getSocket==="function"){this.getSocket=e.getSocket}if(e.url){t=r.parseConnectionUrl(e.url);i=i||t.service}this.options=r.assign(false,e,t,i&&o(i));this.options.maxConnections=this.options.maxConnections||5;this.options.maxMessages=this.options.maxMessages||100;this.logger=r.getLogger(this.options,{component:this.options.component||"smtp-pool"});let a=new n(this.options);this.name="SMTP (pool)";this.version=p.version+"[client:"+a.version+"]";this._rateLimit={counter:0,timeout:null,waiting:[],checkpoint:false,delta:Number(this.options.rateDelta)||1e3,limit:Number(this.options.rateLimit)||0};this._closed=false;this._queue=[];this._connections=[];this._connectionCounter=0;this.idling=true;setImmediate((()=>{if(this.idling){this.emit("idle")}}))}getSocket(e,t){return setImmediate((()=>t(null,false)))}send(e,t){if(this._closed){return false}this._queue.push({mail:e,requeueAttempts:0,callback:t});if(this.idling&&this._queue.length>=this.options.maxConnections){this.idling=false}setImmediate((()=>this._processMessages()));return true}close(){let e;let t=this._connections.length;this._closed=true;clearTimeout(this._rateLimit.timeout);if(!t&&!this._queue.length){return}for(let i=t-1;i>=0;i--){if(this._connections[i]&&this._connections[i].available){e=this._connections[i];e.close();this.logger.info({tnx:"connection",cid:e.id,action:"removed"},"Connection #%s removed",e.id)}}if(t&&!this._connections.length){this.logger.debug({tnx:"connection"},"All connections removed")}if(!this._queue.length){return}let invokeCallbacks=()=>{if(!this._queue.length){this.logger.debug({tnx:"connection"},"Pending queue entries cleared");return}let t=this._queue.shift();if(t&&typeof t.callback==="function"){try{t.callback(new Error("Connection pool was closed"))}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}}setImmediate(invokeCallbacks)};setImmediate(invokeCallbacks)}_processMessages(){let e;let t,i;if(this._closed){return}if(!this._queue.length){if(!this.idling){this.idling=true;this.emit("idle")}return}for(t=0,i=this._connections.length;t<i;t++){if(this._connections[t].available){e=this._connections[t];break}}if(!e&&this._connections.length<this.options.maxConnections){e=this._createConnection()}if(!e){this.idling=false;return}if(!this.idling&&this._queue.length<this.options.maxConnections){this.idling=true;this.emit("idle")}let a=e.queueEntry=this._queue.shift();a.messageId=(e.queueEntry.mail.message.getHeader("message-id")||"").replace(/[<>\s]/g,"");e.available=false;this.logger.debug({tnx:"pool",cid:e.id,messageId:a.messageId,action:"assign"},"Assigned message <%s> to #%s (%s)",a.messageId,e.id,e.messages+1);if(this._rateLimit.limit){this._rateLimit.counter++;if(!this._rateLimit.checkpoint){this._rateLimit.checkpoint=Date.now()}}e.send(a.mail,((t,i)=>{if(a===e.queueEntry){try{a.callback(t,i)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=false}}))}_createConnection(){let e=new s(this);e.id=++this._connectionCounter;this.logger.info({tnx:"pool",cid:e.id,action:"conection"},"Created new pool resource #%s",e.id);e.on("available",(()=>{this.logger.debug({tnx:"connection",cid:e.id,action:"available"},"Connection #%s became available",e.id);if(this._closed){this.close()}else{this._processMessages()}}));e.once("error",(t=>{if(t.code!=="EMAXLIMIT"){this.logger.error({err:t,tnx:"pool",cid:e.id},"Pool Error for #%s: %s",e.id,t.message)}else{this.logger.debug({tnx:"pool",cid:e.id,action:"maxlimit"},"Max messages limit exchausted for #%s",e.id)}if(e.queueEntry){try{e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=false}this._removeConnection(e);this._continueProcessing()}));e.once("close",(()=>{this.logger.info({tnx:"connection",cid:e.id,action:"closed"},"Connection #%s was closed",e.id);this._removeConnection(e);if(e.queueEntry){setTimeout((()=>{if(e.queueEntry){if(this._shouldRequeuOnConnectionClose(e.queueEntry)){this._requeueEntryOnConnectionClose(e)}else{this._failDeliveryOnConnectionClose(e)}}this._continueProcessing()}),50)}else{this._continueProcessing()}}));this._connections.push(e);return e}_shouldRequeuOnConnectionClose(e){if(this.options.maxRequeues===undefined||this.options.maxRequeues<0){return true}return e.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(e){if(e.queueEntry&&e.queueEntry.callback){try{e.queueEntry.callback(new Error("Reached maximum number of retries after connection was closed"))}catch(t){this.logger.error({err:t,tnx:"callback",messageId:e.queueEntry.messageId,cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=false}}_requeueEntryOnConnectionClose(e){e.queueEntry.requeueAttempts=e.queueEntry.requeueAttempts+1;this.logger.debug({tnx:"pool",cid:e.id,messageId:e.queueEntry.messageId,action:"requeue"},"Re-queued message <%s> for #%s. Attempt: #%s",e.queueEntry.messageId,e.id,e.queueEntry.requeueAttempts);this._queue.unshift(e.queueEntry);e.queueEntry=false}_continueProcessing(){if(this._closed){this.close()}else{setTimeout((()=>this._processMessages()),100)}}_removeConnection(e){let t=this._connections.indexOf(e);if(t!==-1){this._connections.splice(t,1)}}_checkRateLimit(e){if(!this._rateLimit.limit){return e()}let t=Date.now();if(this._rateLimit.counter<this._rateLimit.limit){return e()}this._rateLimit.waiting.push(e);if(this._rateLimit.checkpoint<=t-this._rateLimit.delta){return this._clearRateLimit()}else if(!this._rateLimit.timeout){this._rateLimit.timeout=setTimeout((()=>this._clearRateLimit()),this._rateLimit.delta-(t-this._rateLimit.checkpoint));this._rateLimit.checkpoint=t}}_clearRateLimit(){clearTimeout(this._rateLimit.timeout);this._rateLimit.timeout=null;this._rateLimit.counter=0;this._rateLimit.checkpoint=false;while(this._rateLimit.waiting.length){let e=this._rateLimit.waiting.shift();setImmediate(e)}}isIdle(){return this.idling}verify(e){let t;if(!e){t=new Promise(((t,i)=>{e=r.callbackPromise(t,i)}))}let i=new s(this).auth;this.getSocket(this.options,((t,a)=>{if(t){return e(t)}let s=this.options;if(a&&a.connection){this.logger.info({tnx:"proxy",remoteAddress:a.connection.remoteAddress,remotePort:a.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",a.connection.remoteAddress,a.connection.remotePort,s.host||"",s.port||"");s=r.assign(false,s);Object.keys(a).forEach((e=>{s[e]=a[e]}))}let o=new n(s);let p=false;o.once("error",(t=>{if(p){return}p=true;o.close();return e(t)}));o.once("end",(()=>{if(p){return}p=true;return e(new Error("Connection closed"))}));let finalize=()=>{if(p){return}p=true;o.quit();return e(null,true)};o.connect((()=>{if(p){return}if(i&&(o.allowsAuth||s.forceAuth)){o.login(i,(t=>{if(p){return}if(t){p=true;o.close();return e(t)}finalize()}))}else if(!i&&o.allowsAuth&&s.forceAuth){let t=new Error("Authentication info was not provided");t.code="NoAuth";p=true;o.close();return e(t)}else{finalize()}}))}));return t}}e.exports=SMTPPool},230:function(e,t,i){const a=i(559);const s=i(673).assign;const n=i(882);const o=i(361);class PoolResource extends o{constructor(e){super();this.pool=e;this.options=e.options;this.logger=this.pool.logger;if(this.options.auth){switch((this.options.auth.type||"").toString().toUpperCase()){case"OAUTH2":{let e=new n(this.options.auth,this.logger);e.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||e.provisionCallback;this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:e,method:"XOAUTH2"};e.on("token",(e=>this.pool.mailer.emit("token",e)));e.on("error",(e=>this.emit("error",e)));break}default:if(!this.options.auth.user&&!this.options.auth.pass){break}this.auth={type:(this.options.auth.type||"").toString().toUpperCase()||"LOGIN",user:this.options.auth.user,credentials:{user:this.options.auth.user||"",pass:this.options.auth.pass,options:this.options.auth.options},method:(this.options.auth.method||"").trim().toUpperCase()||this.options.authMethod||false}}}this._connection=false;this._connected=false;this.messages=0;this.available=true}connect(e){this.pool.getSocket(this.options,((t,i)=>{if(t){return e(t)}let n=false;let o=this.options;if(i&&i.connection){this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:o.host||"",destPort:o.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,o.host||"",o.port||"");o=s(false,o);Object.keys(i).forEach((e=>{o[e]=i[e]}))}this.connection=new a(o);this.connection.once("error",(t=>{this.emit("error",t);if(n){return}n=true;return e(t)}));this.connection.once("end",(()=>{this.close();if(n){return}n=true;let t=setTimeout((()=>{if(n){return}let t=new Error("Unexpected socket close");if(this.connection&&this.connection._socket&&this.connection._socket.upgrading){t.code="ETLS"}e(t)}),1e3);try{t.unref()}catch(e){}}));this.connection.connect((()=>{if(n){return}if(this.auth&&(this.connection.allowsAuth||o.forceAuth)){this.connection.login(this.auth,(t=>{if(n){return}n=true;if(t){this.connection.close();this.emit("error",t);return e(t)}this._connected=true;e(null,true)}))}else{n=true;this._connected=true;return e(null,true)}}))}))}send(e,t){if(!this._connected){return this.connect((i=>{if(i){return t(i)}return this.send(e,t)}))}let i=e.message.getEnvelope();let a=e.message.messageId();let s=[].concat(i.to||[]);if(s.length>3){s.push("...and "+s.splice(2).length+" more")}this.logger.info({tnx:"send",messageId:a,cid:this.id},"Sending message %s using #%s to <%s>",a,this.id,s.join(", "));if(e.data.dsn){i.dsn=e.data.dsn}this.connection.send(i,e.message.createReadStream(),((e,s)=>{this.messages++;if(e){this.connection.close();this.emit("error",e);return t(e)}s.envelope={from:i.from,to:i.to};s.messageId=a;setImmediate((()=>{let e;if(this.messages>=this.options.maxMessages){e=new Error("Resource exhausted");e.code="EMAXLIMIT";this.connection.close();this.emit("error",e)}else{this.pool._checkRateLimit((()=>{this.available=true;this.emit("available")}))}}));t(null,s)}))}close(){this._connected=false;if(this.auth&&this.auth.oauth2){this.auth.oauth2.removeAllListeners()}if(this.connection){this.connection.close()}this.emit("close")}}e.exports=PoolResource},349:function(e,t,i){const a=i(361);const s=i(559);const n=i(961);const o=i(673);const r=i(882);const p=i(129);class SMTPTransport extends a{constructor(e){super();e=e||{};if(typeof e==="string"){e={url:e}}let t;let i=e.service;if(typeof e.getSocket==="function"){this.getSocket=e.getSocket}if(e.url){t=o.parseConnectionUrl(e.url);i=i||t.service}this.options=o.assign(false,e,t,i&&n(i));this.logger=o.getLogger(this.options,{component:this.options.component||"smtp-transport"});let a=new s(this.options);this.name="SMTP";this.version=p.version+"[client:"+a.version+"]";if(this.options.auth){this.auth=this.getAuth({})}}getSocket(e,t){return setImmediate((()=>t(null,false)))}getAuth(e){if(!e){return this.auth}let t=false;let i={};if(this.options.auth&&typeof this.options.auth==="object"){Object.keys(this.options.auth).forEach((e=>{t=true;i[e]=this.options.auth[e]}))}if(e&&typeof e==="object"){Object.keys(e).forEach((a=>{t=true;i[a]=e[a]}))}if(!t){return false}switch((i.type||"").toString().toUpperCase()){case"OAUTH2":{if(!i.service&&!i.user){return false}let e=new r(i,this.logger);e.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||e.provisionCallback;e.on("token",(e=>this.mailer.emit("token",e)));e.on("error",(e=>this.emit("error",e)));return{type:"OAUTH2",user:i.user,oauth2:e,method:"XOAUTH2"}}default:return{type:(i.type||"").toString().toUpperCase()||"LOGIN",user:i.user,credentials:{user:i.user||"",pass:i.pass,options:i.options},method:(i.method||"").trim().toUpperCase()||this.options.authMethod||false}}}send(e,t){this.getSocket(this.options,((i,a)=>{if(i){return t(i)}let n=false;let r=this.options;if(a&&a.connection){this.logger.info({tnx:"proxy",remoteAddress:a.connection.remoteAddress,remotePort:a.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",a.connection.remoteAddress,a.connection.remotePort,r.host||"",r.port||"");r=o.assign(false,r);Object.keys(a).forEach((e=>{r[e]=a[e]}))}let p=new s(r);p.once("error",(e=>{if(n){return}n=true;p.close();return t(e)}));p.once("end",(()=>{if(n){return}let e=setTimeout((()=>{if(n){return}n=true;let e=new Error("Unexpected socket close");if(p&&p._socket&&p._socket.upgrading){e.code="ETLS"}t(e)}),1e3);try{e.unref()}catch(e){}}));let sendMessage=()=>{let i=e.message.getEnvelope();let a=e.message.messageId();let s=[].concat(i.to||[]);if(s.length>3){s.push("...and "+s.splice(2).length+" more")}if(e.data.dsn){i.dsn=e.data.dsn}this.logger.info({tnx:"send",messageId:a},"Sending message %s to <%s>",a,s.join(", "));p.send(i,e.message.createReadStream(),((e,s)=>{n=true;p.close();if(e){this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",a,e.message);return t(e)}s.envelope={from:i.from,to:i.to};s.messageId=a;try{return t(null,s)}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error for %s: %s",a,e.message)}}))};p.connect((()=>{if(n){return}let i=this.getAuth(e.data.auth);if(i&&(p.allowsAuth||r.forceAuth)){p.login(i,(e=>{if(i&&i!==this.auth&&i.oauth2){i.oauth2.removeAllListeners()}if(n){return}if(e){n=true;p.close();return t(e)}sendMessage()}))}else{sendMessage()}}))}))}verify(e){let t;if(!e){t=new Promise(((t,i)=>{e=o.callbackPromise(t,i)}))}this.getSocket(this.options,((t,i)=>{if(t){return e(t)}let a=this.options;if(i&&i.connection){this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:a.host||"",destPort:a.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,a.host||"",a.port||"");a=o.assign(false,a);Object.keys(i).forEach((e=>{a[e]=i[e]}))}let n=new s(a);let r=false;n.once("error",(t=>{if(r){return}r=true;n.close();return e(t)}));n.once("end",(()=>{if(r){return}r=true;return e(new Error("Connection closed"))}));let finalize=()=>{if(r){return}r=true;n.quit();return e(null,true)};n.connect((()=>{if(r){return}let t=this.getAuth({});if(t&&(n.allowsAuth||a.forceAuth)){n.login(t,(t=>{if(r){return}if(t){r=true;n.close();return e(t)}finalize()}))}else if(!t&&n.allowsAuth&&a.forceAuth){let t=new Error("Authentication info was not provided");t.code="NoAuth";r=true;n.close();return e(t)}else{finalize()}}))}));return t}close(){if(this.auth&&this.auth.oauth2){this.auth.oauth2.removeAllListeners()}this.emit("close")}}e.exports=SMTPTransport},888:function(e,t,i){const a=i(129);const s=i(673);class StreamTransport{constructor(e){e=e||{};this.options=e||{};this.name="StreamTransport";this.version=a.version;this.logger=s.getLogger(this.options,{component:this.options.component||"stream-transport"});this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=true;let i=e.data.envelope||e.message.getEnvelope();let a=e.message.messageId();let s=[].concat(i.to||[]);if(s.length>3){s.push("...and "+s.splice(2).length+" more")}this.logger.info({tnx:"send",messageId:a},"Sending message %s to <%s> using %s line breaks",a,s.join(", "),this.winbreak?"<CR><LF>":"<LF>");setImmediate((()=>{let i;try{i=e.message.createReadStream()}catch(e){this.logger.error({err:e,tnx:"send",messageId:a},"Creating send stream failed for %s. %s",a,e.message);return t(e)}if(!this.options.buffer){i.once("error",(e=>{this.logger.error({err:e,tnx:"send",messageId:a},"Failed creating message for %s. %s",a,e.message)}));return t(null,{envelope:e.data.envelope||e.message.getEnvelope(),messageId:a,message:i})}let s=[];let n=0;i.on("readable",(()=>{let e;while((e=i.read())!==null){s.push(e);n+=e.length}}));i.once("error",(e=>{this.logger.error({err:e,tnx:"send",messageId:a},"Failed creating message for %s. %s",a,e.message);return t(e)}));i.on("end",(()=>t(null,{envelope:e.data.envelope||e.message.getEnvelope(),messageId:a,message:Buffer.concat(s,n)})))}))}}e.exports=StreamTransport},961:function(e,t,i){const a=i(249);const s={};Object.keys(a).forEach((e=>{let t=a[e];s[normalizeKey(e)]=normalizeService(t);[].concat(t.aliases||[]).forEach((e=>{s[normalizeKey(e)]=normalizeService(t)}));[].concat(t.domains||[]).forEach((e=>{s[normalizeKey(e)]=normalizeService(t)}))}));function normalizeKey(e){return e.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}function normalizeService(e){let t=["domains","aliases"];let i={};Object.keys(e).forEach((a=>{if(t.indexOf(a)<0){i[a]=e[a]}}));return i}e.exports=function(e){e=normalizeKey(e.split("@").pop());return s[e]||false}},882:function(e,t,i){const a=i(781).Stream;const s=i(106);const n=i(113);const o=i(673);class XOAuth2 extends a{constructor(e,t){super();this.options=e||{};if(e&&e.serviceClient){if(!e.privateKey||!e.user){setImmediate((()=>this.emit("error",new Error('Options "privateKey" and "user" are required for service account!'))));return}let t=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=t||5*60}this.logger=o.getLogger({logger:t},{component:this.options.component||"OAuth2"});this.provisionCallback=typeof this.options.provisionCallback==="function"?this.options.provisionCallback:false;this.options.accessUrl=this.options.accessUrl||"https://accounts.google.com/o/oauth2/token";this.options.customHeaders=this.options.customHeaders||{};this.options.customParams=this.options.customParams||{};this.accessToken=this.options.accessToken||false;if(this.options.expires&&Number(this.options.expires)){this.expires=this.options.expires}else{let e=Math.max(Number(this.options.timeout)||0,0);this.expires=e&&Date.now()+e*1e3||0}}getToken(e,t){if(!e&&this.accessToken&&(!this.expires||this.expires>Date.now())){return t(null,this.accessToken)}let generateCallback=(...e)=>{if(e[0]){this.logger.error({err:e[0],tnx:"OAUTH2",user:this.options.user,action:"renew"},"Failed generating new Access Token for %s",this.options.user)}else{this.logger.info({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Generated new Access Token for %s",this.options.user)}t(...e)};if(this.provisionCallback){this.provisionCallback(this.options.user,!!e,((e,t,i)=>{if(!e&&t){this.accessToken=t;this.expires=i||0}generateCallback(e,t)}))}else{this.generateToken(generateCallback)}}updateToken(e,t){this.accessToken=e;t=Math.max(Number(t)||0,0);this.expires=t&&Date.now()+t*1e3||0;this.emit("token",{user:this.options.user,accessToken:e||"",expires:this.expires})}generateToken(e){let t;let i;if(this.options.serviceClient){let a=Math.floor(Date.now()/1e3);let s={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:a,exp:a+this.options.serviceRequestTimeout};let n;try{n=this.jwtSignRS256(s)}catch(t){return e(new Error("Can't generate token. Check your auth options"))}t={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:n};i={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:s}}else{if(!this.options.refreshToken){return e(new Error("Can't create new access token for user"))}t={client_id:this.options.clientId||"",client_secret:this.options.clientSecret||"",refresh_token:this.options.refreshToken,grant_type:"refresh_token"};i={client_id:this.options.clientId||"",client_secret:(this.options.clientSecret||"").substr(0,6)+"...",refresh_token:(this.options.refreshToken||"").substr(0,6)+"...",grant_type:"refresh_token"}}Object.keys(this.options.customParams).forEach((e=>{t[e]=this.options.customParams[e];i[e]=this.options.customParams[e]}));this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"generate"},"Requesting token using: %s",JSON.stringify(i));this.postRequest(this.options.accessUrl,t,this.options,((t,i)=>{let a;if(t){return e(t)}try{a=JSON.parse(i.toString())}catch(t){return e(t)}if(!a||typeof a!=="object"){this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(i||"").toString());return e(new Error("Invalid authentication response"))}let s={};Object.keys(a).forEach((e=>{if(e!=="access_token"){s[e]=a[e]}else{s[e]=(a[e]||"").toString().substr(0,6)+"..."}}));this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(s));if(a.error){let t=a.error;if(a.error_description){t+=": "+a.error_description}if(a.error_uri){t+=" ("+a.error_uri+")"}return e(new Error(t))}if(a.access_token){this.updateToken(a.access_token,a.expires_in);return e(null,this.accessToken)}return e(new Error("No access token"))}))}buildXOAuth2Token(e){let t=["user="+(this.options.user||""),"auth=Bearer "+(e||this.accessToken),"",""];return Buffer.from(t.join(""),"utf-8").toString("base64")}postRequest(e,t,i,a){let n=false;let o=[];let r=0;let p=s(e,{method:"post",headers:i.customHeaders,body:t,allowErrorResponse:true});p.on("readable",(()=>{let e;while((e=p.read())!==null){o.push(e);r+=e.length}}));p.once("error",(e=>{if(n){return}n=true;return a(e)}));p.once("end",(()=>{if(n){return}n=true;return a(null,Buffer.concat(o,r))}))}toBase64URL(e){if(typeof e==="string"){e=Buffer.from(e)}return e.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(e){e=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(e)].map((e=>this.toBase64URL(e))).join(".");let t=n.createSign("RSA-SHA256").update(e).sign(this.options.privateKey);return e+"."+this.toBase64URL(t)}}e.exports=XOAuth2},81:function(e){e.exports=require("child_process")},113:function(e){e.exports=require("crypto")},523:function(e){e.exports=require("dns")},361:function(e){e.exports=require("events")},147:function(e){e.exports=require("fs")},685:function(e){e.exports=require("http")},687:function(e){e.exports=require("https")},808:function(e){e.exports=require("net")},37:function(e){e.exports=require("os")},17:function(e){e.exports=require("path")},477:function(e){e.exports=require("punycode")},781:function(e){e.exports=require("stream")},404:function(e){e.exports=require("tls")},310:function(e){e.exports=require("url")},837:function(e){e.exports=require("util")},796:function(e){e.exports=require("zlib")},249:function(e){e.exports=JSON.parse('{"126":{"host":"smtp.126.com","port":465,"secure":true},"163":{"host":"smtp.163.com","port":465,"secure":true},"1und1":{"host":"smtp.1und1.de","port":465,"secure":true,"authMethod":"LOGIN"},"Aliyun":{"domains":["aliyun.com"],"host":"smtp.aliyun.com","port":465,"secure":true},"AOL":{"domains":["aol.com"],"host":"smtp.aol.com","port":587},"Bluewin":{"host":"smtpauths.bluewin.ch","domains":["bluewin.ch"],"port":465},"DebugMail":{"host":"debugmail.io","port":25},"DynectEmail":{"aliases":["Dynect"],"host":"smtp.dynect.net","port":25},"Ethereal":{"aliases":["ethereal.email"],"host":"smtp.ethereal.email","port":587},"FastMail":{"domains":["fastmail.fm"],"host":"smtp.fastmail.com","port":465,"secure":true},"Forward Email":{"aliases":["FE","ForwardEmail"],"domains":["forwardemail.net"],"host":"smtp.forwardemail.net","port":465,"secure":true},"GandiMail":{"aliases":["Gandi","Gandi Mail"],"host":"mail.gandi.net","port":587},"Gmail":{"aliases":["Google Mail"],"domains":["gmail.com","googlemail.com"],"host":"smtp.gmail.com","port":465,"secure":true},"Godaddy":{"host":"smtpout.secureserver.net","port":25},"GodaddyAsia":{"host":"smtp.asia.secureserver.net","port":25},"GodaddyEurope":{"host":"smtp.europe.secureserver.net","port":25},"hot.ee":{"host":"mail.hot.ee"},"Hotmail":{"aliases":["Outlook","Outlook.com","Hotmail.com"],"domains":["hotmail.com","outlook.com"],"host":"smtp-mail.outlook.com","port":587},"iCloud":{"aliases":["Me","Mac"],"domains":["me.com","mac.com"],"host":"smtp.mail.me.com","port":587},"Infomaniak":{"host":"mail.infomaniak.com","domains":["ik.me","ikmail.com","etik.com"],"port":587},"mail.ee":{"host":"smtp.mail.ee"},"Mail.ru":{"host":"smtp.mail.ru","port":465,"secure":true},"Maildev":{"port":1025,"ignoreTLS":true},"Mailgun":{"host":"smtp.mailgun.org","port":465,"secure":true},"Mailjet":{"host":"in.mailjet.com","port":587},"Mailosaur":{"host":"mailosaur.io","port":25},"Mailtrap":{"host":"smtp.mailtrap.io","port":2525},"Mandrill":{"host":"smtp.mandrillapp.com","port":587},"Naver":{"host":"smtp.naver.com","port":587},"One":{"host":"send.one.com","port":465,"secure":true},"OpenMailBox":{"aliases":["OMB","openmailbox.org"],"host":"smtp.openmailbox.org","port":465,"secure":true},"Outlook365":{"host":"smtp.office365.com","port":587,"secure":false},"OhMySMTP":{"host":"smtp.ohmysmtp.com","port":587,"secure":false},"Postmark":{"aliases":["PostmarkApp"],"host":"smtp.postmarkapp.com","port":2525},"qiye.aliyun":{"host":"smtp.mxhichina.com","port":"465","secure":true},"QQ":{"domains":["qq.com"],"host":"smtp.qq.com","port":465,"secure":true},"QQex":{"aliases":["QQ Enterprise"],"domains":["exmail.qq.com"],"host":"smtp.exmail.qq.com","port":465,"secure":true},"SendCloud":{"host":"smtp.sendcloud.net","port":2525},"SendGrid":{"host":"smtp.sendgrid.net","port":587},"SendinBlue":{"aliases":["Brevo"],"host":"smtp-relay.brevo.com","port":587},"SendPulse":{"host":"smtp-pulse.com","port":465,"secure":true},"SES":{"host":"email-smtp.us-east-1.amazonaws.com","port":465,"secure":true},"SES-US-EAST-1":{"host":"email-smtp.us-east-1.amazonaws.com","port":465,"secure":true},"SES-US-WEST-2":{"host":"email-smtp.us-west-2.amazonaws.com","port":465,"secure":true},"SES-EU-WEST-1":{"host":"email-smtp.eu-west-1.amazonaws.com","port":465,"secure":true},"SES-AP-SOUTH-1":{"host":"email-smtp.ap-south-1.amazonaws.com","port":465,"secure":true},"SES-AP-NORTHEAST-1":{"host":"email-smtp.ap-northeast-1.amazonaws.com","port":465,"secure":true},"SES-AP-NORTHEAST-2":{"host":"email-smtp.ap-northeast-2.amazonaws.com","port":465,"secure":true},"SES-AP-NORTHEAST-3":{"host":"email-smtp.ap-northeast-3.amazonaws.com","port":465,"secure":true},"SES-AP-SOUTHEAST-1":{"host":"email-smtp.ap-southeast-1.amazonaws.com","port":465,"secure":true},"SES-AP-SOUTHEAST-2":{"host":"email-smtp.ap-southeast-2.amazonaws.com","port":465,"secure":true},"Sparkpost":{"aliases":["SparkPost","SparkPost Mail"],"domains":["sparkpost.com"],"host":"smtp.sparkpostmail.com","port":587,"secure":false},"Tipimail":{"host":"smtp.tipimail.com","port":587},"Yahoo":{"domains":["yahoo.com"],"host":"smtp.mail.yahoo.com","port":465,"secure":true},"Yandex":{"domains":["yandex.ru"],"host":"smtp.yandex.ru","port":465,"secure":true},"Zoho":{"host":"smtp.zoho.com","port":465,"secure":true,"authMethod":"LOGIN"}}')},129:function(e){e.exports=JSON.parse('{"name":"nodemailer","version":"6.9.7","description":"Easy as cake e-mail sending from your Node.js applications","main":"lib/nodemailer.js","scripts":{"test":"grunt --trace-warnings","update":"rm -rf node_modules/ package-lock.json && ncu -u && npm install"},"repository":{"type":"git","url":"https://github.com/nodemailer/nodemailer.git"},"keywords":["Nodemailer"],"author":"Andris Reinman","license":"MIT-0","bugs":{"url":"https://github.com/nodemailer/nodemailer/issues"},"homepage":"https://nodemailer.com/","devDependencies":{"@aws-sdk/client-ses":"3.433.0","aws-sdk":"2.1478.0","bunyan":"1.8.15","chai":"4.3.10","eslint-config-nodemailer":"1.2.0","eslint-config-prettier":"9.0.0","grunt":"1.6.1","grunt-cli":"1.4.3","grunt-eslint":"24.3.0","grunt-mocha-test":"0.13.3","libbase64":"1.2.1","libmime":"5.2.1","libqp":"2.0.1","mocha":"10.2.0","nodemailer-ntlm-auth":"1.0.4","proxy":"1.0.2","proxy-test-server":"1.0.0","sinon":"17.0.0","smtp-server":"3.13.0"},"engines":{"node":">=6.0.0"}}')}};var t={};function __nccwpck_require__(i){var a=t[i];if(a!==undefined){return a.exports}var s=t[i]={exports:{}};var n=true;try{e[i](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(289);module.exports=i})();