axios-7accb92c.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. function e(e,t){return function(){return e.apply(t,arguments)}}
  2. // utils is a library of generic helper functions non-specific to axios
  3. const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(i=Object.create(null),e=>{const n=t.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())});var i;const a=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e
  4. /**
  5. * Determine if a value is an Array
  6. *
  7. * @param {Object} val The value to test
  8. *
  9. * @returns {boolean} True if value is an Array, otherwise false
  10. */,{isArray:l}=Array,u=c("undefined");
  11. /**
  12. * Determine if a value is an ArrayBuffer
  13. *
  14. * @param {*} val The value to test
  15. *
  16. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  17. */
  18. const f=a("ArrayBuffer");
  19. /**
  20. * Determine if a value is a view on an ArrayBuffer
  21. *
  22. * @param {*} val The value to test
  23. *
  24. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  25. */
  26. /**
  27. * Determine if a value is a String
  28. *
  29. * @param {*} val The value to test
  30. *
  31. * @returns {boolean} True if value is a String, otherwise false
  32. */
  33. const d=c("string"),p=c("function"),h=c("number"),m=e=>null!==e&&"object"==typeof e
  34. /**
  35. * Determine if a value is a Boolean
  36. *
  37. * @param {*} thing The value to test
  38. * @returns {boolean} True if value is a Boolean, otherwise false
  39. */,y=e=>{if("object"!==s(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||o in e||r in e)},b=a("Date"),g=a("File"),w=a("Blob"),E=a("FileList"),O=a("URLSearchParams"),[R,S,T,A]=["ReadableStream","Request","Response","Headers"].map(a);
  40. /**
  41. * Determine if a value is a Function
  42. *
  43. * @param {*} val The value to test
  44. * @returns {boolean} True if value is a Function, otherwise false
  45. */
  46. /**
  47. * Iterate over an Array or an Object invoking a function for each item.
  48. *
  49. * If `obj` is an Array callback will be called passing
  50. * the value, index, and complete array for each item.
  51. *
  52. * If 'obj' is an Object callback will be called passing
  53. * the value, key, and complete object for each property.
  54. *
  55. * @param {Object|Array} obj The object to iterate
  56. * @param {Function} fn The callback to invoke for each item
  57. *
  58. * @param {Boolean} [allOwnKeys = false]
  59. * @returns {any}
  60. */
  61. function v(e,t,{allOwnKeys:n=!1}={}){
  62. // Don't bother if no value provided
  63. if(null==e)return;let r,o;if(
  64. // Force an array if not already something iterable
  65. "object"!=typeof e&&(
  66. /*eslint no-param-reassign:0*/
  67. e=[e]),l(e))
  68. // Iterate over array values
  69. for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{
  70. // Iterate over object keys
  71. const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function x(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const j=
  72. /*eslint no-undef:0*/
  73. "undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=e=>!u(e)&&e!==j
  74. /**
  75. * Accepts varargs expecting each argument to be an object, then
  76. * immutably merges the properties of each object and returns result.
  77. *
  78. * When multiple objects contain the same key the later object in
  79. * the arguments list will take precedence.
  80. *
  81. * Example:
  82. *
  83. * ```js
  84. * var result = merge({foo: 123}, {foo: 456});
  85. * console.log(result.foo); // outputs 456
  86. * ```
  87. *
  88. * @param {Object} obj1 Object to merge
  89. *
  90. * @returns {Object} Result of all merge properties
  91. */;
  92. /**
  93. * Extends object a by mutably adding to it the properties of object b.
  94. *
  95. * @param {Object} a The object to be extended
  96. * @param {Object} b The object to copy properties from
  97. * @param {Object} thisArg The object to bind function to
  98. *
  99. * @param {Boolean} [allOwnKeys]
  100. * @returns {Object} The resulting value of object a
  101. */
  102. const N=(P="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>P&&e instanceof P);
  103. /**
  104. * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  105. *
  106. * @param {string} content with BOM
  107. *
  108. * @returns {string} content value without BOM
  109. */var P;
  110. /**
  111. * For each entry in the object, call the function with the key and value.
  112. *
  113. * @param {Object<any, any>} obj - The object to iterate over.
  114. * @param {Function} fn - The function to call for each entry.
  115. *
  116. * @returns {void}
  117. */
  118. const U=a("HTMLFormElement"),_=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),F=a("RegExp"),L=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};v(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)};
  119. /**
  120. * It takes a regular expression and a string, and returns an array of all the matches
  121. *
  122. * @param {string} regExp - The regular expression to match against.
  123. * @param {string} str - The string to search.
  124. *
  125. * @returns {Array<boolean>}
  126. */const B=a("AsyncFunction"),k=(D="function"==typeof setImmediate,q=p(j.postMessage),D?setImmediate:q?(M=`axios@${Math.random()}`,I=[],j.addEventListener("message",(({source:e,data:t})=>{e===j&&t===M&&I.length&&I.shift()()}),!1),e=>{I.push(e),j.postMessage(M,"*")}):e=>setTimeout(e));var D,q,M,I;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||k,H={isArray:l,isArrayBuffer:f,isBuffer:
  127. /**
  128. * Determine if a value is a Buffer
  129. *
  130. * @param {*} val The value to test
  131. *
  132. * @returns {boolean} True if value is a Buffer, otherwise false
  133. */
  134. function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=s(e))||
  135. // detect form-data instance
  136. "object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:d,isNumber:h,isBoolean:e=>!0===e||!1===e
  137. /**
  138. * Determine if a value is a plain Object
  139. *
  140. * @param {*} val The value to test
  141. *
  142. * @returns {boolean} True if value is a plain Object, otherwise false
  143. */,isObject:m,isPlainObject:y,isReadableStream:R,isRequest:S,isResponse:T,isHeaders:A,isUndefined:u,isDate:b,isFile:g,isBlob:w,isRegExp:F,isFunction:p,isStream:e=>m(e)&&p(e.pipe)
  144. /**
  145. * Determine if a value is a FormData
  146. *
  147. * @param {*} thing The value to test
  148. *
  149. * @returns {boolean} True if value is an FormData, otherwise false
  150. */,isURLSearchParams:O,isTypedArray:N,isFileList:E,forEach:v,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,o)=>{const s=t&&x(n,o)||o;y(n[s])&&y(r)?n[s]=e(n[s],r):y(r)?n[s]=e({},r):l(r)?n[s]=r.slice():n[s]=r};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&v(arguments[o],r);return n},extend:(t,n,r,{allOwnKeys:o}={})=>(v(n,((n,o)=>{r&&p(n)?t[o]=e(n,r):t[o]=n}),{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};
  151. // eslint-disable-next-line no-eq-null,eqeqeq
  152. if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!h(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:U,hasOwnProperty:_,hasOwnProp:_,// an alias to avoid ESLint no-prototype-builtins detection
  153. reduceDescriptors:L,freezeMethods:e=>{L(e,((t,n)=>{
  154. // skip restricted props in strict mode
  155. if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:j,isContextDefined:C,isSpecCompliantForm:
  156. /**
  157. * If the thing is a FormData object, return true, otherwise return false.
  158. *
  159. * @param {unknown} thing - The thing to check.
  160. *
  161. * @returns {boolean}
  162. */
  163. function(e){return!!(e&&p(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return v(e,((e,t)=>{const s=n(e,r+1);!u(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch)
  164. // original code
  165. // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
  166. ,setImmediate:k,asap:z,isIterable:e=>null!=e&&p(e[r])};
  167. // *********************
  168. /**
  169. * Create an Error with the specified message, config, error code, request and response.
  170. *
  171. * @param {string} message The error message.
  172. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  173. * @param {Object} [config] The config.
  174. * @param {Object} [request] The request.
  175. * @param {Object} [response] The response.
  176. *
  177. * @returns {Error} The created error.
  178. */
  179. function J(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}H.inherits(J,Error,{toJSON:function(){return{
  180. // Standard
  181. message:this.message,name:this.name,
  182. // Microsoft
  183. description:this.description,number:this.number,
  184. // Mozilla
  185. fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,
  186. // Axios
  187. config:H.toJSONObject(this.config),code:this.code,status:this.status}}});const W=J.prototype,K={};["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((e=>{K[e]={value:e}})),Object.defineProperties(J,K),Object.defineProperty(W,"isAxiosError",{value:!0}),
  188. // eslint-disable-next-line func-names
  189. J.from=(e,t,n,r,o,s)=>{const i=Object.create(W);return H.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),J.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};
  190. /**
  191. * Determines if the given thing is a array or js object.
  192. *
  193. * @param {string} thing - The object or array to be visited.
  194. *
  195. * @returns {boolean}
  196. */
  197. function V(e){return H.isPlainObject(e)||H.isArray(e)}
  198. /**
  199. * It removes the brackets from the end of a string
  200. *
  201. * @param {string} key - The key of the parameter.
  202. *
  203. * @returns {string} the key without the brackets.
  204. */function $(e){return H.endsWith(e,"[]")?e.slice(0,-2):e}
  205. /**
  206. * It takes a path, a key, and a boolean, and returns a string
  207. *
  208. * @param {string} path - The path to the current key.
  209. * @param {string} key - The key of the current object being iterated over.
  210. * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
  211. *
  212. * @returns {string} The path to the current key.
  213. */function X(e,t,n){return e?e.concat(t).map((function(e,t){
  214. // eslint-disable-next-line no-param-reassign
  215. return e=$(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}
  216. /**
  217. * If the array is an array and none of its elements are visitable, then it's a flat array.
  218. *
  219. * @param {Array<any>} arr - The array to check
  220. *
  221. * @returns {boolean}
  222. */const G=H.toFlatObject(H,{},null,(function(e){return/^is[A-Z]/.test(e)}));
  223. /**
  224. * Convert a data object to FormData
  225. *
  226. * @param {Object} obj
  227. * @param {?Object} [formData]
  228. * @param {?Object} [options]
  229. * @param {Function} [options.visitor]
  230. * @param {Boolean} [options.metaTokens = true]
  231. * @param {Boolean} [options.dots = false]
  232. * @param {?Boolean} [options.indexes = false]
  233. *
  234. * @returns {Object}
  235. **/
  236. /**
  237. * It converts an object into a FormData object
  238. *
  239. * @param {Object<any, any>} obj - The object to convert to form data.
  240. * @param {string} formData - The FormData object to append to.
  241. * @param {Object<string, any>} options
  242. *
  243. * @returns
  244. */function Q(e,t,n){if(!H.isObject(e))throw new TypeError("target must be an object");
  245. // eslint-disable-next-line no-param-reassign
  246. t=t||new FormData;const r=(
  247. // eslint-disable-next-line no-param-reassign
  248. n=H.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){
  249. // eslint-disable-next-line no-eq-null,eqeqeq
  250. return!H.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&H.isSpecCompliantForm(t);
  251. // eslint-disable-next-line no-use-before-define
  252. if(!H.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(H.isDate(e))return e.toISOString();if(!a&&H.isBlob(e))throw new J("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(e)||H.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}
  253. /**
  254. * Default visitor.
  255. *
  256. * @param {*} value
  257. * @param {String|Number} key
  258. * @param {Array<String|Number>} path
  259. * @this {FormData}
  260. *
  261. * @returns {boolean} return true to visit the each prop of the value recursively
  262. */function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(H.endsWith(n,"{}"))
  263. // eslint-disable-next-line no-param-reassign
  264. n=r?n:n.slice(0,-2),
  265. // eslint-disable-next-line no-param-reassign
  266. e=JSON.stringify(e);else if(H.isArray(e)&&function(e){return H.isArray(e)&&!e.some(V)}(e)||(H.isFileList(e)||H.endsWith(n,"[]"))&&(a=H.toArray(e)))
  267. // eslint-disable-next-line no-param-reassign
  268. return n=$(n),a.forEach((function(e,r){!H.isUndefined(e)&&null!==e&&t.append(
  269. // eslint-disable-next-line no-nested-ternary
  270. !0===i?X([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!V(e)||(t.append(X(o,n,s),c(e)),!1)}const u=[],f=Object.assign(G,{defaultVisitor:l,convertValue:c,isVisitable:V});if(!H.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!H.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),H.forEach(n,(function(n,s){!0===(!(H.isUndefined(n)||null===n)&&o.call(t,n,H.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),u.pop()}}(e),t}
  271. /**
  272. * It encodes a string by replacing all characters that are not in the unreserved set with
  273. * their percent-encoded equivalents
  274. *
  275. * @param {string} str - The string to encode.
  276. *
  277. * @returns {string} The encoded string.
  278. */function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}
  279. /**
  280. * It takes a params object and converts it to a FormData object
  281. *
  282. * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
  283. * @param {Object<string, any>} options - The options object passed to the Axios constructor.
  284. *
  285. * @returns {void}
  286. */function Y(e,t){this._pairs=[],e&&Q(e,this,t)}const ee=Y.prototype;
  287. /**
  288. * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
  289. * URI encoded counterparts
  290. *
  291. * @param {string} val The value to be encoded.
  292. *
  293. * @returns {string} The encoded value.
  294. */
  295. function te(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}
  296. /**
  297. * Build a URL by appending params to the end
  298. *
  299. * @param {string} url The base of the url (e.g., http://www.google.com)
  300. * @param {object} [params] The params to be appended
  301. * @param {?(object|Function)} options
  302. *
  303. * @returns {string} The formatted url
  304. */function ne(e,t,n){
  305. /*eslint no-param-reassign:0*/
  306. if(!t)return e;const r=n&&n.encode||te;H.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):H.isURLSearchParams(t)?t.toString():new Y(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ee.append=function(e,t){this._pairs.push([e,t])},ee.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const re=class{constructor(){this.handlers=[]}
  307. /**
  308. * Add a new interceptor to the stack
  309. *
  310. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  311. * @param {Function} rejected The function to handle `reject` for a `Promise`
  312. *
  313. * @return {Number} An ID used to remove interceptor later
  314. */use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}
  315. /**
  316. * Remove an interceptor from the stack
  317. *
  318. * @param {Number} id The ID that was returned by `use`
  319. *
  320. * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
  321. */eject(e){this.handlers[e]&&(this.handlers[e]=null)}
  322. /**
  323. * Clear all interceptors from the stack
  324. *
  325. * @returns {void}
  326. */clear(){this.handlers&&(this.handlers=[])}
  327. /**
  328. * Iterate over all the registered interceptors
  329. *
  330. * This method is particularly useful for skipping over any
  331. * interceptors that may have become `null` calling `eject`.
  332. *
  333. * @param {Function} fn The function to call for each interceptor
  334. *
  335. * @returns {void}
  336. */forEach(e){H.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},oe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},se={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Y,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ie="undefined"!=typeof window&&"undefined"!=typeof document,ae="object"==typeof navigator&&navigator||void 0,ce=ie&&(!ae||["ReactNative","NativeScript","NS"].indexOf(ae.product)<0),le="undefined"!=typeof WorkerGlobalScope&&
  337. // eslint-disable-next-line no-undef
  338. self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ue=ie&&window.location.href||"http://localhost",fe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ie,hasStandardBrowserEnv:ce,hasStandardBrowserWebWorkerEnv:le,navigator:ae,origin:ue},Symbol.toStringTag,{value:"Module"})),...se};
  339. /**
  340. * It takes a FormData object and returns a JavaScript object
  341. *
  342. * @param {string} formData The FormData object to convert to JSON.
  343. *
  344. * @returns {Object<string, any> | null} The converted object.
  345. */
  346. function de(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&H.isArray(r)?r.length:s,a)return H.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&H.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&H.isArray(r[s])&&(r[s]=
  347. /**
  348. * Convert an array to an object.
  349. *
  350. * @param {Array<any>} arr - The array to convert to an object.
  351. *
  352. * @returns An object with the same keys and values as the array.
  353. */
  354. function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(H.isFormData(e)&&H.isFunction(e.entries)){const n={};return H.forEachEntry(e,((e,r)=>{t(
  355. /**
  356. * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
  357. *
  358. * @param {string} name - The name of the property to get.
  359. *
  360. * @returns An array of strings.
  361. */
  362. function(e){
  363. // foo[x][y][z]
  364. // foo.x.y.z
  365. // foo-x-y-z
  366. // foo x y z
  367. return H.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}
  368. /**
  369. * It takes a string, tries to parse it, and if it fails, it returns the stringified version
  370. * of the input
  371. *
  372. * @param {any} rawValue - The value to be stringified.
  373. * @param {Function} parser - A function that parses a string into a JavaScript object.
  374. * @param {Function} encoder - A function that takes a value and returns a string.
  375. *
  376. * @returns {string} A stringified version of the rawValue.
  377. */const pe={transitional:oe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=H.isObject(e);o&&H.isHTMLForm(e)&&(e=new FormData(e));if(H.isFormData(e))return r?JSON.stringify(de(e)):e;if(H.isArrayBuffer(e)||H.isBuffer(e)||H.isStream(e)||H.isFile(e)||H.isBlob(e)||H.isReadableStream(e))return e;if(H.isArrayBufferView(e))return e.buffer;if(H.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Q(e,new fe.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return fe.isNode&&H.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=H.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Q(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(H.isString(e))try{return(t||JSON.parse)(e),H.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||pe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(H.isResponse(e)||H.isReadableStream(e))return e;if(e&&H.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(n){if("SyntaxError"===o.name)throw J.from(o,J.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],
  378. /**
  379. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  380. * timeout is not created.
  381. */
  382. timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fe.classes.FormData,Blob:fe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],(e=>{pe.headers[e]={}}));const he=pe,me=H.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"]),ye=Symbol("internals");
  383. // RawAxiosHeaders whose duplicates are ignored by node
  384. // c.f. https://nodejs.org/api/http.html#http_message_headers
  385. function be(e){return e&&String(e).trim().toLowerCase()}function ge(e){return!1===e||null==e?e:H.isArray(e)?e.map(ge):String(e)}function we(e,t,n,r,o){return H.isFunction(r)?r.call(this,t,n):(o&&(t=n),H.isString(t)?H.isString(r)?-1!==t.indexOf(r):H.isRegExp(r)?r.test(t):void 0:void 0)}class Ee{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=be(t);if(!o)throw new Error("header name must be a non-empty string");const s=H.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ge(e))}const s=(e,t)=>H.forEach(e,((e,n)=>o(e,n,t)));if(H.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(H.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&me[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(H.isObject(e)&&H.isIterable(e)){let n,r,o={};for(const t of e){if(!H.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?H.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=be(e)){const n=H.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(H.isFunction(t))return t.call(this,e,n);if(H.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=be(e)){const n=H.findKey(this,e);return!(!n||void 0===this[n]||t&&!we(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=be(e)){const o=H.findKey(n,e);!o||t&&!we(0,n[o],o,t)||(delete n[o],r=!0)}}return H.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!we(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return H.forEach(this,((r,o)=>{const s=H.findKey(n,o);if(s)return t[s]=ge(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ge(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return H.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&H.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ye]=this[ye]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=be(e);t[r]||(!function(e,t){const n=H.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return H.isArray(e)?e.forEach(r):r(e),this}}Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),
  386. // reserved names hotfix
  387. H.reduceDescriptors(Ee.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);// map `set` => `Set`
  388. return{get:()=>e,set(e){this[n]=e}}})),H.freezeMethods(Ee);const Oe=Ee;
  389. /**
  390. * Transform the data for a request or a response
  391. *
  392. * @param {Array|Function} fns A single function or Array of functions
  393. * @param {?Object} response The response object
  394. *
  395. * @returns {*} The resulting transformed data
  396. */function Re(e,t){const n=this||he,r=t||n,o=Oe.from(r.headers);let s=r.data;return H.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Se(e){return!(!e||!e.__CANCEL__)}
  397. /**
  398. * A `CanceledError` is an object that is thrown when an operation is canceled.
  399. *
  400. * @param {string=} message The message.
  401. * @param {Object=} config The config.
  402. * @param {Object=} request The request.
  403. *
  404. * @returns {CanceledError} The created error.
  405. */function Te(e,t,n){
  406. // eslint-disable-next-line no-eq-null,eqeqeq
  407. J.call(this,null==e?"canceled":e,J.ERR_CANCELED,t,n),this.name="CanceledError"}
  408. /**
  409. * Resolve or reject a Promise based on response status.
  410. *
  411. * @param {Function} resolve A function that resolves the promise.
  412. * @param {Function} reject A function that rejects the promise.
  413. * @param {object} response The response.
  414. *
  415. * @returns {object} The response.
  416. */
  417. function Ae(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}H.inherits(Te,J,{__CANCEL__:!0});const ve=(e,t,n=3)=>{let r=0;const o=
  418. /**
  419. * Calculate data maxRate
  420. * @param {Number} [samplesCount= 10]
  421. * @param {Number} [min= 1000]
  422. * @returns {Function}
  423. */
  424. function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}
  425. /**
  426. * Throttle decorator
  427. * @param {Function} fn
  428. * @param {Number} freq
  429. * @return {Function}
  430. */(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,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,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},xe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},je=e=>(...t)=>H.asap((()=>e(...t))),Ce=fe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,fe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(fe.origin),fe.navigator&&/(msie|trident)/i.test(fe.navigator.userAgent)):()=>!0,Ne=fe.hasStandardBrowserEnv?
  431. // Standard browser envs support document.cookie
  432. {write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];H.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),H.isString(r)&&i.push("path="+r),H.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:
  433. // Non-standard browser env (web workers, react-native) lack needed support.
  434. {write(){},read:()=>null,remove(){}};
  435. /**
  436. * Creates a new URL by combining the baseURL with the requestedURL,
  437. * only when the requestedURL is not already an absolute URL.
  438. * If the requestURL is absolute, this function returns the requestedURL untouched.
  439. *
  440. * @param {string} baseURL The base URL
  441. * @param {string} requestedURL Absolute or relative URL to combine
  442. *
  443. * @returns {string} The combined full path
  444. */
  445. function Pe(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?
  446. /**
  447. * Creates a new URL by combining the specified URLs
  448. *
  449. * @param {string} baseURL The base URL
  450. * @param {string} relativeURL The relative URL
  451. *
  452. * @returns {string} The combined URL
  453. */
  454. function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ue=e=>e instanceof Oe?{...e}:e
  455. /**
  456. * Config-specific merge-function which creates a new config-object
  457. * by merging two configuration objects together.
  458. *
  459. * @param {Object} config1
  460. * @param {Object} config2
  461. *
  462. * @returns {Object} New object resulting from merging config2 to config1
  463. */;function _e(e,t){
  464. // eslint-disable-next-line no-param-reassign
  465. t=t||{};const n={};function r(e,t,n,r){return H.isPlainObject(e)&&H.isPlainObject(t)?H.merge.call({caseless:r},e,t):H.isPlainObject(t)?H.merge({},t):H.isArray(t)?t.slice():t}
  466. // eslint-disable-next-line consistent-return
  467. function o(e,t,n,o){return H.isUndefined(t)?H.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}
  468. // eslint-disable-next-line consistent-return
  469. function s(e,t){if(!H.isUndefined(t))return r(void 0,t)}
  470. // eslint-disable-next-line consistent-return
  471. function i(e,t){return H.isUndefined(t)?H.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}
  472. // eslint-disable-next-line consistent-return
  473. function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={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:(e,t,n)=>o(Ue(e),Ue(t),0,!0)};return H.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);H.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Fe=e=>{const t=_e({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=Oe.from(a),t.url=ne(Pe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),
  474. // HTTP basic authentication
  475. c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),H.isFormData(r))if(fe.hasStandardBrowserEnv||fe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);// Let the browser set it
  476. else if(!1!==(n=a.getContentType())){
  477. // fix semicolon duplication issue for ReactNative FormData implementation
  478. const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}
  479. // Add xsrf header
  480. // This is only done if running in a standard browser environment.
  481. // Specifically not if we're in a web worker, or react-native.
  482. if(fe.hasStandardBrowserEnv&&(o&&H.isFunction(o)&&(o=o(t)),o||!1!==o&&Ce(t.url))){
  483. // Add xsrf header
  484. const e=s&&i&&Ne.read(i);e&&a.set(s,e)}return t},Le="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Fe(e);let o=r.data;const s=Oe.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),// flush events
  485. u&&u(),// flush events
  486. r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function y(){if(!m)return;
  487. // Prepare the response
  488. const r=Oe.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ae((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),
  489. // Clean up request
  490. m=null}m.open(r.method.toUpperCase(),r.url,!0),
  491. // Set the request timeout in MS
  492. m.timeout=r.timeout,"onloadend"in m?
  493. // Use onloadend if available
  494. m.onloadend=y:
  495. // Listen for ready state to emulate onloadend
  496. m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&
  497. // readystate handler is calling before onerror or ontimeout handlers,
  498. // so we should call onloadend on the next 'tick'
  499. setTimeout(y);
  500. // The request errored out and we didn't get a response, this will be
  501. // handled by onerror instead
  502. // With one exception: request that using file: protocol, most browsers
  503. // will return status as 0 even though it's a successful request
  504. },
  505. // Handle browser request cancellation (as opposed to a manual cancellation)
  506. m.onabort=function(){m&&(n(new J("Request aborted",J.ECONNABORTED,e,m)),
  507. // Clean up request
  508. m=null)},
  509. // Handle low level network errors
  510. m.onerror=function(){
  511. // Real errors are hidden from us by the browser
  512. // onerror should only fire if it's a network error
  513. n(new J("Network Error",J.ERR_NETWORK,e,m)),
  514. // Clean up request
  515. m=null},
  516. // Handle timeout
  517. m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||oe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new J(t,o.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,m)),
  518. // Clean up request
  519. m=null},
  520. // Remove Content-Type if data is undefined
  521. void 0===o&&s.setContentType(null),
  522. // Add headers to the request
  523. "setRequestHeader"in m&&H.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),
  524. // Add withCredentials to request if needed
  525. H.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),
  526. // Add responseType to request if needed
  527. f&&"json"!==f&&(m.responseType=r.responseType),
  528. // Handle progress if needed
  529. p&&([c,u]=ve(p,!0),m.addEventListener("progress",c)),
  530. // Not all browsers support upload events
  531. d&&m.upload&&([a,l]=ve(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(
  532. // Handle cancellation
  533. // eslint-disable-next-line func-names
  534. i=t=>{m&&(n(!t||t.type?new Te(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===fe.protocols.indexOf(b)?n(new J("Unsupported protocol "+b+":",J.ERR_BAD_REQUEST,e)):
  535. // Send the request
  536. m.send(o||null)}))},Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof J?t:new Te(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new J(`timeout ${t} of ms exceeded`,J.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>H.asap(i),a}},ke=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},De=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},qe=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of De(e))yield*ke(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Me="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ie=Me&&"function"==typeof ReadableStream,ze=Me&&("function"==typeof TextEncoder?(He=new TextEncoder,e=>He.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var He;const Je=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},We=Ie&&Je((()=>{let e=!1;const t=new Request(fe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Ke=Ie&&Je((()=>H.isReadableStream(new Response("").body))),Ve={stream:Ke&&(e=>e.body)};var $e;Me&&($e=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ve[e]&&(Ve[e]=H.isFunction($e[e])?t=>t[e]():(t,n)=>{throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,n)})})));const Xe=async(e,t)=>{const n=H.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(H.isBlob(e))return e.size;if(H.isSpecCompliantForm(e)){const t=new Request(fe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return H.isArrayBufferView(e)||H.isArrayBuffer(e)?e.byteLength:(H.isURLSearchParams(e)&&(e+=""),H.isString(e)?(await ze(e)).byteLength:void 0)})(t):n},Ge={http:null,xhr:Le,fetch:Me&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:d}=Fe(e);l=l?(l+"").toLowerCase():"text";let p,h=Be([o,s&&s.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let y;try{if(c&&We&&"get"!==n&&"head"!==n&&0!==(y=await Xe(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(H.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=xe(y,ve(je(c)));r=qe(n.body,65536,e,t)}}H.isString(f)||(f=f?"include":"omit");
  537. // Cloudflare Workers throws when credentials are defined
  538. // see https://github.com/cloudflare/workerd/issues/902
  539. const o="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let s=await fetch(p);const i=Ke&&("stream"===l||"response"===l);if(Ke&&(a||i&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=H.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&xe(t,ve(je(a),!0))||[];s=new Response(qe(s.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let b=await Ve[H.findKey(Ve,l)||"text"](s,e);return!i&&m&&m(),await new Promise(((t,n)=>{Ae(t,n,{data:b,headers:Oe.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:p})}))}catch(b){if(m&&m(),b&&"TypeError"===b.name&&/Load failed|fetch/i.test(b.message))throw Object.assign(new J("Network Error",J.ERR_NETWORK,e,p),{cause:b.cause||b});throw J.from(b,b&&b.code,e,p)}})};H.forEach(Ge,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){
  540. // eslint-disable-next-line no-empty
  541. }Object.defineProperty(e,"adapterName",{value:t})}}));const Qe=e=>`- ${e}`,Ze=e=>H.isFunction(e)||null===e||!1===e,Ye=e=>{e=H.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!Ze(n)&&(r=Ge[(t=String(n)).toLowerCase()],void 0===r))throw new J(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new J("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Qe).join("\n"):" "+Qe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};
  542. /**
  543. * Throws a `CanceledError` if cancellation has been requested.
  544. *
  545. * @param {Object} config The config that is to be used for the request
  546. *
  547. * @returns {void}
  548. */
  549. function et(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}
  550. /**
  551. * Dispatch a request to the server using the configured adapter.
  552. *
  553. * @param {object} config The config that is to be used for the request
  554. *
  555. * @returns {Promise} The Promise to be fulfilled
  556. */function tt(e){et(e),e.headers=Oe.from(e.headers),
  557. // Transform request data
  558. e.data=Re.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ye(e.adapter||he.adapter)(e).then((function(t){return et(e),
  559. // Transform response data
  560. t.data=Re.call(e,e.transformResponse,t),t.headers=Oe.from(t.headers),t}),(function(t){return Se(t)||(et(e),
  561. // Transform response data
  562. t&&t.response&&(t.response.data=Re.call(e,e.transformResponse,t.response),t.response.headers=Oe.from(t.response.headers))),Promise.reject(t)}))}const nt="1.9.0",rt={};
  563. // eslint-disable-next-line func-names
  564. ["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{rt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ot={};
  565. /**
  566. * Transitional option validator
  567. *
  568. * @param {function|boolean?} validator - set to false if the transitional option has been removed
  569. * @param {string?} version - deprecated version / removed since version
  570. * @param {string?} message - some message with additional info
  571. *
  572. * @returns {function}
  573. */rt.transitional=function(e,t,n){
  574. // eslint-disable-next-line func-names
  575. return(r,o,s)=>{if(!1===e)throw new J(function(e,t){return"[Axios v1.9.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}(o," has been removed"+(t?" in "+t:"")),J.ERR_DEPRECATED);return t&&!ot[o]&&(ot[o]=!0),!e||e(r,o,s)}},rt.spelling=function(e){return(e,t)=>!0};const st={assertOptions:
  576. /**
  577. * Assert object's properties type
  578. *
  579. * @param {object} options
  580. * @param {object} schema
  581. * @param {boolean?} allowUnknown
  582. *
  583. * @returns {object}
  584. */
  585. function(e,t,n){if("object"!=typeof e)throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new J("option "+s+" must be "+n,J.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}},validators:rt},it=st.validators;
  586. /**
  587. * Create a new instance of Axios
  588. *
  589. * @param {Object} instanceConfig The default config for the instance
  590. *
  591. * @return {Axios} A new instance of Axios
  592. */
  593. let at=class{constructor(e){this.defaults=e||{},this.interceptors={request:new re,response:new re}}
  594. /**
  595. * Dispatch a request
  596. *
  597. * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
  598. * @param {?Object} config
  599. *
  600. * @returns {Promise} The Promise to be fulfilled
  601. */async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;
  602. // slice off the Error: ... line
  603. const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){
  604. // ignore the case where "stack" is an un-writable property
  605. }}throw n}}_request(e,t){
  606. /*eslint no-param-reassign:0*/
  607. // Allow for axios('example/url'[, config]) a la fetch API
  608. "string"==typeof e?(t=t||{}).url=e:t=e||{},t=_e(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&st.assertOptions(n,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean)},!1),null!=r&&(H.isFunction(r)?t.paramsSerializer={serialize:r}:st.assertOptions(r,{encode:it.function,serialize:it.function},!0)),
  609. // Set config.allowAbsoluteUrls
  610. void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),st.assertOptions(t,{baseUrl:it.spelling("baseURL"),withXsrfToken:it.spelling("withXSRFToken")},!0),
  611. // Set config.method
  612. t.method=(t.method||this.defaults.method||"get").toLowerCase();
  613. // Flatten headers
  614. let s=o&&H.merge(o.common,o[t.method]);o&&H.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Oe.concat(s,o);
  615. // filter out skipped interceptors
  616. const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,f=0;if(!a){const e=[tt.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(f=0;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(p){t.call(this,p);break}}try{l=tt.call(this,d)}catch(p){return Promise.reject(p)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return ne(Pe((e=_e(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};
  617. // Provide aliases for supported request methods
  618. H.forEach(["delete","get","head","options"],(function(e){
  619. /*eslint func-names:0*/
  620. at.prototype[e]=function(t,n){return this.request(_e(n||{},{method:e,url:t,data:(n||{}).data}))}})),H.forEach(["post","put","patch"],(function(e){
  621. /*eslint func-names:0*/
  622. function t(t){return function(n,r,o){return this.request(_e(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}at.prototype[e]=t(),at.prototype[e+"Form"]=t(!0)}));const ct=at;
  623. /**
  624. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  625. *
  626. * @param {Function} executor The executor function.
  627. *
  628. * @returns {CancelToken}
  629. */class lt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;
  630. // eslint-disable-next-line func-names
  631. this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),
  632. // eslint-disable-next-line func-names
  633. this.promise.then=e=>{let t;
  634. // eslint-disable-next-line func-names
  635. const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Te(e,r,o),t(n.reason))}))}
  636. /**
  637. * Throws a `CanceledError` if cancellation has been requested.
  638. */throwIfRequested(){if(this.reason)throw this.reason}
  639. /**
  640. * Subscribe to the cancel signal
  641. */subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}
  642. /**
  643. * Unsubscribe from the cancel signal
  644. */unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}
  645. /**
  646. * Returns an object that contains a new `CancelToken` and a function that, when called,
  647. * cancels the `CancelToken`.
  648. */static source(){let e;return{token:new lt((function(t){e=t})),cancel:e}}}const ut=lt;
  649. /**
  650. * Syntactic sugar for invoking a function and expanding an array for arguments.
  651. *
  652. * Common use case would be to use `Function.prototype.apply`.
  653. *
  654. * ```js
  655. * function f(x, y, z) {}
  656. * var args = [1, 2, 3];
  657. * f.apply(null, args);
  658. * ```
  659. *
  660. * With `spread` this example can be re-written.
  661. *
  662. * ```js
  663. * spread(function(x, y, z) {})([1, 2, 3]);
  664. * ```
  665. *
  666. * @param {Function} callback
  667. *
  668. * @returns {Function}
  669. */const ft={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(ft).forEach((([e,t])=>{ft[t]=e}));const dt=ft;
  670. /**
  671. * Create an instance of Axios
  672. *
  673. * @param {Object} defaultConfig The default config for the instance
  674. *
  675. * @returns {Axios} A new instance of Axios
  676. */
  677. // Create the default instance to be exported
  678. const pt=function t(n){const r=new ct(n),o=e(ct.prototype.request,r);
  679. // Copy axios.prototype to instance
  680. return H.extend(o,ct.prototype,r,{allOwnKeys:!0}),
  681. // Copy context to instance
  682. H.extend(o,r,null,{allOwnKeys:!0}),
  683. // Factory for creating new instances
  684. o.create=function(e){return t(_e(n,e))},o}(he);
  685. // Expose Axios class to allow class inheritance
  686. pt.Axios=ct,
  687. // Expose Cancel & CancelToken
  688. pt.CanceledError=Te,pt.CancelToken=ut,pt.isCancel=Se,pt.VERSION=nt,pt.toFormData=Q,
  689. // Expose AxiosError class
  690. pt.AxiosError=J,
  691. // alias for CanceledError for backward compatibility
  692. pt.Cancel=pt.CanceledError,
  693. // Expose all/spread
  694. pt.all=function(e){return Promise.all(e)},pt.spread=function(e){return function(t){return e.apply(null,t)}}
  695. /**
  696. * Determines whether the payload is an error thrown by Axios
  697. *
  698. * @param {*} payload The value to test
  699. *
  700. * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
  701. */,
  702. // Expose isAxiosError
  703. pt.isAxiosError=function(e){return H.isObject(e)&&!0===e.isAxiosError},
  704. // Expose mergeConfig
  705. pt.mergeConfig=_e,pt.AxiosHeaders=Oe,pt.formToJSON=e=>de(H.isHTMLForm(e)?new FormData(e):e),pt.getAdapter=Ye,pt.HttpStatusCode=dt,pt.default=pt;
  706. // this module should only have a default export
  707. const ht=pt;export{ht as A};
  708. //# sourceMappingURL=axios-7accb92c.js.map