mailgun.js 12.1.1 → 12.3.0
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.
- package/AMD/definitions.amd.js +1 -1
- package/AMD/mailgun.amd.js +2 -2
- package/CHANGELOG.md +23 -0
- package/CJS/definitions.cjs +1 -1
- package/CJS/mailgun.node.cjs +2 -2
- package/ESM/definitions.browser.js +1 -1
- package/ESM/definitions.node.js +1 -1
- package/ESM/mailgun.browser.js +2 -2
- package/ESM/mailgun.node.js +2 -2
- package/README.md +548 -96
- package/Types/Classes/Domains/domainsClient.d.ts +13 -2
- package/Types/Classes/Domains/domainsKeys.d.ts +19 -0
- package/Types/Classes/Messages.d.ts +19 -1
- package/Types/Classes/Subaccounts.d.ts +6 -1
- package/Types/Classes/common/Request.d.ts +3 -3
- package/Types/Interfaces/Domains/DomainKeys.d.ts +11 -0
- package/Types/Interfaces/Domains/index.d.ts +1 -0
- package/Types/Interfaces/Subaccounts/ISubaccountsClient.d.ts +4 -1
- package/Types/Types/Common/RequestOptions.d.ts +6 -3
- package/Types/Types/Domains/DomainKeys.d.ts +70 -0
- package/Types/Types/Domains/index.d.ts +1 -0
- package/Types/Types/Messages/Messages.d.ts +58 -0
- package/Types/Types/Subaccounts/Subaccounts.d.ts +52 -3
- package/Types/index.js +387 -34
- package/package.json +1 -1
- package/version.md +1 -1
package/AMD/definitions.amd.js
CHANGED
package/AMD/mailgun.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define((function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};function r(t,e,n,r){return new(n||(n=Promise))((function(o,s){function i(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}u((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function s(t,e,n){if(n||2===arguments.length)for(var r,o=0,s=e.length;o<s;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,c={exports:{}};var l,p,d,h=(u||(u=1,p=c.exports,d=function(){return function(){return function(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<t.length;r++){var o=t[r];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(r>0&&(o=o.replace(/^[\/]+/,"")),o=r<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var s=e.join("/"),i=(s=s.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i.shift()+(i.length>0?"?":"")+i.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},(l=c).exports?l.exports=d():p.urljoin=d()),c.exports),f=a(h),y=function(t){function n(e){var n=e.status,r=e.statusText,o=e.message,s=e.body,i=void 0===s?{}:s,a=this,u="",c="";return"string"==typeof i?u=i:(u=(null==i?void 0:i.message)||"",c=(null==i?void 0:i.error)||""),(a=t.call(this)||this).stack="",a.status=n,a.message=o||c||r||"",a.details=u,a.type="MailgunAPIError",a}return e(n,t),n.isApiError=function(t){return"object"==typeof t&&"MailgunAPIError"===(null==t?void 0:t.type)},n.getUserDataError=function(t,e){return new this({status:400,statusText:t,body:{message:e}})},n}(Error),m=function(){function t(t,e){this._stream=t,this.size=e}return t.prototype.stream=function(){return this._stream},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return"Blob"},enumerable:!1,configurable:!0}),t}(),b=function(){function t(){}return t.prototype.getAttachmentOptions=function(t){var e=t.filename,r=t.contentType,o=t.knownLength;return n(n(n({},e?{filename:e}:{filename:"file"}),r&&{contentType:r}),o&&{knownLength:o})},t.prototype.getFileInfo=function(t){var e=t.name,n=t.type,r=t.size;return this.getAttachmentOptions({filename:e,contentType:n,knownLength:r})},t.prototype.getCustomFileInfo=function(t){var e=t.filename,n=t.contentType,r=t.knownLength;return this.getAttachmentOptions({filename:e,contentType:n,knownLength:r})},t.prototype.getBufferInfo=function(t){var e=t.byteLength;return this.getAttachmentOptions({filename:"file",contentType:"",knownLength:e})},t.prototype.isStream=function(t){return"object"==typeof t&&"function"==typeof t.pipe},t.prototype.isCustomFile=function(t){return"object"==typeof t&&!!t.data},t.prototype.isBrowserFile=function(t){return"object"==typeof t&&(!!t.name||"undefined"!=typeof Blob&&t instanceof Blob)},t.prototype.isBuffer=function(t){return"undefined"!=typeof Buffer&&Buffer.isBuffer(t)},t.prototype.getAttachmentInfo=function(t){var e=this.isBrowserFile(t),n=this.isCustomFile(t);if(!("string"==typeof t)){if(e)return this.getFileInfo(t);if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return this.getBufferInfo(t);if(n)return this.getCustomFileInfo(t)}return{filename:"file",contentType:void 0,knownLength:void 0}},t.prototype.convertToFDexpectedShape=function(t){var e,n=this.isStream(t),r=this.isBrowserFile(t),o=this.isCustomFile(t);if(n||"string"==typeof t||r||this.isBuffer(t))e=t;else{if(!o)throw y.getUserDataError("Unknown attachment type ".concat(typeof t),'The "attachment" property expects either Buffer, Blob, or String.\n Also, It is possible to provide an object that has the property "data" with a value that is equal to one of the types counted before.\n Additionally, you may use an array to send more than one attachment.');e=t.data}return e},t.prototype.getBlobFromStream=function(t,e){return new m(t,e)},t}(),g=function(){function t(t,e){this.FormDataConstructor=t,this.fileKeys=["attachment","inline","multipleValidationFile"],this.attachmentsHandler=new b,this.useFetch=null==e?void 0:e.useFetch}return t.prototype.createFormData=function(t){return r(this,void 0,void 0,(function(){var e,n,r,s,i,a=this;return o(this,(function(o){switch(o.label){case 0:if(!t)throw new Error("Please provide data object");if(e=new this.FormDataConstructor,(n=this.isFormDataPackage(e))&&this.useFetch)throw y.getUserDataError('"form-data" npm package detected, and it can not be used together with "fetch" client',"fetch client does not recognize object created by form-data package as valid FormData instance");return r=Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){if(a.fileKeys.includes(n)){var r=t[n];if(a.isMessageAttachment(r))return a.addFilesToFD(n,r,e),e;throw y.getUserDataError("Unknown value ".concat(t[n]," with type ").concat(typeof t[n],' for property "').concat(n,'"'),'The key "'.concat(n,'" should have type of Buffer, Stream, File, or String '))}if("message"===n){var o=t[n];if(!o||!a.isMIME(o))throw y.getUserDataError('Unknown data type for "'.concat(n,'" property'),"The mime data should have type of Buffer, String or Blob");return a.addMimeDataToFD(n,o,e),e}return a.addCommonPropertyToFD(n,t[n],e),e}),e),s={formData:r,dataSize:0},!this.useFetch||n?[3,2]:(Object.defineProperty(r,"getHeaders",{value:function(){return{"Content-Type":void 0}}}),void 0===Response?[3,2]:[4,new Response(r).blob()]);case 1:i=o.sent(),s.dataSize=i.size,o.label=2;case 2:return[2,s]}}))}))},t.prototype.addMimeDataToFD=function(t,e,n){if("string"!=typeof e){if(this.isFormDataPackage(n))n.append(t,e,{filename:"MimeMessage"});else if(void 0!==typeof Blob){var r=n;if(e instanceof Blob)return void r.append(t,e,"MimeMessage");if(this.attachmentsHandler.isBuffer(e)){var o=new Blob([e]);r.append(t,o,"MimeMessage")}}}else n.append(t,e)},t.prototype.isMIME=function(t){return"string"==typeof t||"undefined"!=typeof Blob&&t instanceof Blob||this.attachmentsHandler.isBuffer(t)||"undefined"!=typeof ReadableStream&&t instanceof ReadableStream},t.prototype.isFormDataPackage=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getHeaders},t.prototype.isMessageAttachment=function(t){var e=this;return this.attachmentsHandler.isCustomFile(t)||"string"==typeof t||"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||this.attachmentsHandler.isBuffer(t)||this.attachmentsHandler.isStream(t)||Array.isArray(t)&&t.every((function(n){return e.attachmentsHandler.isCustomFile(n)||"undefined"!=typeof File&&n instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||e.attachmentsHandler.isBuffer(n)||e.attachmentsHandler.isStream(n)}))},t.prototype.addFilesToFD=function(t,e,n){var r=this,o=function(t,e,o){var s="multipleValidationFile"===t?"file":t,i=r.attachmentsHandler.convertToFDexpectedShape(e),a=r.attachmentsHandler.getAttachmentInfo(e);if(r.isFormDataPackage(o)){var u=o,c="string"==typeof i?Buffer.from(i):i;u.append(s,c,a)}else if(void 0!==typeof Blob){var l=n;if("string"==typeof i||r.attachmentsHandler.isBuffer(i)){var p=new Blob([i]);return void l.append(s,p,a.filename)}if(i instanceof Blob)return void l.append(s,i,a.filename);if(r.attachmentsHandler.isStream(i)){var d=r.attachmentsHandler.getBlobFromStream(i,a.knownLength);l.set(s,d,a.filename)}}};Array.isArray(e)?e.forEach((function(e){o(t,e,n)})):o(t,e,n)},t.prototype.addCommonPropertyToFD=function(t,e,n){var r=this,o=function(t,e){if(r.isFormDataPackage(n))return"object"==typeof e?(console.warn('The received value is an object. \n"JSON.Stringify" will be used to avoid TypeError \nTo remove this warning: \nConsider switching to built-in FormData or converting the value on your own.\n'),n.append(t,JSON.stringify(e))):n.append(t,e);if("string"==typeof e)return n.append(t,e);if(void 0!==typeof Blob&&e instanceof Blob)return n.append(t,e);throw y.getUserDataError("Unknown value type for Form Data. String or Blob expected","Browser compliant FormData allows only string or Blob values for properties that are not attachments.")};Array.isArray(e)?e.forEach((function(e){o(t,e)})):null!=e&&o(t,e)},t}();function v(t,e){return function(){return t.apply(e,arguments)}}const{toString:w}=Object.prototype,{getPrototypeOf:R}=Object,{iterator:S,toStringTag:_}=Symbol,q=(E=Object.create(null),t=>{const e=w.call(t);return E[e]||(E[e]=e.slice(8,-1).toLowerCase())});var E;const D=t=>(t=t.toLowerCase(),e=>q(e)===t),T=t=>e=>typeof e===t,{isArray:O}=Array,A=T("undefined");function k(t){return null!==t&&!A(t)&&null!==t.constructor&&!A(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const x=D("ArrayBuffer");const F=T("string"),C=T("function"),P=T("number"),L=t=>null!==t&&"object"==typeof t,U=t=>{if("object"!==q(t))return!1;const e=R(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||_ in t||S in t)},B=D("Date"),j=D("File"),N=D("Blob"),I=D("FileList"),M=D("URLSearchParams"),[W,H,z,V]=["ReadableStream","Request","Response","Headers"].map(D);function J(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),O(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(k(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let i;for(r=0;r<s;r++)i=o[r],e.call(null,t[i],i,t)}}function K(t,e){if(k(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Q=t=>!A(t)&&t!==$;const X=(G="undefined"!=typeof Uint8Array&&R(Uint8Array),t=>G&&t instanceof G);var G;const Y=D("HTMLFormElement"),Z=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),tt=D("RegExp"),et=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};J(n,((n,o)=>{let s;!1!==(s=e(n,o,t))&&(r[o]=s||n)})),Object.defineProperties(t,r)};const nt=D("AsyncFunction"),rt=(ot="function"==typeof setImmediate,st=C($.postMessage),ot?setImmediate:st?(it=`axios@${Math.random()}`,at=[],$.addEventListener("message",(({source:t,data:e})=>{t===$&&e===it&&at.length&&at.shift()()}),!1),t=>{at.push(t),$.postMessage(it,"*")}):t=>setTimeout(t));var ot,st,it,at;const ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind($):"undefined"!=typeof process&&process.nextTick||rt;var ct={isArray:O,isArrayBuffer:x,isBuffer:k,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||C(t.append)&&("formdata"===(e=q(t))||"object"===e&&C(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&x(t.buffer),e},isString:F,isNumber:P,isBoolean:t=>!0===t||!1===t,isObject:L,isPlainObject:U,isEmptyObject:t=>{if(!L(t)||k(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:W,isRequest:H,isResponse:z,isHeaders:V,isUndefined:A,isDate:B,isFile:j,isBlob:N,isRegExp:tt,isFunction:C,isStream:t=>L(t)&&C(t.pipe),isURLSearchParams:M,isTypedArray:X,isFileList:I,forEach:J,merge:function t(){const{caseless:e,skipUndefined:n}=Q(this)&&this||{},r={},o=(o,s)=>{const i=e&&K(r,s)||s;U(r[i])&&U(o)?r[i]=t(r[i],o):U(o)?r[i]=t({},o):O(o)?r[i]=o.slice():n&&A(o)||(r[i]=o)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&J(arguments[t],o);return r},extend:(t,e,n,{allOwnKeys:r}={})=>(J(e,((e,r)=>{n&&C(e)?t[r]=v(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,s,i;const a={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)i=o[s],r&&!r(i,t,e)||a[i]||(e[i]=t[i],a[i]=!0);t=!1!==n&&R(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:q,kindOfTest:D,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(O(t))return t;let e=t.length;if(!P(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[S]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:Y,hasOwnProperty:Z,hasOwnProp:Z,reduceDescriptors:et,freezeMethods:t=>{et(t,((e,n)=>{if(C(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];C(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return O(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:K,global:$,isContextDefined:Q,isSpecCompliantForm:function(t){return!!(t&&C(t.append)&&"FormData"===t[_]&&t[S])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(L(t)){if(e.indexOf(t)>=0)return;if(k(t))return t;if(!("toJSON"in t)){e[r]=t;const o=O(t)?[]:{};return J(t,((t,e)=>{const s=n(t,r+1);!A(s)&&(o[e]=s)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:nt,isThenable:t=>t&&(L(t)||C(t))&&C(t.then)&&C(t.catch),setImmediate:rt,asap:ut,isIterable:t=>null!=t&&C(t[S])};function lt(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}ct.inherits(lt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ct.toJSONObject(this.config),code:this.code,status:this.status}}});const pt=lt.prototype,dt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{dt[t]={value:t}})),Object.defineProperties(lt,dt),Object.defineProperty(pt,"isAxiosError",{value:!0}),lt.from=(t,e,n,r,o,s)=>{const i=Object.create(pt);ct.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t));const a=t&&t.message?t.message:"Error",u=null==e&&t?t.code:e;return lt.call(i,a,u,n,r,o),t&&null==i.cause&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",s&&Object.assign(i,s),i};function ht(t){return ct.isPlainObject(t)||ct.isArray(t)}function ft(t){return ct.endsWith(t,"[]")?t.slice(0,-2):t}function yt(t,e,n){return t?t.concat(e).map((function(t,e){return t=ft(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const mt=ct.toFlatObject(ct,{},null,(function(t){return/^is[A-Z]/.test(t)}));function bt(t,e,n){if(!ct.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=ct.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!ct.isUndefined(e[t])}))).metaTokens,o=n.visitor||c,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ct.isSpecCompliantForm(e);if(!ct.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(ct.isDate(t))return t.toISOString();if(ct.isBoolean(t))return t.toString();if(!a&&ct.isBlob(t))throw new lt("Blob is not supported. Use a Buffer instead.");return ct.isArrayBuffer(t)||ct.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,o){let a=t;if(t&&!o&&"object"==typeof t)if(ct.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(ct.isArray(t)&&function(t){return ct.isArray(t)&&!t.some(ht)}(t)||(ct.isFileList(t)||ct.endsWith(n,"[]"))&&(a=ct.toArray(t)))return n=ft(n),a.forEach((function(t,r){!ct.isUndefined(t)&&null!==t&&e.append(!0===i?yt([n],r,s):null===i?n:n+"[]",u(t))})),!1;return!!ht(t)||(e.append(yt(o,n,s),u(t)),!1)}const l=[],p=Object.assign(mt,{defaultVisitor:c,convertValue:u,isVisitable:ht});if(!ct.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!ct.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),ct.forEach(n,(function(n,s){!0===(!(ct.isUndefined(n)||null===n)&&o.call(e,n,ct.isString(s)?s.trim():s,r,p))&&t(n,r?r.concat(s):[s])})),l.pop()}}(t),e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function vt(t,e){this._pairs=[],t&&bt(t,this,e)}const wt=vt.prototype;function Rt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function St(t,e,n){if(!e)return t;const r=n&&n.encode||Rt;ct.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(e,n):ct.isURLSearchParams(e)?e.toString():new vt(e,n).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}wt.append=function(t,e){this._pairs.push([t,e])},wt.toString=function(t){const e=t?function(e){return t.call(this,e,gt)}:gt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};class _t{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ct.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}var qt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Et={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:vt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Dt="undefined"!=typeof window&&"undefined"!=typeof document,Tt="object"==typeof navigator&&navigator||void 0,Ot=Dt&&(!Tt||["ReactNative","NativeScript","NS"].indexOf(Tt.product)<0),At="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,kt=Dt&&window.location.href||"http://localhost";var xt={...Object.freeze({__proto__:null,hasBrowserEnv:Dt,hasStandardBrowserEnv:Ot,hasStandardBrowserWebWorkerEnv:At,navigator:Tt,origin:kt}),...Et};function Ft(t){function e(t,n,r,o){let s=t[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=t.length;if(s=!s&&ct.isArray(r)?r.length:s,a)return ct.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&ct.isObject(r[s])||(r[s]=[]);return e(t,n,r[s],o)&&ct.isArray(r[s])&&(r[s]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}(r[s])),!i}if(ct.isFormData(t)&&ct.isFunction(t.entries)){const n={};return ct.forEachEntry(t,((t,r)=>{e(function(t){return ct.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const Ct={transitional:qt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=ct.isObject(t);o&&ct.isHTMLForm(t)&&(t=new FormData(t));if(ct.isFormData(t))return r?JSON.stringify(Ft(t)):t;if(ct.isArrayBuffer(t)||ct.isBuffer(t)||ct.isStream(t)||ct.isFile(t)||ct.isBlob(t)||ct.isReadableStream(t))return t;if(ct.isArrayBufferView(t))return t.buffer;if(ct.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return bt(t,new xt.classes.URLSearchParams,{visitor:function(t,e,n,r){return xt.isNode&&ct.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=ct.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return bt(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t,e,n){if(ct.isString(t))try{return(e||JSON.parse)(t),ct.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Ct.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(ct.isResponse(t)||ct.isReadableStream(t))return t;if(t&&ct.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(t){if(n){if("SyntaxError"===t.name)throw lt.from(t,lt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xt.classes.FormData,Blob:xt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ct.forEach(["delete","get","head","post","put","patch"],(t=>{Ct.headers[t]={}}));const Pt=ct.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Lt=Symbol("internals");function Ut(t){return t&&String(t).trim().toLowerCase()}function Bt(t){return!1===t||null==t?t:ct.isArray(t)?t.map(Bt):String(t)}function jt(t,e,n,r,o){return ct.isFunction(r)?r.call(this,e,n):(o&&(e=n),ct.isString(e)?ct.isString(r)?-1!==e.indexOf(r):ct.isRegExp(r)?r.test(e):void 0:void 0)}let Nt=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Ut(e);if(!o)throw new Error("header name must be a non-empty string");const s=ct.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||e]=Bt(t))}const s=(t,e)=>ct.forEach(t,((t,n)=>o(t,n,e)));if(ct.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(ct.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Pt[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(ct.isObject(t)&&ct.isIterable(t)){let n,r,o={};for(const e of t){if(!ct.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[r=e[0]]=(n=o[r])?ct.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}s(o,e)}else null!=t&&o(e,t,n);return this}get(t,e){if(t=Ut(t)){const n=ct.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(ct.isFunction(e))return e.call(this,t,n);if(ct.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Ut(t)){const n=ct.findKey(this,t);return!(!n||void 0===this[n]||e&&!jt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=Ut(t)){const o=ct.findKey(n,t);!o||e&&!jt(0,n[o],o,e)||(delete n[o],r=!0)}}return ct.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!jt(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return ct.forEach(this,((r,o)=>{const s=ct.findKey(n,o);if(s)return e[s]=Bt(r),void delete e[o];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete e[o],e[i]=Bt(r),n[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return ct.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&ct.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[Lt]=this[Lt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Ut(t);e[r]||(!function(t,e){const n=ct.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return ct.isArray(t)?t.forEach(r):r(t),this}};function It(t,e){const n=this||Ct,r=e||n,o=Nt.from(r.headers);let s=r.data;return ct.forEach(t,(function(t){s=t.call(n,s,o.normalize(),e?e.status:void 0)})),o.normalize(),s}function Mt(t){return!(!t||!t.__CANCEL__)}function Wt(t,e,n){lt.call(this,null==t?"canceled":t,lt.ERR_CANCELED,e,n),this.name="CanceledError"}function Ht(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new lt("Request failed with status code "+n.status,[lt.ERR_BAD_REQUEST,lt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ct.reduceDescriptors(Nt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),ct.freezeMethods(Nt),ct.inherits(Wt,lt,{__CANCEL__:!0});const zt=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,s=0,i=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=r[i];o||(o=u),n[s]=a,r[s]=u;let l=i,p=0;for(;l!==s;)p+=n[l++],l%=t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),u-o<e)return;const d=c&&u-c;return d?Math.round(1e3*p/d):void 0}}(50,250);return function(t,e){let n,r,o=0,s=1e3/e;const i=(e,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-o;a>=s?i(t,e):(n=t,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,u=o(a);r=s;t({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:u||void 0,estimated:u&&i&&s<=i?(i-s)/u:void 0,event:n,lengthComputable:null!=i,[e?"download":"upload"]:!0})}),n)},Vt=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Jt=t=>(...e)=>ct.asap((()=>t(...e)));var Kt=xt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,xt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(xt.origin),xt.navigator&&/(msie|trident)/i.test(xt.navigator.userAgent)):()=>!0,$t=xt.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const i=[t+"="+encodeURIComponent(e)];ct.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),ct.isString(r)&&i.push("path="+r),ct.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Qt(t,e,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Xt=t=>t instanceof Nt?{...t}:t;function Gt(t,e){e=e||{};const n={};function r(t,e,n,r){return ct.isPlainObject(t)&&ct.isPlainObject(e)?ct.merge.call({caseless:r},t,e):ct.isPlainObject(e)?ct.merge({},e):ct.isArray(e)?e.slice():e}function o(t,e,n,o){return ct.isUndefined(e)?ct.isUndefined(t)?void 0:r(void 0,t,0,o):r(t,e,0,o)}function s(t,e){if(!ct.isUndefined(e))return r(void 0,e)}function i(t,e){return ct.isUndefined(e)?ct.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,o,s){return s in e?r(n,o):s in t?r(void 0,n):void 0}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e,n)=>o(Xt(t),Xt(e),0,!0)};return ct.forEach(Object.keys({...t,...e}),(function(r){const s=u[r]||o,i=s(t[r],e[r],r);ct.isUndefined(i)&&s!==a||(n[r]=i)})),n}var Yt=t=>{const e=Gt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=e;if(e.headers=i=Nt.from(i),e.url=St(Qt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ct.isFormData(n))if(xt.hasStandardBrowserEnv||xt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(ct.isFunction(n.getHeaders)){const t=n.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach((([t,n])=>{e.includes(t.toLowerCase())&&i.set(t,n)}))}if(xt.hasStandardBrowserEnv&&(r&&ct.isFunction(r)&&(r=r(e)),r||!1!==r&&Kt(e.url))){const t=o&&s&&$t.read(s);t&&i.set(o,t)}return e};var Zt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=Yt(t);let o=r.data;const s=Nt.from(r.headers).normalize();let i,a,u,c,l,{responseType:p,onUploadProgress:d,onDownloadProgress:h}=r;function f(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let y=new XMLHttpRequest;function m(){if(!y)return;const r=Nt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Ht((function(t){e(t),f()}),(function(t){n(t),f()}),{data:p&&"text"!==p&&"json"!==p?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:t,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(n(new lt("Request aborted",lt.ECONNABORTED,t,y)),y=null)},y.onerror=function(e){const r=new lt(e&&e.message?e.message:"Network Error",lt.ERR_NETWORK,t,y);r.event=e||null,n(r),y=null},y.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||qt;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new lt(e,o.clarifyTimeoutError?lt.ETIMEDOUT:lt.ECONNABORTED,t,y)),y=null},void 0===o&&s.setContentType(null),"setRequestHeader"in y&&ct.forEach(s.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),ct.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),p&&"json"!==p&&(y.responseType=r.responseType),h&&([u,l]=zt(h,!0),y.addEventListener("progress",u)),d&&y.upload&&([a,c]=zt(d),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(i=e=>{y&&(n(!e||e.type?new Wt(null,t,y):e),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);b&&-1===xt.protocols.indexOf(b)?n(new lt("Unsupported protocol "+b+":",lt.ERR_BAD_REQUEST,t)):y.send(o||null)}))};const te=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,i();const e=t instanceof Error?t:this.reason;r.abort(e instanceof lt?e:new Wt(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null,o(new lt(`timeout ${e} of ms exceeded`,lt.ETIMEDOUT))}),e);const i=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>ct.asap(i),a}},ee=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},ne=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},re=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of ne(t))yield*ee(n,e)}(t,e);let s,i=0,a=t=>{s||(s=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return a(),void t.close();let s=r.byteLength;if(n){let t=i+=s;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:t=>(a(t),o.return())},{highWaterMark:2})},{isFunction:oe}=ct,se=(({fetch:t,Request:e,Response:n})=>({fetch:t,Request:e,Response:n}))(ct.global),{ReadableStream:ie,TextEncoder:ae}=ct.global,ue=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ce=t=>{const{fetch:e,Request:n,Response:r}=Object.assign({},se,t),o=oe(e),s=oe(n),i=oe(r);if(!o)return!1;const a=o&&oe(ie),u=o&&("function"==typeof ae?(c=new ae,t=>c.encode(t)):async t=>new Uint8Array(await new n(t).arrayBuffer()));var c;const l=s&&a&&ue((()=>{let t=!1;const e=new n(xt.origin,{body:new ie,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),p=i&&a&&ue((()=>ct.isReadableStream(new r("").body))),d={stream:p&&(t=>t.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!d[t]&&(d[t]=(e,n)=>{let r=e&&e[t];if(r)return r.call(e);throw new lt(`Response type '${t}' is not supported`,lt.ERR_NOT_SUPPORT,n)})}));const h=async(t,e)=>{const r=ct.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(ct.isBlob(t))return t.size;if(ct.isSpecCompliantForm(t)){const e=new n(xt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return ct.isArrayBufferView(t)||ct.isArrayBuffer(t)?t.byteLength:(ct.isURLSearchParams(t)&&(t+=""),ct.isString(t)?(await u(t)).byteLength:void 0)})(e):r};return async t=>{let{url:o,method:i,data:a,signal:u,cancelToken:c,timeout:f,onDownloadProgress:y,onUploadProgress:m,responseType:b,headers:g,withCredentials:v="same-origin",fetchOptions:w}=Yt(t);b=b?(b+"").toLowerCase():"text";let R=te([u,c&&c.toAbortSignal()],f),S=null;const _=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let q;try{if(m&&l&&"get"!==i&&"head"!==i&&0!==(q=await h(g,a))){let t,e=new n(o,{method:"POST",body:a,duplex:"half"});if(ct.isFormData(a)&&(t=e.headers.get("content-type"))&&g.setContentType(t),e.body){const[t,n]=Vt(q,zt(Jt(m)));a=re(e.body,65536,t,n)}}ct.isString(v)||(v=v?"include":"omit");const u=s&&"credentials"in n.prototype,c={...w,signal:R,method:i.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:u?v:void 0};S=s&&new n(o,c);let f=await(s?e(S,w):e(o,c));const E=p&&("stream"===b||"response"===b);if(p&&(y||E&&_)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=f[e]}));const e=ct.toFiniteNumber(f.headers.get("content-length")),[n,o]=y&&Vt(e,zt(Jt(y),!0))||[];f=new r(re(f.body,65536,n,(()=>{o&&o(),_&&_()})),t)}b=b||"text";let D=await d[ct.findKey(d,b)||"text"](f,t);return!E&&_&&_(),await new Promise(((e,n)=>{Ht(e,n,{data:D,headers:Nt.from(f.headers),status:f.status,statusText:f.statusText,config:t,request:S})}))}catch(e){if(_&&_(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new lt("Network Error",lt.ERR_NETWORK,t,S),{cause:e.cause||e});throw lt.from(e,e&&e.code,t,S)}}},le=new Map,pe=t=>{let e=ct.merge.call({skipUndefined:!0},se,t?t.env:null);const{fetch:n,Request:r,Response:o}=e,s=[r,o,n];let i,a,u=s.length,c=le;for(;u--;)i=s[u],a=c.get(i),void 0===a&&c.set(i,a=u?new Map:ce(e)),c=a;return a};pe();const de={http:null,xhr:Zt,fetch:{get:pe}};ct.forEach(de,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const he=t=>`- ${t}`,fe=t=>ct.isFunction(t)||null===t||!1===t;var ye=(t,e)=>{t=ct.isArray(t)?t:[t];const{length:n}=t;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=t[i],o=r,!fe(r)&&(o=de[(n=String(r)).toLowerCase()],void 0===o))throw new lt(`Unknown adapter '${n}'`);if(o&&(ct.isFunction(o)||(o=o.get(e))))break;s[n||"#"+i]=o}if(!o){const t=Object.entries(s).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new lt("There is no suitable adapter to dispatch the request "+(n?t.length>1?"since :\n"+t.map(he).join("\n"):" "+he(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function me(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Wt(null,t)}function be(t){me(t),t.headers=Nt.from(t.headers),t.data=It.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return ye(t.adapter||Ct.adapter,t)(t).then((function(e){return me(t),e.data=It.call(t,t.transformResponse,e),e.headers=Nt.from(e.headers),e}),(function(e){return Mt(e)||(me(t),e&&e.response&&(e.response.data=It.call(t,t.transformResponse,e.response),e.response.headers=Nt.from(e.response.headers))),Promise.reject(e)}))}const ge="1.12.1",ve={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ve[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const we={};ve.transitional=function(t,e,n){function r(t,e){return"[Axios v"+ge+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,s)=>{if(!1===t)throw new lt(r(o," has been removed"+(e?" in "+e:"")),lt.ERR_DEPRECATED);return e&&!we[o]&&(we[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,s)}},ve.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};var Re={assertOptions:function(t,e,n){if("object"!=typeof t)throw new lt("options must be an object",lt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],i=e[s];if(i){const e=t[s],n=void 0===e||i(e,s,t);if(!0!==n)throw new lt("option "+s+" must be "+n,lt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new lt("Unknown option "+s,lt.ERR_BAD_OPTION)}},validators:ve};const Se=Re.validators;let _e=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _t,response:new _t}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Gt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&Re.assertOptions(n,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1),null!=r&&(ct.isFunction(r)?e.paramsSerializer={serialize:r}:Re.assertOptions(r,{encode:Se.function,serialize:Se.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Re.assertOptions(e,{baseUrl:Se.spelling("baseURL"),withXsrfToken:Se.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=o&&ct.merge(o.common,o[e.method]);o&&ct.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Nt.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,p=0;if(!a){const t=[be.bind(this),void 0];for(t.unshift(...i),t.push(...u),l=t.length,c=Promise.resolve(e);p<l;)c=c.then(t[p++],t[p++]);return c}l=i.length;let d=e;for(p=0;p<l;){const t=i[p++],e=i[p++];try{d=t(d)}catch(t){e.call(this,t);break}}try{c=be.call(this,d)}catch(t){return Promise.reject(t)}for(p=0,l=u.length;p<l;)c=c.then(u[p++],u[p++]);return c}getUri(t){return St(Qt((t=Gt(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};ct.forEach(["delete","get","head","options"],(function(t){_e.prototype[t]=function(e,n){return this.request(Gt(n||{},{method:t,url:e,data:(n||{}).data}))}})),ct.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(Gt(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}_e.prototype[t]=e(),_e.prototype[t+"Form"]=e(!0)}));const qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qe).forEach((([t,e])=>{qe[e]=t}));const Ee=function t(e){const n=new _e(e),r=v(_e.prototype.request,n);return ct.extend(r,_e.prototype,n,{allOwnKeys:!0}),ct.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Gt(e,n))},r}(Ct);Ee.Axios=_e,Ee.CanceledError=Wt,Ee.CancelToken=class t{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Wt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let e;return{token:new t((function(t){e=t})),cancel:e}}},Ee.isCancel=Mt,Ee.VERSION=ge,Ee.toFormData=bt,Ee.AxiosError=lt,Ee.Cancel=Ee.CanceledError,Ee.all=function(t){return Promise.all(t)},Ee.spread=function(t){return function(e){return t.apply(null,e)}},Ee.isAxiosError=function(t){return ct.isObject(t)&&!0===t.isAxiosError},Ee.mergeConfig=Gt,Ee.AxiosHeaders=Nt,Ee.formToJSON=t=>Ft(ct.isHTMLForm(t)?new FormData(t):t),Ee.getAdapter=ye,Ee.HttpStatusCode=qe,Ee.default=Ee;const{Axios:De,AxiosError:Te,CanceledError:Oe,isCancel:Ae,CancelToken:ke,VERSION:xe,all:Fe,Cancel:Ce,isAxiosError:Pe,spread:Le,toFormData:Ue,AxiosHeaders:Be,HttpStatusCode:je,formToJSON:Ne,getAdapter:Ie,mergeConfig:Me}=Ee;var We,He={exports:{}},ze=He.exports;
|
|
2
|
-
/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */var Ve,Je,Ke,$e,Qe=(We||(We=1,function(t,e){!function(n){var r=e,o=t&&t.exports==r&&t,s="object"==typeof i&&i;s.global!==s&&s.window!==s||(n=s);var a=function(t){this.message=t};(a.prototype=new Error).name="InvalidCharacterError";var u=function(t){throw new a(t)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=/[\t\n\f\r ]/g,p={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&u("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,o,s=t.length%3,i="",a=-1,l=t.length-s;++a<l;)e=t.charCodeAt(a)<<16,n=t.charCodeAt(++a)<<8,r=t.charCodeAt(++a),i+=c.charAt((o=e+n+r)>>18&63)+c.charAt(o>>12&63)+c.charAt(o>>6&63)+c.charAt(63&o);return 2==s?(e=t.charCodeAt(a)<<8,n=t.charCodeAt(++a),i+=c.charAt((o=e+n)>>10)+c.charAt(o>>4&63)+c.charAt(o<<2&63)+"="):1==s&&(o=t.charCodeAt(a),i+=c.charAt(o>>2)+c.charAt(o<<4&63)+"=="),i},decode:function(t){var e=(t=String(t).replace(l,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&u("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,o=0,s="",i=-1;++i<e;)r=c.indexOf(t.charAt(i)),n=o%4?64*n+r:r,o++%4&&(s+=String.fromCharCode(255&n>>(-2*o&6)));return s},version:"1.0.0"};if(r&&!r.nodeType)if(o)o.exports=p;else for(var d in p)p.hasOwnProperty(d)&&(r[d]=p[d]);else n.base64=p}(ze)}(He,He.exports)),He.exports),Xe=function(){function t(t){this.request=t}return t.prototype.list=function(t){return this.request.get("/v5/accounts/subaccounts",t).then((function(t){return t.body}))},t.prototype.get=function(t){return this.request.get("/v5/accounts/subaccounts/".concat(t)).then((function(t){return t.body}))},t.prototype.create=function(t){return this.request.postWithFD("/v5/accounts/subaccounts",{name:t}).then((function(t){return t.body}))},t.prototype.enable=function(t){return this.request.post("/v5/accounts/subaccounts/".concat(t,"/enable")).then((function(t){return t.body}))},t.prototype.disable=function(t){return this.request.post("/v5/accounts/subaccounts/".concat(t,"/disable")).then((function(t){return t.body}))},t.SUBACCOUNT_HEADER="X-Mailgun-On-Behalf-Of",t}(),Ge=function(){function t(t){var e=t.username,n=t.key,r=t.timeout,o=t.maxBodyLength,s=t.proxy,i=t.configHeaders,a=t.useFetch;this.timeout=r,this.maxBodyLength=o,this.proxy=s,this.username=e,this.key=n,this.headers=this.makeHeadersFromObject(i),this.useFetch=a}return t.prototype.getResponseBody=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){if(e={body:{},status:null==t?void 0:t.status},"string"==typeof t.data){if("Mailgun Magnificent API"===t.data)throw new y({status:400,statusText:"Incorrect url",body:t.data});e.body={message:t.data}}else e.body=t.data;return[2,e]}))}))},t.prototype.getDataRelatedHeaders=function(t){var e,n=null===(e=null==t?void 0:t.isFormURLEncoded)||void 0===e||e,r=null==t?void 0:t.isMultipartFormData,o=null==t?void 0:t.isApplicationJSON,s={};return n&&(s["Content-Type"]="application/x-www-form-urlencoded"),r&&(s["Content-Type"]="multipart/form-data"),o&&(s["Content-Type"]="application/json"),s},t.prototype.addRequestLevelHeaders=function(t){var e=new Be,n=Qe.encode("".concat(this.username,":").concat(this.key));e.setAuthorization("Basic ".concat(n)),e.set(this.headers);var r=this.getDataRelatedHeaders(t),o=this.makeHeadersFromObject(r);return e.set(o),e},t.prototype.makeHeadersFromObject=function(t){void 0===t&&(t={});var e=new Be;return e=Object.entries(t).reduce((function(t,e){var n=e[0],r=e[1];return t.set(n,r),t}),e)},t.prototype.setSubAccountHeader=function(t){this.headers.set(Xe.SUBACCOUNT_HEADER,t)},t.prototype.resetSubAccountHeader=function(){this.headers.delete(Xe.SUBACCOUNT_HEADER)},t.prototype.makeRequest=function(t,e,s,i){var a,u,c;return r(this,void 0,void 0,(function(){var r,l,p,d,h;return o(this,(function(o){switch(o.label){case 0:l=this.addRequestLevelHeaders(i),o.label=1;case 1:if(o.trys.push([1,3,,4]),p=n(n({method:e.toLocaleUpperCase(),timeout:this.timeout,url:t,headers:l},s),{maxBodyLength:this.maxBodyLength,proxy:this.proxy}),this.useFetch&&(p.adapter="fetch",(null==i?void 0:i.dataSize)&&i.dataSize>0&&i.dataSize>this.maxBodyLength))throw new y({status:400,statusText:"(Fetch) Request body larger than maxBodyLength limit",body:"(Fetch) Request body size of ".concat(i.dataSize," bytes exceeds the maximum allowed size of ").concat(this.maxBodyLength," bytes")});return[4,Ee.request(p)];case 2:return r=o.sent(),[3,4];case 3:throw d=o.sent(),new y({status:(null===(a=null==(h=d)?void 0:h.response)||void 0===a?void 0:a.status)||400,statusText:(null===(u=null==h?void 0:h.response)||void 0===u?void 0:u.statusText)||h.code,body:(null===(c=null==h?void 0:h.response)||void 0===c?void 0:c.data)||h.message});case 4:return[4,this.getResponseBody(r)];case 5:return[2,o.sent()]}}))}))},t}(),Ye=function(){function t(t,e){this.url=t.url,this.formDataBuilder=new g(e,{useFetch:t.useFetch});var n={timeout:t.timeout,maxBodyLength:52428800,proxy:t.proxy,username:t.username,key:t.key,configHeaders:t.headers,useFetch:t.useFetch};this.requestProvider=new Ge(n)}return t.prototype.request=function(t,e,s,i){var a;return r(this,void 0,void 0,(function(){var r,u,c;return o(this,(function(o){return r=n({},s),u={},c=f(this.url,e),(null==r?void 0:r.query)&&Object.getOwnPropertyNames(null==r?void 0:r.query).length>0&&((null===(a=null==r?void 0:r.query)||void 0===a?void 0:a.searchParams)?u.params=new URLSearchParams(r.query.searchParams):u.params=new URLSearchParams(r.query)),(null==r?void 0:r.body)&&(u.data=null==r?void 0:r.body),[2,this.requestProvider.makeRequest(c,t.toUpperCase(),u,i)]}))}))},t.prototype.setSubaccountHeader=function(t){this.requestProvider.setSubAccountHeader(t)},t.prototype.resetSubaccountHeader=function(){this.requestProvider.resetSubAccountHeader()},t.prototype.query=function(t,e,n){return this.request(t,e,{query:n})},t.prototype.command=function(t,e,n,r,o){var s={body:n,query:null==o?void 0:o.query};return this.request(t,e,s,r)},t.prototype.get=function(t,e){return this.query("get",t,e)},t.prototype.post=function(t,e,n){return this.command("post",t,e,{isFormURLEncoded:!1,isApplicationJSON:null==n?void 0:n.isApplicationJSON})},t.prototype.postWithFD=function(t,e){return r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return[4,this.formDataBuilder.createFormData(e)];case 1:return n=o.sent(),r=n.formData,s=n.dataSize,[2,this.command("post",t,r,{isFormURLEncoded:!1,isMultipartFormData:!0,dataSize:s})]}}))}))},t.prototype.putWithFD=function(t,e){return r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return[4,this.formDataBuilder.createFormData(e)];case 1:return n=o.sent(),r=n.formData,s=n.dataSize,[2,this.command("put",t,r,{isFormURLEncoded:!1,isMultipartFormData:!0,dataSize:s})]}}))}))},t.prototype.patchWithFD=function(t,e){return r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return[4,this.formDataBuilder.createFormData(e)];case 1:return n=o.sent(),r=n.formData,s=n.dataSize,[2,this.command("patch",t,r,{isFormURLEncoded:!1,isMultipartFormData:!0,dataSize:s})]}}))}))},t.prototype.put=function(t,e,n){return this.command("put",t,e,{},n)},t.prototype.delete=function(t,e){return this.command("delete",t,e)},t}(),Ze=function(t,e,n){this.name=t.name,this.require_tls=t.require_tls,this.skip_verification=t.skip_verification,this.state=t.state,this.wildcard=t.wildcard,this.spam_action=t.spam_action,this.created_at=new Date(t.created_at),this.smtp_password=t.smtp_password,this.smtp_login=t.smtp_login,this.type=t.type,this.receiving_dns_records=e||null,this.sending_dns_records=n||null,this.id=t.id,this.is_disabled=t.is_disabled,this.web_prefix=t.web_prefix,this.web_scheme=t.web_scheme,this.use_automatic_sender_security=t.use_automatic_sender_security;var r=["dkim_host","mailfrom_host"].reduce((function(e,n){return t[n]&&(e[n]=t[n]),e}),{});Object.assign(this,r)},tn=function(){function t(t,e,n,r,o,s){void 0===s&&(s=console),this.request=t,this.domainCredentials=e,this.domainTemplates=n,this.domainTags=r,this.logger=s,this.domainTracking=o}return t.prototype._handleBoolValues=function(t){var e=t,r=Object.keys(e).reduce((function(t,n){var r=n;if("boolean"==typeof e[r]){var o=e[r];t[r]="true"===o.toString()?"true":"false"}return t}),{});return n(n({},t),r)},t.prototype._parseMessage=function(t){return t.body},t.prototype.parseDomainList=function(t){return t.body&&t.body.items?t.body.items.map((function(t){return new Ze(t)})):[]},t.prototype._parseDomain=function(t){return new Ze(t.body.domain,t.body.receiving_dns_records,t.body.sending_dns_records)},t.prototype.list=function(t){var e=this;return this.request.get("/v4/domains",t).then((function(t){return e.parseDomainList(t)}))},t.prototype.get=function(t,e){var n,r,o=this,s=e?{"h:extended":null!==(n=null==e?void 0:e.extended)&&void 0!==n&&n,"h:with_dns":null===(r=null==e?void 0:e.with_dns)||void 0===r||r}:{};return this.request.get("/v4/domains/".concat(t),s).then((function(t){return o._parseDomain(t)}))},t.prototype.create=function(t){var e=this,n=this._handleBoolValues(t);return this.request.postWithFD("/v4/domains",n).then((function(t){return e._parseDomain(t)}))},t.prototype.update=function(t,e){var n=this,r=this._handleBoolValues(e);return this.request.putWithFD("/v4/domains/".concat(t),r).then((function(t){return n._parseDomain(t)}))},t.prototype.verify=function(t){var e=this;return this.request.put("/v4/domains/".concat(t,"/verify")).then((function(t){return e._parseDomain(t)}))},t.prototype.destroy=function(t){var e=this;return this.request.delete("/v3/domains/".concat(t)).then((function(t){return e._parseMessage(t)}))},t.prototype.getConnection=function(t){return this.request.get("/v3/domains/".concat(t,"/connection")).then((function(t){return t})).then((function(t){return t.body}))},t.prototype.updateConnection=function(t,e){return this.request.put("/v3/domains/".concat(t,"/connection"),e).then((function(t){return t})).then((function(t){return t.body}))},t.prototype.getTracking=function(t){return this.logger.warn("\n 'domains.getTracking' method is deprecated, and will be removed. Please use 'domains.domainTracking.getTracking' instead.\n "),this.domainTracking.getTracking(t)},t.prototype.updateTracking=function(t,e,n){return this.logger.warn("\n 'domains.updateTracking' method is deprecated, and will be removed. Please use 'domains.domainTracking.updateTracking' instead.\n "),this.domainTracking.updateTracking(t,e,n)},t.prototype.getIps=function(t){return this.logger.warn('"domains.getIps" method is deprecated and will be removed in the future releases.'),this.request.get(f("/v3/domains",t,"ips")).then((function(t){var e;return null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.items}))},t.prototype.assignIp=function(t,e){return this.logger.warn('"domains.assignIp" method is deprecated and will be removed in the future releases.'),this.request.postWithFD(f("/v3/domains",t,"ips"),{ip:e})},t.prototype.deleteIp=function(t,e){return this.logger.warn('"domains.deleteIp" method is deprecated and will be moved into the IpsClient in the future releases.'),this.request.delete(f("/v3/domains",t,"ips",e))},t.prototype.linkIpPool=function(t,e){return this.logger.warn('"domains.linkIpPool" method is deprecated, and will be removed in the future releases.'),this.request.postWithFD(f("/v3/domains",t,"ips"),{pool_id:e})},t.prototype.unlinkIpPoll=function(t,e){this.logger.warn('"domains.unlinkIpPoll" method is deprecated, and will be moved into the IpsClient in the future releases.');var n="";if(e.pool_id&&e.ip)throw y.getUserDataError("Too much data for replacement","Please specify either pool_id or ip (not both)");return e.pool_id?n="?pool_id=".concat(e.pool_id):e.ip&&(n="?ip=".concat(e.ip)),this.request.delete(f("/v3/domains",t,"ips","ip_pool",n))},t.prototype.updateDKIMAuthority=function(t,e){var n={query:"self=".concat(e.self)};return this.request.put("/v3/domains/".concat(t,"/dkim_authority"),{},n).then((function(t){return t})).then((function(t){return t.body}))},t.prototype.updateDKIMSelector=function(t,e){var n;return r(this,void 0,void 0,(function(){var r,s;return o(this,(function(o){switch(o.label){case 0:return r={query:"dkim_selector=".concat(e.dkimSelector)},[4,this.request.put("/v3/domains/".concat(t,"/dkim_selector"),{},r)];case 1:return[2,{status:(s=o.sent()).status,message:null===(n=null==s?void 0:s.body)||void 0===n?void 0:n.message}]}}))}))},t.prototype.updateWebPrefix=function(t,e){this.logger.warn('"domains.updateWebPrefix" method is deprecated, please use domains.update to set new "web_prefix". Current method will be removed in the future releases.');var n={query:"web_prefix=".concat(e.webPrefix)};return this.request.put("/v3/domains/".concat(t,"/web_prefix"),{},n).then((function(t){return t}))},t}(),en=function(){function t(t){t&&(this.request=t)}return t.prototype.parsePage=function(t,e,n,r){var o=new URL(e).searchParams,s=e&&"string"==typeof e&&e.split(n).pop()||"",i=null;return r&&(i=o.has(r)?o.get(r):void 0),{id:t,page:"?"===n?"?".concat(s):s,iteratorPosition:i,url:e}},t.prototype.parsePageLinks=function(t,e,n){var r=this;return Object.entries(t.body.paging).reduce((function(t,o){var s=o[0],i=o[1];return t[s]=r.parsePage(s,i,e,n),t}),{})},t.prototype.updateUrlAndQuery=function(t,e){var r=t,o=n({},e);return o.page&&(r=f(t,o.page),delete o.page),{url:r,updatedQuery:o}},t.prototype.requestListWithPages=function(t,e,n){return r(this,void 0,void 0,(function(){var r,s,i,a;return o(this,(function(o){switch(o.label){case 0:return r=this.updateUrlAndQuery(t,e),s=r.url,i=r.updatedQuery,this.request?[4,this.request.get(s,i)]:[3,2];case 1:return a=o.sent(),[2,this.parseList(a,n)];case 2:throw new y({status:500,statusText:"Request property is empty",body:{message:""}})}}))}))},t}(),nn=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n}return e(n,t),n.prototype.parseList=function(t){var e={};return e.items=t.body.items,e.pages=this.parsePageLinks(t,"/"),e.status=t.status,e},n.prototype.get=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.requestListWithPages(f("/v3",t,"events"),e)]}))}))},n}(en),rn=function(t){this.start=new Date(t.start),this.end=new Date(t.end),this.resolution=t.resolution,this.stats=t.stats.map((function(t){var e=n({},t);return e.time=new Date(t.time),e}))},on=function(){function t(t,e){void 0===e&&(e=console),this.request=t,this.logger=e}return t.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date:"'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toUTCString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),[t,e.toUTCString()]},t.prototype.prepareSearchParams=function(t){var e=this,n=[];return"object"==typeof t&&Object.keys(t).length&&(n=Object.entries(t).reduce((function(t,n){var r=n[0],o=n[1];if(Array.isArray(o)&&o.length){var i=o.map((function(t){return[r,t]}));return s(s([],t,!0),i,!0)}return o instanceof Date?(t.push(e.convertDateToUTC(r,o)),t):("string"==typeof o&&t.push([r,o]),t)}),[])),n},t.prototype.parseStats=function(t){return new rn(t.body)},t.prototype.getDomain=function(t,e){var n=this.prepareSearchParams(e);return this.request.get(f("/v3",t,"stats/total"),{searchParams:n}).then(this.parseStats)},t.prototype.getAccount=function(t){var e=this.prepareSearchParams(t);return this.request.get("/v3/stats/total",{searchParams:e}).then(this.parseStats)},t}();!function(t){t.HOUR="hour",t.DAY="day",t.MONTH="month"}(Ve||(Ve={})),function(t){t.BOUNCES="bounces",t.COMPLAINTS="complaints",t.UNSUBSCRIBES="unsubscribes",t.WHITELISTS="whitelists"}(Je||(Je={})),function(t){t.CLICKED="clicked",t.COMPLAINED="complained",t.DELIVERED="delivered",t.OPENED="opened",t.PERMANENT_FAIL="permanent_fail",t.TEMPORARY_FAIL="temporary_fail",t.UNSUBSCRIBED="unsubscribe"}(Ke||(Ke={})),function(t){t.YES="yes",t.NO="no"}($e||($e={}));var sn=function(t){this.type=t},an=function(t){function n(e){var n=t.call(this,Je.BOUNCES)||this;return n.address=e.address,n.code=+e.code,n.error=e.error,n.created_at=new Date(e.created_at),n}return e(n,t),n}(sn),un=function(t){function n(e){var n=t.call(this,Je.COMPLAINTS)||this;return n.address=e.address,n.created_at=new Date(e.created_at),n}return e(n,t),n}(sn),cn=function(t){function n(e){var n=t.call(this,Je.UNSUBSCRIBES)||this;return n.address=e.address,n.tags=e.tags,n.created_at=new Date(e.created_at),n}return e(n,t),n}(sn),ln=function(t){function n(e){var n=t.call(this,Je.WHITELISTS)||this;return n.value=e.value,n.reason=e.reason,n.createdAt=new Date(e.createdAt),n}return e(n,t),n}(sn),pn=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n.models={bounces:an,complaints:un,unsubscribes:cn,whitelists:ln},n}return e(n,t),n.prototype.parseList=function(t,e){var n,r={};return r.items=(null===(n=t.body.items)||void 0===n?void 0:n.map((function(t){return new e(t)})))||[],r.pages=this.parsePageLinks(t,"?","address"),r.status=t.status,r},n.prototype._parseItem=function(t,e){return new e(t)},n.prototype.createWhiteList=function(t,e,n){if(n)throw y.getUserDataError("Data property should be an object","Whitelist's creation process does not support multiple creations. Data property should be an object");return this.request.postWithFD(f("v3",t,"whitelists"),e).then(this.prepareResponse)},n.prototype.createUnsubscribe=function(t,e){if(Array.isArray(e)){if(e.some((function(t){return t.tag})))throw y.getUserDataError("Tag property should not be used for creating multiple unsubscribes.","Tag property can be used only if one unsubscribe provided as second argument of create method. Please use tags instead.");return this.request.post(f("v3",t,"unsubscribes"),JSON.stringify(e),{isApplicationJSON:!0}).then(this.prepareResponse)}if(null==e?void 0:e.tags)throw y.getUserDataError("Tags property should not be used for creating one unsubscribe.","Tags property can be used if you provides an array of unsubscribes as second argument of create method. Please use tag instead");if(Array.isArray(e.tag))throw y.getUserDataError("Tag property can not be an array","Please use array of unsubscribes as second argument of create method to be able to provide few tags");return this.request.postWithFD(f("v3",t,"unsubscribes"),e).then(this.prepareResponse)},n.prototype.getModel=function(t){if(t in this.models)return this.models[t];throw y.getUserDataError("Unknown type value","Type may be only one of [bounces, complaints, unsubscribes, whitelists]")},n.prototype.prepareResponse=function(t){return{message:t.body.message,type:t.body.type||"",value:t.body.value||"",status:t.status}},n.prototype.list=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){return r=this.getModel(e),[2,this.requestListWithPages(f("v3",t,e),n,r)]}))}))},n.prototype.get=function(t,e,n){var r=this,o=this.getModel(e);return this.request.get(f("v3",t,e,encodeURIComponent(n))).then((function(t){return r._parseItem(t.body,o)}))},n.prototype.create=function(t,e,n){var r;this.getModel(e);var o=Array.isArray(n);return"whitelists"===e?this.createWhiteList(t,n,o):"unsubscribes"===e?this.createUnsubscribe(t,n):(r=o?s([],n,!0):[n],this.request.post(f("v3",t,e),JSON.stringify(r),{isApplicationJSON:!0}).then(this.prepareResponse))},n.prototype.destroy=function(t,e,n){return this.getModel(e),this.request.delete(f("v3",t,e,encodeURIComponent(n))).then((function(t){return{message:t.body.message,value:t.body.value||"",address:t.body.address||"",status:t.status}}))},n}(en),dn=function(t,e,n){this.id=t,this.url=e,this.urls=n},hn=function(){function t(t){this.request=t}return t.prototype._parseWebhookList=function(t){return t.body.webhooks},t.prototype._parseWebhookWithID=function(t){return function(e){var n,r=null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.webhook,o=null==r?void 0:r.url,s=null==r?void 0:r.urls;return o||(o=s&&s.length?s[0]:void 0),s&&0!==s.length||!o||(s=[o]),new dn(t,o,s)}},t.prototype._parseWebhookTest=function(t){return{code:t.body.code,message:t.body.message}},t.prototype.list=function(t,e){return this.request.get(f("/v3/domains",t,"webhooks"),e).then(this._parseWebhookList)},t.prototype.get=function(t,e){return this.request.get(f("/v3/domains",t,"webhooks",e)).then(this._parseWebhookWithID(e))},t.prototype.create=function(t,e,n,r){return void 0===r&&(r=!1),r?this.request.putWithFD(f("/v3/domains",t,"webhooks",e,"test"),{url:n}).then(this._parseWebhookTest):this.request.postWithFD(f("/v3/domains",t,"webhooks"),{id:e,url:n}).then(this._parseWebhookWithID(e))},t.prototype.update=function(t,e,n){return this.request.putWithFD(f("/v3/domains",t,"webhooks",e),{url:n}).then(this._parseWebhookWithID(e))},t.prototype.destroy=function(t,e){return this.request.delete(f("/v3/domains",t,"webhooks",e)).then(this._parseWebhookWithID(e))},t}(),fn=function(){function t(t){this.request=t}return t.prototype.prepareBooleanValues=function(t){var e=new Set(["o:testmode","t:text","o:dkim","o:tracking","o:tracking-clicks","o:tracking-opens","o:require-tls","o:skip-verification"]);if(!t||0===Object.keys(t).length)throw y.getUserDataError("Message data object can not be empty","Message data object can not be empty");return Object.keys(t).reduce((function(n,r){return e.has(r)&&"boolean"==typeof t[r]?n[r]=t[r]?"yes":"no":n[r]=t[r],n}),{})},t.prototype._parseResponse=function(t){return n({status:t.status},t.body)},t.prototype.create=function(t,e){if(e.message)return this.request.postWithFD("/v3/".concat(t,"/messages.mime"),e).then(this._parseResponse);var n=this.prepareBooleanValues(e);return this.request.postWithFD("/v3/".concat(t,"/messages"),n).then(this._parseResponse)},t}(),yn=function(){function t(t){this.request=t}return t.prototype.list=function(t){return this.request.get("/v3/routes",t).then((function(t){return t.body.items}))},t.prototype.get=function(t){return this.request.get("/v3/routes/".concat(t)).then((function(t){return t.body.route}))},t.prototype.create=function(t){return this.request.postWithFD("/v3/routes",t).then((function(t){return t.body.route}))},t.prototype.update=function(t,e){return this.request.putWithFD("/v3/routes/".concat(t),e).then((function(t){return t.body}))},t.prototype.destroy=function(t){return this.request.delete("/v3/routes/".concat(t)).then((function(t){return t.body}))},t}(),mn=function(){function t(t,e){this.request=t,this.multipleValidation=e}return t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return e={address:t},[4,this.request.get("/v4/address/validate",e)];case 1:return[2,n.sent().body]}}))}))},t}(),bn=function(){function t(t){this.request=t}return t.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v3/ips",t)];case 1:return e=n.sent(),[2,this.parseIpsResponse(e)]}}))}))},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v3/ips/".concat(t))];case 1:return e=n.sent(),[2,this.parseIpsResponse(e)]}}))}))},t.prototype.parseIpsResponse=function(t){return t.body},t}(),gn=function(){function t(t){this.request=t}return t.prototype.list=function(){var t=this;return this.request.get("/v1/ip_pools").then((function(e){return t.parseIpPoolsResponse(e)}))},t.prototype.create=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.postWithFD("/v1/ip_pools",t)];case 1:return e=r.sent(),[2,n({status:e.status},e.body)]}}))}))},t.prototype.update=function(t,e){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return[4,this.request.patchWithFD("/v1/ip_pools/".concat(t),e)];case 1:return r=o.sent(),[2,n({status:r.status},r.body)]}}))}))},t.prototype.delete=function(t,e){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return[4,this.request.delete("/v1/ip_pools/".concat(t),e)];case 1:return r=o.sent(),[2,n({status:r.status},r.body)]}}))}))},t.prototype.parseIpPoolsResponse=function(t){return n({status:t.status},t.body)},t}(),vn=function(t){function s(e,n){var r=t.call(this,e)||this;return r.request=e,r.baseRoute="/v3/lists",r.members=n,r}return e(s,t),s.prototype.parseValidationResult=function(t,e){return{status:t,validationResult:n(n({},e),{created_at:new Date(1e3*e.created_at)})}},s.prototype.parseList=function(t){var e={};return e.items=t.body.items,e.pages=this.parsePageLinks(t,"?","address"),e.status=t.status,e},s.prototype.list=function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.requestListWithPages("".concat(this.baseRoute,"/pages"),t)]}))}))},s.prototype.get=function(t){return this.request.get("".concat(this.baseRoute,"/").concat(t)).then((function(t){return t.body.list}))},s.prototype.create=function(t){return this.request.postWithFD(this.baseRoute,t).then((function(t){return t.body.list}))},s.prototype.update=function(t,e){return this.request.putWithFD("".concat(this.baseRoute,"/").concat(t),e).then((function(t){return t.body.list}))},s.prototype.destroy=function(t){return this.request.delete("".concat(this.baseRoute,"/").concat(t)).then((function(t){return t.body}))},s.prototype.validate=function(t){return this.request.post("".concat(this.baseRoute,"/").concat(t,"/validate"),{}).then((function(t){return n({status:t.status},t.body)}))},s.prototype.validationResult=function(t){var e=this;return this.request.get("".concat(this.baseRoute,"/").concat(t,"/validate")).then((function(t){return e.parseValidationResult(t.status,t.body)}))},s.prototype.cancelValidation=function(t){return this.request.delete("".concat(this.baseRoute,"/").concat(t,"/validate")).then((function(t){return{status:t.status,message:t.body.message}}))},s}(en),wn=function(t){function s(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/lists",n}return e(s,t),s.prototype.checkAndUpdateData=function(t){var e=n({},t);return"object"==typeof t.vars&&(e.vars=JSON.stringify(e.vars)),"boolean"==typeof t.subscribed&&(e.subscribed=t.subscribed?"yes":"no"),e},s.prototype.parseList=function(t){var e={};return e.items=t.body.items,e.pages=this.parsePageLinks(t,"?","address"),e},s.prototype.listMembers=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.requestListWithPages("".concat(this.baseRoute,"/").concat(t,"/members/pages"),e)]}))}))},s.prototype.getMember=function(t,e){return this.request.get("".concat(this.baseRoute,"/").concat(t,"/members/").concat(e)).then((function(t){return t.body.member}))},s.prototype.createMember=function(t,e){var n=this.checkAndUpdateData(e);return this.request.postWithFD("".concat(this.baseRoute,"/").concat(t,"/members"),n).then((function(t){return t.body.member}))},s.prototype.createMembers=function(t,e){var n={members:Array.isArray(e.members)?JSON.stringify(e.members):e.members,upsert:e.upsert};return this.request.postWithFD("".concat(this.baseRoute,"/").concat(t,"/members.json"),n).then((function(t){return t.body}))},s.prototype.updateMember=function(t,e,n){var r=this.checkAndUpdateData(n);return this.request.putWithFD("".concat(this.baseRoute,"/").concat(t,"/members/").concat(e),r).then((function(t){return t.body.member}))},s.prototype.destroyMember=function(t,e){return this.request.delete("".concat(this.baseRoute,"/").concat(t,"/members/").concat(e)).then((function(t){return t.body}))},s}(en),Rn=function(){function t(t){this.request=t,this.baseRoute="/v3/domains/"}return t.prototype._parseDomainCredentialsList=function(t){return{items:t.body.items,totalCount:t.body.total_count}},t.prototype._parseMessageResponse=function(t){return{status:t.status,message:t.body.message}},t.prototype._parseDeletedResponse=function(t){return{status:t.status,message:t.body.message,spec:t.body.spec}},t.prototype.list=function(t,e){var n=this;return this.request.get(f(this.baseRoute,t,"/credentials"),e).then((function(t){return n._parseDomainCredentialsList(t)}))},t.prototype.create=function(t,e){var n=this;return this.request.postWithFD("".concat(this.baseRoute).concat(t,"/credentials"),e).then((function(t){return n._parseMessageResponse(t)}))},t.prototype.update=function(t,e,n){var r=this;return this.request.putWithFD("".concat(this.baseRoute).concat(t,"/credentials/").concat(e),n).then((function(t){return r._parseMessageResponse(t)}))},t.prototype.destroy=function(t,e){var n=this;return this.request.delete("".concat(this.baseRoute).concat(t,"/credentials/").concat(e)).then((function(t){return n._parseDeletedResponse(t)}))},t}(),Sn=function(t,e){var n,r;this.createdAt=new Date(t.created_at),this.id=t.id,this.quantity=t.quantity,this.recordsProcessed=t.records_processed,this.status=t.status,this.responseStatusCode=e,t.download_url&&(this.downloadUrl={csv:null===(n=t.download_url)||void 0===n?void 0:n.csv,json:null===(r=t.download_url)||void 0===r?void 0:r.json}),t.summary&&(this.summary={result:{catchAll:t.summary.result.catch_all,deliverable:t.summary.result.deliverable,doNotSend:t.summary.result.do_not_send,undeliverable:t.summary.result.undeliverable,unknown:t.summary.result.unknown},risk:{high:t.summary.risk.high,low:t.summary.risk.low,medium:t.summary.risk.medium,unknown:t.summary.risk.unknown}})},_n=function(t){function s(e){var n=t.call(this)||this;return n.request=e,n.attachmentsHandler=new b,n}return e(s,t),s.prototype.handleResponse=function(t){return n({status:t.status},null==t?void 0:t.body)},s.prototype.parseList=function(t){var e={};return e.jobs=t.body.jobs.map((function(e){return new Sn(e,t.status)})),e.pages=this.parsePageLinks(t,"?","pivot"),e.total=t.body.total,e.status=t.status,e},s.prototype.list=function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.requestListWithPages("/v4/address/validate/bulk",t)]}))}))},s.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v4/address/validate/bulk/".concat(t))];case 1:return e=n.sent(),[2,new Sn(e.body,e.status)]}}))}))},s.prototype.convertToExpectedShape=function(t){return this.attachmentsHandler.isBuffer(t.file)?{multipleValidationFile:t.file}:"string"==typeof t.file?{multipleValidationFile:{data:t.file}}:(this.attachmentsHandler.isStream(t.file),{multipleValidationFile:t.file})},s.prototype.create=function(t,e){return r(this,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:if(!e||!e.file)throw y.getUserDataError('"file" property expected.','Make sure second argument has "file" property.');return n=this.convertToExpectedShape(e),[4,this.request.postWithFD("/v4/address/validate/bulk/".concat(t),n)];case 1:return r=o.sent(),[2,this.handleResponse(r)]}}))}))},s.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.request.delete("/v4/address/validate/bulk/".concat(t))];case 1:return e=n.sent(),[2,this.handleResponse(e)]}}))}))},s}(en),qn=function(t){this.name=t.name,this.description=t.description,this.createdAt=t.createdAt?new Date(t.createdAt):"",this.createdBy=t.createdBy,this.id=t.id,t.version&&(this.version=t.version,this.version&&t.version.createdAt&&(this.version.createdAt=new Date(t.version.createdAt))),t.versions&&t.versions.length&&(this.versions=t.versions.map((function(t){var e=n({},t);return e.createdAt=new Date(t.createdAt),e})))},En=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/",n}return e(n,t),n.prototype.parseCreationResponse=function(t){return new qn(t.body.template)},n.prototype.parseCreationVersionResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,t.body&&t.body.template&&(e.template=new qn(t.body.template)),e},n.prototype.parseMutationResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,t.body&&t.body.template&&(e.templateName=t.body.template.name),e},n.prototype.parseNotificationResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,e},n.prototype.parseMutateTemplateVersionResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,t.body.template&&(e.templateName=t.body.template.name,e.templateVersion={tag:t.body.template.version.tag}),e},n.prototype.parseList=function(t){var e={};return e.items=t.body.items.map((function(t){return new qn(t)})),e.pages=this.parsePageLinks(t,"?","p"),e.status=t.status,e},n.prototype.parseListTemplateVersions=function(t){var e={};return e.template=new qn(t.body.template),e.pages=this.parsePageLinks(t,"?","p"),e},n.prototype.list=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.requestListWithPages(f(this.baseRoute,t,"/templates"),e)]}))}))},n.prototype.get=function(t,e,n){return this.request.get(f(this.baseRoute,t,"/templates/",e),n).then((function(t){return new qn(t.body.template)}))},n.prototype.create=function(t,e){var n=this;return this.request.postWithFD(f(this.baseRoute,t,"/templates"),e).then((function(t){return n.parseCreationResponse(t)}))},n.prototype.update=function(t,e,n){var r=this;return this.request.putWithFD(f(this.baseRoute,t,"/templates/",e),n).then((function(t){return r.parseMutationResponse(t)}))},n.prototype.destroy=function(t,e){var n=this;return this.request.delete(f(this.baseRoute,t,"/templates/",e)).then((function(t){return n.parseMutationResponse(t)}))},n.prototype.destroyAll=function(t){var e=this;return this.request.delete(f(this.baseRoute,t,"/templates")).then((function(t){return e.parseNotificationResponse(t)}))},n.prototype.listVersions=function(t,e,n){var r=this;return this.request.get(f(this.baseRoute,t,"/templates",e,"/versions"),n).then((function(t){return r.parseListTemplateVersions(t)}))},n.prototype.getVersion=function(t,e,n){return this.request.get(f(this.baseRoute,t,"/templates/",e,"/versions/",n)).then((function(t){return new qn(t.body.template)}))},n.prototype.createVersion=function(t,e,n){var r=this;return this.request.postWithFD(f(this.baseRoute,t,"/templates/",e,"/versions"),n).then((function(t){return r.parseCreationVersionResponse(t)}))},n.prototype.updateVersion=function(t,e,n,r){var o=this;return this.request.putWithFD(f(this.baseRoute,t,"/templates/",e,"/versions/",n),r).then((function(t){return o.parseMutateTemplateVersionResponse(t)}))},n.prototype.destroyVersion=function(t,e,n){var r=this;return this.request.delete(f(this.baseRoute,t,"/templates/",e,"/versions/",n)).then((function(t){return r.parseMutateTemplateVersionResponse(t)}))},n}(en),Dn=function(t){this.tag=t.tag,this.description=t.description,this["first-seen"]=new Date(t["first-seen"]),this["last-seen"]=new Date(t["last-seen"])},Tn=function(t){this.tag=t.body.tag,this.description=t.body.description,this.start=new Date(t.body.start),this.end=new Date(t.body.end),this.resolution=t.body.resolution,this.stats=t.body.stats.map((function(t){return n(n({},t),{time:new Date(t.time)})}))},On=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/",n}return e(n,t),n.prototype.parseList=function(t){var e={};return e.items=t.body.items.map((function(t){return new Dn(t)})),e.pages=this.parsePageLinks(t,"?","tag"),e.status=t.status,e},n.prototype._parseTagStatistic=function(t){return new Tn(t)},n.prototype.list=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.requestListWithPages(f(this.baseRoute,t,"/tags"),e)]}))}))},n.prototype.get=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e)).then((function(t){return new Dn(t.body)}))},n.prototype.update=function(t,e,n){return this.request.put(f(this.baseRoute,t,"/tags",e),{description:n}).then((function(t){return t.body}))},n.prototype.destroy=function(t,e){return this.request.delete("".concat(this.baseRoute).concat(t,"/tags/").concat(e)).then((function(t){return{message:t.body.message,status:t.status}}))},n.prototype.statistic=function(t,e,n){var r=this;return this.request.get(f(this.baseRoute,t,"/tags",e,"stats"),n).then((function(t){return r._parseTagStatistic(t)}))},n.prototype.countries=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e,"stats/aggregates/countries")).then((function(t){return t.body}))},n.prototype.providers=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e,"stats/aggregates/providers")).then((function(t){return t.body}))},n.prototype.devices=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e,"stats/aggregates/devices")).then((function(t){return t.body}))},n}(en),An=function(t){function s(e,n,r,o){void 0===o&&(o=console);var s=t.call(this,e)||this;return s.request=e,s.attributes=n,s.filters=r,s.logger=o,s}return e(s,t),s.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date: "'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toISOString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),e.toISOString()},s.prototype.prepareQueryData=function(t){var e=this,r=t,o=Object.keys(r).reduce((function(n,o){var s=o;if(r[s]&&"object"==typeof r[s]){var i=t[s];n[s]=e.convertDateToUTC(s,i)}return n}),{});return n(n({},t),o)},s.prototype.prepareResult=function(t){var e=this.prepareSeedList(t.body);return n(n({},e),{status:t.status})},s.prototype.prepareSeedList=function(t){var e,r={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at),last_result_at:new Date(t.last_result_at)};e=t.Seeds?t.Seeds.map((function(t){var e={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at),max_email_count_hit_at:new Date(t.max_email_count_hit_at),last_sent_to_at:new Date(t.last_sent_to_at),last_delivered_at:new Date(t.last_delivered_at)};return n(n({},t),e)})):null;var o=n(n(n({},t),{Seeds:e}),r);return delete o.Id,o},s.prototype.parseList=function(t){var e,n=this,r={items:[]};return r.items=null===(e=t.body.items)||void 0===e?void 0:e.map((function(t){return n.prepareSeedList(t)})),r.pages=this.parsePageLinks(t,"?","address"),r.status=t.status,r},s.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return e=this.prepareQueryData(t),[4,this.request.get("/v4/inbox/seedlists",e)];case 1:return r=o.sent(),[2,n(n({},this.parseList(r)),{status:200})]}}))}))},s.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return[4,this.request.get("/v4/inbox/seedlists/".concat(t))];case 1:return e=o.sent(),r=this.prepareSeedList(e.body.seedlist),[2,n(n({},r),{status:e.status})]}}))}))},s.prototype.create=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.request.postWithFD("/v4/inbox/seedlists",t)];case 1:return e=n.sent(),[2,this.prepareResult(e)]}}))}))},s.prototype.update=function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.put("/v4/inbox/seedlists/".concat(t),e)];case 1:return n=r.sent(),[2,this.prepareResult(n)]}}))}))},s.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.request.delete("/v4/inbox/seedlists/".concat(t))]}))}))},s}(en),kn=function(){function t(t,e,n,r){this.request=t,this.seedsLists=e,this.seedsLists=e,this.results=n,this.providers=r}return t.prototype.runTest=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.post("/v4/inbox/tests",t)];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t}(),xn=function(t){function s(e,n,r,o,s){void 0===s&&(s=console);var i=t.call(this,e)||this;return i.request=e,i.attributes=n,i.filters=r,i.sharing=o,i.logger=s,i}return e(s,t),s.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date: "'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toISOString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),e.toISOString()},s.prototype.prepareQueryData=function(t){var e=this,r=t,o=Object.keys(r).reduce((function(n,o){var s=o;if(r[s]&&"object"==typeof r[s]){var i=t[s];n[s]=e.convertDateToUTC(s,i)}return n}),{});return n(n({},t),o)},s.prototype.prepareInboxPlacementsResult=function(t){var e={},r={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at),sharing_expires_at:new Date(t.sharing_expires_at)};t.Box&&delete(e=n(n({},t.Box),{created_at:new Date(t.Box.created_at),updated_at:new Date(t.Box.updated_at),last_result_at:new Date(t.Box.last_result_at)})).ID;var o=n(n(n(n({},t),{Box:e}),r),{id:t.Id});return delete o.ID,o},s.prototype.parseList=function(t){var e=this,n={};return n.items=t.body.items.map((function(t){return e.prepareInboxPlacementsResult(t)})),n.pages=this.parsePageLinks(t,"?","address"),n.status=t.status,n},s.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return e=this.prepareQueryData(t),[4,this.request.get("/v4/inbox/results",n({},e))];case 1:return r=o.sent(),[2,this.parseList(r)]}}))}))},s.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.get("/v4/inbox/results/".concat(t))];case 1:return e=r.sent(),n=this.prepareInboxPlacementsResult(e.body.result),[2,{status:e.status,inboxPlacementResult:n}]}}))}))},s.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.delete("/v4/inbox/results/".concat(t))];case 1:return e=r.sent(),[2,n({status:e.status},e.body)]}}))}))},s.prototype.getResultByShareId=function(t){return r(this,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.get("/v4/inbox/sharing/public/".concat(t))];case 1:return e=r.sent(),n=this.prepareInboxPlacementsResult(e.body.result),[2,{status:e.status,inboxPlacementResult:n}]}}))}))},s}(en),Fn=function(){function t(t,e){this.path=e,this.request=t}return t.prototype.list=function(){return r(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.request.get(this.path)];case 1:return[2,{items:(t=e.sent()).body.items,status:t.status}]}}))}))},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.get("".concat(this.path,"/").concat(t))];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t}(),Cn=function(){function t(t,e){this.request=t,this.path=e}return t.prototype.list=function(){return r(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.request.get(this.path)];case 1:return[2,{status:(t=e.sent()).status,supported_filters:t.body.supported_filters}]}}))}))},t}(),Pn=function(){function t(t){this.request=t}return t.prototype.prepareInboxPlacementsResultSharing=function(t){var e={expires_at:new Date(t.expires_at)};return n(n({},t),e)},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return[4,this.request.get("/v4/inbox/sharing/".concat(t))];case 1:return e=o.sent(),r=this.prepareInboxPlacementsResultSharing(e.body.sharing),[2,n({status:e.status},r)]}}))}))},t.prototype.update=function(t,e){return r(this,void 0,void 0,(function(){var r,s,i;return o(this,(function(o){switch(o.label){case 0:return r={query:"enabled=".concat(e.enabled)},[4,this.request.put("/v4/inbox/sharing/".concat(t),{},r)];case 1:return s=o.sent(),i=this.prepareInboxPlacementsResultSharing(s.body.sharing),[2,n(n({},i),{status:s.status})]}}))}))},t}(),Ln=function(){function t(t){this.path="/v4/inbox/providers",this.request=t}return t.prototype.parseList=function(t){var e={};return e.items=t.body.items.map((function(t){var e={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at)};return n(n({},t),e)})),e.status=t.status,e},t.prototype.list=function(){return r(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.request.get(this.path)];case 1:return t=e.sent(),[2,this.parseList(t)]}}))}))},t}(),Un=function(){function t(t,e){void 0===e&&(e=console),this.request=t,this.logger=e}return t.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date:"'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toUTCString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),e.toUTCString()},t.prototype.prepareQuery=function(t){var e,r;if(t){var o=null==t?void 0:t.start,s=null==t?void 0:t.end;e=o instanceof Date?this.convertDateToUTC("start",o):null!=o?o:"",r=s&&s instanceof Date?this.convertDateToUTC("end",s):null!=s?s:""}return n(n({},t),{start:e,end:r})},t.prototype.handleResponse=function(t){var e=t.body,r=Date.parse(e.start)?new Date(e.start):null,o=Date.parse(e.end)?new Date(e.end):null;return n(n({},e),{status:t.status,start:r,end:o})},t.prototype.getAccount=function(t){return r(this,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return e=this.prepareQuery(t),[4,this.request.post("/v1/analytics/metrics",e)];case 1:return n=r.sent(),[2,this.handleResponse(n)]}}))}))},t.prototype.getAccountUsage=function(t){return r(this,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return e=this.prepareQuery(t),[4,this.request.post("/v1/analytics/usage/metrics",e)];case 1:return n=r.sent(),[2,this.handleResponse(n)]}}))}))},t}(),Bn=function(){function t(t){this.request=t}return t.prototype._parseTrackingSettings=function(t){return t.body.tracking},t.prototype._parseTrackingUpdate=function(t){return t.body},t.prototype._isOpenTrackingInfoWitPlace=function(t){return"object"==typeof t&&"place_at_the_top"in t},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.get("/v2/x509/".concat(t,"/status"))];case 1:return e=r.sent(),[2,n(n({},e.body),{responseStatusCode:e.status})]}}))}))},t.prototype.generate=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.post("/v2/x509/".concat(t))];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t.prototype.regenerate=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.request.put("/v2/x509/".concat(t))];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t.prototype.getTracking=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.request.get(f("/v3/domains",t,"tracking"))];case 1:return e=n.sent(),[2,this._parseTrackingSettings(e)]}}))}))},t.prototype.updateTracking=function(t,e,s){return r(this,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return r=n({},s),"boolean"==typeof(null==s?void 0:s.active)&&(r.active=(null==s?void 0:s.active)?"yes":"no"),this._isOpenTrackingInfoWitPlace(s)&&"boolean"==typeof(null==s?void 0:s.place_at_the_top)&&(r.place_at_the_top=(null==s?void 0:s.place_at_the_top)?"yes":"no"),[4,this.request.putWithFD(f("/v3/domains",t,"tracking",e),r)];case 1:return i=o.sent(),[2,this._parseTrackingUpdate(i)]}}))}))},t}(),jn=function(){function t(t,e){var r=n({},t);if(r.url||(r.url="https://api.mailgun.net"),!r.username)throw new Error('Parameter "username" is required');if(!r.key)throw new Error('Parameter "key" is required');if(r.useFetch&&r.proxy)throw new Error("Proxy can not be used with fetch provider");this.request=new Ye(r,e);var o=new wn(this.request),s=new Rn(this.request),i=new En(this.request),a=new On(this.request),u=new Bn(this.request),c=new _n(this.request),l=new Pn(this.request),p=new Fn(this.request,"/v4/inbox/seedlists/a"),d=new Fn(this.request,"/v4/inbox/results/a"),h=new Cn(this.request,"/v4/inbox/seedlists/_filters"),f=new Cn(this.request,"/v4/inbox/results/_filters"),y=new An(this.request,p,h),m=new xn(this.request,d,f,l),b=new Ln(this.request);this.domains=new tn(this.request,s,i,a,u),this.webhooks=new hn(this.request),this.events=new nn(this.request),this.stats=new on(this.request),this.metrics=new Un(this.request),this.suppressions=new pn(this.request),this.messages=new fn(this.request),this.routes=new yn(this.request),this.ips=new bn(this.request),this.ip_pools=new gn(this.request),this.lists=new vn(this.request,o),this.validate=new mn(this.request,c),this.subaccounts=new Xe(this.request),this.inboxPlacements=new kn(this.request,y,m,b)}return t.prototype.setSubaccount=function(t){var e;null===(e=this.request)||void 0===e||e.setSubaccountHeader(t)},t.prototype.resetSubaccount=function(){var t;null===(t=this.request)||void 0===t||t.resetSubaccountHeader()},t}();return function(){function t(t){this.formData=t}return Object.defineProperty(t,"default",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.client=function(t){return new jn(t,this.formData)},t}()}));
|
|
1
|
+
define((function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},n.apply(this,arguments)};function r(t,e,n,r){return new(n||(n=Promise))((function(s,o){function i(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}u((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(s=2&a[0]?r.return:a[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;switch(r=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function o(t,e,n){if(n||2===arguments.length)for(var r,s=0,o=e.length;s<o;s++)!r&&s in e||(r||(r=Array.prototype.slice.call(e,0,s)),r[s]=e[s]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,c={exports:{}};var l,d,p,h=(u||(u=1,d=c.exports,p=function(){return function(){return function(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<t.length;r++){var s=t[r];if("string"!=typeof s)throw new TypeError("Url must be a string. Received "+s);""!==s&&(r>0&&(s=s.replace(/^[\/]+/,"")),s=r<t.length-1?s.replace(/[\/]+$/,""):s.replace(/[\/]+$/,"/"),e.push(s))}var o=e.join("/"),i=(o=o.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i.shift()+(i.length>0?"?":"")+i.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},(l=c).exports?l.exports=p():d.urljoin=p()),c.exports),f=a(h),y=function(t){function n(e){var n=e.status,r=e.statusText,s=e.message,o=e.body,i=void 0===o?{}:o,a=this,u="",c="";return"string"==typeof i?u=i:(u=(null==i?void 0:i.message)||"",c=(null==i?void 0:i.error)||""),(a=t.call(this)||this).stack="",a.status=n,a.message=s||c||r||"",a.details=u,a.type="MailgunAPIError",a}return e(n,t),n.isApiError=function(t){return"object"==typeof t&&"MailgunAPIError"===(null==t?void 0:t.type)},n.getUserDataError=function(t,e){return new this({status:400,statusText:t,body:{message:e}})},n}(Error),m=function(){function t(t,e){this._stream=t,this.size=e}return t.prototype.stream=function(){return this._stream},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return"Blob"},enumerable:!1,configurable:!0}),t}(),b=function(){function t(){}return t.prototype.getAttachmentOptions=function(t){var e=t.filename,r=t.contentType,s=t.knownLength;return n(n(n({},e?{filename:e}:{filename:"file"}),r&&{contentType:r}),s&&{knownLength:s})},t.prototype.getFileInfo=function(t){var e=t.name,n=t.type,r=t.size;return this.getAttachmentOptions({filename:e,contentType:n,knownLength:r})},t.prototype.getCustomFileInfo=function(t){var e=t.filename,n=t.contentType,r=t.knownLength;return this.getAttachmentOptions({filename:e,contentType:n,knownLength:r})},t.prototype.getBufferInfo=function(t){var e=t.byteLength;return this.getAttachmentOptions({filename:"file",contentType:"",knownLength:e})},t.prototype.isStream=function(t){return"object"==typeof t&&"function"==typeof t.pipe},t.prototype.isCustomFile=function(t){return"object"==typeof t&&!!t.data},t.prototype.isBrowserFile=function(t){return"object"==typeof t&&(!!t.name||"undefined"!=typeof Blob&&t instanceof Blob)},t.prototype.isBuffer=function(t){return"undefined"!=typeof Buffer&&Buffer.isBuffer(t)},t.prototype.getAttachmentInfo=function(t){var e=this.isBrowserFile(t),n=this.isCustomFile(t);if(!("string"==typeof t)){if(e)return this.getFileInfo(t);if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return this.getBufferInfo(t);if(n)return this.getCustomFileInfo(t)}return{filename:"file",contentType:void 0,knownLength:void 0}},t.prototype.convertToFDexpectedShape=function(t){var e,n=this.isStream(t),r=this.isBrowserFile(t),s=this.isCustomFile(t);if(n||"string"==typeof t||r||this.isBuffer(t))e=t;else{if(!s)throw y.getUserDataError("Unknown attachment type ".concat(typeof t),'The "attachment" property expects either Buffer, Blob, or String.\n Also, It is possible to provide an object that has the property "data" with a value that is equal to one of the types counted before.\n Additionally, you may use an array to send more than one attachment.');e=t.data}return e},t.prototype.getBlobFromStream=function(t,e){return new m(t,e)},t}(),v=function(){function t(t,e){this.FormDataConstructor=t,this.fileKeys=["attachment","inline","multipleValidationFile"],this.attachmentsHandler=new b,this.useFetch=null==e?void 0:e.useFetch}return t.prototype.createFormData=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,i,a=this;return s(this,(function(s){switch(s.label){case 0:if(!t)throw new Error("Please provide data object");if(e=new this.FormDataConstructor,(n=this.isFormDataPackage(e))&&this.useFetch)throw y.getUserDataError('"form-data" npm package detected, and it can not be used together with "fetch" client',"fetch client does not recognize object created by form-data package as valid FormData instance");return r=Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){if(a.fileKeys.includes(n)){var r=t[n];if(a.isMessageAttachment(r))return a.addFilesToFD(n,r,e),e;throw y.getUserDataError("Unknown value ".concat(t[n]," with type ").concat(typeof t[n],' for property "').concat(n,'"'),'The key "'.concat(n,'" should have type of Buffer, Stream, File, or String '))}if("message"===n){var s=t[n];if(!s||!a.isMIME(s))throw y.getUserDataError('Unknown data type for "'.concat(n,'" property'),"The mime data should have type of Buffer, String or Blob");return a.addMimeDataToFD(n,s,e),e}return a.addCommonPropertyToFD(n,t[n],e),e}),e),o={formData:r,dataSize:0},!this.useFetch||n?[3,2]:(Object.defineProperty(r,"getHeaders",{value:function(){return{"Content-Type":void 0}}}),void 0===Response?[3,2]:[4,new Response(r).blob()]);case 1:i=s.sent(),o.dataSize=i.size,s.label=2;case 2:return[2,o]}}))}))},t.prototype.addMimeDataToFD=function(t,e,n){if("string"!=typeof e){if(this.isFormDataPackage(n))n.append(t,e,{filename:"MimeMessage"});else if(void 0!==typeof Blob){var r=n;if(e instanceof Blob)return void r.append(t,e,"MimeMessage");if(this.attachmentsHandler.isBuffer(e)){var s=new Blob([e]);r.append(t,s,"MimeMessage")}}}else n.append(t,e)},t.prototype.isMIME=function(t){return"string"==typeof t||"undefined"!=typeof Blob&&t instanceof Blob||this.attachmentsHandler.isBuffer(t)||"undefined"!=typeof ReadableStream&&t instanceof ReadableStream},t.prototype.isFormDataPackage=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getHeaders},t.prototype.isMessageAttachment=function(t){var e=this;return this.attachmentsHandler.isCustomFile(t)||"string"==typeof t||"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||this.attachmentsHandler.isBuffer(t)||this.attachmentsHandler.isStream(t)||Array.isArray(t)&&t.every((function(n){return e.attachmentsHandler.isCustomFile(n)||"undefined"!=typeof File&&n instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||e.attachmentsHandler.isBuffer(n)||e.attachmentsHandler.isStream(n)}))},t.prototype.addFilesToFD=function(t,e,n){var r=this,s=function(t,e,s){var o="multipleValidationFile"===t?"file":t,i=r.attachmentsHandler.convertToFDexpectedShape(e),a=r.attachmentsHandler.getAttachmentInfo(e);if(r.isFormDataPackage(s)){var u=s,c="string"==typeof i?Buffer.from(i):i;u.append(o,c,a)}else if(void 0!==typeof Blob){var l=n;if("string"==typeof i||r.attachmentsHandler.isBuffer(i)){var d=new Blob([i]);return void l.append(o,d,a.filename)}if(i instanceof Blob)return void l.append(o,i,a.filename);if(r.attachmentsHandler.isStream(i)){var p=r.attachmentsHandler.getBlobFromStream(i,a.knownLength);l.set(o,p,a.filename)}}};Array.isArray(e)?e.forEach((function(e){s(t,e,n)})):s(t,e,n)},t.prototype.addCommonPropertyToFD=function(t,e,n){var r=this,s=function(t,e){if(r.isFormDataPackage(n))return"object"==typeof e?(console.warn('The received value is an object. \n"JSON.Stringify" will be used to avoid TypeError \nTo remove this warning: \nConsider switching to built-in FormData or converting the value on your own.\n'),n.append(t,JSON.stringify(e))):n.append(t,e);if("string"==typeof e)return n.append(t,e);if(void 0!==typeof Blob&&e instanceof Blob)return n.append(t,e);throw y.getUserDataError("Unknown value type for Form Data. String or Blob expected","Browser compliant FormData allows only string or Blob values for properties that are not attachments.")};Array.isArray(e)?e.forEach((function(e){s(t,e)})):null!=e&&s(t,e)},t}();function g(t,e){return function(){return t.apply(e,arguments)}}const{toString:w}=Object.prototype,{getPrototypeOf:R}=Object,{iterator:_,toStringTag:S}=Symbol,q=(D=Object.create(null),t=>{const e=w.call(t);return D[e]||(D[e]=e.slice(8,-1).toLowerCase())});var D;const E=t=>(t=t.toLowerCase(),e=>q(e)===t),T=t=>e=>typeof e===t,{isArray:O}=Array,A=T("undefined");function k(t){return null!==t&&!A(t)&&null!==t.constructor&&!A(t.constructor)&&P(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const x=E("ArrayBuffer");const F=T("string"),P=T("function"),C=T("number"),L=t=>null!==t&&"object"==typeof t,U=t=>{if("object"!==q(t))return!1;const e=R(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||S in t||_ in t)},B=E("Date"),j=E("File"),N=E("Blob"),I=E("FileList"),M=E("URLSearchParams"),[W,H,z,V]=["ReadableStream","Request","Response","Headers"].map(E);function K(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,s;if("object"!=typeof t&&(t=[t]),O(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(k(t))return;const s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let i;for(r=0;r<o;r++)i=s[r],e.call(null,t[i],i,t)}}function J(t,e){if(k(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,s=n.length;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Q=t=>!A(t)&&t!==$;const X=(G="undefined"!=typeof Uint8Array&&R(Uint8Array),t=>G&&t instanceof G);var G;const Y=E("HTMLFormElement"),Z=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),tt=E("RegExp"),et=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};K(n,((n,s)=>{let o;!1!==(o=e(n,s,t))&&(r[s]=o||n)})),Object.defineProperties(t,r)};const nt=E("AsyncFunction"),rt=(st="function"==typeof setImmediate,ot=P($.postMessage),st?setImmediate:ot?(it=`axios@${Math.random()}`,at=[],$.addEventListener("message",(({source:t,data:e})=>{t===$&&e===it&&at.length&&at.shift()()}),!1),t=>{at.push(t),$.postMessage(it,"*")}):t=>setTimeout(t));var st,ot,it,at;const ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind($):"undefined"!=typeof process&&process.nextTick||rt;var ct={isArray:O,isArrayBuffer:x,isBuffer:k,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||P(t.append)&&("formdata"===(e=q(t))||"object"===e&&P(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&x(t.buffer),e},isString:F,isNumber:C,isBoolean:t=>!0===t||!1===t,isObject:L,isPlainObject:U,isEmptyObject:t=>{if(!L(t)||k(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:W,isRequest:H,isResponse:z,isHeaders:V,isUndefined:A,isDate:B,isFile:j,isBlob:N,isRegExp:tt,isFunction:P,isStream:t=>L(t)&&P(t.pipe),isURLSearchParams:M,isTypedArray:X,isFileList:I,forEach:K,merge:function t(){const{caseless:e,skipUndefined:n}=Q(this)&&this||{},r={},s=(s,o)=>{const i=e&&J(r,o)||o;U(r[i])&&U(s)?r[i]=t(r[i],s):U(s)?r[i]=t({},s):O(s)?r[i]=s.slice():n&&A(s)||(r[i]=s)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&K(arguments[t],s);return r},extend:(t,e,n,{allOwnKeys:r}={})=>(K(e,((e,r)=>{n&&P(e)?t[r]=g(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let s,o,i;const a={};if(e=e||{},null==t)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)i=s[o],r&&!r(i,t,e)||a[i]||(e[i]=t[i],a[i]=!0);t=!1!==n&&R(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:q,kindOfTest:E,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(O(t))return t;let e=t.length;if(!C(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[_]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:Y,hasOwnProperty:Z,hasOwnProp:Z,reduceDescriptors:et,freezeMethods:t=>{et(t,((e,n)=>{if(P(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];P(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return O(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:J,global:$,isContextDefined:Q,isSpecCompliantForm:function(t){return!!(t&&P(t.append)&&"FormData"===t[S]&&t[_])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(L(t)){if(e.indexOf(t)>=0)return;if(k(t))return t;if(!("toJSON"in t)){e[r]=t;const s=O(t)?[]:{};return K(t,((t,e)=>{const o=n(t,r+1);!A(o)&&(s[e]=o)})),e[r]=void 0,s}}return t};return n(t,0)},isAsyncFn:nt,isThenable:t=>t&&(L(t)||P(t))&&P(t.then)&&P(t.catch),setImmediate:rt,asap:ut,isIterable:t=>null!=t&&P(t[_])};function lt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ct.inherits(lt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ct.toJSONObject(this.config),code:this.code,status:this.status}}});const dt=lt.prototype,pt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{pt[t]={value:t}})),Object.defineProperties(lt,pt),Object.defineProperty(dt,"isAxiosError",{value:!0}),lt.from=(t,e,n,r,s,o)=>{const i=Object.create(dt);ct.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t));const a=t&&t.message?t.message:"Error",u=null==e&&t?t.code:e;return lt.call(i,a,u,n,r,s),t&&null==i.cause&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",o&&Object.assign(i,o),i};function ht(t){return ct.isPlainObject(t)||ct.isArray(t)}function ft(t){return ct.endsWith(t,"[]")?t.slice(0,-2):t}function yt(t,e,n){return t?t.concat(e).map((function(t,e){return t=ft(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const mt=ct.toFlatObject(ct,{},null,(function(t){return/^is[A-Z]/.test(t)}));function bt(t,e,n){if(!ct.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=ct.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!ct.isUndefined(e[t])}))).metaTokens,s=n.visitor||c,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ct.isSpecCompliantForm(e);if(!ct.isFunction(s))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(ct.isDate(t))return t.toISOString();if(ct.isBoolean(t))return t.toString();if(!a&&ct.isBlob(t))throw new lt("Blob is not supported. Use a Buffer instead.");return ct.isArrayBuffer(t)||ct.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,s){let a=t;if(t&&!s&&"object"==typeof t)if(ct.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(ct.isArray(t)&&function(t){return ct.isArray(t)&&!t.some(ht)}(t)||(ct.isFileList(t)||ct.endsWith(n,"[]"))&&(a=ct.toArray(t)))return n=ft(n),a.forEach((function(t,r){!ct.isUndefined(t)&&null!==t&&e.append(!0===i?yt([n],r,o):null===i?n:n+"[]",u(t))})),!1;return!!ht(t)||(e.append(yt(s,n,o),u(t)),!1)}const l=[],d=Object.assign(mt,{defaultVisitor:c,convertValue:u,isVisitable:ht});if(!ct.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!ct.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),ct.forEach(n,(function(n,o){!0===(!(ct.isUndefined(n)||null===n)&&s.call(e,n,ct.isString(o)?o.trim():o,r,d))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function vt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function gt(t,e){this._pairs=[],t&&bt(t,this,e)}const wt=gt.prototype;function Rt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _t(t,e,n){if(!e)return t;const r=n&&n.encode||Rt;ct.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(o=s?s(e,n):ct.isURLSearchParams(e)?e.toString():new gt(e,n).toString(r),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}wt.append=function(t,e){this._pairs.push([t,e])},wt.toString=function(t){const e=t?function(e){return t.call(this,e,vt)}:vt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};class St{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ct.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}var qt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:gt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Et="undefined"!=typeof window&&"undefined"!=typeof document,Tt="object"==typeof navigator&&navigator||void 0,Ot=Et&&(!Tt||["ReactNative","NativeScript","NS"].indexOf(Tt.product)<0),At="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,kt=Et&&window.location.href||"http://localhost";var xt={...Object.freeze({__proto__:null,hasBrowserEnv:Et,hasStandardBrowserEnv:Ot,hasStandardBrowserWebWorkerEnv:At,navigator:Tt,origin:kt}),...Dt};function Ft(t){function e(t,n,r,s){let o=t[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=t.length;if(o=!o&&ct.isArray(r)?r.length:o,a)return ct.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&ct.isObject(r[o])||(r[o]=[]);return e(t,n,r[o],s)&&ct.isArray(r[o])&&(r[o]=function(t){const e={},n=Object.keys(t);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],e[o]=t[o];return e}(r[o])),!i}if(ct.isFormData(t)&&ct.isFunction(t.entries)){const n={};return ct.forEachEntry(t,((t,r)=>{e(function(t){return ct.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const Pt={transitional:qt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,s=ct.isObject(t);s&&ct.isHTMLForm(t)&&(t=new FormData(t));if(ct.isFormData(t))return r?JSON.stringify(Ft(t)):t;if(ct.isArrayBuffer(t)||ct.isBuffer(t)||ct.isStream(t)||ct.isFile(t)||ct.isBlob(t)||ct.isReadableStream(t))return t;if(ct.isArrayBufferView(t))return t.buffer;if(ct.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return bt(t,new xt.classes.URLSearchParams,{visitor:function(t,e,n,r){return xt.isNode&&ct.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((o=ct.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return bt(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return s||r?(e.setContentType("application/json",!1),function(t,e,n){if(ct.isString(t))try{return(e||JSON.parse)(t),ct.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Pt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(ct.isResponse(t)||ct.isReadableStream(t))return t;if(t&&ct.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(t){if(n){if("SyntaxError"===t.name)throw lt.from(t,lt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xt.classes.FormData,Blob:xt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ct.forEach(["delete","get","head","post","put","patch"],(t=>{Pt.headers[t]={}}));const Ct=ct.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Lt=Symbol("internals");function Ut(t){return t&&String(t).trim().toLowerCase()}function Bt(t){return!1===t||null==t?t:ct.isArray(t)?t.map(Bt):String(t)}function jt(t,e,n,r,s){return ct.isFunction(r)?r.call(this,e,n):(s&&(e=n),ct.isString(e)?ct.isString(r)?-1!==e.indexOf(r):ct.isRegExp(r)?r.test(e):void 0:void 0)}let Nt=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function s(t,e,n){const s=Ut(e);if(!s)throw new Error("header name must be a non-empty string");const o=ct.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=Bt(t))}const o=(t,e)=>ct.forEach(t,((t,n)=>s(t,n,e)));if(ct.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(ct.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o((t=>{const e={};let n,r,s;return t&&t.split("\n").forEach((function(t){s=t.indexOf(":"),n=t.substring(0,s).trim().toLowerCase(),r=t.substring(s+1).trim(),!n||e[n]&&Ct[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(ct.isObject(t)&&ct.isIterable(t)){let n,r,s={};for(const e of t){if(!ct.isArray(e))throw TypeError("Object iterator must return a key-value pair");s[r=e[0]]=(n=s[r])?ct.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}o(s,e)}else null!=t&&s(e,t,n);return this}get(t,e){if(t=Ut(t)){const n=ct.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(ct.isFunction(e))return e.call(this,t,n);if(ct.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Ut(t)){const n=ct.findKey(this,t);return!(!n||void 0===this[n]||e&&!jt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function s(t){if(t=Ut(t)){const s=ct.findKey(n,t);!s||e&&!jt(0,n[s],s,e)||(delete n[s],r=!0)}}return ct.isArray(t)?t.forEach(s):s(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const s=e[n];t&&!jt(0,this[s],s,t,!0)||(delete this[s],r=!0)}return r}normalize(t){const e=this,n={};return ct.forEach(this,((r,s)=>{const o=ct.findKey(n,s);if(o)return e[o]=Bt(r),void delete e[s];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(s):String(s).trim();i!==s&&delete e[s],e[i]=Bt(r),n[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return ct.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&ct.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[Lt]=this[Lt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Ut(t);e[r]||(!function(t,e){const n=ct.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,s){return this[r].call(this,e,t,n,s)},configurable:!0})}))}(n,t),e[r]=!0)}return ct.isArray(t)?t.forEach(r):r(t),this}};function It(t,e){const n=this||Pt,r=e||n,s=Nt.from(r.headers);let o=r.data;return ct.forEach(t,(function(t){o=t.call(n,o,s.normalize(),e?e.status:void 0)})),s.normalize(),o}function Mt(t){return!(!t||!t.__CANCEL__)}function Wt(t,e,n){lt.call(this,null==t?"canceled":t,lt.ERR_CANCELED,e,n),this.name="CanceledError"}function Ht(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new lt("Request failed with status code "+n.status,[lt.ERR_BAD_REQUEST,lt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ct.reduceDescriptors(Nt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),ct.freezeMethods(Nt),ct.inherits(Wt,lt,{__CANCEL__:!0});const zt=(t,e,n=3)=>{let r=0;const s=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s,o=0,i=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=r[i];s||(s=u),n[o]=a,r[o]=u;let l=i,d=0;for(;l!==o;)d+=n[l++],l%=t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s<e)return;const p=c&&u-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(t,e){let n,r,s=0,o=1e3/e;const i=(e,o=Date.now())=>{s=o,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-s;a>=o?i(t,e):(n=t,r||(r=setTimeout((()=>{r=null,i(n)}),o-a)))},()=>n&&i(n)]}((n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,a=o-r,u=s(a);r=o;t({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:u||void 0,estimated:u&&i&&o<=i?(i-o)/u:void 0,event:n,lengthComputable:null!=i,[e?"download":"upload"]:!0})}),n)},Vt=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Kt=t=>(...e)=>ct.asap((()=>t(...e)));var Jt=xt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,xt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(xt.origin),xt.navigator&&/(msie|trident)/i.test(xt.navigator.userAgent)):()=>!0,$t=xt.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const i=[t+"="+encodeURIComponent(e)];ct.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),ct.isString(r)&&i.push("path="+r),ct.isString(s)&&i.push("domain="+s),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Qt(t,e,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Xt=t=>t instanceof Nt?{...t}:t;function Gt(t,e){e=e||{};const n={};function r(t,e,n,r){return ct.isPlainObject(t)&&ct.isPlainObject(e)?ct.merge.call({caseless:r},t,e):ct.isPlainObject(e)?ct.merge({},e):ct.isArray(e)?e.slice():e}function s(t,e,n,s){return ct.isUndefined(e)?ct.isUndefined(t)?void 0:r(void 0,t,0,s):r(t,e,0,s)}function o(t,e){if(!ct.isUndefined(e))return r(void 0,e)}function i(t,e){return ct.isUndefined(e)?ct.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,s,o){return o in e?r(n,s):o in t?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e,n)=>s(Xt(t),Xt(e),0,!0)};return ct.forEach(Object.keys({...t,...e}),(function(r){const o=u[r]||s,i=o(t[r],e[r],r);ct.isUndefined(i)&&o!==a||(n[r]=i)})),n}var Yt=t=>{const e=Gt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=e;if(e.headers=i=Nt.from(i),e.url=_t(Qt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ct.isFormData(n))if(xt.hasStandardBrowserEnv||xt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(ct.isFunction(n.getHeaders)){const t=n.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach((([t,n])=>{e.includes(t.toLowerCase())&&i.set(t,n)}))}if(xt.hasStandardBrowserEnv&&(r&&ct.isFunction(r)&&(r=r(e)),r||!1!==r&&Jt(e.url))){const t=s&&o&&$t.read(o);t&&i.set(s,t)}return e};var Zt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=Yt(t);let s=r.data;const o=Nt.from(r.headers).normalize();let i,a,u,c,l,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let y=new XMLHttpRequest;function m(){if(!y)return;const r=Nt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Ht((function(t){e(t),f()}),(function(t){n(t),f()}),{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:t,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(n(new lt("Request aborted",lt.ECONNABORTED,t,y)),y=null)},y.onerror=function(e){const r=new lt(e&&e.message?e.message:"Network Error",lt.ERR_NETWORK,t,y);r.event=e||null,n(r),y=null},y.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||qt;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new lt(e,s.clarifyTimeoutError?lt.ETIMEDOUT:lt.ECONNABORTED,t,y)),y=null},void 0===s&&o.setContentType(null),"setRequestHeader"in y&&ct.forEach(o.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),ct.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),h&&([u,l]=zt(h,!0),y.addEventListener("progress",u)),p&&y.upload&&([a,c]=zt(p),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(i=e=>{y&&(n(!e||e.type?new Wt(null,t,y):e),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);b&&-1===xt.protocols.indexOf(b)?n(new lt("Unsupported protocol "+b+":",lt.ERR_BAD_REQUEST,t)):y.send(s||null)}))};const te=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const s=function(t){if(!n){n=!0,i();const e=t instanceof Error?t:this.reason;r.abort(e instanceof lt?e:new Wt(e instanceof Error?e.message:e))}};let o=e&&setTimeout((()=>{o=null,s(new lt(`timeout ${e} of ms exceeded`,lt.ETIMEDOUT))}),e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(s):t.removeEventListener("abort",s)})),t=null)};t.forEach((t=>t.addEventListener("abort",s)));const{signal:a}=r;return a.unsubscribe=()=>ct.asap(i),a}},ee=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,s=0;for(;s<n;)r=s+e,yield t.slice(s,r),s=r},ne=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},re=(t,e,n,r)=>{const s=async function*(t,e){for await(const n of ne(t))yield*ee(n,e)}(t,e);let o,i=0,a=t=>{o||(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await s.next();if(e)return a(),void t.close();let o=r.byteLength;if(n){let t=i+=o;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:t=>(a(t),s.return())},{highWaterMark:2})},{isFunction:se}=ct,oe=(({fetch:t,Request:e,Response:n})=>({fetch:t,Request:e,Response:n}))(ct.global),{ReadableStream:ie,TextEncoder:ae}=ct.global,ue=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ce=t=>{const{fetch:e,Request:n,Response:r}=Object.assign({},oe,t),s=se(e),o=se(n),i=se(r);if(!s)return!1;const a=s&&se(ie),u=s&&("function"==typeof ae?(c=new ae,t=>c.encode(t)):async t=>new Uint8Array(await new n(t).arrayBuffer()));var c;const l=o&&a&&ue((()=>{let t=!1;const e=new n(xt.origin,{body:new ie,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),d=i&&a&&ue((()=>ct.isReadableStream(new r("").body))),p={stream:d&&(t=>t.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!p[t]&&(p[t]=(e,n)=>{let r=e&&e[t];if(r)return r.call(e);throw new lt(`Response type '${t}' is not supported`,lt.ERR_NOT_SUPPORT,n)})}));const h=async(t,e)=>{const r=ct.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(ct.isBlob(t))return t.size;if(ct.isSpecCompliantForm(t)){const e=new n(xt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return ct.isArrayBufferView(t)||ct.isArrayBuffer(t)?t.byteLength:(ct.isURLSearchParams(t)&&(t+=""),ct.isString(t)?(await u(t)).byteLength:void 0)})(e):r};return async t=>{let{url:s,method:i,data:a,signal:u,cancelToken:c,timeout:f,onDownloadProgress:y,onUploadProgress:m,responseType:b,headers:v,withCredentials:g="same-origin",fetchOptions:w}=Yt(t);b=b?(b+"").toLowerCase():"text";let R=te([u,c&&c.toAbortSignal()],f),_=null;const S=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let q;try{if(m&&l&&"get"!==i&&"head"!==i&&0!==(q=await h(v,a))){let t,e=new n(s,{method:"POST",body:a,duplex:"half"});if(ct.isFormData(a)&&(t=e.headers.get("content-type"))&&v.setContentType(t),e.body){const[t,n]=Vt(q,zt(Kt(m)));a=re(e.body,65536,t,n)}}ct.isString(g)||(g=g?"include":"omit");const u=o&&"credentials"in n.prototype,c={...w,signal:R,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:u?g:void 0};_=o&&new n(s,c);let f=await(o?e(_,w):e(s,c));const D=d&&("stream"===b||"response"===b);if(d&&(y||D&&S)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=f[e]}));const e=ct.toFiniteNumber(f.headers.get("content-length")),[n,s]=y&&Vt(e,zt(Kt(y),!0))||[];f=new r(re(f.body,65536,n,(()=>{s&&s(),S&&S()})),t)}b=b||"text";let E=await p[ct.findKey(p,b)||"text"](f,t);return!D&&S&&S(),await new Promise(((e,n)=>{Ht(e,n,{data:E,headers:Nt.from(f.headers),status:f.status,statusText:f.statusText,config:t,request:_})}))}catch(e){if(S&&S(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new lt("Network Error",lt.ERR_NETWORK,t,_),{cause:e.cause||e});throw lt.from(e,e&&e.code,t,_)}}},le=new Map,de=t=>{let e=ct.merge.call({skipUndefined:!0},oe,t?t.env:null);const{fetch:n,Request:r,Response:s}=e,o=[r,s,n];let i,a,u=o.length,c=le;for(;u--;)i=o[u],a=c.get(i),void 0===a&&c.set(i,a=u?new Map:ce(e)),c=a;return a};de();const pe={http:null,xhr:Zt,fetch:{get:de}};ct.forEach(pe,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const he=t=>`- ${t}`,fe=t=>ct.isFunction(t)||null===t||!1===t;var ye=(t,e)=>{t=ct.isArray(t)?t:[t];const{length:n}=t;let r,s;const o={};for(let i=0;i<n;i++){let n;if(r=t[i],s=r,!fe(r)&&(s=pe[(n=String(r)).toLowerCase()],void 0===s))throw new lt(`Unknown adapter '${n}'`);if(s&&(ct.isFunction(s)||(s=s.get(e))))break;o[n||"#"+i]=s}if(!s){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new lt("There is no suitable adapter to dispatch the request "+(n?t.length>1?"since :\n"+t.map(he).join("\n"):" "+he(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s};function me(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Wt(null,t)}function be(t){me(t),t.headers=Nt.from(t.headers),t.data=It.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return ye(t.adapter||Pt.adapter,t)(t).then((function(e){return me(t),e.data=It.call(t,t.transformResponse,e),e.headers=Nt.from(e.headers),e}),(function(e){return Mt(e)||(me(t),e&&e.response&&(e.response.data=It.call(t,t.transformResponse,e.response),e.response.headers=Nt.from(e.response.headers))),Promise.reject(e)}))}const ve="1.12.1",ge={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ge[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const we={};ge.transitional=function(t,e,n){function r(t,e){return"[Axios v"+ve+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,s,o)=>{if(!1===t)throw new lt(r(s," has been removed"+(e?" in "+e:"")),lt.ERR_DEPRECATED);return e&&!we[s]&&(we[s]=!0,console.warn(r(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,s,o)}},ge.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};var Re={assertOptions:function(t,e,n){if("object"!=typeof t)throw new lt("options must be an object",lt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],i=e[o];if(i){const e=t[o],n=void 0===e||i(e,o,t);if(!0!==n)throw new lt("option "+o+" must be "+n,lt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new lt("Unknown option "+o,lt.ERR_BAD_OPTION)}},validators:ge};const _e=Re.validators;let Se=class{constructor(t){this.defaults=t||{},this.interceptors={request:new St,response:new St}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Gt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:s}=e;void 0!==n&&Re.assertOptions(n,{silentJSONParsing:_e.transitional(_e.boolean),forcedJSONParsing:_e.transitional(_e.boolean),clarifyTimeoutError:_e.transitional(_e.boolean)},!1),null!=r&&(ct.isFunction(r)?e.paramsSerializer={serialize:r}:Re.assertOptions(r,{encode:_e.function,serialize:_e.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Re.assertOptions(e,{baseUrl:_e.spelling("baseURL"),withXsrfToken:_e.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=s&&ct.merge(s.common,s[e.method]);s&&ct.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete s[t]})),e.headers=Nt.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,d=0;if(!a){const t=[be.bind(this),void 0];for(t.unshift(...i),t.push(...u),l=t.length,c=Promise.resolve(e);d<l;)c=c.then(t[d++],t[d++]);return c}l=i.length;let p=e;for(d=0;d<l;){const t=i[d++],e=i[d++];try{p=t(p)}catch(t){e.call(this,t);break}}try{c=be.call(this,p)}catch(t){return Promise.reject(t)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(t){return _t(Qt((t=Gt(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};ct.forEach(["delete","get","head","options"],(function(t){Se.prototype[t]=function(e,n){return this.request(Gt(n||{},{method:t,url:e,data:(n||{}).data}))}})),ct.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,s){return this.request(Gt(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Se.prototype[t]=e(),Se.prototype[t+"Form"]=e(!0)}));const qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qe).forEach((([t,e])=>{qe[e]=t}));const De=function t(e){const n=new Se(e),r=g(Se.prototype.request,n);return ct.extend(r,Se.prototype,n,{allOwnKeys:!0}),ct.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Gt(e,n))},r}(Pt);De.Axios=Se,De.CanceledError=Wt,De.CancelToken=class t{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,s){n.reason||(n.reason=new Wt(t,r,s),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let e;return{token:new t((function(t){e=t})),cancel:e}}},De.isCancel=Mt,De.VERSION=ve,De.toFormData=bt,De.AxiosError=lt,De.Cancel=De.CanceledError,De.all=function(t){return Promise.all(t)},De.spread=function(t){return function(e){return t.apply(null,e)}},De.isAxiosError=function(t){return ct.isObject(t)&&!0===t.isAxiosError},De.mergeConfig=Gt,De.AxiosHeaders=Nt,De.formToJSON=t=>Ft(ct.isHTMLForm(t)?new FormData(t):t),De.getAdapter=ye,De.HttpStatusCode=qe,De.default=De;const{Axios:Ee,AxiosError:Te,CanceledError:Oe,isCancel:Ae,CancelToken:ke,VERSION:xe,all:Fe,Cancel:Pe,isAxiosError:Ce,spread:Le,toFormData:Ue,AxiosHeaders:Be,HttpStatusCode:je,formToJSON:Ne,getAdapter:Ie,mergeConfig:Me}=De;var We,He={exports:{}},ze=He.exports;
|
|
2
|
+
/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */var Ve,Ke,Je,$e,Qe=(We||(We=1,function(t,e){!function(n){var r=e,s=t&&t.exports==r&&t,o="object"==typeof i&&i;o.global!==o&&o.window!==o||(n=o);var a=function(t){this.message=t};(a.prototype=new Error).name="InvalidCharacterError";var u=function(t){throw new a(t)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=/[\t\n\f\r ]/g,d={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&u("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,s,o=t.length%3,i="",a=-1,l=t.length-o;++a<l;)e=t.charCodeAt(a)<<16,n=t.charCodeAt(++a)<<8,r=t.charCodeAt(++a),i+=c.charAt((s=e+n+r)>>18&63)+c.charAt(s>>12&63)+c.charAt(s>>6&63)+c.charAt(63&s);return 2==o?(e=t.charCodeAt(a)<<8,n=t.charCodeAt(++a),i+=c.charAt((s=e+n)>>10)+c.charAt(s>>4&63)+c.charAt(s<<2&63)+"="):1==o&&(s=t.charCodeAt(a),i+=c.charAt(s>>2)+c.charAt(s<<4&63)+"=="),i},decode:function(t){var e=(t=String(t).replace(l,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&u("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,s=0,o="",i=-1;++i<e;)r=c.indexOf(t.charAt(i)),n=s%4?64*n+r:r,s++%4&&(o+=String.fromCharCode(255&n>>(-2*s&6)));return o},version:"1.0.0"};if(r&&!r.nodeType)if(s)s.exports=d;else for(var p in d)d.hasOwnProperty(p)&&(r[p]=d[p]);else n.base64=d}(ze)}(He,He.exports)),He.exports),Xe=function(){function t(t){this.request=t}return t.prototype.convertToDate=function(t){return n(n({},t),{created_at:new Date(t.created_at),updated_at:new Date(t.updated_at)})},t.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v5/accounts/subaccounts",t)];case 1:return[2,{total:(e=n.sent()).body.total,subaccounts:e.body.subaccounts.map(this.convertToDate)}]}}))}))},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v5/accounts/subaccounts/".concat(t))];case 1:return e=n.sent(),[2,{subaccount:this.convertToDate(e.body.subaccount)}]}}))}))},t.prototype.create=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.postWithFD("/v5/accounts/subaccounts",{name:t})];case 1:return e=n.sent(),[2,{subaccount:this.convertToDate(e.body.subaccount)}]}}))}))},t.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.request.setSubaccountHeader(t),[4,this.request.delete("/v5/accounts/subaccounts")];case 1:return e=r.sent(),this.request.resetSubaccountHeader(),[2,e.body];case 2:throw n=r.sent(),this.request.resetSubaccountHeader(),n;case 3:return[2]}}))}))},t.prototype.getMonthlySendingLimit=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.request.get("/v5/accounts/subaccounts/".concat(t,"/limit/custom/monthly"))];case 1:return[2,e.sent().body]}}))}))},t.prototype.setMonthlySendingLimit=function(t,e){return r(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return n={query:"limit=".concat(e)},[4,this.request.put("/v5/accounts/subaccounts/".concat(t,"/limit/custom/monthly"),void 0,n)];case 1:return[2,r.sent().body]}}))}))},t.prototype.updateSubaccountFeature=function(t,e){return r(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return n=["email_preview","inbox_placement","sending","validations","validations_bulk"].reduce((function(t,n){return n in e&&"boolean"==typeof e[n]&&(t[n]=JSON.stringify({enabled:e[n]})),t}),{}),[4,this.request.put("/v5/accounts/subaccounts/".concat(t,"/features"),n)];case 1:return[2,r.sent().body]}}))}))},t.prototype.enable=function(t){return this.request.post("/v5/accounts/subaccounts/".concat(t,"/enable")).then((function(t){return t.body}))},t.prototype.disable=function(t){return this.request.post("/v5/accounts/subaccounts/".concat(t,"/disable")).then((function(t){return t.body}))},t.SUBACCOUNT_HEADER="X-Mailgun-On-Behalf-Of",t}(),Ge=function(){function t(t){var e=t.username,n=t.key,r=t.timeout,s=t.maxBodyLength,o=t.proxy,i=t.configHeaders,a=t.useFetch;this.timeout=r,this.maxBodyLength=s,this.proxy=o,this.username=e,this.key=n,this.headers=this.makeHeadersFromObject(i),this.useFetch=a}return t.prototype.getResponseBody=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){if(e={body:{},status:null==t?void 0:t.status},"string"==typeof t.data){if("Mailgun Magnificent API"===t.data)throw new y({status:400,statusText:"Incorrect url",body:t.data});e.body={message:t.data}}else e.body=t.data;return[2,e]}))}))},t.prototype.getDataRelatedHeaders=function(t){var e,n=null===(e=null==t?void 0:t.isFormURLEncoded)||void 0===e||e,r=null==t?void 0:t.isMultipartFormData,s=null==t?void 0:t.isApplicationJSON,o={};return n&&(o["Content-Type"]="application/x-www-form-urlencoded"),r&&(o["Content-Type"]="multipart/form-data"),s&&(o["Content-Type"]="application/json"),o},t.prototype.addRequestLevelHeaders=function(t){var e=new Be,n=Qe.encode("".concat(this.username,":").concat(this.key));e.setAuthorization("Basic ".concat(n)),e.set(this.headers);var r=this.getDataRelatedHeaders(t),s=this.makeHeadersFromObject(r);return e.set(s),e},t.prototype.makeHeadersFromObject=function(t){void 0===t&&(t={});var e=new Be;return e=Object.entries(t).reduce((function(t,e){var n=e[0],r=e[1];return t.set(n,r),t}),e)},t.prototype.setSubAccountHeader=function(t){this.headers.set(Xe.SUBACCOUNT_HEADER,t)},t.prototype.resetSubAccountHeader=function(){this.headers.delete(Xe.SUBACCOUNT_HEADER)},t.prototype.makeRequest=function(t,e,o,i){var a,u,c;return r(this,void 0,void 0,(function(){var r,l,d,p,h;return s(this,(function(s){switch(s.label){case 0:l=this.addRequestLevelHeaders(i),s.label=1;case 1:if(s.trys.push([1,3,,4]),d=n(n({method:e.toLocaleUpperCase(),timeout:this.timeout,url:t,headers:l},o),{maxBodyLength:this.maxBodyLength,proxy:this.proxy}),this.useFetch&&(d.adapter="fetch",(null==i?void 0:i.dataSize)&&i.dataSize>0&&i.dataSize>this.maxBodyLength))throw new y({status:400,statusText:"(Fetch) Request body larger than maxBodyLength limit",body:"(Fetch) Request body size of ".concat(i.dataSize," bytes exceeds the maximum allowed size of ").concat(this.maxBodyLength," bytes")});return[4,De.request(d)];case 2:return r=s.sent(),[3,4];case 3:throw p=s.sent(),new y({status:(null===(a=null==(h=p)?void 0:h.response)||void 0===a?void 0:a.status)||400,statusText:(null===(u=null==h?void 0:h.response)||void 0===u?void 0:u.statusText)||h.code,body:(null===(c=null==h?void 0:h.response)||void 0===c?void 0:c.data)||h.message});case 4:return[4,this.getResponseBody(r)];case 5:return[2,s.sent()]}}))}))},t}(),Ye=function(){function t(t,e){this.url=t.url,this.formDataBuilder=new v(e,{useFetch:t.useFetch});var n={timeout:t.timeout,maxBodyLength:52428800,proxy:t.proxy,username:t.username,key:t.key,configHeaders:t.headers,useFetch:t.useFetch};this.requestProvider=new Ge(n)}return t.prototype.request=function(t,e,o,i){var a;return r(this,void 0,void 0,(function(){var r,u,c;return s(this,(function(s){return r=n({},o),u={},c=(null==i?void 0:i.isStorageAPI)?e:f(this.url,e),(null==r?void 0:r.query)&&Object.getOwnPropertyNames(null==r?void 0:r.query).length>0&&((null===(a=null==r?void 0:r.query)||void 0===a?void 0:a.searchParams)?u.params=new URLSearchParams(r.query.searchParams):u.params=new URLSearchParams(r.query)),(null==r?void 0:r.body)&&(u.data=null==r?void 0:r.body),[2,this.requestProvider.makeRequest(c,t.toUpperCase(),u,i)]}))}))},t.prototype.setSubaccountHeader=function(t){this.requestProvider.setSubAccountHeader(t)},t.prototype.resetSubaccountHeader=function(){this.requestProvider.resetSubAccountHeader()},t.prototype.query=function(t,e,n){return this.request(t,e,{query:n})},t.prototype.command=function(t,e,n,r,s){var o={body:n,query:null==s?void 0:s.query};return this.request(t,e,o,r)},t.prototype.get=function(t,e){return this.query("get",t,e)},t.prototype.post=function(t,e,n){return this.command("post",t,e,{isFormURLEncoded:!1,isApplicationJSON:null==n?void 0:n.isApplicationJSON})},t.prototype.postWithFD=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o;return s(this,(function(s){switch(s.label){case 0:return[4,this.formDataBuilder.createFormData(e)];case 1:return n=s.sent(),r=n.formData,o=n.dataSize,[2,this.command("post",t,r,{isFormURLEncoded:!1,isMultipartFormData:!0,dataSize:o})]}}))}))},t.prototype.putWithFD=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o;return s(this,(function(s){switch(s.label){case 0:return[4,this.formDataBuilder.createFormData(e)];case 1:return n=s.sent(),r=n.formData,o=n.dataSize,[2,this.command("put",t,r,{isFormURLEncoded:!1,isMultipartFormData:!0,dataSize:o})]}}))}))},t.prototype.patchWithFD=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o;return s(this,(function(s){switch(s.label){case 0:return[4,this.formDataBuilder.createFormData(e)];case 1:return n=s.sent(),r=n.formData,o=n.dataSize,[2,this.command("patch",t,r,{isFormURLEncoded:!1,isMultipartFormData:!0,dataSize:o})]}}))}))},t.prototype.put=function(t,e,n){return this.command("put",t,e,{},n)},t.prototype.delete=function(t,e,n){return this.command("delete",t,e,{},{query:n})},t}(),Ze=function(t,e,n){this.name=t.name,this.require_tls=t.require_tls,this.skip_verification=t.skip_verification,this.state=t.state,this.wildcard=t.wildcard,this.spam_action=t.spam_action,this.created_at=new Date(t.created_at),this.smtp_password=t.smtp_password,this.smtp_login=t.smtp_login,this.type=t.type,this.receiving_dns_records=e||null,this.sending_dns_records=n||null,this.id=t.id,this.is_disabled=t.is_disabled,this.web_prefix=t.web_prefix,this.web_scheme=t.web_scheme,this.use_automatic_sender_security=t.use_automatic_sender_security;var r=["dkim_host","mailfrom_host"].reduce((function(e,n){return t[n]&&(e[n]=t[n]),e}),{});Object.assign(this,r)},tn=function(){function t(t,e,n,r,s,o,i){void 0===i&&(i=console),this.request=t,this.domainCredentials=e,this.domainTemplates=n,this.domainTags=r,this.logger=i,this.domainTracking=s,this.domainKeys=o}return t.prototype._handleBoolValues=function(t){var e=t,r=Object.keys(e).reduce((function(t,n){var r=n;if("boolean"==typeof e[r]){var s=e[r];t[r]="true"===s.toString()?"true":"false"}return t}),{});return n(n({},t),r)},t.prototype._parseMessage=function(t){return t.body},t.prototype.parseDomainList=function(t){return t.body&&t.body.items?t.body.items.map((function(t){return new Ze(t)})):[]},t.prototype._parseDomain=function(t){return new Ze(t.body.domain,t.body.receiving_dns_records,t.body.sending_dns_records)},t.prototype.list=function(t){var e=this;return this.request.get("/v4/domains",t).then((function(t){return e.parseDomainList(t)}))},t.prototype.get=function(t,e){var n,r,s=this,o=e?{"h:extended":null!==(n=null==e?void 0:e.extended)&&void 0!==n&&n,"h:with_dns":null===(r=null==e?void 0:e.with_dns)||void 0===r||r}:{};return this.request.get("/v4/domains/".concat(t),o).then((function(t){return s._parseDomain(t)}))},t.prototype.create=function(t){var e=this,n=this._handleBoolValues(t);return this.request.postWithFD("/v4/domains",n).then((function(t){return e._parseDomain(t)}))},t.prototype.update=function(t,e){var n=this,r=this._handleBoolValues(e);return this.request.putWithFD("/v4/domains/".concat(t),r).then((function(t){return n._parseDomain(t)}))},t.prototype.verify=function(t){var e=this;return this.request.put("/v4/domains/".concat(t,"/verify")).then((function(t){return e._parseDomain(t)}))},t.prototype.destroy=function(t){var e=this;return this.request.delete("/v3/domains/".concat(t)).then((function(t){return e._parseMessage(t)}))},t.prototype.getConnection=function(t){return this.request.get("/v3/domains/".concat(t,"/connection")).then((function(t){return t})).then((function(t){return t.body}))},t.prototype.updateConnection=function(t,e){return this.request.put("/v3/domains/".concat(t,"/connection"),e).then((function(t){return t})).then((function(t){return t.body}))},t.prototype.getTracking=function(t){return this.logger.warn("\n 'domains.getTracking' method is deprecated, and will be removed. Please use 'domains.domainTracking.getTracking' instead.\n "),this.domainTracking.getTracking(t)},t.prototype.updateTracking=function(t,e,n){return this.logger.warn("\n 'domains.updateTracking' method is deprecated, and will be removed. Please use 'domains.domainTracking.updateTracking' instead.\n "),this.domainTracking.updateTracking(t,e,n)},t.prototype.getIps=function(t){return this.logger.warn('"domains.getIps" method is deprecated and will be removed in the future releases.'),this.request.get(f("/v3/domains",t,"ips")).then((function(t){var e;return null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.items}))},t.prototype.assignIp=function(t,e){return this.logger.warn('"domains.assignIp" method is deprecated and will be removed in the future releases.'),this.request.postWithFD(f("/v3/domains",t,"ips"),{ip:e})},t.prototype.deleteIp=function(t,e){return this.logger.warn('"domains.deleteIp" method is deprecated and will be moved into the IpsClient in the future releases.'),this.request.delete(f("/v3/domains",t,"ips",e))},t.prototype.linkIpPool=function(t,e){return this.logger.warn('"domains.linkIpPool" method is deprecated, and will be removed in the future releases.'),this.request.postWithFD(f("/v3/domains",t,"ips"),{pool_id:e})},t.prototype.unlinkIpPoll=function(t,e){this.logger.warn('"domains.unlinkIpPoll" method is deprecated, and will be moved into the IpsClient in the future releases.');var n="";if(e.pool_id&&e.ip)throw y.getUserDataError("Too much data for replacement","Please specify either pool_id or ip (not both)");return e.pool_id?n="?pool_id=".concat(e.pool_id):e.ip&&(n="?ip=".concat(e.ip)),this.request.delete(f("/v3/domains",t,"ips","ip_pool",n))},t.prototype.updateDKIMAuthority=function(t,e){return this.logger.warn('"domains.updateDKIMAuthority" method is deprecated. Please use "domains.domainKeys.updateDKIMAuthority" instead'),this.domainKeys.updateDKIMAuthority(t,e)},t.prototype.updateDKIMSelector=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){return this.logger.warn('"domains.updateDKIMSelector" method is deprecated. Please use domains.domainKeys.updateDKIMSelector instead'),[2,this.domainKeys.updateDKIMSelector(t,e)]}))}))},t.prototype.updateWebPrefix=function(t,e){this.logger.warn('"domains.updateWebPrefix" method is deprecated, please use domains.update to set new "web_prefix". Current method will be removed in the future releases.');var n={query:"web_prefix=".concat(e.webPrefix)};return this.request.put("/v3/domains/".concat(t,"/web_prefix"),{},n).then((function(t){return t}))},t}(),en=function(){function t(t){t&&(this.request=t)}return t.prototype.parsePage=function(t,e,n,r){var s=new URL(e).searchParams,o=e&&"string"==typeof e&&e.split(n).pop()||"",i=null;return r&&(i=s.has(r)?s.get(r):void 0),{id:t,page:"?"===n?"?".concat(o):o,iteratorPosition:i,url:e}},t.prototype.parsePageLinks=function(t,e,n){var r=this;return Object.entries(t.body.paging).reduce((function(t,s){var o=s[0],i=s[1];return t[o]=r.parsePage(o,i,e,n),t}),{})},t.prototype.updateUrlAndQuery=function(t,e){var r=t,s=n({},e);return s.page&&(r=f(t,s.page),delete s.page),{url:r,updatedQuery:s}},t.prototype.requestListWithPages=function(t,e,n){return r(this,void 0,void 0,(function(){var r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return r=this.updateUrlAndQuery(t,e),o=r.url,i=r.updatedQuery,this.request?[4,this.request.get(o,i)]:[3,2];case 1:return a=s.sent(),[2,this.parseList(a,n)];case 2:throw new y({status:500,statusText:"Request property is empty",body:{message:""}})}}))}))},t}(),nn=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n}return e(n,t),n.prototype.parseList=function(t){var e={};return e.items=t.body.items,e.pages=this.parsePageLinks(t,"/"),e.status=t.status,e},n.prototype.get=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this.requestListWithPages(f("/v3",t,"events"),e)]}))}))},n}(en),rn=function(t){this.start=new Date(t.start),this.end=new Date(t.end),this.resolution=t.resolution,this.stats=t.stats.map((function(t){var e=n({},t);return e.time=new Date(t.time),e}))},sn=function(){function t(t,e){void 0===e&&(e=console),this.request=t,this.logger=e}return t.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date:"'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toUTCString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),[t,e.toUTCString()]},t.prototype.prepareSearchParams=function(t){var e=this,n=[];return"object"==typeof t&&Object.keys(t).length&&(n=Object.entries(t).reduce((function(t,n){var r=n[0],s=n[1];if(Array.isArray(s)&&s.length){var i=s.map((function(t){return[r,t]}));return o(o([],t,!0),i,!0)}return s instanceof Date?(t.push(e.convertDateToUTC(r,s)),t):("string"==typeof s&&t.push([r,s]),t)}),[])),n},t.prototype.parseStats=function(t){return new rn(t.body)},t.prototype.getDomain=function(t,e){var n=this.prepareSearchParams(e);return this.request.get(f("/v3",t,"stats/total"),{searchParams:n}).then(this.parseStats)},t.prototype.getAccount=function(t){var e=this.prepareSearchParams(t);return this.request.get("/v3/stats/total",{searchParams:e}).then(this.parseStats)},t}();!function(t){t.HOUR="hour",t.DAY="day",t.MONTH="month"}(Ve||(Ve={})),function(t){t.BOUNCES="bounces",t.COMPLAINTS="complaints",t.UNSUBSCRIBES="unsubscribes",t.WHITELISTS="whitelists"}(Ke||(Ke={})),function(t){t.CLICKED="clicked",t.COMPLAINED="complained",t.DELIVERED="delivered",t.OPENED="opened",t.PERMANENT_FAIL="permanent_fail",t.TEMPORARY_FAIL="temporary_fail",t.UNSUBSCRIBED="unsubscribe"}(Je||(Je={})),function(t){t.YES="yes",t.NO="no"}($e||($e={}));var on=function(t){this.type=t},an=function(t){function n(e){var n=t.call(this,Ke.BOUNCES)||this;return n.address=e.address,n.code=+e.code,n.error=e.error,n.created_at=new Date(e.created_at),n}return e(n,t),n}(on),un=function(t){function n(e){var n=t.call(this,Ke.COMPLAINTS)||this;return n.address=e.address,n.created_at=new Date(e.created_at),n}return e(n,t),n}(on),cn=function(t){function n(e){var n=t.call(this,Ke.UNSUBSCRIBES)||this;return n.address=e.address,n.tags=e.tags,n.created_at=new Date(e.created_at),n}return e(n,t),n}(on),ln=function(t){function n(e){var n=t.call(this,Ke.WHITELISTS)||this;return n.value=e.value,n.reason=e.reason,n.createdAt=new Date(e.createdAt),n}return e(n,t),n}(on),dn=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n.models={bounces:an,complaints:un,unsubscribes:cn,whitelists:ln},n}return e(n,t),n.prototype.parseList=function(t,e){var n,r={};return r.items=(null===(n=t.body.items)||void 0===n?void 0:n.map((function(t){return new e(t)})))||[],r.pages=this.parsePageLinks(t,"?","address"),r.status=t.status,r},n.prototype._parseItem=function(t,e){return new e(t)},n.prototype.createWhiteList=function(t,e,n){if(n)throw y.getUserDataError("Data property should be an object","Whitelist's creation process does not support multiple creations. Data property should be an object");return this.request.postWithFD(f("v3",t,"whitelists"),e).then(this.prepareResponse)},n.prototype.createUnsubscribe=function(t,e){if(Array.isArray(e)){if(e.some((function(t){return t.tag})))throw y.getUserDataError("Tag property should not be used for creating multiple unsubscribes.","Tag property can be used only if one unsubscribe provided as second argument of create method. Please use tags instead.");return this.request.post(f("v3",t,"unsubscribes"),JSON.stringify(e),{isApplicationJSON:!0}).then(this.prepareResponse)}if(null==e?void 0:e.tags)throw y.getUserDataError("Tags property should not be used for creating one unsubscribe.","Tags property can be used if you provides an array of unsubscribes as second argument of create method. Please use tag instead");if(Array.isArray(e.tag))throw y.getUserDataError("Tag property can not be an array","Please use array of unsubscribes as second argument of create method to be able to provide few tags");return this.request.postWithFD(f("v3",t,"unsubscribes"),e).then(this.prepareResponse)},n.prototype.getModel=function(t){if(t in this.models)return this.models[t];throw y.getUserDataError("Unknown type value","Type may be only one of [bounces, complaints, unsubscribes, whitelists]")},n.prototype.prepareResponse=function(t){return{message:t.body.message,type:t.body.type||"",value:t.body.value||"",status:t.status}},n.prototype.list=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return s(this,(function(s){return r=this.getModel(e),[2,this.requestListWithPages(f("v3",t,e),n,r)]}))}))},n.prototype.get=function(t,e,n){var r=this,s=this.getModel(e);return this.request.get(f("v3",t,e,encodeURIComponent(n))).then((function(t){return r._parseItem(t.body,s)}))},n.prototype.create=function(t,e,n){var r;this.getModel(e);var s=Array.isArray(n);return"whitelists"===e?this.createWhiteList(t,n,s):"unsubscribes"===e?this.createUnsubscribe(t,n):(r=s?o([],n,!0):[n],this.request.post(f("v3",t,e),JSON.stringify(r),{isApplicationJSON:!0}).then(this.prepareResponse))},n.prototype.destroy=function(t,e,n){return this.getModel(e),this.request.delete(f("v3",t,e,encodeURIComponent(n))).then((function(t){return{message:t.body.message,value:t.body.value||"",address:t.body.address||"",status:t.status}}))},n}(en),pn=function(t,e,n){this.id=t,this.url=e,this.urls=n},hn=function(){function t(t){this.request=t}return t.prototype._parseWebhookList=function(t){return t.body.webhooks},t.prototype._parseWebhookWithID=function(t){return function(e){var n,r=null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.webhook,s=null==r?void 0:r.url,o=null==r?void 0:r.urls;return s||(s=o&&o.length?o[0]:void 0),o&&0!==o.length||!s||(o=[s]),new pn(t,s,o)}},t.prototype._parseWebhookTest=function(t){return{code:t.body.code,message:t.body.message}},t.prototype.list=function(t,e){return this.request.get(f("/v3/domains",t,"webhooks"),e).then(this._parseWebhookList)},t.prototype.get=function(t,e){return this.request.get(f("/v3/domains",t,"webhooks",e)).then(this._parseWebhookWithID(e))},t.prototype.create=function(t,e,n,r){return void 0===r&&(r=!1),r?this.request.putWithFD(f("/v3/domains",t,"webhooks",e,"test"),{url:n}).then(this._parseWebhookTest):this.request.postWithFD(f("/v3/domains",t,"webhooks"),{id:e,url:n}).then(this._parseWebhookWithID(e))},t.prototype.update=function(t,e,n){return this.request.putWithFD(f("/v3/domains",t,"webhooks",e),{url:n}).then(this._parseWebhookWithID(e))},t.prototype.destroy=function(t,e){return this.request.delete(f("/v3/domains",t,"webhooks",e)).then(this._parseWebhookWithID(e))},t}(),fn=function(){function t(t){this.request=t}return t.prototype.prepareBooleanValues=function(t){var e=new Set(["o:testmode","t:text","o:dkim","o:tracking","o:tracking-clicks","o:tracking-opens","o:require-tls","o:skip-verification"]);return Object.keys(t).reduce((function(n,r){return e.has(r)&&"boolean"==typeof t[r]?n[r]=t[r]?"yes":"no":n[r]=t[r],n}),{})},t.prototype._parseResponse=function(t){return n({status:t.status},t.body)},t.prototype.create=function(t,e){if(!e||0===Object.keys(e).length)throw y.getUserDataError("Message data object can not be empty","Message data object can not be empty");if(e.message)return this.request.postWithFD("/v3/".concat(t,"/messages.mime"),e).then(this._parseResponse);var n=this.prepareBooleanValues(e);return this.request.postWithFD("/v3/".concat(t,"/messages"),n).then(this._parseResponse)},t.prototype.retrieveStoredEmail=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v3/domains/".concat(t,"/messages/").concat(e))];case 1:return[2,n.sent().body]}}))}))},t.prototype.resendEmail=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.postWithFD("/v3/domains/".concat(t,"/messages/").concat(e),{to:n})];case 1:return r=s.sent(),[2,this._parseResponse(r)]}}))}))},t.prototype.getMessagesQueueStatus=function(t){var e,n,o,i,a,u,c,l,d,p;return r(this,void 0,void 0,(function(){var r,h;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.get("/v3/domains/".concat(t,"/sending_queues"))];case 1:return r=s.sent(),h=r.body,[2,{regular:{is_disabled:null===(e=h.regular)||void 0===e?void 0:e.is_disabled,disabled:{until:(null===(o=null===(n=h.regular)||void 0===n?void 0:n.disabled)||void 0===o?void 0:o.until)?new Date(h.regular.disabled.until):"",reason:(null===(a=null===(i=h.regular)||void 0===i?void 0:i.disabled)||void 0===a?void 0:a.reason)||""}},scheduled:{is_disabled:null===(u=h.scheduled)||void 0===u?void 0:u.is_disabled,disabled:{until:(null===(l=null===(c=h.scheduled)||void 0===c?void 0:c.disabled)||void 0===l?void 0:l.until)?new Date(h.scheduled.disabled.until):"",reason:(null===(p=null===(d=h.scheduled)||void 0===d?void 0:d.disabled)||void 0===p?void 0:p.reason)||""}}}]}}))}))},t.prototype.clearMessagesQueue=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:if(!["storage-us-east4.api.mailgun.net","storage-us-west1.api.mailgun.net","storage-europe-west1.api.mailgun.net"].includes(e))throw y.getUserDataError("Invalid storage URL","The provided storage URL is not allowed.");return[4,this.request.command("delete","https://".concat(e,"/v3/").concat(t,"/envelopes"),void 0,{isStorageAPI:!0})];case 1:return[2,n.sent().body]}}))}))},t}(),yn=function(){function t(t){this.request=t}return t.prototype.list=function(t){return this.request.get("/v3/routes",t).then((function(t){return t.body.items}))},t.prototype.get=function(t){return this.request.get("/v3/routes/".concat(t)).then((function(t){return t.body.route}))},t.prototype.create=function(t){return this.request.postWithFD("/v3/routes",t).then((function(t){return t.body.route}))},t.prototype.update=function(t,e){return this.request.putWithFD("/v3/routes/".concat(t),e).then((function(t){return t.body}))},t.prototype.destroy=function(t){return this.request.delete("/v3/routes/".concat(t)).then((function(t){return t.body}))},t}(),mn=function(){function t(t,e){this.request=t,this.multipleValidation=e}return t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return e={address:t},[4,this.request.get("/v4/address/validate",e)];case 1:return[2,n.sent().body]}}))}))},t}(),bn=function(){function t(t){this.request=t}return t.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v3/ips",t)];case 1:return e=n.sent(),[2,this.parseIpsResponse(e)]}}))}))},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v3/ips/".concat(t))];case 1:return e=n.sent(),[2,this.parseIpsResponse(e)]}}))}))},t.prototype.parseIpsResponse=function(t){return t.body},t}(),vn=function(){function t(t){this.request=t}return t.prototype.list=function(){var t=this;return this.request.get("/v1/ip_pools").then((function(e){return t.parseIpPoolsResponse(e)}))},t.prototype.create=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.postWithFD("/v1/ip_pools",t)];case 1:return e=r.sent(),[2,n({status:e.status},e.body)]}}))}))},t.prototype.update=function(t,e){return r(this,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.patchWithFD("/v1/ip_pools/".concat(t),e)];case 1:return r=s.sent(),[2,n({status:r.status},r.body)]}}))}))},t.prototype.delete=function(t,e){return r(this,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.delete("/v1/ip_pools/".concat(t),e)];case 1:return r=s.sent(),[2,n({status:r.status},r.body)]}}))}))},t.prototype.parseIpPoolsResponse=function(t){return n({status:t.status},t.body)},t}(),gn=function(t){function o(e,n){var r=t.call(this,e)||this;return r.request=e,r.baseRoute="/v3/lists",r.members=n,r}return e(o,t),o.prototype.parseValidationResult=function(t,e){return{status:t,validationResult:n(n({},e),{created_at:new Date(1e3*e.created_at)})}},o.prototype.parseList=function(t){var e={};return e.items=t.body.items,e.pages=this.parsePageLinks(t,"?","address"),e.status=t.status,e},o.prototype.list=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.requestListWithPages("".concat(this.baseRoute,"/pages"),t)]}))}))},o.prototype.get=function(t){return this.request.get("".concat(this.baseRoute,"/").concat(t)).then((function(t){return t.body.list}))},o.prototype.create=function(t){return this.request.postWithFD(this.baseRoute,t).then((function(t){return t.body.list}))},o.prototype.update=function(t,e){return this.request.putWithFD("".concat(this.baseRoute,"/").concat(t),e).then((function(t){return t.body.list}))},o.prototype.destroy=function(t){return this.request.delete("".concat(this.baseRoute,"/").concat(t)).then((function(t){return t.body}))},o.prototype.validate=function(t){return this.request.post("".concat(this.baseRoute,"/").concat(t,"/validate"),{}).then((function(t){return n({status:t.status},t.body)}))},o.prototype.validationResult=function(t){var e=this;return this.request.get("".concat(this.baseRoute,"/").concat(t,"/validate")).then((function(t){return e.parseValidationResult(t.status,t.body)}))},o.prototype.cancelValidation=function(t){return this.request.delete("".concat(this.baseRoute,"/").concat(t,"/validate")).then((function(t){return{status:t.status,message:t.body.message}}))},o}(en),wn=function(t){function o(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/lists",n}return e(o,t),o.prototype.checkAndUpdateData=function(t){var e=n({},t);return"object"==typeof t.vars&&(e.vars=JSON.stringify(e.vars)),"boolean"==typeof t.subscribed&&(e.subscribed=t.subscribed?"yes":"no"),e},o.prototype.parseList=function(t){var e={};return e.items=t.body.items,e.pages=this.parsePageLinks(t,"?","address"),e},o.prototype.listMembers=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this.requestListWithPages("".concat(this.baseRoute,"/").concat(t,"/members/pages"),e)]}))}))},o.prototype.getMember=function(t,e){return this.request.get("".concat(this.baseRoute,"/").concat(t,"/members/").concat(e)).then((function(t){return t.body.member}))},o.prototype.createMember=function(t,e){var n=this.checkAndUpdateData(e);return this.request.postWithFD("".concat(this.baseRoute,"/").concat(t,"/members"),n).then((function(t){return t.body.member}))},o.prototype.createMembers=function(t,e){var n={members:Array.isArray(e.members)?JSON.stringify(e.members):e.members,upsert:e.upsert};return this.request.postWithFD("".concat(this.baseRoute,"/").concat(t,"/members.json"),n).then((function(t){return t.body}))},o.prototype.updateMember=function(t,e,n){var r=this.checkAndUpdateData(n);return this.request.putWithFD("".concat(this.baseRoute,"/").concat(t,"/members/").concat(e),r).then((function(t){return t.body.member}))},o.prototype.destroyMember=function(t,e){return this.request.delete("".concat(this.baseRoute,"/").concat(t,"/members/").concat(e)).then((function(t){return t.body}))},o}(en),Rn=function(){function t(t){this.request=t,this.baseRoute="/v3/domains/"}return t.prototype._parseDomainCredentialsList=function(t){return{items:t.body.items,totalCount:t.body.total_count}},t.prototype._parseMessageResponse=function(t){return{status:t.status,message:t.body.message}},t.prototype._parseDeletedResponse=function(t){return{status:t.status,message:t.body.message,spec:t.body.spec}},t.prototype.list=function(t,e){var n=this;return this.request.get(f(this.baseRoute,t,"/credentials"),e).then((function(t){return n._parseDomainCredentialsList(t)}))},t.prototype.create=function(t,e){var n=this;return this.request.postWithFD("".concat(this.baseRoute).concat(t,"/credentials"),e).then((function(t){return n._parseMessageResponse(t)}))},t.prototype.update=function(t,e,n){var r=this;return this.request.putWithFD("".concat(this.baseRoute).concat(t,"/credentials/").concat(e),n).then((function(t){return r._parseMessageResponse(t)}))},t.prototype.destroy=function(t,e){var n=this;return this.request.delete("".concat(this.baseRoute).concat(t,"/credentials/").concat(e)).then((function(t){return n._parseDeletedResponse(t)}))},t}(),_n=function(t,e){var n,r;this.createdAt=new Date(t.created_at),this.id=t.id,this.quantity=t.quantity,this.recordsProcessed=t.records_processed,this.status=t.status,this.responseStatusCode=e,t.download_url&&(this.downloadUrl={csv:null===(n=t.download_url)||void 0===n?void 0:n.csv,json:null===(r=t.download_url)||void 0===r?void 0:r.json}),t.summary&&(this.summary={result:{catchAll:t.summary.result.catch_all,deliverable:t.summary.result.deliverable,doNotSend:t.summary.result.do_not_send,undeliverable:t.summary.result.undeliverable,unknown:t.summary.result.unknown},risk:{high:t.summary.risk.high,low:t.summary.risk.low,medium:t.summary.risk.medium,unknown:t.summary.risk.unknown}})},Sn=function(t){function o(e){var n=t.call(this)||this;return n.request=e,n.attachmentsHandler=new b,n}return e(o,t),o.prototype.handleResponse=function(t){return n({status:t.status},null==t?void 0:t.body)},o.prototype.parseList=function(t){var e={};return e.jobs=t.body.jobs.map((function(e){return new _n(e,t.status)})),e.pages=this.parsePageLinks(t,"?","pivot"),e.total=t.body.total,e.status=t.status,e},o.prototype.list=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.requestListWithPages("/v4/address/validate/bulk",t)]}))}))},o.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get("/v4/address/validate/bulk/".concat(t))];case 1:return e=n.sent(),[2,new _n(e.body,e.status)]}}))}))},o.prototype.convertToExpectedShape=function(t){return this.attachmentsHandler.isBuffer(t.file)?{multipleValidationFile:t.file}:"string"==typeof t.file?{multipleValidationFile:{data:t.file}}:(this.attachmentsHandler.isStream(t.file),{multipleValidationFile:t.file})},o.prototype.create=function(t,e){return r(this,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:if(!e||!e.file)throw y.getUserDataError('"file" property expected.','Make sure second argument has "file" property.');return n=this.convertToExpectedShape(e),[4,this.request.postWithFD("/v4/address/validate/bulk/".concat(t),n)];case 1:return r=s.sent(),[2,this.handleResponse(r)]}}))}))},o.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.delete("/v4/address/validate/bulk/".concat(t))];case 1:return e=n.sent(),[2,this.handleResponse(e)]}}))}))},o}(en),qn=function(t){this.name=t.name,this.description=t.description,this.createdAt=t.createdAt?new Date(t.createdAt):"",this.createdBy=t.createdBy,this.id=t.id,t.version&&(this.version=t.version,this.version&&t.version.createdAt&&(this.version.createdAt=new Date(t.version.createdAt))),t.versions&&t.versions.length&&(this.versions=t.versions.map((function(t){var e=n({},t);return e.createdAt=new Date(t.createdAt),e})))},Dn=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/",n}return e(n,t),n.prototype.parseCreationResponse=function(t){return new qn(t.body.template)},n.prototype.parseCreationVersionResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,t.body&&t.body.template&&(e.template=new qn(t.body.template)),e},n.prototype.parseMutationResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,t.body&&t.body.template&&(e.templateName=t.body.template.name),e},n.prototype.parseNotificationResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,e},n.prototype.parseMutateTemplateVersionResponse=function(t){var e={};return e.status=t.status,e.message=t.body.message,t.body.template&&(e.templateName=t.body.template.name,e.templateVersion={tag:t.body.template.version.tag}),e},n.prototype.parseList=function(t){var e={};return e.items=t.body.items.map((function(t){return new qn(t)})),e.pages=this.parsePageLinks(t,"?","p"),e.status=t.status,e},n.prototype.parseListTemplateVersions=function(t){var e={};return e.template=new qn(t.body.template),e.pages=this.parsePageLinks(t,"?","p"),e},n.prototype.list=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this.requestListWithPages(f(this.baseRoute,t,"/templates"),e)]}))}))},n.prototype.get=function(t,e,n){return this.request.get(f(this.baseRoute,t,"/templates/",e),n).then((function(t){return new qn(t.body.template)}))},n.prototype.create=function(t,e){var n=this;return this.request.postWithFD(f(this.baseRoute,t,"/templates"),e).then((function(t){return n.parseCreationResponse(t)}))},n.prototype.update=function(t,e,n){var r=this;return this.request.putWithFD(f(this.baseRoute,t,"/templates/",e),n).then((function(t){return r.parseMutationResponse(t)}))},n.prototype.destroy=function(t,e){var n=this;return this.request.delete(f(this.baseRoute,t,"/templates/",e)).then((function(t){return n.parseMutationResponse(t)}))},n.prototype.destroyAll=function(t){var e=this;return this.request.delete(f(this.baseRoute,t,"/templates")).then((function(t){return e.parseNotificationResponse(t)}))},n.prototype.listVersions=function(t,e,n){var r=this;return this.request.get(f(this.baseRoute,t,"/templates",e,"/versions"),n).then((function(t){return r.parseListTemplateVersions(t)}))},n.prototype.getVersion=function(t,e,n){return this.request.get(f(this.baseRoute,t,"/templates/",e,"/versions/",n)).then((function(t){return new qn(t.body.template)}))},n.prototype.createVersion=function(t,e,n){var r=this;return this.request.postWithFD(f(this.baseRoute,t,"/templates/",e,"/versions"),n).then((function(t){return r.parseCreationVersionResponse(t)}))},n.prototype.updateVersion=function(t,e,n,r){var s=this;return this.request.putWithFD(f(this.baseRoute,t,"/templates/",e,"/versions/",n),r).then((function(t){return s.parseMutateTemplateVersionResponse(t)}))},n.prototype.destroyVersion=function(t,e,n){var r=this;return this.request.delete(f(this.baseRoute,t,"/templates/",e,"/versions/",n)).then((function(t){return r.parseMutateTemplateVersionResponse(t)}))},n}(en),En=function(t){this.tag=t.tag,this.description=t.description,this["first-seen"]=new Date(t["first-seen"]),this["last-seen"]=new Date(t["last-seen"])},Tn=function(t){this.tag=t.body.tag,this.description=t.body.description,this.start=new Date(t.body.start),this.end=new Date(t.body.end),this.resolution=t.body.resolution,this.stats=t.body.stats.map((function(t){return n(n({},t),{time:new Date(t.time)})}))},On=function(t){function n(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/",n}return e(n,t),n.prototype.parseList=function(t){var e={};return e.items=t.body.items.map((function(t){return new En(t)})),e.pages=this.parsePageLinks(t,"?","tag"),e.status=t.status,e},n.prototype._parseTagStatistic=function(t){return new Tn(t)},n.prototype.list=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this.requestListWithPages(f(this.baseRoute,t,"/tags"),e)]}))}))},n.prototype.get=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e)).then((function(t){return new En(t.body)}))},n.prototype.update=function(t,e,n){return this.request.put(f(this.baseRoute,t,"/tags",e),{description:n}).then((function(t){return t.body}))},n.prototype.destroy=function(t,e){return this.request.delete("".concat(this.baseRoute).concat(t,"/tags/").concat(e)).then((function(t){return{message:t.body.message,status:t.status}}))},n.prototype.statistic=function(t,e,n){var r=this;return this.request.get(f(this.baseRoute,t,"/tags",e,"stats"),n).then((function(t){return r._parseTagStatistic(t)}))},n.prototype.countries=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e,"stats/aggregates/countries")).then((function(t){return t.body}))},n.prototype.providers=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e,"stats/aggregates/providers")).then((function(t){return t.body}))},n.prototype.devices=function(t,e){return this.request.get(f(this.baseRoute,t,"/tags",e,"stats/aggregates/devices")).then((function(t){return t.body}))},n}(en),An=function(t){function o(e,n,r,s){void 0===s&&(s=console);var o=t.call(this,e)||this;return o.request=e,o.attributes=n,o.filters=r,o.logger=s,o}return e(o,t),o.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date: "'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toISOString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),e.toISOString()},o.prototype.prepareQueryData=function(t){var e=this,r=t,s=Object.keys(r).reduce((function(n,s){var o=s;if(r[o]&&"object"==typeof r[o]){var i=t[o];n[o]=e.convertDateToUTC(o,i)}return n}),{});return n(n({},t),s)},o.prototype.prepareResult=function(t){var e=this.prepareSeedList(t.body);return n(n({},e),{status:t.status})},o.prototype.prepareSeedList=function(t){var e,r={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at),last_result_at:new Date(t.last_result_at)};e=t.Seeds?t.Seeds.map((function(t){var e={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at),max_email_count_hit_at:new Date(t.max_email_count_hit_at),last_sent_to_at:new Date(t.last_sent_to_at),last_delivered_at:new Date(t.last_delivered_at)};return n(n({},t),e)})):null;var s=n(n(n({},t),{Seeds:e}),r);return delete s.Id,s},o.prototype.parseList=function(t){var e,n=this,r={items:[]};return r.items=null===(e=t.body.items)||void 0===e?void 0:e.map((function(t){return n.prepareSeedList(t)})),r.pages=this.parsePageLinks(t,"?","address"),r.status=t.status,r},o.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return e=this.prepareQueryData(t),[4,this.request.get("/v4/inbox/seedlists",e)];case 1:return r=s.sent(),[2,n(n({},this.parseList(r)),{status:200})]}}))}))},o.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.get("/v4/inbox/seedlists/".concat(t))];case 1:return e=s.sent(),r=this.prepareSeedList(e.body.seedlist),[2,n(n({},r),{status:e.status})]}}))}))},o.prototype.create=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.postWithFD("/v4/inbox/seedlists",t)];case 1:return e=n.sent(),[2,this.prepareResult(e)]}}))}))},o.prototype.update=function(t,e){return r(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.put("/v4/inbox/seedlists/".concat(t),e)];case 1:return n=r.sent(),[2,this.prepareResult(n)]}}))}))},o.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request.delete("/v4/inbox/seedlists/".concat(t))]}))}))},o}(en),kn=function(){function t(t,e,n,r){this.request=t,this.seedsLists=e,this.seedsLists=e,this.results=n,this.providers=r}return t.prototype.runTest=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.post("/v4/inbox/tests",t)];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t}(),xn=function(t){function o(e,n,r,s,o){void 0===o&&(o=console);var i=t.call(this,e)||this;return i.request=e,i.attributes=n,i.filters=r,i.sharing=s,i.logger=o,i}return e(o,t),o.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date: "'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toISOString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),e.toISOString()},o.prototype.prepareQueryData=function(t){var e=this,r=t,s=Object.keys(r).reduce((function(n,s){var o=s;if(r[o]&&"object"==typeof r[o]){var i=t[o];n[o]=e.convertDateToUTC(o,i)}return n}),{});return n(n({},t),s)},o.prototype.prepareInboxPlacementsResult=function(t){var e={},r={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at),sharing_expires_at:new Date(t.sharing_expires_at)};t.Box&&delete(e=n(n({},t.Box),{created_at:new Date(t.Box.created_at),updated_at:new Date(t.Box.updated_at),last_result_at:new Date(t.Box.last_result_at)})).ID;var s=n(n(n(n({},t),{Box:e}),r),{id:t.Id});return delete s.ID,s},o.prototype.parseList=function(t){var e=this,n={};return n.items=t.body.items.map((function(t){return e.prepareInboxPlacementsResult(t)})),n.pages=this.parsePageLinks(t,"?","address"),n.status=t.status,n},o.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return e=this.prepareQueryData(t),[4,this.request.get("/v4/inbox/results",n({},e))];case 1:return r=s.sent(),[2,this.parseList(r)]}}))}))},o.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.get("/v4/inbox/results/".concat(t))];case 1:return e=r.sent(),n=this.prepareInboxPlacementsResult(e.body.result),[2,{status:e.status,inboxPlacementResult:n}]}}))}))},o.prototype.destroy=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.delete("/v4/inbox/results/".concat(t))];case 1:return e=r.sent(),[2,n({status:e.status},e.body)]}}))}))},o.prototype.getResultByShareId=function(t){return r(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.get("/v4/inbox/sharing/public/".concat(t))];case 1:return e=r.sent(),n=this.prepareInboxPlacementsResult(e.body.result),[2,{status:e.status,inboxPlacementResult:n}]}}))}))},o}(en),Fn=function(){function t(t,e){this.path=e,this.request=t}return t.prototype.list=function(){return r(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.request.get(this.path)];case 1:return[2,{items:(t=e.sent()).body.items,status:t.status}]}}))}))},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.get("".concat(this.path,"/").concat(t))];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t}(),Pn=function(){function t(t,e){this.request=t,this.path=e}return t.prototype.list=function(){return r(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.request.get(this.path)];case 1:return[2,{status:(t=e.sent()).status,supported_filters:t.body.supported_filters}]}}))}))},t}(),Cn=function(){function t(t){this.request=t}return t.prototype.prepareInboxPlacementsResultSharing=function(t){var e={expires_at:new Date(t.expires_at)};return n(n({},t),e)},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.get("/v4/inbox/sharing/".concat(t))];case 1:return e=s.sent(),r=this.prepareInboxPlacementsResultSharing(e.body.sharing),[2,n({status:e.status},r)]}}))}))},t.prototype.update=function(t,e){return r(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(s){switch(s.label){case 0:return r={query:"enabled=".concat(e.enabled)},[4,this.request.put("/v4/inbox/sharing/".concat(t),{},r)];case 1:return o=s.sent(),i=this.prepareInboxPlacementsResultSharing(o.body.sharing),[2,n(n({},i),{status:o.status})]}}))}))},t}(),Ln=function(){function t(t){this.path="/v4/inbox/providers",this.request=t}return t.prototype.parseList=function(t){var e={};return e.items=t.body.items.map((function(t){var e={created_at:new Date(t.created_at),updated_at:new Date(t.updated_at)};return n(n({},t),e)})),e.status=t.status,e},t.prototype.list=function(){return r(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.request.get(this.path)];case 1:return t=e.sent(),[2,this.parseList(t)]}}))}))},t}(),Un=function(){function t(t,e){void 0===e&&(e=console),this.request=t,this.logger=e}return t.prototype.convertDateToUTC=function(t,e){return this.logger.warn('Date:"'.concat(e,'" was auto-converted to UTC time zone.\nValue "').concat(e.toUTCString(),'" will be used for request.\nConsider using string type for property "').concat(t,'" to avoid auto-converting')),e.toUTCString()},t.prototype.prepareQuery=function(t){var e,r;if(t){var s=null==t?void 0:t.start,o=null==t?void 0:t.end;e=s instanceof Date?this.convertDateToUTC("start",s):null!=s?s:"",r=o&&o instanceof Date?this.convertDateToUTC("end",o):null!=o?o:""}return n(n({},t),{start:e,end:r})},t.prototype.handleResponse=function(t){var e=t.body,r=Date.parse(e.start)?new Date(e.start):null,s=Date.parse(e.end)?new Date(e.end):null;return n(n({},e),{status:t.status,start:r,end:s})},t.prototype.getAccount=function(t){return r(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return e=this.prepareQuery(t),[4,this.request.post("/v1/analytics/metrics",e)];case 1:return n=r.sent(),[2,this.handleResponse(n)]}}))}))},t.prototype.getAccountUsage=function(t){return r(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return e=this.prepareQuery(t),[4,this.request.post("/v1/analytics/usage/metrics",e)];case 1:return n=r.sent(),[2,this.handleResponse(n)]}}))}))},t}(),Bn=function(){function t(t){this.request=t}return t.prototype._parseTrackingSettings=function(t){return t.body.tracking},t.prototype._parseTrackingUpdate=function(t){return t.body},t.prototype._isOpenTrackingInfoWitPlace=function(t){return"object"==typeof t&&"place_at_the_top"in t},t.prototype.get=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.get("/v2/x509/".concat(t,"/status"))];case 1:return e=r.sent(),[2,n(n({},e.body),{responseStatusCode:e.status})]}}))}))},t.prototype.generate=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.post("/v2/x509/".concat(t))];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t.prototype.regenerate=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.put("/v2/x509/".concat(t))];case 1:return e=r.sent(),[2,n(n({},e.body),{status:e.status})]}}))}))},t.prototype.getTracking=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.request.get(f("/v3/domains",t,"tracking"))];case 1:return e=n.sent(),[2,this._parseTrackingSettings(e)]}}))}))},t.prototype.updateTracking=function(t,e,o){return r(this,void 0,void 0,(function(){var r,i;return s(this,(function(s){switch(s.label){case 0:return r=n({},o),"boolean"==typeof(null==o?void 0:o.active)&&(r.active=(null==o?void 0:o.active)?"yes":"no"),this._isOpenTrackingInfoWitPlace(o)&&"boolean"==typeof(null==o?void 0:o.place_at_the_top)&&(r.place_at_the_top=(null==o?void 0:o.place_at_the_top)?"yes":"no"),[4,this.request.putWithFD(f("/v3/domains",t,"tracking",e),r)];case 1:return i=s.sent(),[2,this._parseTrackingUpdate(i)]}}))}))},t}(),jn=function(t){function o(e){var n=t.call(this,e)||this;return n.request=e,n.baseRoute="/v3/domains/",n}return e(o,t),o.prototype._parseDomainKeysList=function(t){return{items:t.items}},o.prototype.parseList=function(t){return t.body.items,this.parsePageLinks(t,"?","page"),t.status,{items:t.body.items,pages:this.parsePageLinks(t,"?","page"),status:t.status||200}},o.prototype.list=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.request.get(f("v4/domains/",t,"/keys"))];case 1:return e=r.sent(),[2,n(n({},this._parseDomainKeysList(e.body)),{status:e.status})]}}))}))},o.prototype.listAll=function(t){return r(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return e=n(n(n({},(null==t?void 0:t.signingDomain)?{signing_domain:encodeURIComponent(t.signingDomain)}:{}),(null==t?void 0:t.selector)?{selector:encodeURIComponent(t.selector)}:{}),{page:"",limit:""}),[4,this.requestListWithPages(f("/v1/dkim/keys"),e)];case 1:return[2,r.sent()]}}))}))},o.prototype.create=function(t){return r(this,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return e={signing_domain:t.signingDomain,selector:t.selector},t.bits&&(e.bits=t.bits),t.pem&&(e.pem=t.pem),[4,this.request.postWithFD(f("v1/dkim/keys"),e)];case 1:return r=s.sent(),[2,n({status:r.status},r.body)]}}))}))},o.prototype.activate=function(t,e){return r(this,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.put("/v4/domains/".concat(t,"/keys/").concat(e,"/activate"))];case 1:return r=s.sent(),[2,n(n({},r.body),{status:r.status})]}}))}))},o.prototype.deactivate=function(t,e){return r(this,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,this.request.put("/v4/domains/".concat(t,"/keys/").concat(e,"/deactivate"))];case 1:return r=s.sent(),[2,n(n({},r.body),{status:r.status})]}}))}))},o.prototype.destroy=function(t,e){return r(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.request.delete(f("v1/dkim/keys"),void 0,{signing_domain:t,selector:e})];case 1:return[2,n.sent().body]}}))}))},o.prototype.updateDKIMSelector=function(t,e){var n;return r(this,void 0,void 0,(function(){var r,o;return s(this,(function(s){switch(s.label){case 0:return r={query:"dkim_selector=".concat(e.dkimSelector)},[4,this.request.put("/v3/domains/".concat(t,"/dkim_selector"),{},r)];case 1:return[2,{status:(o=s.sent()).status,message:null===(n=null==o?void 0:o.body)||void 0===n?void 0:n.message}]}}))}))},o.prototype.updateDKIMAuthority=function(t,e){return r(this,void 0,void 0,(function(){var n;return s(this,(function(r){return n={query:"self=".concat(e.self)},[2,this.request.put("/v3/domains/".concat(t,"/dkim_authority"),{},n).then((function(t){return t})).then((function(t){return t.body}))]}))}))},o}(en),Nn=function(){function t(t,e){var r=n({},t);if(r.url||(r.url="https://api.mailgun.net"),!r.username)throw new Error('Parameter "username" is required');if(!r.key)throw new Error('Parameter "key" is required');if(r.useFetch&&r.proxy)throw new Error("Proxy can not be used with fetch provider");this.request=new Ye(r,e);var s=new wn(this.request),o=new Rn(this.request),i=new Dn(this.request),a=new On(this.request),u=new Bn(this.request),c=new jn(this.request),l=new Sn(this.request),d=new Cn(this.request),p=new Fn(this.request,"/v4/inbox/seedlists/a"),h=new Fn(this.request,"/v4/inbox/results/a"),f=new Pn(this.request,"/v4/inbox/seedlists/_filters"),y=new Pn(this.request,"/v4/inbox/results/_filters"),m=new An(this.request,p,f),b=new xn(this.request,h,y,d),v=new Ln(this.request);this.domains=new tn(this.request,o,i,a,u,c),this.webhooks=new hn(this.request),this.events=new nn(this.request),this.stats=new sn(this.request),this.metrics=new Un(this.request),this.suppressions=new dn(this.request),this.messages=new fn(this.request),this.routes=new yn(this.request),this.ips=new bn(this.request),this.ip_pools=new vn(this.request),this.lists=new gn(this.request,s),this.validate=new mn(this.request,l),this.subaccounts=new Xe(this.request),this.inboxPlacements=new kn(this.request,m,b,v)}return t.prototype.setSubaccount=function(t){var e;null===(e=this.request)||void 0===e||e.setSubaccountHeader(t)},t.prototype.resetSubaccount=function(){var t;null===(t=this.request)||void 0===t||t.resetSubaccountHeader()},t}();return function(){function t(t){this.formData=t}return Object.defineProperty(t,"default",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.client=function(t){return new Nn(t,this.formData)},t}()}));
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [12.3.0](https://github.com/mailgun/mailgun.js/compare/v12.2.0...v12.3.0) (2025-12-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Add domain keys endpoints ([74d5f02](https://github.com/mailgun/mailgun.js/commits/74d5f02c8835a467b67d0366ff11dd797116e964))
|
|
11
|
+
* Add missed messages endpoints ([8df975a](https://github.com/mailgun/mailgun.js/commits/8df975a79fbb011d86b45bd2fcfbb040ab510f5d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Other changes
|
|
15
|
+
|
|
16
|
+
* Add tests for domainKeys and deprecation messages to logs ([3d6e9b2](https://github.com/mailgun/mailgun.js/commits/3d6e9b2378f1cfdc17c3d42dab3821f34711e7de))
|
|
17
|
+
* Refresh build and types ([3dedac7](https://github.com/mailgun/mailgun.js/commits/3dedac7e946d433441722f8868545b2e62408d29))
|
|
18
|
+
* Update Readme ([f117df5](https://github.com/mailgun/mailgun.js/commits/f117df585c8e96d67d7f6ee46cd6efb9e700604f))
|
|
19
|
+
* Update readme by domainKeys methods ([886c4eb](https://github.com/mailgun/mailgun.js/commits/886c4eb2cc8866911a77db54a24ab26c15428740))
|
|
20
|
+
|
|
21
|
+
## [12.2.0](https://github.com/mailgun/mailgun.js/compare/v12.1.1...v12.2.0) (2025-11-25)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* Add new subaccounts endpoints and fix existing types ([a4bb781](https://github.com/mailgun/mailgun.js/commits/a4bb781b1a1d158614bff2dceb3bdaca49e15d8c))
|
|
27
|
+
|
|
5
28
|
### [12.1.1](https://github.com/mailgun/mailgun.js/compare/v12.1.0...v12.1.1) (2025-10-10)
|
|
6
29
|
|
|
7
30
|
|
package/CJS/definitions.cjs
CHANGED