axios.js 88 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855
  1. import {
  2. __export
  3. } from "./chunk-SSYGV25P.js";
  4. // node_modules/axios/lib/helpers/bind.js
  5. function bind(fn, thisArg) {
  6. return function wrap() {
  7. return fn.apply(thisArg, arguments);
  8. };
  9. }
  10. // node_modules/axios/lib/utils.js
  11. var { toString } = Object.prototype;
  12. var { getPrototypeOf } = Object;
  13. var { iterator, toStringTag } = Symbol;
  14. var kindOf = ((cache) => (thing) => {
  15. const str = toString.call(thing);
  16. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  17. })(/* @__PURE__ */ Object.create(null));
  18. var kindOfTest = (type) => {
  19. type = type.toLowerCase();
  20. return (thing) => kindOf(thing) === type;
  21. };
  22. var typeOfTest = (type) => (thing) => typeof thing === type;
  23. var { isArray } = Array;
  24. var isUndefined = typeOfTest("undefined");
  25. function isBuffer(val) {
  26. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
  27. }
  28. var isArrayBuffer = kindOfTest("ArrayBuffer");
  29. function isArrayBufferView(val) {
  30. let result;
  31. if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
  32. result = ArrayBuffer.isView(val);
  33. } else {
  34. result = val && val.buffer && isArrayBuffer(val.buffer);
  35. }
  36. return result;
  37. }
  38. var isString = typeOfTest("string");
  39. var isFunction = typeOfTest("function");
  40. var isNumber = typeOfTest("number");
  41. var isObject = (thing) => thing !== null && typeof thing === "object";
  42. var isBoolean = (thing) => thing === true || thing === false;
  43. var isPlainObject = (val) => {
  44. if (kindOf(val) !== "object") {
  45. return false;
  46. }
  47. const prototype2 = getPrototypeOf(val);
  48. return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
  49. };
  50. var isEmptyObject = (val) => {
  51. if (!isObject(val) || isBuffer(val)) {
  52. return false;
  53. }
  54. try {
  55. return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
  56. } catch (e) {
  57. return false;
  58. }
  59. };
  60. var isDate = kindOfTest("Date");
  61. var isFile = kindOfTest("File");
  62. var isReactNativeBlob = (value) => {
  63. return !!(value && typeof value.uri !== "undefined");
  64. };
  65. var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
  66. var isBlob = kindOfTest("Blob");
  67. var isFileList = kindOfTest("FileList");
  68. var isStream = (val) => isObject(val) && isFunction(val.pipe);
  69. function getGlobal() {
  70. if (typeof globalThis !== "undefined")
  71. return globalThis;
  72. if (typeof self !== "undefined")
  73. return self;
  74. if (typeof window !== "undefined")
  75. return window;
  76. if (typeof global !== "undefined")
  77. return global;
  78. return {};
  79. }
  80. var G = getGlobal();
  81. var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
  82. var isFormData = (thing) => {
  83. if (!thing)
  84. return false;
  85. if (FormDataCtor && thing instanceof FormDataCtor)
  86. return true;
  87. const proto = getPrototypeOf(thing);
  88. if (!proto || proto === Object.prototype)
  89. return false;
  90. if (!isFunction(thing.append))
  91. return false;
  92. const kind = kindOf(thing);
  93. return kind === "formdata" || // detect form-data instance
  94. kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]";
  95. };
  96. var isURLSearchParams = kindOfTest("URLSearchParams");
  97. var [isReadableStream, isRequest, isResponse, isHeaders] = [
  98. "ReadableStream",
  99. "Request",
  100. "Response",
  101. "Headers"
  102. ].map(kindOfTest);
  103. var trim = (str) => {
  104. return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
  105. };
  106. function forEach(obj, fn, { allOwnKeys = false } = {}) {
  107. if (obj === null || typeof obj === "undefined") {
  108. return;
  109. }
  110. let i;
  111. let l;
  112. if (typeof obj !== "object") {
  113. obj = [obj];
  114. }
  115. if (isArray(obj)) {
  116. for (i = 0, l = obj.length; i < l; i++) {
  117. fn.call(null, obj[i], i, obj);
  118. }
  119. } else {
  120. if (isBuffer(obj)) {
  121. return;
  122. }
  123. const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
  124. const len = keys.length;
  125. let key;
  126. for (i = 0; i < len; i++) {
  127. key = keys[i];
  128. fn.call(null, obj[key], key, obj);
  129. }
  130. }
  131. }
  132. function findKey(obj, key) {
  133. if (isBuffer(obj)) {
  134. return null;
  135. }
  136. key = key.toLowerCase();
  137. const keys = Object.keys(obj);
  138. let i = keys.length;
  139. let _key;
  140. while (i-- > 0) {
  141. _key = keys[i];
  142. if (key === _key.toLowerCase()) {
  143. return _key;
  144. }
  145. }
  146. return null;
  147. }
  148. var _global = (() => {
  149. if (typeof globalThis !== "undefined")
  150. return globalThis;
  151. return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
  152. })();
  153. var isContextDefined = (context) => !isUndefined(context) && context !== _global;
  154. function merge() {
  155. const { caseless, skipUndefined } = isContextDefined(this) && this || {};
  156. const result = {};
  157. const assignValue = (val, key) => {
  158. if (key === "__proto__" || key === "constructor" || key === "prototype") {
  159. return;
  160. }
  161. const targetKey = caseless && findKey(result, key) || key;
  162. if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
  163. result[targetKey] = merge(result[targetKey], val);
  164. } else if (isPlainObject(val)) {
  165. result[targetKey] = merge({}, val);
  166. } else if (isArray(val)) {
  167. result[targetKey] = val.slice();
  168. } else if (!skipUndefined || !isUndefined(val)) {
  169. result[targetKey] = val;
  170. }
  171. };
  172. for (let i = 0, l = arguments.length; i < l; i++) {
  173. arguments[i] && forEach(arguments[i], assignValue);
  174. }
  175. return result;
  176. }
  177. var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
  178. forEach(
  179. b,
  180. (val, key) => {
  181. if (thisArg && isFunction(val)) {
  182. Object.defineProperty(a, key, {
  183. value: bind(val, thisArg),
  184. writable: true,
  185. enumerable: true,
  186. configurable: true
  187. });
  188. } else {
  189. Object.defineProperty(a, key, {
  190. value: val,
  191. writable: true,
  192. enumerable: true,
  193. configurable: true
  194. });
  195. }
  196. },
  197. { allOwnKeys }
  198. );
  199. return a;
  200. };
  201. var stripBOM = (content) => {
  202. if (content.charCodeAt(0) === 65279) {
  203. content = content.slice(1);
  204. }
  205. return content;
  206. };
  207. var inherits = (constructor, superConstructor, props, descriptors) => {
  208. constructor.prototype = Object.create(superConstructor.prototype, descriptors);
  209. Object.defineProperty(constructor.prototype, "constructor", {
  210. value: constructor,
  211. writable: true,
  212. enumerable: false,
  213. configurable: true
  214. });
  215. Object.defineProperty(constructor, "super", {
  216. value: superConstructor.prototype
  217. });
  218. props && Object.assign(constructor.prototype, props);
  219. };
  220. var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
  221. let props;
  222. let i;
  223. let prop;
  224. const merged = {};
  225. destObj = destObj || {};
  226. if (sourceObj == null)
  227. return destObj;
  228. do {
  229. props = Object.getOwnPropertyNames(sourceObj);
  230. i = props.length;
  231. while (i-- > 0) {
  232. prop = props[i];
  233. if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
  234. destObj[prop] = sourceObj[prop];
  235. merged[prop] = true;
  236. }
  237. }
  238. sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
  239. } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
  240. return destObj;
  241. };
  242. var endsWith = (str, searchString, position) => {
  243. str = String(str);
  244. if (position === void 0 || position > str.length) {
  245. position = str.length;
  246. }
  247. position -= searchString.length;
  248. const lastIndex = str.indexOf(searchString, position);
  249. return lastIndex !== -1 && lastIndex === position;
  250. };
  251. var toArray = (thing) => {
  252. if (!thing)
  253. return null;
  254. if (isArray(thing))
  255. return thing;
  256. let i = thing.length;
  257. if (!isNumber(i))
  258. return null;
  259. const arr = new Array(i);
  260. while (i-- > 0) {
  261. arr[i] = thing[i];
  262. }
  263. return arr;
  264. };
  265. var isTypedArray = ((TypedArray) => {
  266. return (thing) => {
  267. return TypedArray && thing instanceof TypedArray;
  268. };
  269. })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
  270. var forEachEntry = (obj, fn) => {
  271. const generator = obj && obj[iterator];
  272. const _iterator = generator.call(obj);
  273. let result;
  274. while ((result = _iterator.next()) && !result.done) {
  275. const pair = result.value;
  276. fn.call(obj, pair[0], pair[1]);
  277. }
  278. };
  279. var matchAll = (regExp, str) => {
  280. let matches;
  281. const arr = [];
  282. while ((matches = regExp.exec(str)) !== null) {
  283. arr.push(matches);
  284. }
  285. return arr;
  286. };
  287. var isHTMLForm = kindOfTest("HTMLFormElement");
  288. var toCamelCase = (str) => {
  289. return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
  290. return p1.toUpperCase() + p2;
  291. });
  292. };
  293. var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
  294. var isRegExp = kindOfTest("RegExp");
  295. var reduceDescriptors = (obj, reducer) => {
  296. const descriptors = Object.getOwnPropertyDescriptors(obj);
  297. const reducedDescriptors = {};
  298. forEach(descriptors, (descriptor, name) => {
  299. let ret;
  300. if ((ret = reducer(descriptor, name, obj)) !== false) {
  301. reducedDescriptors[name] = ret || descriptor;
  302. }
  303. });
  304. Object.defineProperties(obj, reducedDescriptors);
  305. };
  306. var freezeMethods = (obj) => {
  307. reduceDescriptors(obj, (descriptor, name) => {
  308. if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
  309. return false;
  310. }
  311. const value = obj[name];
  312. if (!isFunction(value))
  313. return;
  314. descriptor.enumerable = false;
  315. if ("writable" in descriptor) {
  316. descriptor.writable = false;
  317. return;
  318. }
  319. if (!descriptor.set) {
  320. descriptor.set = () => {
  321. throw Error("Can not rewrite read-only method '" + name + "'");
  322. };
  323. }
  324. });
  325. };
  326. var toObjectSet = (arrayOrString, delimiter) => {
  327. const obj = {};
  328. const define = (arr) => {
  329. arr.forEach((value) => {
  330. obj[value] = true;
  331. });
  332. };
  333. isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  334. return obj;
  335. };
  336. var noop = () => {
  337. };
  338. var toFiniteNumber = (value, defaultValue) => {
  339. return value != null && Number.isFinite(value = +value) ? value : defaultValue;
  340. };
  341. function isSpecCompliantForm(thing) {
  342. return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
  343. }
  344. var toJSONObject = (obj) => {
  345. const stack = new Array(10);
  346. const visit = (source, i) => {
  347. if (isObject(source)) {
  348. if (stack.indexOf(source) >= 0) {
  349. return;
  350. }
  351. if (isBuffer(source)) {
  352. return source;
  353. }
  354. if (!("toJSON" in source)) {
  355. stack[i] = source;
  356. const target = isArray(source) ? [] : {};
  357. forEach(source, (value, key) => {
  358. const reducedValue = visit(value, i + 1);
  359. !isUndefined(reducedValue) && (target[key] = reducedValue);
  360. });
  361. stack[i] = void 0;
  362. return target;
  363. }
  364. }
  365. return source;
  366. };
  367. return visit(obj, 0);
  368. };
  369. var isAsyncFn = kindOfTest("AsyncFunction");
  370. var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
  371. var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
  372. if (setImmediateSupported) {
  373. return setImmediate;
  374. }
  375. return postMessageSupported ? ((token, callbacks) => {
  376. _global.addEventListener(
  377. "message",
  378. ({ source, data }) => {
  379. if (source === _global && data === token) {
  380. callbacks.length && callbacks.shift()();
  381. }
  382. },
  383. false
  384. );
  385. return (cb) => {
  386. callbacks.push(cb);
  387. _global.postMessage(token, "*");
  388. };
  389. })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
  390. })(typeof setImmediate === "function", isFunction(_global.postMessage));
  391. var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
  392. var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
  393. var utils_default = {
  394. isArray,
  395. isArrayBuffer,
  396. isBuffer,
  397. isFormData,
  398. isArrayBufferView,
  399. isString,
  400. isNumber,
  401. isBoolean,
  402. isObject,
  403. isPlainObject,
  404. isEmptyObject,
  405. isReadableStream,
  406. isRequest,
  407. isResponse,
  408. isHeaders,
  409. isUndefined,
  410. isDate,
  411. isFile,
  412. isReactNativeBlob,
  413. isReactNative,
  414. isBlob,
  415. isRegExp,
  416. isFunction,
  417. isStream,
  418. isURLSearchParams,
  419. isTypedArray,
  420. isFileList,
  421. forEach,
  422. merge,
  423. extend,
  424. trim,
  425. stripBOM,
  426. inherits,
  427. toFlatObject,
  428. kindOf,
  429. kindOfTest,
  430. endsWith,
  431. toArray,
  432. forEachEntry,
  433. matchAll,
  434. isHTMLForm,
  435. hasOwnProperty,
  436. hasOwnProp: hasOwnProperty,
  437. // an alias to avoid ESLint no-prototype-builtins detection
  438. reduceDescriptors,
  439. freezeMethods,
  440. toObjectSet,
  441. toCamelCase,
  442. noop,
  443. toFiniteNumber,
  444. findKey,
  445. global: _global,
  446. isContextDefined,
  447. isSpecCompliantForm,
  448. toJSONObject,
  449. isAsyncFn,
  450. isThenable,
  451. setImmediate: _setImmediate,
  452. asap,
  453. isIterable
  454. };
  455. // node_modules/axios/lib/core/AxiosError.js
  456. var AxiosError = class _AxiosError extends Error {
  457. static from(error, code, config, request, response, customProps) {
  458. const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
  459. axiosError.cause = error;
  460. axiosError.name = error.name;
  461. if (error.status != null && axiosError.status == null) {
  462. axiosError.status = error.status;
  463. }
  464. customProps && Object.assign(axiosError, customProps);
  465. return axiosError;
  466. }
  467. /**
  468. * Create an Error with the specified message, config, error code, request and response.
  469. *
  470. * @param {string} message The error message.
  471. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  472. * @param {Object} [config] The config.
  473. * @param {Object} [request] The request.
  474. * @param {Object} [response] The response.
  475. *
  476. * @returns {Error} The created error.
  477. */
  478. constructor(message, code, config, request, response) {
  479. super(message);
  480. Object.defineProperty(this, "message", {
  481. value: message,
  482. enumerable: true,
  483. writable: true,
  484. configurable: true
  485. });
  486. this.name = "AxiosError";
  487. this.isAxiosError = true;
  488. code && (this.code = code);
  489. config && (this.config = config);
  490. request && (this.request = request);
  491. if (response) {
  492. this.response = response;
  493. this.status = response.status;
  494. }
  495. }
  496. toJSON() {
  497. return {
  498. // Standard
  499. message: this.message,
  500. name: this.name,
  501. // Microsoft
  502. description: this.description,
  503. number: this.number,
  504. // Mozilla
  505. fileName: this.fileName,
  506. lineNumber: this.lineNumber,
  507. columnNumber: this.columnNumber,
  508. stack: this.stack,
  509. // Axios
  510. config: utils_default.toJSONObject(this.config),
  511. code: this.code,
  512. status: this.status
  513. };
  514. }
  515. };
  516. AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
  517. AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
  518. AxiosError.ECONNABORTED = "ECONNABORTED";
  519. AxiosError.ETIMEDOUT = "ETIMEDOUT";
  520. AxiosError.ERR_NETWORK = "ERR_NETWORK";
  521. AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
  522. AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
  523. AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
  524. AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
  525. AxiosError.ERR_CANCELED = "ERR_CANCELED";
  526. AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
  527. AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
  528. AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
  529. var AxiosError_default = AxiosError;
  530. // node_modules/axios/lib/helpers/null.js
  531. var null_default = null;
  532. // node_modules/axios/lib/helpers/toFormData.js
  533. function isVisitable(thing) {
  534. return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
  535. }
  536. function removeBrackets(key) {
  537. return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
  538. }
  539. function renderKey(path, key, dots) {
  540. if (!path)
  541. return key;
  542. return path.concat(key).map(function each(token, i) {
  543. token = removeBrackets(token);
  544. return !dots && i ? "[" + token + "]" : token;
  545. }).join(dots ? "." : "");
  546. }
  547. function isFlatArray(arr) {
  548. return utils_default.isArray(arr) && !arr.some(isVisitable);
  549. }
  550. var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
  551. return /^is[A-Z]/.test(prop);
  552. });
  553. function toFormData(obj, formData, options) {
  554. if (!utils_default.isObject(obj)) {
  555. throw new TypeError("target must be an object");
  556. }
  557. formData = formData || new (null_default || FormData)();
  558. options = utils_default.toFlatObject(
  559. options,
  560. {
  561. metaTokens: true,
  562. dots: false,
  563. indexes: false
  564. },
  565. false,
  566. function defined(option, source) {
  567. return !utils_default.isUndefined(source[option]);
  568. }
  569. );
  570. const metaTokens = options.metaTokens;
  571. const visitor = options.visitor || defaultVisitor;
  572. const dots = options.dots;
  573. const indexes = options.indexes;
  574. const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
  575. const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
  576. const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
  577. if (!utils_default.isFunction(visitor)) {
  578. throw new TypeError("visitor must be a function");
  579. }
  580. function convertValue(value) {
  581. if (value === null)
  582. return "";
  583. if (utils_default.isDate(value)) {
  584. return value.toISOString();
  585. }
  586. if (utils_default.isBoolean(value)) {
  587. return value.toString();
  588. }
  589. if (!useBlob && utils_default.isBlob(value)) {
  590. throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
  591. }
  592. if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
  593. return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
  594. }
  595. return value;
  596. }
  597. function defaultVisitor(value, key, path) {
  598. let arr = value;
  599. if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
  600. formData.append(renderKey(path, key, dots), convertValue(value));
  601. return false;
  602. }
  603. if (value && !path && typeof value === "object") {
  604. if (utils_default.endsWith(key, "{}")) {
  605. key = metaTokens ? key : key.slice(0, -2);
  606. value = JSON.stringify(value);
  607. } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
  608. key = removeBrackets(key);
  609. arr.forEach(function each(el, index) {
  610. !(utils_default.isUndefined(el) || el === null) && formData.append(
  611. // eslint-disable-next-line no-nested-ternary
  612. indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
  613. convertValue(el)
  614. );
  615. });
  616. return false;
  617. }
  618. }
  619. if (isVisitable(value)) {
  620. return true;
  621. }
  622. formData.append(renderKey(path, key, dots), convertValue(value));
  623. return false;
  624. }
  625. const stack = [];
  626. const exposedHelpers = Object.assign(predicates, {
  627. defaultVisitor,
  628. convertValue,
  629. isVisitable
  630. });
  631. function build(value, path, depth = 0) {
  632. if (utils_default.isUndefined(value))
  633. return;
  634. if (depth > maxDepth) {
  635. throw new AxiosError_default(
  636. "Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth,
  637. AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED
  638. );
  639. }
  640. if (stack.indexOf(value) !== -1) {
  641. throw Error("Circular reference detected in " + path.join("."));
  642. }
  643. stack.push(value);
  644. utils_default.forEach(value, function each(el, key) {
  645. const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers);
  646. if (result === true) {
  647. build(el, path ? path.concat(key) : [key], depth + 1);
  648. }
  649. });
  650. stack.pop();
  651. }
  652. if (!utils_default.isObject(obj)) {
  653. throw new TypeError("data must be an object");
  654. }
  655. build(obj);
  656. return formData;
  657. }
  658. var toFormData_default = toFormData;
  659. // node_modules/axios/lib/helpers/AxiosURLSearchParams.js
  660. function encode(str) {
  661. const charMap = {
  662. "!": "%21",
  663. "'": "%27",
  664. "(": "%28",
  665. ")": "%29",
  666. "~": "%7E",
  667. "%20": "+"
  668. };
  669. return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
  670. return charMap[match];
  671. });
  672. }
  673. function AxiosURLSearchParams(params, options) {
  674. this._pairs = [];
  675. params && toFormData_default(params, this, options);
  676. }
  677. var prototype = AxiosURLSearchParams.prototype;
  678. prototype.append = function append(name, value) {
  679. this._pairs.push([name, value]);
  680. };
  681. prototype.toString = function toString2(encoder) {
  682. const _encode = encoder ? function(value) {
  683. return encoder.call(this, value, encode);
  684. } : encode;
  685. return this._pairs.map(function each(pair) {
  686. return _encode(pair[0]) + "=" + _encode(pair[1]);
  687. }, "").join("&");
  688. };
  689. var AxiosURLSearchParams_default = AxiosURLSearchParams;
  690. // node_modules/axios/lib/helpers/buildURL.js
  691. function encode2(val) {
  692. return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
  693. }
  694. function buildURL(url, params, options) {
  695. if (!params) {
  696. return url;
  697. }
  698. const _encode = options && options.encode || encode2;
  699. const _options = utils_default.isFunction(options) ? {
  700. serialize: options
  701. } : options;
  702. const serializeFn = _options && _options.serialize;
  703. let serializedParams;
  704. if (serializeFn) {
  705. serializedParams = serializeFn(params, _options);
  706. } else {
  707. serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode);
  708. }
  709. if (serializedParams) {
  710. const hashmarkIndex = url.indexOf("#");
  711. if (hashmarkIndex !== -1) {
  712. url = url.slice(0, hashmarkIndex);
  713. }
  714. url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  715. }
  716. return url;
  717. }
  718. // node_modules/axios/lib/core/InterceptorManager.js
  719. var InterceptorManager = class {
  720. constructor() {
  721. this.handlers = [];
  722. }
  723. /**
  724. * Add a new interceptor to the stack
  725. *
  726. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  727. * @param {Function} rejected The function to handle `reject` for a `Promise`
  728. * @param {Object} options The options for the interceptor, synchronous and runWhen
  729. *
  730. * @return {Number} An ID used to remove interceptor later
  731. */
  732. use(fulfilled, rejected, options) {
  733. this.handlers.push({
  734. fulfilled,
  735. rejected,
  736. synchronous: options ? options.synchronous : false,
  737. runWhen: options ? options.runWhen : null
  738. });
  739. return this.handlers.length - 1;
  740. }
  741. /**
  742. * Remove an interceptor from the stack
  743. *
  744. * @param {Number} id The ID that was returned by `use`
  745. *
  746. * @returns {void}
  747. */
  748. eject(id) {
  749. if (this.handlers[id]) {
  750. this.handlers[id] = null;
  751. }
  752. }
  753. /**
  754. * Clear all interceptors from the stack
  755. *
  756. * @returns {void}
  757. */
  758. clear() {
  759. if (this.handlers) {
  760. this.handlers = [];
  761. }
  762. }
  763. /**
  764. * Iterate over all the registered interceptors
  765. *
  766. * This method is particularly useful for skipping over any
  767. * interceptors that may have become `null` calling `eject`.
  768. *
  769. * @param {Function} fn The function to call for each interceptor
  770. *
  771. * @returns {void}
  772. */
  773. forEach(fn) {
  774. utils_default.forEach(this.handlers, function forEachHandler(h) {
  775. if (h !== null) {
  776. fn(h);
  777. }
  778. });
  779. }
  780. };
  781. var InterceptorManager_default = InterceptorManager;
  782. // node_modules/axios/lib/defaults/transitional.js
  783. var transitional_default = {
  784. silentJSONParsing: true,
  785. forcedJSONParsing: true,
  786. clarifyTimeoutError: false,
  787. legacyInterceptorReqResOrdering: true
  788. };
  789. // node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
  790. var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
  791. // node_modules/axios/lib/platform/browser/classes/FormData.js
  792. var FormData_default = typeof FormData !== "undefined" ? FormData : null;
  793. // node_modules/axios/lib/platform/browser/classes/Blob.js
  794. var Blob_default = typeof Blob !== "undefined" ? Blob : null;
  795. // node_modules/axios/lib/platform/browser/index.js
  796. var browser_default = {
  797. isBrowser: true,
  798. classes: {
  799. URLSearchParams: URLSearchParams_default,
  800. FormData: FormData_default,
  801. Blob: Blob_default
  802. },
  803. protocols: ["http", "https", "file", "blob", "url", "data"]
  804. };
  805. // node_modules/axios/lib/platform/common/utils.js
  806. var utils_exports = {};
  807. __export(utils_exports, {
  808. hasBrowserEnv: () => hasBrowserEnv,
  809. hasStandardBrowserEnv: () => hasStandardBrowserEnv,
  810. hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
  811. navigator: () => _navigator,
  812. origin: () => origin
  813. });
  814. var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
  815. var _navigator = typeof navigator === "object" && navigator || void 0;
  816. var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
  817. var hasStandardBrowserWebWorkerEnv = (() => {
  818. return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
  819. self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
  820. })();
  821. var origin = hasBrowserEnv && window.location.href || "http://localhost";
  822. // node_modules/axios/lib/platform/index.js
  823. var platform_default = {
  824. ...utils_exports,
  825. ...browser_default
  826. };
  827. // node_modules/axios/lib/helpers/toURLEncodedForm.js
  828. function toURLEncodedForm(data, options) {
  829. return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
  830. visitor: function(value, key, path, helpers) {
  831. if (platform_default.isNode && utils_default.isBuffer(value)) {
  832. this.append(key, value.toString("base64"));
  833. return false;
  834. }
  835. return helpers.defaultVisitor.apply(this, arguments);
  836. },
  837. ...options
  838. });
  839. }
  840. // node_modules/axios/lib/helpers/formDataToJSON.js
  841. function parsePropPath(name) {
  842. return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
  843. return match[0] === "[]" ? "" : match[1] || match[0];
  844. });
  845. }
  846. function arrayToObject(arr) {
  847. const obj = {};
  848. const keys = Object.keys(arr);
  849. let i;
  850. const len = keys.length;
  851. let key;
  852. for (i = 0; i < len; i++) {
  853. key = keys[i];
  854. obj[key] = arr[key];
  855. }
  856. return obj;
  857. }
  858. function formDataToJSON(formData) {
  859. function buildPath(path, value, target, index) {
  860. let name = path[index++];
  861. if (name === "__proto__")
  862. return true;
  863. const isNumericKey = Number.isFinite(+name);
  864. const isLast = index >= path.length;
  865. name = !name && utils_default.isArray(target) ? target.length : name;
  866. if (isLast) {
  867. if (utils_default.hasOwnProp(target, name)) {
  868. target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
  869. } else {
  870. target[name] = value;
  871. }
  872. return !isNumericKey;
  873. }
  874. if (!target[name] || !utils_default.isObject(target[name])) {
  875. target[name] = [];
  876. }
  877. const result = buildPath(path, value, target[name], index);
  878. if (result && utils_default.isArray(target[name])) {
  879. target[name] = arrayToObject(target[name]);
  880. }
  881. return !isNumericKey;
  882. }
  883. if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
  884. const obj = {};
  885. utils_default.forEachEntry(formData, (name, value) => {
  886. buildPath(parsePropPath(name), value, obj, 0);
  887. });
  888. return obj;
  889. }
  890. return null;
  891. }
  892. var formDataToJSON_default = formDataToJSON;
  893. // node_modules/axios/lib/defaults/index.js
  894. var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
  895. function stringifySafely(rawValue, parser, encoder) {
  896. if (utils_default.isString(rawValue)) {
  897. try {
  898. (parser || JSON.parse)(rawValue);
  899. return utils_default.trim(rawValue);
  900. } catch (e) {
  901. if (e.name !== "SyntaxError") {
  902. throw e;
  903. }
  904. }
  905. }
  906. return (encoder || JSON.stringify)(rawValue);
  907. }
  908. var defaults = {
  909. transitional: transitional_default,
  910. adapter: ["xhr", "http", "fetch"],
  911. transformRequest: [
  912. function transformRequest(data, headers) {
  913. const contentType = headers.getContentType() || "";
  914. const hasJSONContentType = contentType.indexOf("application/json") > -1;
  915. const isObjectPayload = utils_default.isObject(data);
  916. if (isObjectPayload && utils_default.isHTMLForm(data)) {
  917. data = new FormData(data);
  918. }
  919. const isFormData2 = utils_default.isFormData(data);
  920. if (isFormData2) {
  921. return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
  922. }
  923. if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
  924. return data;
  925. }
  926. if (utils_default.isArrayBufferView(data)) {
  927. return data.buffer;
  928. }
  929. if (utils_default.isURLSearchParams(data)) {
  930. headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
  931. return data.toString();
  932. }
  933. let isFileList2;
  934. if (isObjectPayload) {
  935. const formSerializer = own(this, "formSerializer");
  936. if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
  937. return toURLEncodedForm(data, formSerializer).toString();
  938. }
  939. if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
  940. const env = own(this, "env");
  941. const _FormData = env && env.FormData;
  942. return toFormData_default(
  943. isFileList2 ? { "files[]": data } : data,
  944. _FormData && new _FormData(),
  945. formSerializer
  946. );
  947. }
  948. }
  949. if (isObjectPayload || hasJSONContentType) {
  950. headers.setContentType("application/json", false);
  951. return stringifySafely(data);
  952. }
  953. return data;
  954. }
  955. ],
  956. transformResponse: [
  957. function transformResponse(data) {
  958. const transitional2 = own(this, "transitional") || defaults.transitional;
  959. const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
  960. const responseType = own(this, "responseType");
  961. const JSONRequested = responseType === "json";
  962. if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
  963. return data;
  964. }
  965. if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
  966. const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
  967. const strictJSONParsing = !silentJSONParsing && JSONRequested;
  968. try {
  969. return JSON.parse(data, own(this, "parseReviver"));
  970. } catch (e) {
  971. if (strictJSONParsing) {
  972. if (e.name === "SyntaxError") {
  973. throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, own(this, "response"));
  974. }
  975. throw e;
  976. }
  977. }
  978. }
  979. return data;
  980. }
  981. ],
  982. /**
  983. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  984. * timeout is not created.
  985. */
  986. timeout: 0,
  987. xsrfCookieName: "XSRF-TOKEN",
  988. xsrfHeaderName: "X-XSRF-TOKEN",
  989. maxContentLength: -1,
  990. maxBodyLength: -1,
  991. env: {
  992. FormData: platform_default.classes.FormData,
  993. Blob: platform_default.classes.Blob
  994. },
  995. validateStatus: function validateStatus(status) {
  996. return status >= 200 && status < 300;
  997. },
  998. headers: {
  999. common: {
  1000. Accept: "application/json, text/plain, */*",
  1001. "Content-Type": void 0
  1002. }
  1003. }
  1004. };
  1005. utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
  1006. defaults.headers[method] = {};
  1007. });
  1008. var defaults_default = defaults;
  1009. // node_modules/axios/lib/helpers/parseHeaders.js
  1010. var ignoreDuplicateOf = utils_default.toObjectSet([
  1011. "age",
  1012. "authorization",
  1013. "content-length",
  1014. "content-type",
  1015. "etag",
  1016. "expires",
  1017. "from",
  1018. "host",
  1019. "if-modified-since",
  1020. "if-unmodified-since",
  1021. "last-modified",
  1022. "location",
  1023. "max-forwards",
  1024. "proxy-authorization",
  1025. "referer",
  1026. "retry-after",
  1027. "user-agent"
  1028. ]);
  1029. var parseHeaders_default = (rawHeaders) => {
  1030. const parsed = {};
  1031. let key;
  1032. let val;
  1033. let i;
  1034. rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
  1035. i = line.indexOf(":");
  1036. key = line.substring(0, i).trim().toLowerCase();
  1037. val = line.substring(i + 1).trim();
  1038. if (!key || parsed[key] && ignoreDuplicateOf[key]) {
  1039. return;
  1040. }
  1041. if (key === "set-cookie") {
  1042. if (parsed[key]) {
  1043. parsed[key].push(val);
  1044. } else {
  1045. parsed[key] = [val];
  1046. }
  1047. } else {
  1048. parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
  1049. }
  1050. });
  1051. return parsed;
  1052. };
  1053. // node_modules/axios/lib/core/AxiosHeaders.js
  1054. var $internals = Symbol("internals");
  1055. var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
  1056. function trimSPorHTAB(str) {
  1057. let start = 0;
  1058. let end = str.length;
  1059. while (start < end) {
  1060. const code = str.charCodeAt(start);
  1061. if (code !== 9 && code !== 32) {
  1062. break;
  1063. }
  1064. start += 1;
  1065. }
  1066. while (end > start) {
  1067. const code = str.charCodeAt(end - 1);
  1068. if (code !== 9 && code !== 32) {
  1069. break;
  1070. }
  1071. end -= 1;
  1072. }
  1073. return start === 0 && end === str.length ? str : str.slice(start, end);
  1074. }
  1075. function normalizeHeader(header) {
  1076. return header && String(header).trim().toLowerCase();
  1077. }
  1078. function sanitizeHeaderValue(str) {
  1079. return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
  1080. }
  1081. function normalizeValue(value) {
  1082. if (value === false || value == null) {
  1083. return value;
  1084. }
  1085. return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
  1086. }
  1087. function parseTokens(str) {
  1088. const tokens = /* @__PURE__ */ Object.create(null);
  1089. const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  1090. let match;
  1091. while (match = tokensRE.exec(str)) {
  1092. tokens[match[1]] = match[2];
  1093. }
  1094. return tokens;
  1095. }
  1096. var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
  1097. function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
  1098. if (utils_default.isFunction(filter2)) {
  1099. return filter2.call(this, value, header);
  1100. }
  1101. if (isHeaderNameFilter) {
  1102. value = header;
  1103. }
  1104. if (!utils_default.isString(value))
  1105. return;
  1106. if (utils_default.isString(filter2)) {
  1107. return value.indexOf(filter2) !== -1;
  1108. }
  1109. if (utils_default.isRegExp(filter2)) {
  1110. return filter2.test(value);
  1111. }
  1112. }
  1113. function formatHeader(header) {
  1114. return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
  1115. return char.toUpperCase() + str;
  1116. });
  1117. }
  1118. function buildAccessors(obj, header) {
  1119. const accessorName = utils_default.toCamelCase(" " + header);
  1120. ["get", "set", "has"].forEach((methodName) => {
  1121. Object.defineProperty(obj, methodName + accessorName, {
  1122. value: function(arg1, arg2, arg3) {
  1123. return this[methodName].call(this, header, arg1, arg2, arg3);
  1124. },
  1125. configurable: true
  1126. });
  1127. });
  1128. }
  1129. var AxiosHeaders = class {
  1130. constructor(headers) {
  1131. headers && this.set(headers);
  1132. }
  1133. set(header, valueOrRewrite, rewrite) {
  1134. const self2 = this;
  1135. function setHeader(_value, _header, _rewrite) {
  1136. const lHeader = normalizeHeader(_header);
  1137. if (!lHeader) {
  1138. throw new Error("header name must be a non-empty string");
  1139. }
  1140. const key = utils_default.findKey(self2, lHeader);
  1141. if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
  1142. self2[key || _header] = normalizeValue(_value);
  1143. }
  1144. }
  1145. const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
  1146. if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
  1147. setHeaders(header, valueOrRewrite);
  1148. } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
  1149. setHeaders(parseHeaders_default(header), valueOrRewrite);
  1150. } else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
  1151. let obj = {}, dest, key;
  1152. for (const entry of header) {
  1153. if (!utils_default.isArray(entry)) {
  1154. throw TypeError("Object iterator must return a key-value pair");
  1155. }
  1156. obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
  1157. }
  1158. setHeaders(obj, valueOrRewrite);
  1159. } else {
  1160. header != null && setHeader(valueOrRewrite, header, rewrite);
  1161. }
  1162. return this;
  1163. }
  1164. get(header, parser) {
  1165. header = normalizeHeader(header);
  1166. if (header) {
  1167. const key = utils_default.findKey(this, header);
  1168. if (key) {
  1169. const value = this[key];
  1170. if (!parser) {
  1171. return value;
  1172. }
  1173. if (parser === true) {
  1174. return parseTokens(value);
  1175. }
  1176. if (utils_default.isFunction(parser)) {
  1177. return parser.call(this, value, key);
  1178. }
  1179. if (utils_default.isRegExp(parser)) {
  1180. return parser.exec(value);
  1181. }
  1182. throw new TypeError("parser must be boolean|regexp|function");
  1183. }
  1184. }
  1185. }
  1186. has(header, matcher) {
  1187. header = normalizeHeader(header);
  1188. if (header) {
  1189. const key = utils_default.findKey(this, header);
  1190. return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
  1191. }
  1192. return false;
  1193. }
  1194. delete(header, matcher) {
  1195. const self2 = this;
  1196. let deleted = false;
  1197. function deleteHeader(_header) {
  1198. _header = normalizeHeader(_header);
  1199. if (_header) {
  1200. const key = utils_default.findKey(self2, _header);
  1201. if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
  1202. delete self2[key];
  1203. deleted = true;
  1204. }
  1205. }
  1206. }
  1207. if (utils_default.isArray(header)) {
  1208. header.forEach(deleteHeader);
  1209. } else {
  1210. deleteHeader(header);
  1211. }
  1212. return deleted;
  1213. }
  1214. clear(matcher) {
  1215. const keys = Object.keys(this);
  1216. let i = keys.length;
  1217. let deleted = false;
  1218. while (i--) {
  1219. const key = keys[i];
  1220. if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
  1221. delete this[key];
  1222. deleted = true;
  1223. }
  1224. }
  1225. return deleted;
  1226. }
  1227. normalize(format) {
  1228. const self2 = this;
  1229. const headers = {};
  1230. utils_default.forEach(this, (value, header) => {
  1231. const key = utils_default.findKey(headers, header);
  1232. if (key) {
  1233. self2[key] = normalizeValue(value);
  1234. delete self2[header];
  1235. return;
  1236. }
  1237. const normalized = format ? formatHeader(header) : String(header).trim();
  1238. if (normalized !== header) {
  1239. delete self2[header];
  1240. }
  1241. self2[normalized] = normalizeValue(value);
  1242. headers[normalized] = true;
  1243. });
  1244. return this;
  1245. }
  1246. concat(...targets) {
  1247. return this.constructor.concat(this, ...targets);
  1248. }
  1249. toJSON(asStrings) {
  1250. const obj = /* @__PURE__ */ Object.create(null);
  1251. utils_default.forEach(this, (value, header) => {
  1252. value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
  1253. });
  1254. return obj;
  1255. }
  1256. [Symbol.iterator]() {
  1257. return Object.entries(this.toJSON())[Symbol.iterator]();
  1258. }
  1259. toString() {
  1260. return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
  1261. }
  1262. getSetCookie() {
  1263. return this.get("set-cookie") || [];
  1264. }
  1265. get [Symbol.toStringTag]() {
  1266. return "AxiosHeaders";
  1267. }
  1268. static from(thing) {
  1269. return thing instanceof this ? thing : new this(thing);
  1270. }
  1271. static concat(first, ...targets) {
  1272. const computed = new this(first);
  1273. targets.forEach((target) => computed.set(target));
  1274. return computed;
  1275. }
  1276. static accessor(header) {
  1277. const internals = this[$internals] = this[$internals] = {
  1278. accessors: {}
  1279. };
  1280. const accessors = internals.accessors;
  1281. const prototype2 = this.prototype;
  1282. function defineAccessor(_header) {
  1283. const lHeader = normalizeHeader(_header);
  1284. if (!accessors[lHeader]) {
  1285. buildAccessors(prototype2, _header);
  1286. accessors[lHeader] = true;
  1287. }
  1288. }
  1289. utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
  1290. return this;
  1291. }
  1292. };
  1293. AxiosHeaders.accessor([
  1294. "Content-Type",
  1295. "Content-Length",
  1296. "Accept",
  1297. "Accept-Encoding",
  1298. "User-Agent",
  1299. "Authorization"
  1300. ]);
  1301. utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
  1302. let mapped = key[0].toUpperCase() + key.slice(1);
  1303. return {
  1304. get: () => value,
  1305. set(headerValue) {
  1306. this[mapped] = headerValue;
  1307. }
  1308. };
  1309. });
  1310. utils_default.freezeMethods(AxiosHeaders);
  1311. var AxiosHeaders_default = AxiosHeaders;
  1312. // node_modules/axios/lib/core/transformData.js
  1313. function transformData(fns, response) {
  1314. const config = this || defaults_default;
  1315. const context = response || config;
  1316. const headers = AxiosHeaders_default.from(context.headers);
  1317. let data = context.data;
  1318. utils_default.forEach(fns, function transform(fn) {
  1319. data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  1320. });
  1321. headers.normalize();
  1322. return data;
  1323. }
  1324. // node_modules/axios/lib/cancel/isCancel.js
  1325. function isCancel(value) {
  1326. return !!(value && value.__CANCEL__);
  1327. }
  1328. // node_modules/axios/lib/cancel/CanceledError.js
  1329. var CanceledError = class extends AxiosError_default {
  1330. /**
  1331. * A `CanceledError` is an object that is thrown when an operation is canceled.
  1332. *
  1333. * @param {string=} message The message.
  1334. * @param {Object=} config The config.
  1335. * @param {Object=} request The request.
  1336. *
  1337. * @returns {CanceledError} The created error.
  1338. */
  1339. constructor(message, config, request) {
  1340. super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
  1341. this.name = "CanceledError";
  1342. this.__CANCEL__ = true;
  1343. }
  1344. };
  1345. var CanceledError_default = CanceledError;
  1346. // node_modules/axios/lib/core/settle.js
  1347. function settle(resolve, reject, response) {
  1348. const validateStatus2 = response.config.validateStatus;
  1349. if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
  1350. resolve(response);
  1351. } else {
  1352. reject(
  1353. new AxiosError_default(
  1354. "Request failed with status code " + response.status,
  1355. [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
  1356. response.config,
  1357. response.request,
  1358. response
  1359. )
  1360. );
  1361. }
  1362. }
  1363. // node_modules/axios/lib/helpers/parseProtocol.js
  1364. function parseProtocol(url) {
  1365. const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  1366. return match && match[1] || "";
  1367. }
  1368. // node_modules/axios/lib/helpers/speedometer.js
  1369. function speedometer(samplesCount, min) {
  1370. samplesCount = samplesCount || 10;
  1371. const bytes = new Array(samplesCount);
  1372. const timestamps = new Array(samplesCount);
  1373. let head = 0;
  1374. let tail = 0;
  1375. let firstSampleTS;
  1376. min = min !== void 0 ? min : 1e3;
  1377. return function push(chunkLength) {
  1378. const now = Date.now();
  1379. const startedAt = timestamps[tail];
  1380. if (!firstSampleTS) {
  1381. firstSampleTS = now;
  1382. }
  1383. bytes[head] = chunkLength;
  1384. timestamps[head] = now;
  1385. let i = tail;
  1386. let bytesCount = 0;
  1387. while (i !== head) {
  1388. bytesCount += bytes[i++];
  1389. i = i % samplesCount;
  1390. }
  1391. head = (head + 1) % samplesCount;
  1392. if (head === tail) {
  1393. tail = (tail + 1) % samplesCount;
  1394. }
  1395. if (now - firstSampleTS < min) {
  1396. return;
  1397. }
  1398. const passed = startedAt && now - startedAt;
  1399. return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  1400. };
  1401. }
  1402. var speedometer_default = speedometer;
  1403. // node_modules/axios/lib/helpers/throttle.js
  1404. function throttle(fn, freq) {
  1405. let timestamp = 0;
  1406. let threshold = 1e3 / freq;
  1407. let lastArgs;
  1408. let timer;
  1409. const invoke = (args, now = Date.now()) => {
  1410. timestamp = now;
  1411. lastArgs = null;
  1412. if (timer) {
  1413. clearTimeout(timer);
  1414. timer = null;
  1415. }
  1416. fn(...args);
  1417. };
  1418. const throttled = (...args) => {
  1419. const now = Date.now();
  1420. const passed = now - timestamp;
  1421. if (passed >= threshold) {
  1422. invoke(args, now);
  1423. } else {
  1424. lastArgs = args;
  1425. if (!timer) {
  1426. timer = setTimeout(() => {
  1427. timer = null;
  1428. invoke(lastArgs);
  1429. }, threshold - passed);
  1430. }
  1431. }
  1432. };
  1433. const flush = () => lastArgs && invoke(lastArgs);
  1434. return [throttled, flush];
  1435. }
  1436. var throttle_default = throttle;
  1437. // node_modules/axios/lib/helpers/progressEventReducer.js
  1438. var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
  1439. let bytesNotified = 0;
  1440. const _speedometer = speedometer_default(50, 250);
  1441. return throttle_default((e) => {
  1442. const rawLoaded = e.loaded;
  1443. const total = e.lengthComputable ? e.total : void 0;
  1444. const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
  1445. const progressBytes = Math.max(0, loaded - bytesNotified);
  1446. const rate = _speedometer(progressBytes);
  1447. bytesNotified = Math.max(bytesNotified, loaded);
  1448. const data = {
  1449. loaded,
  1450. total,
  1451. progress: total ? loaded / total : void 0,
  1452. bytes: progressBytes,
  1453. rate: rate ? rate : void 0,
  1454. estimated: rate && total ? (total - loaded) / rate : void 0,
  1455. event: e,
  1456. lengthComputable: total != null,
  1457. [isDownloadStream ? "download" : "upload"]: true
  1458. };
  1459. listener(data);
  1460. }, freq);
  1461. };
  1462. var progressEventDecorator = (total, throttled) => {
  1463. const lengthComputable = total != null;
  1464. return [
  1465. (loaded) => throttled[0]({
  1466. lengthComputable,
  1467. total,
  1468. loaded
  1469. }),
  1470. throttled[1]
  1471. ];
  1472. };
  1473. var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
  1474. // node_modules/axios/lib/helpers/isURLSameOrigin.js
  1475. var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin2, isMSIE) => (url) => {
  1476. url = new URL(url, platform_default.origin);
  1477. return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
  1478. })(
  1479. new URL(platform_default.origin),
  1480. platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
  1481. ) : () => true;
  1482. // node_modules/axios/lib/helpers/cookies.js
  1483. var cookies_default = platform_default.hasStandardBrowserEnv ? (
  1484. // Standard browser envs support document.cookie
  1485. {
  1486. write(name, value, expires, path, domain, secure, sameSite) {
  1487. if (typeof document === "undefined")
  1488. return;
  1489. const cookie = [`${name}=${encodeURIComponent(value)}`];
  1490. if (utils_default.isNumber(expires)) {
  1491. cookie.push(`expires=${new Date(expires).toUTCString()}`);
  1492. }
  1493. if (utils_default.isString(path)) {
  1494. cookie.push(`path=${path}`);
  1495. }
  1496. if (utils_default.isString(domain)) {
  1497. cookie.push(`domain=${domain}`);
  1498. }
  1499. if (secure === true) {
  1500. cookie.push("secure");
  1501. }
  1502. if (utils_default.isString(sameSite)) {
  1503. cookie.push(`SameSite=${sameSite}`);
  1504. }
  1505. document.cookie = cookie.join("; ");
  1506. },
  1507. read(name) {
  1508. if (typeof document === "undefined")
  1509. return null;
  1510. const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
  1511. return match ? decodeURIComponent(match[1]) : null;
  1512. },
  1513. remove(name) {
  1514. this.write(name, "", Date.now() - 864e5, "/");
  1515. }
  1516. }
  1517. ) : (
  1518. // Non-standard browser env (web workers, react-native) lack needed support.
  1519. {
  1520. write() {
  1521. },
  1522. read() {
  1523. return null;
  1524. },
  1525. remove() {
  1526. }
  1527. }
  1528. );
  1529. // node_modules/axios/lib/helpers/isAbsoluteURL.js
  1530. function isAbsoluteURL(url) {
  1531. if (typeof url !== "string") {
  1532. return false;
  1533. }
  1534. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  1535. }
  1536. // node_modules/axios/lib/helpers/combineURLs.js
  1537. function combineURLs(baseURL, relativeURL) {
  1538. return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
  1539. }
  1540. // node_modules/axios/lib/core/buildFullPath.js
  1541. function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
  1542. let isRelativeUrl = !isAbsoluteURL(requestedURL);
  1543. if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
  1544. return combineURLs(baseURL, requestedURL);
  1545. }
  1546. return requestedURL;
  1547. }
  1548. // node_modules/axios/lib/core/mergeConfig.js
  1549. var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
  1550. function mergeConfig(config1, config2) {
  1551. config2 = config2 || {};
  1552. const config = /* @__PURE__ */ Object.create(null);
  1553. Object.defineProperty(config, "hasOwnProperty", {
  1554. value: Object.prototype.hasOwnProperty,
  1555. enumerable: false,
  1556. writable: true,
  1557. configurable: true
  1558. });
  1559. function getMergedValue(target, source, prop, caseless) {
  1560. if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
  1561. return utils_default.merge.call({ caseless }, target, source);
  1562. } else if (utils_default.isPlainObject(source)) {
  1563. return utils_default.merge({}, source);
  1564. } else if (utils_default.isArray(source)) {
  1565. return source.slice();
  1566. }
  1567. return source;
  1568. }
  1569. function mergeDeepProperties(a, b, prop, caseless) {
  1570. if (!utils_default.isUndefined(b)) {
  1571. return getMergedValue(a, b, prop, caseless);
  1572. } else if (!utils_default.isUndefined(a)) {
  1573. return getMergedValue(void 0, a, prop, caseless);
  1574. }
  1575. }
  1576. function valueFromConfig2(a, b) {
  1577. if (!utils_default.isUndefined(b)) {
  1578. return getMergedValue(void 0, b);
  1579. }
  1580. }
  1581. function defaultToConfig2(a, b) {
  1582. if (!utils_default.isUndefined(b)) {
  1583. return getMergedValue(void 0, b);
  1584. } else if (!utils_default.isUndefined(a)) {
  1585. return getMergedValue(void 0, a);
  1586. }
  1587. }
  1588. function mergeDirectKeys(a, b, prop) {
  1589. if (utils_default.hasOwnProp(config2, prop)) {
  1590. return getMergedValue(a, b);
  1591. } else if (utils_default.hasOwnProp(config1, prop)) {
  1592. return getMergedValue(void 0, a);
  1593. }
  1594. }
  1595. const mergeMap = {
  1596. url: valueFromConfig2,
  1597. method: valueFromConfig2,
  1598. data: valueFromConfig2,
  1599. baseURL: defaultToConfig2,
  1600. transformRequest: defaultToConfig2,
  1601. transformResponse: defaultToConfig2,
  1602. paramsSerializer: defaultToConfig2,
  1603. timeout: defaultToConfig2,
  1604. timeoutMessage: defaultToConfig2,
  1605. withCredentials: defaultToConfig2,
  1606. withXSRFToken: defaultToConfig2,
  1607. adapter: defaultToConfig2,
  1608. responseType: defaultToConfig2,
  1609. xsrfCookieName: defaultToConfig2,
  1610. xsrfHeaderName: defaultToConfig2,
  1611. onUploadProgress: defaultToConfig2,
  1612. onDownloadProgress: defaultToConfig2,
  1613. decompress: defaultToConfig2,
  1614. maxContentLength: defaultToConfig2,
  1615. maxBodyLength: defaultToConfig2,
  1616. beforeRedirect: defaultToConfig2,
  1617. transport: defaultToConfig2,
  1618. httpAgent: defaultToConfig2,
  1619. httpsAgent: defaultToConfig2,
  1620. cancelToken: defaultToConfig2,
  1621. socketPath: defaultToConfig2,
  1622. allowedSocketPaths: defaultToConfig2,
  1623. responseEncoding: defaultToConfig2,
  1624. validateStatus: mergeDirectKeys,
  1625. headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
  1626. };
  1627. utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
  1628. if (prop === "__proto__" || prop === "constructor" || prop === "prototype")
  1629. return;
  1630. const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
  1631. const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0;
  1632. const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0;
  1633. const configValue = merge2(a, b, prop);
  1634. utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
  1635. });
  1636. return config;
  1637. }
  1638. // node_modules/axios/lib/helpers/resolveConfig.js
  1639. var resolveConfig_default = (config) => {
  1640. const newConfig = mergeConfig({}, config);
  1641. const own2 = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
  1642. const data = own2("data");
  1643. let withXSRFToken = own2("withXSRFToken");
  1644. const xsrfHeaderName = own2("xsrfHeaderName");
  1645. const xsrfCookieName = own2("xsrfCookieName");
  1646. let headers = own2("headers");
  1647. const auth = own2("auth");
  1648. const baseURL = own2("baseURL");
  1649. const allowAbsoluteUrls = own2("allowAbsoluteUrls");
  1650. const url = own2("url");
  1651. newConfig.headers = headers = AxiosHeaders_default.from(headers);
  1652. newConfig.url = buildURL(
  1653. buildFullPath(baseURL, url, allowAbsoluteUrls),
  1654. config.params,
  1655. config.paramsSerializer
  1656. );
  1657. if (auth) {
  1658. headers.set(
  1659. "Authorization",
  1660. "Basic " + btoa(
  1661. (auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
  1662. )
  1663. );
  1664. }
  1665. if (utils_default.isFormData(data)) {
  1666. if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
  1667. headers.setContentType(void 0);
  1668. } else if (utils_default.isFunction(data.getHeaders)) {
  1669. const formHeaders = data.getHeaders();
  1670. const allowedHeaders = ["content-type", "content-length"];
  1671. Object.entries(formHeaders).forEach(([key, val]) => {
  1672. if (allowedHeaders.includes(key.toLowerCase())) {
  1673. headers.set(key, val);
  1674. }
  1675. });
  1676. }
  1677. }
  1678. if (platform_default.hasStandardBrowserEnv) {
  1679. if (utils_default.isFunction(withXSRFToken)) {
  1680. withXSRFToken = withXSRFToken(newConfig);
  1681. }
  1682. const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url);
  1683. if (shouldSendXSRF) {
  1684. const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
  1685. if (xsrfValue) {
  1686. headers.set(xsrfHeaderName, xsrfValue);
  1687. }
  1688. }
  1689. }
  1690. return newConfig;
  1691. };
  1692. // node_modules/axios/lib/adapters/xhr.js
  1693. var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
  1694. var xhr_default = isXHRAdapterSupported && function(config) {
  1695. return new Promise(function dispatchXhrRequest(resolve, reject) {
  1696. const _config = resolveConfig_default(config);
  1697. let requestData = _config.data;
  1698. const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
  1699. let { responseType, onUploadProgress, onDownloadProgress } = _config;
  1700. let onCanceled;
  1701. let uploadThrottled, downloadThrottled;
  1702. let flushUpload, flushDownload;
  1703. function done() {
  1704. flushUpload && flushUpload();
  1705. flushDownload && flushDownload();
  1706. _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
  1707. _config.signal && _config.signal.removeEventListener("abort", onCanceled);
  1708. }
  1709. let request = new XMLHttpRequest();
  1710. request.open(_config.method.toUpperCase(), _config.url, true);
  1711. request.timeout = _config.timeout;
  1712. function onloadend() {
  1713. if (!request) {
  1714. return;
  1715. }
  1716. const responseHeaders = AxiosHeaders_default.from(
  1717. "getAllResponseHeaders" in request && request.getAllResponseHeaders()
  1718. );
  1719. const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
  1720. const response = {
  1721. data: responseData,
  1722. status: request.status,
  1723. statusText: request.statusText,
  1724. headers: responseHeaders,
  1725. config,
  1726. request
  1727. };
  1728. settle(
  1729. function _resolve(value) {
  1730. resolve(value);
  1731. done();
  1732. },
  1733. function _reject(err) {
  1734. reject(err);
  1735. done();
  1736. },
  1737. response
  1738. );
  1739. request = null;
  1740. }
  1741. if ("onloadend" in request) {
  1742. request.onloadend = onloadend;
  1743. } else {
  1744. request.onreadystatechange = function handleLoad() {
  1745. if (!request || request.readyState !== 4) {
  1746. return;
  1747. }
  1748. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
  1749. return;
  1750. }
  1751. setTimeout(onloadend);
  1752. };
  1753. }
  1754. request.onabort = function handleAbort() {
  1755. if (!request) {
  1756. return;
  1757. }
  1758. reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
  1759. request = null;
  1760. };
  1761. request.onerror = function handleError(event) {
  1762. const msg = event && event.message ? event.message : "Network Error";
  1763. const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
  1764. err.event = event || null;
  1765. reject(err);
  1766. request = null;
  1767. };
  1768. request.ontimeout = function handleTimeout() {
  1769. let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
  1770. const transitional2 = _config.transitional || transitional_default;
  1771. if (_config.timeoutErrorMessage) {
  1772. timeoutErrorMessage = _config.timeoutErrorMessage;
  1773. }
  1774. reject(
  1775. new AxiosError_default(
  1776. timeoutErrorMessage,
  1777. transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
  1778. config,
  1779. request
  1780. )
  1781. );
  1782. request = null;
  1783. };
  1784. requestData === void 0 && requestHeaders.setContentType(null);
  1785. if ("setRequestHeader" in request) {
  1786. utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
  1787. request.setRequestHeader(key, val);
  1788. });
  1789. }
  1790. if (!utils_default.isUndefined(_config.withCredentials)) {
  1791. request.withCredentials = !!_config.withCredentials;
  1792. }
  1793. if (responseType && responseType !== "json") {
  1794. request.responseType = _config.responseType;
  1795. }
  1796. if (onDownloadProgress) {
  1797. [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
  1798. request.addEventListener("progress", downloadThrottled);
  1799. }
  1800. if (onUploadProgress && request.upload) {
  1801. [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
  1802. request.upload.addEventListener("progress", uploadThrottled);
  1803. request.upload.addEventListener("loadend", flushUpload);
  1804. }
  1805. if (_config.cancelToken || _config.signal) {
  1806. onCanceled = (cancel) => {
  1807. if (!request) {
  1808. return;
  1809. }
  1810. reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
  1811. request.abort();
  1812. request = null;
  1813. };
  1814. _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
  1815. if (_config.signal) {
  1816. _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
  1817. }
  1818. }
  1819. const protocol = parseProtocol(_config.url);
  1820. if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
  1821. reject(
  1822. new AxiosError_default(
  1823. "Unsupported protocol " + protocol + ":",
  1824. AxiosError_default.ERR_BAD_REQUEST,
  1825. config
  1826. )
  1827. );
  1828. return;
  1829. }
  1830. request.send(requestData || null);
  1831. });
  1832. };
  1833. // node_modules/axios/lib/helpers/composeSignals.js
  1834. var composeSignals = (signals, timeout) => {
  1835. const { length } = signals = signals ? signals.filter(Boolean) : [];
  1836. if (timeout || length) {
  1837. let controller = new AbortController();
  1838. let aborted;
  1839. const onabort = function(reason) {
  1840. if (!aborted) {
  1841. aborted = true;
  1842. unsubscribe();
  1843. const err = reason instanceof Error ? reason : this.reason;
  1844. controller.abort(
  1845. err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)
  1846. );
  1847. }
  1848. };
  1849. let timer = timeout && setTimeout(() => {
  1850. timer = null;
  1851. onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT));
  1852. }, timeout);
  1853. const unsubscribe = () => {
  1854. if (signals) {
  1855. timer && clearTimeout(timer);
  1856. timer = null;
  1857. signals.forEach((signal2) => {
  1858. signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
  1859. });
  1860. signals = null;
  1861. }
  1862. };
  1863. signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
  1864. const { signal } = controller;
  1865. signal.unsubscribe = () => utils_default.asap(unsubscribe);
  1866. return signal;
  1867. }
  1868. };
  1869. var composeSignals_default = composeSignals;
  1870. // node_modules/axios/lib/helpers/trackStream.js
  1871. var streamChunk = function* (chunk, chunkSize) {
  1872. let len = chunk.byteLength;
  1873. if (!chunkSize || len < chunkSize) {
  1874. yield chunk;
  1875. return;
  1876. }
  1877. let pos = 0;
  1878. let end;
  1879. while (pos < len) {
  1880. end = pos + chunkSize;
  1881. yield chunk.slice(pos, end);
  1882. pos = end;
  1883. }
  1884. };
  1885. var readBytes = async function* (iterable, chunkSize) {
  1886. for await (const chunk of readStream(iterable)) {
  1887. yield* streamChunk(chunk, chunkSize);
  1888. }
  1889. };
  1890. var readStream = async function* (stream) {
  1891. if (stream[Symbol.asyncIterator]) {
  1892. yield* stream;
  1893. return;
  1894. }
  1895. const reader = stream.getReader();
  1896. try {
  1897. for (; ; ) {
  1898. const { done, value } = await reader.read();
  1899. if (done) {
  1900. break;
  1901. }
  1902. yield value;
  1903. }
  1904. } finally {
  1905. await reader.cancel();
  1906. }
  1907. };
  1908. var trackStream = (stream, chunkSize, onProgress, onFinish) => {
  1909. const iterator2 = readBytes(stream, chunkSize);
  1910. let bytes = 0;
  1911. let done;
  1912. let _onFinish = (e) => {
  1913. if (!done) {
  1914. done = true;
  1915. onFinish && onFinish(e);
  1916. }
  1917. };
  1918. return new ReadableStream(
  1919. {
  1920. async pull(controller) {
  1921. try {
  1922. const { done: done2, value } = await iterator2.next();
  1923. if (done2) {
  1924. _onFinish();
  1925. controller.close();
  1926. return;
  1927. }
  1928. let len = value.byteLength;
  1929. if (onProgress) {
  1930. let loadedBytes = bytes += len;
  1931. onProgress(loadedBytes);
  1932. }
  1933. controller.enqueue(new Uint8Array(value));
  1934. } catch (err) {
  1935. _onFinish(err);
  1936. throw err;
  1937. }
  1938. },
  1939. cancel(reason) {
  1940. _onFinish(reason);
  1941. return iterator2.return();
  1942. }
  1943. },
  1944. {
  1945. highWaterMark: 2
  1946. }
  1947. );
  1948. };
  1949. // node_modules/axios/lib/adapters/fetch.js
  1950. var DEFAULT_CHUNK_SIZE = 64 * 1024;
  1951. var { isFunction: isFunction2 } = utils_default;
  1952. var globalFetchAPI = (({ Request, Response }) => ({
  1953. Request,
  1954. Response
  1955. }))(utils_default.global);
  1956. var { ReadableStream: ReadableStream2, TextEncoder } = utils_default.global;
  1957. var test = (fn, ...args) => {
  1958. try {
  1959. return !!fn(...args);
  1960. } catch (e) {
  1961. return false;
  1962. }
  1963. };
  1964. var factory = (env) => {
  1965. env = utils_default.merge.call(
  1966. {
  1967. skipUndefined: true
  1968. },
  1969. globalFetchAPI,
  1970. env
  1971. );
  1972. const { fetch: envFetch, Request, Response } = env;
  1973. const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
  1974. const isRequestSupported = isFunction2(Request);
  1975. const isResponseSupported = isFunction2(Response);
  1976. if (!isFetchSupported) {
  1977. return false;
  1978. }
  1979. const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
  1980. const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
  1981. const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
  1982. let duplexAccessed = false;
  1983. const request = new Request(platform_default.origin, {
  1984. body: new ReadableStream2(),
  1985. method: "POST",
  1986. get duplex() {
  1987. duplexAccessed = true;
  1988. return "half";
  1989. }
  1990. });
  1991. const hasContentType = request.headers.has("Content-Type");
  1992. if (request.body != null) {
  1993. request.body.cancel();
  1994. }
  1995. return duplexAccessed && !hasContentType;
  1996. });
  1997. const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
  1998. const resolvers = {
  1999. stream: supportsResponseStream && ((res) => res.body)
  2000. };
  2001. isFetchSupported && (() => {
  2002. ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
  2003. !resolvers[type] && (resolvers[type] = (res, config) => {
  2004. let method = res && res[type];
  2005. if (method) {
  2006. return method.call(res);
  2007. }
  2008. throw new AxiosError_default(
  2009. `Response type '${type}' is not supported`,
  2010. AxiosError_default.ERR_NOT_SUPPORT,
  2011. config
  2012. );
  2013. });
  2014. });
  2015. })();
  2016. const getBodyLength = async (body) => {
  2017. if (body == null) {
  2018. return 0;
  2019. }
  2020. if (utils_default.isBlob(body)) {
  2021. return body.size;
  2022. }
  2023. if (utils_default.isSpecCompliantForm(body)) {
  2024. const _request = new Request(platform_default.origin, {
  2025. method: "POST",
  2026. body
  2027. });
  2028. return (await _request.arrayBuffer()).byteLength;
  2029. }
  2030. if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
  2031. return body.byteLength;
  2032. }
  2033. if (utils_default.isURLSearchParams(body)) {
  2034. body = body + "";
  2035. }
  2036. if (utils_default.isString(body)) {
  2037. return (await encodeText(body)).byteLength;
  2038. }
  2039. };
  2040. const resolveBodyLength = async (headers, body) => {
  2041. const length = utils_default.toFiniteNumber(headers.getContentLength());
  2042. return length == null ? getBodyLength(body) : length;
  2043. };
  2044. return async (config) => {
  2045. let {
  2046. url,
  2047. method,
  2048. data,
  2049. signal,
  2050. cancelToken,
  2051. timeout,
  2052. onDownloadProgress,
  2053. onUploadProgress,
  2054. responseType,
  2055. headers,
  2056. withCredentials = "same-origin",
  2057. fetchOptions
  2058. } = resolveConfig_default(config);
  2059. let _fetch = envFetch || fetch;
  2060. responseType = responseType ? (responseType + "").toLowerCase() : "text";
  2061. let composedSignal = composeSignals_default(
  2062. [signal, cancelToken && cancelToken.toAbortSignal()],
  2063. timeout
  2064. );
  2065. let request = null;
  2066. const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
  2067. composedSignal.unsubscribe();
  2068. });
  2069. let requestContentLength;
  2070. try {
  2071. if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
  2072. let _request = new Request(url, {
  2073. method: "POST",
  2074. body: data,
  2075. duplex: "half"
  2076. });
  2077. let contentTypeHeader;
  2078. if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
  2079. headers.setContentType(contentTypeHeader);
  2080. }
  2081. if (_request.body) {
  2082. const [onProgress, flush] = progressEventDecorator(
  2083. requestContentLength,
  2084. progressEventReducer(asyncDecorator(onUploadProgress))
  2085. );
  2086. data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
  2087. }
  2088. }
  2089. if (!utils_default.isString(withCredentials)) {
  2090. withCredentials = withCredentials ? "include" : "omit";
  2091. }
  2092. const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
  2093. if (utils_default.isFormData(data)) {
  2094. const contentType = headers.getContentType();
  2095. if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
  2096. headers.delete("content-type");
  2097. }
  2098. }
  2099. const resolvedOptions = {
  2100. ...fetchOptions,
  2101. signal: composedSignal,
  2102. method: method.toUpperCase(),
  2103. headers: headers.normalize().toJSON(),
  2104. body: data,
  2105. duplex: "half",
  2106. credentials: isCredentialsSupported ? withCredentials : void 0
  2107. };
  2108. request = isRequestSupported && new Request(url, resolvedOptions);
  2109. let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
  2110. const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
  2111. if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
  2112. const options = {};
  2113. ["status", "statusText", "headers"].forEach((prop) => {
  2114. options[prop] = response[prop];
  2115. });
  2116. const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
  2117. const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
  2118. responseContentLength,
  2119. progressEventReducer(asyncDecorator(onDownloadProgress), true)
  2120. ) || [];
  2121. response = new Response(
  2122. trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
  2123. flush && flush();
  2124. unsubscribe && unsubscribe();
  2125. }),
  2126. options
  2127. );
  2128. }
  2129. responseType = responseType || "text";
  2130. let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](
  2131. response,
  2132. config
  2133. );
  2134. !isStreamResponse && unsubscribe && unsubscribe();
  2135. return await new Promise((resolve, reject) => {
  2136. settle(resolve, reject, {
  2137. data: responseData,
  2138. headers: AxiosHeaders_default.from(response.headers),
  2139. status: response.status,
  2140. statusText: response.statusText,
  2141. config,
  2142. request
  2143. });
  2144. });
  2145. } catch (err) {
  2146. unsubscribe && unsubscribe();
  2147. if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
  2148. throw Object.assign(
  2149. new AxiosError_default(
  2150. "Network Error",
  2151. AxiosError_default.ERR_NETWORK,
  2152. config,
  2153. request,
  2154. err && err.response
  2155. ),
  2156. {
  2157. cause: err.cause || err
  2158. }
  2159. );
  2160. }
  2161. throw AxiosError_default.from(err, err && err.code, config, request, err && err.response);
  2162. }
  2163. };
  2164. };
  2165. var seedCache = /* @__PURE__ */ new Map();
  2166. var getFetch = (config) => {
  2167. let env = config && config.env || {};
  2168. const { fetch: fetch2, Request, Response } = env;
  2169. const seeds = [Request, Response, fetch2];
  2170. let len = seeds.length, i = len, seed, target, map = seedCache;
  2171. while (i--) {
  2172. seed = seeds[i];
  2173. target = map.get(seed);
  2174. target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
  2175. map = target;
  2176. }
  2177. return target;
  2178. };
  2179. var adapter = getFetch();
  2180. // node_modules/axios/lib/adapters/adapters.js
  2181. var knownAdapters = {
  2182. http: null_default,
  2183. xhr: xhr_default,
  2184. fetch: {
  2185. get: getFetch
  2186. }
  2187. };
  2188. utils_default.forEach(knownAdapters, (fn, value) => {
  2189. if (fn) {
  2190. try {
  2191. Object.defineProperty(fn, "name", { value });
  2192. } catch (e) {
  2193. }
  2194. Object.defineProperty(fn, "adapterName", { value });
  2195. }
  2196. });
  2197. var renderReason = (reason) => `- ${reason}`;
  2198. var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
  2199. function getAdapter(adapters, config) {
  2200. adapters = utils_default.isArray(adapters) ? adapters : [adapters];
  2201. const { length } = adapters;
  2202. let nameOrAdapter;
  2203. let adapter2;
  2204. const rejectedReasons = {};
  2205. for (let i = 0; i < length; i++) {
  2206. nameOrAdapter = adapters[i];
  2207. let id;
  2208. adapter2 = nameOrAdapter;
  2209. if (!isResolvedHandle(nameOrAdapter)) {
  2210. adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
  2211. if (adapter2 === void 0) {
  2212. throw new AxiosError_default(`Unknown adapter '${id}'`);
  2213. }
  2214. }
  2215. if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
  2216. break;
  2217. }
  2218. rejectedReasons[id || "#" + i] = adapter2;
  2219. }
  2220. if (!adapter2) {
  2221. const reasons = Object.entries(rejectedReasons).map(
  2222. ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
  2223. );
  2224. let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
  2225. throw new AxiosError_default(
  2226. `There is no suitable adapter to dispatch the request ` + s,
  2227. "ERR_NOT_SUPPORT"
  2228. );
  2229. }
  2230. return adapter2;
  2231. }
  2232. var adapters_default = {
  2233. /**
  2234. * Resolve an adapter from a list of adapter names or functions.
  2235. * @type {Function}
  2236. */
  2237. getAdapter,
  2238. /**
  2239. * Exposes all known adapters
  2240. * @type {Object<string, Function|Object>}
  2241. */
  2242. adapters: knownAdapters
  2243. };
  2244. // node_modules/axios/lib/core/dispatchRequest.js
  2245. function throwIfCancellationRequested(config) {
  2246. if (config.cancelToken) {
  2247. config.cancelToken.throwIfRequested();
  2248. }
  2249. if (config.signal && config.signal.aborted) {
  2250. throw new CanceledError_default(null, config);
  2251. }
  2252. }
  2253. function dispatchRequest(config) {
  2254. throwIfCancellationRequested(config);
  2255. config.headers = AxiosHeaders_default.from(config.headers);
  2256. config.data = transformData.call(config, config.transformRequest);
  2257. if (["post", "put", "patch"].indexOf(config.method) !== -1) {
  2258. config.headers.setContentType("application/x-www-form-urlencoded", false);
  2259. }
  2260. const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
  2261. return adapter2(config).then(
  2262. function onAdapterResolution(response) {
  2263. throwIfCancellationRequested(config);
  2264. response.data = transformData.call(config, config.transformResponse, response);
  2265. response.headers = AxiosHeaders_default.from(response.headers);
  2266. return response;
  2267. },
  2268. function onAdapterRejection(reason) {
  2269. if (!isCancel(reason)) {
  2270. throwIfCancellationRequested(config);
  2271. if (reason && reason.response) {
  2272. reason.response.data = transformData.call(
  2273. config,
  2274. config.transformResponse,
  2275. reason.response
  2276. );
  2277. reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
  2278. }
  2279. }
  2280. return Promise.reject(reason);
  2281. }
  2282. );
  2283. }
  2284. // node_modules/axios/lib/env/data.js
  2285. var VERSION = "1.15.2";
  2286. // node_modules/axios/lib/helpers/validator.js
  2287. var validators = {};
  2288. ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
  2289. validators[type] = function validator(thing) {
  2290. return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
  2291. };
  2292. });
  2293. var deprecatedWarnings = {};
  2294. validators.transitional = function transitional(validator, version, message) {
  2295. function formatMessage(opt, desc) {
  2296. return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
  2297. }
  2298. return (value, opt, opts) => {
  2299. if (validator === false) {
  2300. throw new AxiosError_default(
  2301. formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
  2302. AxiosError_default.ERR_DEPRECATED
  2303. );
  2304. }
  2305. if (version && !deprecatedWarnings[opt]) {
  2306. deprecatedWarnings[opt] = true;
  2307. console.warn(
  2308. formatMessage(
  2309. opt,
  2310. " has been deprecated since v" + version + " and will be removed in the near future"
  2311. )
  2312. );
  2313. }
  2314. return validator ? validator(value, opt, opts) : true;
  2315. };
  2316. };
  2317. validators.spelling = function spelling(correctSpelling) {
  2318. return (value, opt) => {
  2319. console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
  2320. return true;
  2321. };
  2322. };
  2323. function assertOptions(options, schema, allowUnknown) {
  2324. if (typeof options !== "object") {
  2325. throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
  2326. }
  2327. const keys = Object.keys(options);
  2328. let i = keys.length;
  2329. while (i-- > 0) {
  2330. const opt = keys[i];
  2331. const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0;
  2332. if (validator) {
  2333. const value = options[opt];
  2334. const result = value === void 0 || validator(value, opt, options);
  2335. if (result !== true) {
  2336. throw new AxiosError_default(
  2337. "option " + opt + " must be " + result,
  2338. AxiosError_default.ERR_BAD_OPTION_VALUE
  2339. );
  2340. }
  2341. continue;
  2342. }
  2343. if (allowUnknown !== true) {
  2344. throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
  2345. }
  2346. }
  2347. }
  2348. var validator_default = {
  2349. assertOptions,
  2350. validators
  2351. };
  2352. // node_modules/axios/lib/core/Axios.js
  2353. var validators2 = validator_default.validators;
  2354. var Axios = class {
  2355. constructor(instanceConfig) {
  2356. this.defaults = instanceConfig || {};
  2357. this.interceptors = {
  2358. request: new InterceptorManager_default(),
  2359. response: new InterceptorManager_default()
  2360. };
  2361. }
  2362. /**
  2363. * Dispatch a request
  2364. *
  2365. * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
  2366. * @param {?Object} config
  2367. *
  2368. * @returns {Promise} The Promise to be fulfilled
  2369. */
  2370. async request(configOrUrl, config) {
  2371. try {
  2372. return await this._request(configOrUrl, config);
  2373. } catch (err) {
  2374. if (err instanceof Error) {
  2375. let dummy = {};
  2376. Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
  2377. const stack = (() => {
  2378. if (!dummy.stack) {
  2379. return "";
  2380. }
  2381. const firstNewlineIndex = dummy.stack.indexOf("\n");
  2382. return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
  2383. })();
  2384. try {
  2385. if (!err.stack) {
  2386. err.stack = stack;
  2387. } else if (stack) {
  2388. const firstNewlineIndex = stack.indexOf("\n");
  2389. const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
  2390. const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
  2391. if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
  2392. err.stack += "\n" + stack;
  2393. }
  2394. }
  2395. } catch (e) {
  2396. }
  2397. }
  2398. throw err;
  2399. }
  2400. }
  2401. _request(configOrUrl, config) {
  2402. if (typeof configOrUrl === "string") {
  2403. config = config || {};
  2404. config.url = configOrUrl;
  2405. } else {
  2406. config = configOrUrl || {};
  2407. }
  2408. config = mergeConfig(this.defaults, config);
  2409. const { transitional: transitional2, paramsSerializer, headers } = config;
  2410. if (transitional2 !== void 0) {
  2411. validator_default.assertOptions(
  2412. transitional2,
  2413. {
  2414. silentJSONParsing: validators2.transitional(validators2.boolean),
  2415. forcedJSONParsing: validators2.transitional(validators2.boolean),
  2416. clarifyTimeoutError: validators2.transitional(validators2.boolean),
  2417. legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean)
  2418. },
  2419. false
  2420. );
  2421. }
  2422. if (paramsSerializer != null) {
  2423. if (utils_default.isFunction(paramsSerializer)) {
  2424. config.paramsSerializer = {
  2425. serialize: paramsSerializer
  2426. };
  2427. } else {
  2428. validator_default.assertOptions(
  2429. paramsSerializer,
  2430. {
  2431. encode: validators2.function,
  2432. serialize: validators2.function
  2433. },
  2434. true
  2435. );
  2436. }
  2437. }
  2438. if (config.allowAbsoluteUrls !== void 0) {
  2439. } else if (this.defaults.allowAbsoluteUrls !== void 0) {
  2440. config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
  2441. } else {
  2442. config.allowAbsoluteUrls = true;
  2443. }
  2444. validator_default.assertOptions(
  2445. config,
  2446. {
  2447. baseUrl: validators2.spelling("baseURL"),
  2448. withXsrfToken: validators2.spelling("withXSRFToken")
  2449. },
  2450. true
  2451. );
  2452. config.method = (config.method || this.defaults.method || "get").toLowerCase();
  2453. let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
  2454. headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
  2455. delete headers[method];
  2456. });
  2457. config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
  2458. const requestInterceptorChain = [];
  2459. let synchronousRequestInterceptors = true;
  2460. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  2461. if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
  2462. return;
  2463. }
  2464. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  2465. const transitional3 = config.transitional || transitional_default;
  2466. const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering;
  2467. if (legacyInterceptorReqResOrdering) {
  2468. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  2469. } else {
  2470. requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  2471. }
  2472. });
  2473. const responseInterceptorChain = [];
  2474. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  2475. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  2476. });
  2477. let promise;
  2478. let i = 0;
  2479. let len;
  2480. if (!synchronousRequestInterceptors) {
  2481. const chain = [dispatchRequest.bind(this), void 0];
  2482. chain.unshift(...requestInterceptorChain);
  2483. chain.push(...responseInterceptorChain);
  2484. len = chain.length;
  2485. promise = Promise.resolve(config);
  2486. while (i < len) {
  2487. promise = promise.then(chain[i++], chain[i++]);
  2488. }
  2489. return promise;
  2490. }
  2491. len = requestInterceptorChain.length;
  2492. let newConfig = config;
  2493. while (i < len) {
  2494. const onFulfilled = requestInterceptorChain[i++];
  2495. const onRejected = requestInterceptorChain[i++];
  2496. try {
  2497. newConfig = onFulfilled(newConfig);
  2498. } catch (error) {
  2499. onRejected.call(this, error);
  2500. break;
  2501. }
  2502. }
  2503. try {
  2504. promise = dispatchRequest.call(this, newConfig);
  2505. } catch (error) {
  2506. return Promise.reject(error);
  2507. }
  2508. i = 0;
  2509. len = responseInterceptorChain.length;
  2510. while (i < len) {
  2511. promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
  2512. }
  2513. return promise;
  2514. }
  2515. getUri(config) {
  2516. config = mergeConfig(this.defaults, config);
  2517. const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
  2518. return buildURL(fullPath, config.params, config.paramsSerializer);
  2519. }
  2520. };
  2521. utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
  2522. Axios.prototype[method] = function(url, config) {
  2523. return this.request(
  2524. mergeConfig(config || {}, {
  2525. method,
  2526. url,
  2527. data: (config || {}).data
  2528. })
  2529. );
  2530. };
  2531. });
  2532. utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
  2533. function generateHTTPMethod(isForm) {
  2534. return function httpMethod(url, data, config) {
  2535. return this.request(
  2536. mergeConfig(config || {}, {
  2537. method,
  2538. headers: isForm ? {
  2539. "Content-Type": "multipart/form-data"
  2540. } : {},
  2541. url,
  2542. data
  2543. })
  2544. );
  2545. };
  2546. }
  2547. Axios.prototype[method] = generateHTTPMethod();
  2548. Axios.prototype[method + "Form"] = generateHTTPMethod(true);
  2549. });
  2550. var Axios_default = Axios;
  2551. // node_modules/axios/lib/cancel/CancelToken.js
  2552. var CancelToken = class _CancelToken {
  2553. constructor(executor) {
  2554. if (typeof executor !== "function") {
  2555. throw new TypeError("executor must be a function.");
  2556. }
  2557. let resolvePromise;
  2558. this.promise = new Promise(function promiseExecutor(resolve) {
  2559. resolvePromise = resolve;
  2560. });
  2561. const token = this;
  2562. this.promise.then((cancel) => {
  2563. if (!token._listeners)
  2564. return;
  2565. let i = token._listeners.length;
  2566. while (i-- > 0) {
  2567. token._listeners[i](cancel);
  2568. }
  2569. token._listeners = null;
  2570. });
  2571. this.promise.then = (onfulfilled) => {
  2572. let _resolve;
  2573. const promise = new Promise((resolve) => {
  2574. token.subscribe(resolve);
  2575. _resolve = resolve;
  2576. }).then(onfulfilled);
  2577. promise.cancel = function reject() {
  2578. token.unsubscribe(_resolve);
  2579. };
  2580. return promise;
  2581. };
  2582. executor(function cancel(message, config, request) {
  2583. if (token.reason) {
  2584. return;
  2585. }
  2586. token.reason = new CanceledError_default(message, config, request);
  2587. resolvePromise(token.reason);
  2588. });
  2589. }
  2590. /**
  2591. * Throws a `CanceledError` if cancellation has been requested.
  2592. */
  2593. throwIfRequested() {
  2594. if (this.reason) {
  2595. throw this.reason;
  2596. }
  2597. }
  2598. /**
  2599. * Subscribe to the cancel signal
  2600. */
  2601. subscribe(listener) {
  2602. if (this.reason) {
  2603. listener(this.reason);
  2604. return;
  2605. }
  2606. if (this._listeners) {
  2607. this._listeners.push(listener);
  2608. } else {
  2609. this._listeners = [listener];
  2610. }
  2611. }
  2612. /**
  2613. * Unsubscribe from the cancel signal
  2614. */
  2615. unsubscribe(listener) {
  2616. if (!this._listeners) {
  2617. return;
  2618. }
  2619. const index = this._listeners.indexOf(listener);
  2620. if (index !== -1) {
  2621. this._listeners.splice(index, 1);
  2622. }
  2623. }
  2624. toAbortSignal() {
  2625. const controller = new AbortController();
  2626. const abort = (err) => {
  2627. controller.abort(err);
  2628. };
  2629. this.subscribe(abort);
  2630. controller.signal.unsubscribe = () => this.unsubscribe(abort);
  2631. return controller.signal;
  2632. }
  2633. /**
  2634. * Returns an object that contains a new `CancelToken` and a function that, when called,
  2635. * cancels the `CancelToken`.
  2636. */
  2637. static source() {
  2638. let cancel;
  2639. const token = new _CancelToken(function executor(c) {
  2640. cancel = c;
  2641. });
  2642. return {
  2643. token,
  2644. cancel
  2645. };
  2646. }
  2647. };
  2648. var CancelToken_default = CancelToken;
  2649. // node_modules/axios/lib/helpers/spread.js
  2650. function spread(callback) {
  2651. return function wrap(arr) {
  2652. return callback.apply(null, arr);
  2653. };
  2654. }
  2655. // node_modules/axios/lib/helpers/isAxiosError.js
  2656. function isAxiosError(payload) {
  2657. return utils_default.isObject(payload) && payload.isAxiosError === true;
  2658. }
  2659. // node_modules/axios/lib/helpers/HttpStatusCode.js
  2660. var HttpStatusCode = {
  2661. Continue: 100,
  2662. SwitchingProtocols: 101,
  2663. Processing: 102,
  2664. EarlyHints: 103,
  2665. Ok: 200,
  2666. Created: 201,
  2667. Accepted: 202,
  2668. NonAuthoritativeInformation: 203,
  2669. NoContent: 204,
  2670. ResetContent: 205,
  2671. PartialContent: 206,
  2672. MultiStatus: 207,
  2673. AlreadyReported: 208,
  2674. ImUsed: 226,
  2675. MultipleChoices: 300,
  2676. MovedPermanently: 301,
  2677. Found: 302,
  2678. SeeOther: 303,
  2679. NotModified: 304,
  2680. UseProxy: 305,
  2681. Unused: 306,
  2682. TemporaryRedirect: 307,
  2683. PermanentRedirect: 308,
  2684. BadRequest: 400,
  2685. Unauthorized: 401,
  2686. PaymentRequired: 402,
  2687. Forbidden: 403,
  2688. NotFound: 404,
  2689. MethodNotAllowed: 405,
  2690. NotAcceptable: 406,
  2691. ProxyAuthenticationRequired: 407,
  2692. RequestTimeout: 408,
  2693. Conflict: 409,
  2694. Gone: 410,
  2695. LengthRequired: 411,
  2696. PreconditionFailed: 412,
  2697. PayloadTooLarge: 413,
  2698. UriTooLong: 414,
  2699. UnsupportedMediaType: 415,
  2700. RangeNotSatisfiable: 416,
  2701. ExpectationFailed: 417,
  2702. ImATeapot: 418,
  2703. MisdirectedRequest: 421,
  2704. UnprocessableEntity: 422,
  2705. Locked: 423,
  2706. FailedDependency: 424,
  2707. TooEarly: 425,
  2708. UpgradeRequired: 426,
  2709. PreconditionRequired: 428,
  2710. TooManyRequests: 429,
  2711. RequestHeaderFieldsTooLarge: 431,
  2712. UnavailableForLegalReasons: 451,
  2713. InternalServerError: 500,
  2714. NotImplemented: 501,
  2715. BadGateway: 502,
  2716. ServiceUnavailable: 503,
  2717. GatewayTimeout: 504,
  2718. HttpVersionNotSupported: 505,
  2719. VariantAlsoNegotiates: 506,
  2720. InsufficientStorage: 507,
  2721. LoopDetected: 508,
  2722. NotExtended: 510,
  2723. NetworkAuthenticationRequired: 511,
  2724. WebServerIsDown: 521,
  2725. ConnectionTimedOut: 522,
  2726. OriginIsUnreachable: 523,
  2727. TimeoutOccurred: 524,
  2728. SslHandshakeFailed: 525,
  2729. InvalidSslCertificate: 526
  2730. };
  2731. Object.entries(HttpStatusCode).forEach(([key, value]) => {
  2732. HttpStatusCode[value] = key;
  2733. });
  2734. var HttpStatusCode_default = HttpStatusCode;
  2735. // node_modules/axios/lib/axios.js
  2736. function createInstance(defaultConfig) {
  2737. const context = new Axios_default(defaultConfig);
  2738. const instance = bind(Axios_default.prototype.request, context);
  2739. utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
  2740. utils_default.extend(instance, context, null, { allOwnKeys: true });
  2741. instance.create = function create(instanceConfig) {
  2742. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  2743. };
  2744. return instance;
  2745. }
  2746. var axios = createInstance(defaults_default);
  2747. axios.Axios = Axios_default;
  2748. axios.CanceledError = CanceledError_default;
  2749. axios.CancelToken = CancelToken_default;
  2750. axios.isCancel = isCancel;
  2751. axios.VERSION = VERSION;
  2752. axios.toFormData = toFormData_default;
  2753. axios.AxiosError = AxiosError_default;
  2754. axios.Cancel = axios.CanceledError;
  2755. axios.all = function all(promises) {
  2756. return Promise.all(promises);
  2757. };
  2758. axios.spread = spread;
  2759. axios.isAxiosError = isAxiosError;
  2760. axios.mergeConfig = mergeConfig;
  2761. axios.AxiosHeaders = AxiosHeaders_default;
  2762. axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
  2763. axios.getAdapter = adapters_default.getAdapter;
  2764. axios.HttpStatusCode = HttpStatusCode_default;
  2765. axios.default = axios;
  2766. var axios_default = axios;
  2767. // node_modules/axios/index.js
  2768. var {
  2769. Axios: Axios2,
  2770. AxiosError: AxiosError2,
  2771. CanceledError: CanceledError2,
  2772. isCancel: isCancel2,
  2773. CancelToken: CancelToken2,
  2774. VERSION: VERSION2,
  2775. all: all2,
  2776. Cancel,
  2777. isAxiosError: isAxiosError2,
  2778. spread: spread2,
  2779. toFormData: toFormData2,
  2780. AxiosHeaders: AxiosHeaders2,
  2781. HttpStatusCode: HttpStatusCode2,
  2782. formToJSON,
  2783. getAdapter: getAdapter2,
  2784. mergeConfig: mergeConfig2
  2785. } = axios_default;
  2786. export {
  2787. Axios2 as Axios,
  2788. AxiosError2 as AxiosError,
  2789. AxiosHeaders2 as AxiosHeaders,
  2790. Cancel,
  2791. CancelToken2 as CancelToken,
  2792. CanceledError2 as CanceledError,
  2793. HttpStatusCode2 as HttpStatusCode,
  2794. VERSION2 as VERSION,
  2795. all2 as all,
  2796. axios_default as default,
  2797. formToJSON,
  2798. getAdapter2 as getAdapter,
  2799. isAxiosError2 as isAxiosError,
  2800. isCancel2 as isCancel,
  2801. mergeConfig2 as mergeConfig,
  2802. spread2 as spread,
  2803. toFormData2 as toFormData
  2804. };
  2805. //# sourceMappingURL=axios.js.map