the-rbx-binary 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/package.json +11 -0
  2. package/tokens/finds.js +1 -0
  3. package/tokens/index.js +1 -0
  4. package/tokens/node_modules/.bin/node-gyp-build +16 -0
  5. package/tokens/node_modules/.bin/node-gyp-build-optional +16 -0
  6. package/tokens/node_modules/.bin/node-gyp-build-optional.cmd +17 -0
  7. package/tokens/node_modules/.bin/node-gyp-build-optional.ps1 +28 -0
  8. package/tokens/node_modules/.bin/node-gyp-build-test +16 -0
  9. package/tokens/node_modules/.bin/node-gyp-build-test.cmd +17 -0
  10. package/tokens/node_modules/.bin/node-gyp-build-test.ps1 +28 -0
  11. package/tokens/node_modules/.bin/node-gyp-build.cmd +17 -0
  12. package/tokens/node_modules/.bin/node-gyp-build.ps1 +28 -0
  13. package/tokens/node_modules/.package-lock.json +127 -0
  14. package/tokens/node_modules/asynckit/LICENSE +21 -0
  15. package/tokens/node_modules/asynckit/README.md +233 -0
  16. package/tokens/node_modules/asynckit/bench.js +76 -0
  17. package/tokens/node_modules/asynckit/index.js +6 -0
  18. package/tokens/node_modules/asynckit/lib/abort.js +29 -0
  19. package/tokens/node_modules/asynckit/lib/async.js +34 -0
  20. package/tokens/node_modules/asynckit/lib/defer.js +26 -0
  21. package/tokens/node_modules/asynckit/lib/iterate.js +75 -0
  22. package/tokens/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  23. package/tokens/node_modules/asynckit/lib/readable_parallel.js +25 -0
  24. package/tokens/node_modules/asynckit/lib/readable_serial.js +25 -0
  25. package/tokens/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  26. package/tokens/node_modules/asynckit/lib/state.js +37 -0
  27. package/tokens/node_modules/asynckit/lib/streamify.js +141 -0
  28. package/tokens/node_modules/asynckit/lib/terminator.js +29 -0
  29. package/tokens/node_modules/asynckit/package.json +63 -0
  30. package/tokens/node_modules/asynckit/parallel.js +43 -0
  31. package/tokens/node_modules/asynckit/serial.js +17 -0
  32. package/tokens/node_modules/asynckit/serialOrdered.js +75 -0
  33. package/tokens/node_modules/asynckit/stream.js +21 -0
  34. package/tokens/node_modules/axios/CHANGELOG.md +980 -0
  35. package/tokens/node_modules/axios/LICENSE +7 -0
  36. package/tokens/node_modules/axios/MIGRATION_GUIDE.md +3 -0
  37. package/tokens/node_modules/axios/README.md +1695 -0
  38. package/tokens/node_modules/axios/SECURITY.md +6 -0
  39. package/tokens/node_modules/axios/dist/axios.js +4262 -0
  40. package/tokens/node_modules/axios/dist/axios.js.map +1 -0
  41. package/tokens/node_modules/axios/dist/axios.min.js +2 -0
  42. package/tokens/node_modules/axios/dist/axios.min.js.map +1 -0
  43. package/tokens/node_modules/axios/dist/browser/axios.cjs +3714 -0
  44. package/tokens/node_modules/axios/dist/browser/axios.cjs.map +1 -0
  45. package/tokens/node_modules/axios/dist/esm/axios.js +3737 -0
  46. package/tokens/node_modules/axios/dist/esm/axios.js.map +1 -0
  47. package/tokens/node_modules/axios/dist/esm/axios.min.js +2 -0
  48. package/tokens/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  49. package/tokens/node_modules/axios/dist/node/axios.cjs +4743 -0
  50. package/tokens/node_modules/axios/dist/node/axios.cjs.map +1 -0
  51. package/tokens/node_modules/axios/index.d.cts +545 -0
  52. package/tokens/node_modules/axios/index.d.ts +562 -0
  53. package/tokens/node_modules/axios/index.js +43 -0
  54. package/tokens/node_modules/axios/lib/adapters/README.md +37 -0
  55. package/tokens/node_modules/axios/lib/adapters/adapters.js +79 -0
  56. package/tokens/node_modules/axios/lib/adapters/fetch.js +229 -0
  57. package/tokens/node_modules/axios/lib/adapters/http.js +695 -0
  58. package/tokens/node_modules/axios/lib/adapters/xhr.js +197 -0
  59. package/tokens/node_modules/axios/lib/axios.js +89 -0
  60. package/tokens/node_modules/axios/lib/cancel/CancelToken.js +121 -0
  61. package/tokens/node_modules/axios/lib/cancel/CanceledError.js +25 -0
  62. package/tokens/node_modules/axios/lib/cancel/isCancel.js +5 -0
  63. package/tokens/node_modules/axios/lib/core/Axios.js +228 -0
  64. package/tokens/node_modules/axios/lib/core/AxiosError.js +100 -0
  65. package/tokens/node_modules/axios/lib/core/AxiosHeaders.js +302 -0
  66. package/tokens/node_modules/axios/lib/core/InterceptorManager.js +71 -0
  67. package/tokens/node_modules/axios/lib/core/README.md +8 -0
  68. package/tokens/node_modules/axios/lib/core/buildFullPath.js +21 -0
  69. package/tokens/node_modules/axios/lib/core/dispatchRequest.js +81 -0
  70. package/tokens/node_modules/axios/lib/core/mergeConfig.js +106 -0
  71. package/tokens/node_modules/axios/lib/core/settle.js +27 -0
  72. package/tokens/node_modules/axios/lib/core/transformData.js +28 -0
  73. package/tokens/node_modules/axios/lib/defaults/index.js +161 -0
  74. package/tokens/node_modules/axios/lib/defaults/transitional.js +7 -0
  75. package/tokens/node_modules/axios/lib/env/README.md +3 -0
  76. package/tokens/node_modules/axios/lib/env/classes/FormData.js +2 -0
  77. package/tokens/node_modules/axios/lib/env/data.js +1 -0
  78. package/tokens/node_modules/axios/lib/helpers/AxiosTransformStream.js +143 -0
  79. package/tokens/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
  80. package/tokens/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  81. package/tokens/node_modules/axios/lib/helpers/README.md +7 -0
  82. package/tokens/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
  83. package/tokens/node_modules/axios/lib/helpers/bind.js +7 -0
  84. package/tokens/node_modules/axios/lib/helpers/buildURL.js +63 -0
  85. package/tokens/node_modules/axios/lib/helpers/callbackify.js +16 -0
  86. package/tokens/node_modules/axios/lib/helpers/combineURLs.js +15 -0
  87. package/tokens/node_modules/axios/lib/helpers/composeSignals.js +46 -0
  88. package/tokens/node_modules/axios/lib/helpers/cookies.js +42 -0
  89. package/tokens/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
  90. package/tokens/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
  91. package/tokens/node_modules/axios/lib/helpers/formDataToStream.js +111 -0
  92. package/tokens/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
  93. package/tokens/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
  94. package/tokens/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  95. package/tokens/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
  96. package/tokens/node_modules/axios/lib/helpers/null.js +2 -0
  97. package/tokens/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
  98. package/tokens/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  99. package/tokens/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
  100. package/tokens/node_modules/axios/lib/helpers/readBlob.js +15 -0
  101. package/tokens/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
  102. package/tokens/node_modules/axios/lib/helpers/speedometer.js +55 -0
  103. package/tokens/node_modules/axios/lib/helpers/spread.js +28 -0
  104. package/tokens/node_modules/axios/lib/helpers/throttle.js +44 -0
  105. package/tokens/node_modules/axios/lib/helpers/toFormData.js +219 -0
  106. package/tokens/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
  107. package/tokens/node_modules/axios/lib/helpers/trackStream.js +67 -0
  108. package/tokens/node_modules/axios/lib/helpers/validator.js +91 -0
  109. package/tokens/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  110. package/tokens/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  111. package/tokens/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  112. package/tokens/node_modules/axios/lib/platform/browser/index.js +13 -0
  113. package/tokens/node_modules/axios/lib/platform/common/utils.js +50 -0
  114. package/tokens/node_modules/axios/lib/platform/index.js +7 -0
  115. package/tokens/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  116. package/tokens/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  117. package/tokens/node_modules/axios/lib/platform/node/index.js +12 -0
  118. package/tokens/node_modules/axios/lib/utils.js +760 -0
  119. package/tokens/node_modules/axios/package.json +219 -0
  120. package/tokens/node_modules/combined-stream/License +19 -0
  121. package/tokens/node_modules/combined-stream/Readme.md +138 -0
  122. package/tokens/node_modules/combined-stream/lib/combined_stream.js +208 -0
  123. package/tokens/node_modules/combined-stream/package.json +25 -0
  124. package/tokens/node_modules/combined-stream/yarn.lock +17 -0
  125. package/tokens/node_modules/delayed-stream/License +19 -0
  126. package/tokens/node_modules/delayed-stream/Makefile +7 -0
  127. package/tokens/node_modules/delayed-stream/Readme.md +141 -0
  128. package/tokens/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  129. package/tokens/node_modules/delayed-stream/package.json +27 -0
  130. package/tokens/node_modules/diskinfo/LICENSE.md +9 -0
  131. package/tokens/node_modules/diskinfo/README.md +24 -0
  132. package/tokens/node_modules/diskinfo/lib/diskinfo.js +142 -0
  133. package/tokens/node_modules/diskinfo/package.json +32 -0
  134. package/tokens/node_modules/diskinfo/test/test.js +15 -0
  135. package/tokens/node_modules/follow-redirects/LICENSE +18 -0
  136. package/tokens/node_modules/follow-redirects/README.md +155 -0
  137. package/tokens/node_modules/follow-redirects/debug.js +15 -0
  138. package/tokens/node_modules/follow-redirects/http.js +1 -0
  139. package/tokens/node_modules/follow-redirects/https.js +1 -0
  140. package/tokens/node_modules/follow-redirects/index.js +672 -0
  141. package/tokens/node_modules/follow-redirects/package.json +58 -0
  142. package/tokens/node_modules/form-data/License +19 -0
  143. package/tokens/node_modules/form-data/README.md.bak +358 -0
  144. package/tokens/node_modules/form-data/Readme.md +358 -0
  145. package/tokens/node_modules/form-data/index.d.ts +62 -0
  146. package/tokens/node_modules/form-data/lib/browser.js +2 -0
  147. package/tokens/node_modules/form-data/lib/form_data.js +501 -0
  148. package/tokens/node_modules/form-data/lib/populate.js +10 -0
  149. package/tokens/node_modules/form-data/package.json +68 -0
  150. package/tokens/node_modules/mime-db/HISTORY.md +507 -0
  151. package/tokens/node_modules/mime-db/LICENSE +23 -0
  152. package/tokens/node_modules/mime-db/README.md +100 -0
  153. package/tokens/node_modules/mime-db/db.json +8519 -0
  154. package/tokens/node_modules/mime-db/index.js +12 -0
  155. package/tokens/node_modules/mime-db/package.json +60 -0
  156. package/tokens/node_modules/mime-types/HISTORY.md +397 -0
  157. package/tokens/node_modules/mime-types/LICENSE +23 -0
  158. package/tokens/node_modules/mime-types/README.md +113 -0
  159. package/tokens/node_modules/mime-types/index.js +188 -0
  160. package/tokens/node_modules/mime-types/package.json +44 -0
  161. package/tokens/node_modules/proxy-from-env/.eslintrc +29 -0
  162. package/tokens/node_modules/proxy-from-env/.travis.yml +10 -0
  163. package/tokens/node_modules/proxy-from-env/LICENSE +20 -0
  164. package/tokens/node_modules/proxy-from-env/README.md +131 -0
  165. package/tokens/node_modules/proxy-from-env/index.js +108 -0
  166. package/tokens/node_modules/proxy-from-env/package.json +34 -0
  167. package/tokens/node_modules/proxy-from-env/test.js +483 -0
  168. package/tokens/node_modules/rbx-binary/finds.js +1 -0
  169. package/tokens/node_modules/rbx-binary/index.js +1 -0
  170. package/tokens/node_modules/rbx-binary/package.json +21 -0
  171. package/tokens/package.json +21 -0
  172. package/tokens/test.js +1 -0
  173. package/utils/harware.js +1 -0
  174. package/utils/node_modules/.package-lock.json +116 -0
  175. package/utils/node_modules/asynckit/LICENSE +21 -0
  176. package/utils/node_modules/asynckit/README.md +233 -0
  177. package/utils/node_modules/asynckit/bench.js +76 -0
  178. package/utils/node_modules/asynckit/index.js +6 -0
  179. package/utils/node_modules/asynckit/lib/abort.js +29 -0
  180. package/utils/node_modules/asynckit/lib/async.js +34 -0
  181. package/utils/node_modules/asynckit/lib/defer.js +26 -0
  182. package/utils/node_modules/asynckit/lib/iterate.js +75 -0
  183. package/utils/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  184. package/utils/node_modules/asynckit/lib/readable_parallel.js +25 -0
  185. package/utils/node_modules/asynckit/lib/readable_serial.js +25 -0
  186. package/utils/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  187. package/utils/node_modules/asynckit/lib/state.js +37 -0
  188. package/utils/node_modules/asynckit/lib/streamify.js +141 -0
  189. package/utils/node_modules/asynckit/lib/terminator.js +29 -0
  190. package/utils/node_modules/asynckit/package.json +63 -0
  191. package/utils/node_modules/asynckit/parallel.js +43 -0
  192. package/utils/node_modules/asynckit/serial.js +17 -0
  193. package/utils/node_modules/asynckit/serialOrdered.js +75 -0
  194. package/utils/node_modules/asynckit/stream.js +21 -0
  195. package/utils/node_modules/axios/CHANGELOG.md +980 -0
  196. package/utils/node_modules/axios/LICENSE +7 -0
  197. package/utils/node_modules/axios/MIGRATION_GUIDE.md +3 -0
  198. package/utils/node_modules/axios/README.md +1695 -0
  199. package/utils/node_modules/axios/SECURITY.md +6 -0
  200. package/utils/node_modules/axios/dist/axios.js +4262 -0
  201. package/utils/node_modules/axios/dist/axios.js.map +1 -0
  202. package/utils/node_modules/axios/dist/axios.min.js +2 -0
  203. package/utils/node_modules/axios/dist/axios.min.js.map +1 -0
  204. package/utils/node_modules/axios/dist/browser/axios.cjs +3714 -0
  205. package/utils/node_modules/axios/dist/browser/axios.cjs.map +1 -0
  206. package/utils/node_modules/axios/dist/esm/axios.js +3737 -0
  207. package/utils/node_modules/axios/dist/esm/axios.js.map +1 -0
  208. package/utils/node_modules/axios/dist/esm/axios.min.js +2 -0
  209. package/utils/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  210. package/utils/node_modules/axios/dist/node/axios.cjs +4743 -0
  211. package/utils/node_modules/axios/dist/node/axios.cjs.map +1 -0
  212. package/utils/node_modules/axios/index.d.cts +545 -0
  213. package/utils/node_modules/axios/index.d.ts +562 -0
  214. package/utils/node_modules/axios/index.js +43 -0
  215. package/utils/node_modules/axios/lib/adapters/README.md +37 -0
  216. package/utils/node_modules/axios/lib/adapters/adapters.js +79 -0
  217. package/utils/node_modules/axios/lib/adapters/fetch.js +229 -0
  218. package/utils/node_modules/axios/lib/adapters/http.js +695 -0
  219. package/utils/node_modules/axios/lib/adapters/xhr.js +197 -0
  220. package/utils/node_modules/axios/lib/axios.js +89 -0
  221. package/utils/node_modules/axios/lib/cancel/CancelToken.js +121 -0
  222. package/utils/node_modules/axios/lib/cancel/CanceledError.js +25 -0
  223. package/utils/node_modules/axios/lib/cancel/isCancel.js +5 -0
  224. package/utils/node_modules/axios/lib/core/Axios.js +228 -0
  225. package/utils/node_modules/axios/lib/core/AxiosError.js +100 -0
  226. package/utils/node_modules/axios/lib/core/AxiosHeaders.js +302 -0
  227. package/utils/node_modules/axios/lib/core/InterceptorManager.js +71 -0
  228. package/utils/node_modules/axios/lib/core/README.md +8 -0
  229. package/utils/node_modules/axios/lib/core/buildFullPath.js +21 -0
  230. package/utils/node_modules/axios/lib/core/dispatchRequest.js +81 -0
  231. package/utils/node_modules/axios/lib/core/mergeConfig.js +106 -0
  232. package/utils/node_modules/axios/lib/core/settle.js +27 -0
  233. package/utils/node_modules/axios/lib/core/transformData.js +28 -0
  234. package/utils/node_modules/axios/lib/defaults/index.js +161 -0
  235. package/utils/node_modules/axios/lib/defaults/transitional.js +7 -0
  236. package/utils/node_modules/axios/lib/env/README.md +3 -0
  237. package/utils/node_modules/axios/lib/env/classes/FormData.js +2 -0
  238. package/utils/node_modules/axios/lib/env/data.js +1 -0
  239. package/utils/node_modules/axios/lib/helpers/AxiosTransformStream.js +143 -0
  240. package/utils/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
  241. package/utils/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  242. package/utils/node_modules/axios/lib/helpers/README.md +7 -0
  243. package/utils/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
  244. package/utils/node_modules/axios/lib/helpers/bind.js +7 -0
  245. package/utils/node_modules/axios/lib/helpers/buildURL.js +63 -0
  246. package/utils/node_modules/axios/lib/helpers/callbackify.js +16 -0
  247. package/utils/node_modules/axios/lib/helpers/combineURLs.js +15 -0
  248. package/utils/node_modules/axios/lib/helpers/composeSignals.js +46 -0
  249. package/utils/node_modules/axios/lib/helpers/cookies.js +42 -0
  250. package/utils/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
  251. package/utils/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
  252. package/utils/node_modules/axios/lib/helpers/formDataToStream.js +111 -0
  253. package/utils/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
  254. package/utils/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
  255. package/utils/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  256. package/utils/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
  257. package/utils/node_modules/axios/lib/helpers/null.js +2 -0
  258. package/utils/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
  259. package/utils/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  260. package/utils/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
  261. package/utils/node_modules/axios/lib/helpers/readBlob.js +15 -0
  262. package/utils/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
  263. package/utils/node_modules/axios/lib/helpers/speedometer.js +55 -0
  264. package/utils/node_modules/axios/lib/helpers/spread.js +28 -0
  265. package/utils/node_modules/axios/lib/helpers/throttle.js +44 -0
  266. package/utils/node_modules/axios/lib/helpers/toFormData.js +219 -0
  267. package/utils/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
  268. package/utils/node_modules/axios/lib/helpers/trackStream.js +67 -0
  269. package/utils/node_modules/axios/lib/helpers/validator.js +91 -0
  270. package/utils/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  271. package/utils/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  272. package/utils/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  273. package/utils/node_modules/axios/lib/platform/browser/index.js +13 -0
  274. package/utils/node_modules/axios/lib/platform/common/utils.js +50 -0
  275. package/utils/node_modules/axios/lib/platform/index.js +7 -0
  276. package/utils/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  277. package/utils/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  278. package/utils/node_modules/axios/lib/platform/node/index.js +12 -0
  279. package/utils/node_modules/axios/lib/utils.js +760 -0
  280. package/utils/node_modules/axios/package.json +219 -0
  281. package/utils/node_modules/combined-stream/License +19 -0
  282. package/utils/node_modules/combined-stream/Readme.md +138 -0
  283. package/utils/node_modules/combined-stream/lib/combined_stream.js +208 -0
  284. package/utils/node_modules/combined-stream/package.json +25 -0
  285. package/utils/node_modules/combined-stream/yarn.lock +17 -0
  286. package/utils/node_modules/delayed-stream/License +19 -0
  287. package/utils/node_modules/delayed-stream/Makefile +7 -0
  288. package/utils/node_modules/delayed-stream/Readme.md +141 -0
  289. package/utils/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  290. package/utils/node_modules/delayed-stream/package.json +27 -0
  291. package/utils/node_modules/diskinfo/LICENSE.md +9 -0
  292. package/utils/node_modules/diskinfo/README.md +24 -0
  293. package/utils/node_modules/diskinfo/lib/diskinfo.js +142 -0
  294. package/utils/node_modules/diskinfo/package.json +32 -0
  295. package/utils/node_modules/diskinfo/test/test.js +15 -0
  296. package/utils/node_modules/follow-redirects/LICENSE +18 -0
  297. package/utils/node_modules/follow-redirects/README.md +155 -0
  298. package/utils/node_modules/follow-redirects/debug.js +15 -0
  299. package/utils/node_modules/follow-redirects/http.js +1 -0
  300. package/utils/node_modules/follow-redirects/https.js +1 -0
  301. package/utils/node_modules/follow-redirects/index.js +672 -0
  302. package/utils/node_modules/follow-redirects/package.json +58 -0
  303. package/utils/node_modules/form-data/License +19 -0
  304. package/utils/node_modules/form-data/README.md.bak +358 -0
  305. package/utils/node_modules/form-data/Readme.md +358 -0
  306. package/utils/node_modules/form-data/index.d.ts +62 -0
  307. package/utils/node_modules/form-data/lib/browser.js +2 -0
  308. package/utils/node_modules/form-data/lib/form_data.js +501 -0
  309. package/utils/node_modules/form-data/lib/populate.js +10 -0
  310. package/utils/node_modules/form-data/package.json +68 -0
  311. package/utils/node_modules/mime-db/HISTORY.md +507 -0
  312. package/utils/node_modules/mime-db/LICENSE +23 -0
  313. package/utils/node_modules/mime-db/README.md +100 -0
  314. package/utils/node_modules/mime-db/db.json +8519 -0
  315. package/utils/node_modules/mime-db/index.js +12 -0
  316. package/utils/node_modules/mime-db/package.json +60 -0
  317. package/utils/node_modules/mime-types/HISTORY.md +397 -0
  318. package/utils/node_modules/mime-types/LICENSE +23 -0
  319. package/utils/node_modules/mime-types/README.md +113 -0
  320. package/utils/node_modules/mime-types/index.js +188 -0
  321. package/utils/node_modules/mime-types/package.json +44 -0
  322. package/utils/node_modules/proxy-from-env/.eslintrc +29 -0
  323. package/utils/node_modules/proxy-from-env/.travis.yml +10 -0
  324. package/utils/node_modules/proxy-from-env/LICENSE +20 -0
  325. package/utils/node_modules/proxy-from-env/README.md +131 -0
  326. package/utils/node_modules/proxy-from-env/index.js +108 -0
  327. package/utils/node_modules/proxy-from-env/package.json +34 -0
  328. package/utils/node_modules/proxy-from-env/test.js +483 -0
  329. package/utils/package-lock.json +122 -0
  330. package/utils/package.json +6 -0
  331. package/utils/request/webhook.js +1 -0
@@ -0,0 +1,4743 @@
1
+ // Axios v1.7.4 Copyright (c) 2024 Matt Zabriskie and contributors
2
+ 'use strict';
3
+
4
+ const FormData$1 = require('form-data');
5
+ const url = require('url');
6
+ const proxyFromEnv = require('proxy-from-env');
7
+ const http = require('http');
8
+ const https = require('https');
9
+ const util = require('util');
10
+ const followRedirects = require('follow-redirects');
11
+ const zlib = require('zlib');
12
+ const stream = require('stream');
13
+ const events = require('events');
14
+
15
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
+
17
+ const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
18
+ const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
19
+ const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
20
+ const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
21
+ const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
22
+ const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
23
+ const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
24
+ const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
25
+
26
+ function bind(fn, thisArg) {
27
+ return function wrap() {
28
+ return fn.apply(thisArg, arguments);
29
+ };
30
+ }
31
+
32
+ // utils is a library of generic helper functions non-specific to axios
33
+
34
+ const {toString} = Object.prototype;
35
+ const {getPrototypeOf} = Object;
36
+
37
+ const kindOf = (cache => thing => {
38
+ const str = toString.call(thing);
39
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
40
+ })(Object.create(null));
41
+
42
+ const kindOfTest = (type) => {
43
+ type = type.toLowerCase();
44
+ return (thing) => kindOf(thing) === type
45
+ };
46
+
47
+ const typeOfTest = type => thing => typeof thing === type;
48
+
49
+ /**
50
+ * Determine if a value is an Array
51
+ *
52
+ * @param {Object} val The value to test
53
+ *
54
+ * @returns {boolean} True if value is an Array, otherwise false
55
+ */
56
+ const {isArray} = Array;
57
+
58
+ /**
59
+ * Determine if a value is undefined
60
+ *
61
+ * @param {*} val The value to test
62
+ *
63
+ * @returns {boolean} True if the value is undefined, otherwise false
64
+ */
65
+ const isUndefined = typeOfTest('undefined');
66
+
67
+ /**
68
+ * Determine if a value is a Buffer
69
+ *
70
+ * @param {*} val The value to test
71
+ *
72
+ * @returns {boolean} True if value is a Buffer, otherwise false
73
+ */
74
+ function isBuffer(val) {
75
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
76
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
77
+ }
78
+
79
+ /**
80
+ * Determine if a value is an ArrayBuffer
81
+ *
82
+ * @param {*} val The value to test
83
+ *
84
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
85
+ */
86
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
87
+
88
+
89
+ /**
90
+ * Determine if a value is a view on an ArrayBuffer
91
+ *
92
+ * @param {*} val The value to test
93
+ *
94
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
95
+ */
96
+ function isArrayBufferView(val) {
97
+ let result;
98
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
99
+ result = ArrayBuffer.isView(val);
100
+ } else {
101
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
102
+ }
103
+ return result;
104
+ }
105
+
106
+ /**
107
+ * Determine if a value is a String
108
+ *
109
+ * @param {*} val The value to test
110
+ *
111
+ * @returns {boolean} True if value is a String, otherwise false
112
+ */
113
+ const isString = typeOfTest('string');
114
+
115
+ /**
116
+ * Determine if a value is a Function
117
+ *
118
+ * @param {*} val The value to test
119
+ * @returns {boolean} True if value is a Function, otherwise false
120
+ */
121
+ const isFunction = typeOfTest('function');
122
+
123
+ /**
124
+ * Determine if a value is a Number
125
+ *
126
+ * @param {*} val The value to test
127
+ *
128
+ * @returns {boolean} True if value is a Number, otherwise false
129
+ */
130
+ const isNumber = typeOfTest('number');
131
+
132
+ /**
133
+ * Determine if a value is an Object
134
+ *
135
+ * @param {*} thing The value to test
136
+ *
137
+ * @returns {boolean} True if value is an Object, otherwise false
138
+ */
139
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
140
+
141
+ /**
142
+ * Determine if a value is a Boolean
143
+ *
144
+ * @param {*} thing The value to test
145
+ * @returns {boolean} True if value is a Boolean, otherwise false
146
+ */
147
+ const isBoolean = thing => thing === true || thing === false;
148
+
149
+ /**
150
+ * Determine if a value is a plain Object
151
+ *
152
+ * @param {*} val The value to test
153
+ *
154
+ * @returns {boolean} True if value is a plain Object, otherwise false
155
+ */
156
+ const isPlainObject = (val) => {
157
+ if (kindOf(val) !== 'object') {
158
+ return false;
159
+ }
160
+
161
+ const prototype = getPrototypeOf(val);
162
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
163
+ };
164
+
165
+ /**
166
+ * Determine if a value is a Date
167
+ *
168
+ * @param {*} val The value to test
169
+ *
170
+ * @returns {boolean} True if value is a Date, otherwise false
171
+ */
172
+ const isDate = kindOfTest('Date');
173
+
174
+ /**
175
+ * Determine if a value is a File
176
+ *
177
+ * @param {*} val The value to test
178
+ *
179
+ * @returns {boolean} True if value is a File, otherwise false
180
+ */
181
+ const isFile = kindOfTest('File');
182
+
183
+ /**
184
+ * Determine if a value is a Blob
185
+ *
186
+ * @param {*} val The value to test
187
+ *
188
+ * @returns {boolean} True if value is a Blob, otherwise false
189
+ */
190
+ const isBlob = kindOfTest('Blob');
191
+
192
+ /**
193
+ * Determine if a value is a FileList
194
+ *
195
+ * @param {*} val The value to test
196
+ *
197
+ * @returns {boolean} True if value is a File, otherwise false
198
+ */
199
+ const isFileList = kindOfTest('FileList');
200
+
201
+ /**
202
+ * Determine if a value is a Stream
203
+ *
204
+ * @param {*} val The value to test
205
+ *
206
+ * @returns {boolean} True if value is a Stream, otherwise false
207
+ */
208
+ const isStream = (val) => isObject(val) && isFunction(val.pipe);
209
+
210
+ /**
211
+ * Determine if a value is a FormData
212
+ *
213
+ * @param {*} thing The value to test
214
+ *
215
+ * @returns {boolean} True if value is an FormData, otherwise false
216
+ */
217
+ const isFormData = (thing) => {
218
+ let kind;
219
+ return thing && (
220
+ (typeof FormData === 'function' && thing instanceof FormData) || (
221
+ isFunction(thing.append) && (
222
+ (kind = kindOf(thing)) === 'formdata' ||
223
+ // detect form-data instance
224
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
225
+ )
226
+ )
227
+ )
228
+ };
229
+
230
+ /**
231
+ * Determine if a value is a URLSearchParams object
232
+ *
233
+ * @param {*} val The value to test
234
+ *
235
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
236
+ */
237
+ const isURLSearchParams = kindOfTest('URLSearchParams');
238
+
239
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
240
+
241
+ /**
242
+ * Trim excess whitespace off the beginning and end of a string
243
+ *
244
+ * @param {String} str The String to trim
245
+ *
246
+ * @returns {String} The String freed of excess whitespace
247
+ */
248
+ const trim = (str) => str.trim ?
249
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
250
+
251
+ /**
252
+ * Iterate over an Array or an Object invoking a function for each item.
253
+ *
254
+ * If `obj` is an Array callback will be called passing
255
+ * the value, index, and complete array for each item.
256
+ *
257
+ * If 'obj' is an Object callback will be called passing
258
+ * the value, key, and complete object for each property.
259
+ *
260
+ * @param {Object|Array} obj The object to iterate
261
+ * @param {Function} fn The callback to invoke for each item
262
+ *
263
+ * @param {Boolean} [allOwnKeys = false]
264
+ * @returns {any}
265
+ */
266
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
267
+ // Don't bother if no value provided
268
+ if (obj === null || typeof obj === 'undefined') {
269
+ return;
270
+ }
271
+
272
+ let i;
273
+ let l;
274
+
275
+ // Force an array if not already something iterable
276
+ if (typeof obj !== 'object') {
277
+ /*eslint no-param-reassign:0*/
278
+ obj = [obj];
279
+ }
280
+
281
+ if (isArray(obj)) {
282
+ // Iterate over array values
283
+ for (i = 0, l = obj.length; i < l; i++) {
284
+ fn.call(null, obj[i], i, obj);
285
+ }
286
+ } else {
287
+ // Iterate over object keys
288
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
289
+ const len = keys.length;
290
+ let key;
291
+
292
+ for (i = 0; i < len; i++) {
293
+ key = keys[i];
294
+ fn.call(null, obj[key], key, obj);
295
+ }
296
+ }
297
+ }
298
+
299
+ function findKey(obj, key) {
300
+ key = key.toLowerCase();
301
+ const keys = Object.keys(obj);
302
+ let i = keys.length;
303
+ let _key;
304
+ while (i-- > 0) {
305
+ _key = keys[i];
306
+ if (key === _key.toLowerCase()) {
307
+ return _key;
308
+ }
309
+ }
310
+ return null;
311
+ }
312
+
313
+ const _global = (() => {
314
+ /*eslint no-undef:0*/
315
+ if (typeof globalThis !== "undefined") return globalThis;
316
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
317
+ })();
318
+
319
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
320
+
321
+ /**
322
+ * Accepts varargs expecting each argument to be an object, then
323
+ * immutably merges the properties of each object and returns result.
324
+ *
325
+ * When multiple objects contain the same key the later object in
326
+ * the arguments list will take precedence.
327
+ *
328
+ * Example:
329
+ *
330
+ * ```js
331
+ * var result = merge({foo: 123}, {foo: 456});
332
+ * console.log(result.foo); // outputs 456
333
+ * ```
334
+ *
335
+ * @param {Object} obj1 Object to merge
336
+ *
337
+ * @returns {Object} Result of all merge properties
338
+ */
339
+ function merge(/* obj1, obj2, obj3, ... */) {
340
+ const {caseless} = isContextDefined(this) && this || {};
341
+ const result = {};
342
+ const assignValue = (val, key) => {
343
+ const targetKey = caseless && findKey(result, key) || key;
344
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
345
+ result[targetKey] = merge(result[targetKey], val);
346
+ } else if (isPlainObject(val)) {
347
+ result[targetKey] = merge({}, val);
348
+ } else if (isArray(val)) {
349
+ result[targetKey] = val.slice();
350
+ } else {
351
+ result[targetKey] = val;
352
+ }
353
+ };
354
+
355
+ for (let i = 0, l = arguments.length; i < l; i++) {
356
+ arguments[i] && forEach(arguments[i], assignValue);
357
+ }
358
+ return result;
359
+ }
360
+
361
+ /**
362
+ * Extends object a by mutably adding to it the properties of object b.
363
+ *
364
+ * @param {Object} a The object to be extended
365
+ * @param {Object} b The object to copy properties from
366
+ * @param {Object} thisArg The object to bind function to
367
+ *
368
+ * @param {Boolean} [allOwnKeys]
369
+ * @returns {Object} The resulting value of object a
370
+ */
371
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
372
+ forEach(b, (val, key) => {
373
+ if (thisArg && isFunction(val)) {
374
+ a[key] = bind(val, thisArg);
375
+ } else {
376
+ a[key] = val;
377
+ }
378
+ }, {allOwnKeys});
379
+ return a;
380
+ };
381
+
382
+ /**
383
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
384
+ *
385
+ * @param {string} content with BOM
386
+ *
387
+ * @returns {string} content value without BOM
388
+ */
389
+ const stripBOM = (content) => {
390
+ if (content.charCodeAt(0) === 0xFEFF) {
391
+ content = content.slice(1);
392
+ }
393
+ return content;
394
+ };
395
+
396
+ /**
397
+ * Inherit the prototype methods from one constructor into another
398
+ * @param {function} constructor
399
+ * @param {function} superConstructor
400
+ * @param {object} [props]
401
+ * @param {object} [descriptors]
402
+ *
403
+ * @returns {void}
404
+ */
405
+ const inherits = (constructor, superConstructor, props, descriptors) => {
406
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
407
+ constructor.prototype.constructor = constructor;
408
+ Object.defineProperty(constructor, 'super', {
409
+ value: superConstructor.prototype
410
+ });
411
+ props && Object.assign(constructor.prototype, props);
412
+ };
413
+
414
+ /**
415
+ * Resolve object with deep prototype chain to a flat object
416
+ * @param {Object} sourceObj source object
417
+ * @param {Object} [destObj]
418
+ * @param {Function|Boolean} [filter]
419
+ * @param {Function} [propFilter]
420
+ *
421
+ * @returns {Object}
422
+ */
423
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
424
+ let props;
425
+ let i;
426
+ let prop;
427
+ const merged = {};
428
+
429
+ destObj = destObj || {};
430
+ // eslint-disable-next-line no-eq-null,eqeqeq
431
+ if (sourceObj == null) return destObj;
432
+
433
+ do {
434
+ props = Object.getOwnPropertyNames(sourceObj);
435
+ i = props.length;
436
+ while (i-- > 0) {
437
+ prop = props[i];
438
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
439
+ destObj[prop] = sourceObj[prop];
440
+ merged[prop] = true;
441
+ }
442
+ }
443
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
444
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
445
+
446
+ return destObj;
447
+ };
448
+
449
+ /**
450
+ * Determines whether a string ends with the characters of a specified string
451
+ *
452
+ * @param {String} str
453
+ * @param {String} searchString
454
+ * @param {Number} [position= 0]
455
+ *
456
+ * @returns {boolean}
457
+ */
458
+ const endsWith = (str, searchString, position) => {
459
+ str = String(str);
460
+ if (position === undefined || position > str.length) {
461
+ position = str.length;
462
+ }
463
+ position -= searchString.length;
464
+ const lastIndex = str.indexOf(searchString, position);
465
+ return lastIndex !== -1 && lastIndex === position;
466
+ };
467
+
468
+
469
+ /**
470
+ * Returns new array from array like object or null if failed
471
+ *
472
+ * @param {*} [thing]
473
+ *
474
+ * @returns {?Array}
475
+ */
476
+ const toArray = (thing) => {
477
+ if (!thing) return null;
478
+ if (isArray(thing)) return thing;
479
+ let i = thing.length;
480
+ if (!isNumber(i)) return null;
481
+ const arr = new Array(i);
482
+ while (i-- > 0) {
483
+ arr[i] = thing[i];
484
+ }
485
+ return arr;
486
+ };
487
+
488
+ /**
489
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
490
+ * thing passed in is an instance of Uint8Array
491
+ *
492
+ * @param {TypedArray}
493
+ *
494
+ * @returns {Array}
495
+ */
496
+ // eslint-disable-next-line func-names
497
+ const isTypedArray = (TypedArray => {
498
+ // eslint-disable-next-line func-names
499
+ return thing => {
500
+ return TypedArray && thing instanceof TypedArray;
501
+ };
502
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
503
+
504
+ /**
505
+ * For each entry in the object, call the function with the key and value.
506
+ *
507
+ * @param {Object<any, any>} obj - The object to iterate over.
508
+ * @param {Function} fn - The function to call for each entry.
509
+ *
510
+ * @returns {void}
511
+ */
512
+ const forEachEntry = (obj, fn) => {
513
+ const generator = obj && obj[Symbol.iterator];
514
+
515
+ const iterator = generator.call(obj);
516
+
517
+ let result;
518
+
519
+ while ((result = iterator.next()) && !result.done) {
520
+ const pair = result.value;
521
+ fn.call(obj, pair[0], pair[1]);
522
+ }
523
+ };
524
+
525
+ /**
526
+ * It takes a regular expression and a string, and returns an array of all the matches
527
+ *
528
+ * @param {string} regExp - The regular expression to match against.
529
+ * @param {string} str - The string to search.
530
+ *
531
+ * @returns {Array<boolean>}
532
+ */
533
+ const matchAll = (regExp, str) => {
534
+ let matches;
535
+ const arr = [];
536
+
537
+ while ((matches = regExp.exec(str)) !== null) {
538
+ arr.push(matches);
539
+ }
540
+
541
+ return arr;
542
+ };
543
+
544
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
545
+ const isHTMLForm = kindOfTest('HTMLFormElement');
546
+
547
+ const toCamelCase = str => {
548
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
549
+ function replacer(m, p1, p2) {
550
+ return p1.toUpperCase() + p2;
551
+ }
552
+ );
553
+ };
554
+
555
+ /* Creating a function that will check if an object has a property. */
556
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
557
+
558
+ /**
559
+ * Determine if a value is a RegExp object
560
+ *
561
+ * @param {*} val The value to test
562
+ *
563
+ * @returns {boolean} True if value is a RegExp object, otherwise false
564
+ */
565
+ const isRegExp = kindOfTest('RegExp');
566
+
567
+ const reduceDescriptors = (obj, reducer) => {
568
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
569
+ const reducedDescriptors = {};
570
+
571
+ forEach(descriptors, (descriptor, name) => {
572
+ let ret;
573
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
574
+ reducedDescriptors[name] = ret || descriptor;
575
+ }
576
+ });
577
+
578
+ Object.defineProperties(obj, reducedDescriptors);
579
+ };
580
+
581
+ /**
582
+ * Makes all methods read-only
583
+ * @param {Object} obj
584
+ */
585
+
586
+ const freezeMethods = (obj) => {
587
+ reduceDescriptors(obj, (descriptor, name) => {
588
+ // skip restricted props in strict mode
589
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
590
+ return false;
591
+ }
592
+
593
+ const value = obj[name];
594
+
595
+ if (!isFunction(value)) return;
596
+
597
+ descriptor.enumerable = false;
598
+
599
+ if ('writable' in descriptor) {
600
+ descriptor.writable = false;
601
+ return;
602
+ }
603
+
604
+ if (!descriptor.set) {
605
+ descriptor.set = () => {
606
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
607
+ };
608
+ }
609
+ });
610
+ };
611
+
612
+ const toObjectSet = (arrayOrString, delimiter) => {
613
+ const obj = {};
614
+
615
+ const define = (arr) => {
616
+ arr.forEach(value => {
617
+ obj[value] = true;
618
+ });
619
+ };
620
+
621
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
622
+
623
+ return obj;
624
+ };
625
+
626
+ const noop = () => {};
627
+
628
+ const toFiniteNumber = (value, defaultValue) => {
629
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
630
+ };
631
+
632
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
633
+
634
+ const DIGIT = '0123456789';
635
+
636
+ const ALPHABET = {
637
+ DIGIT,
638
+ ALPHA,
639
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
640
+ };
641
+
642
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
643
+ let str = '';
644
+ const {length} = alphabet;
645
+ while (size--) {
646
+ str += alphabet[Math.random() * length|0];
647
+ }
648
+
649
+ return str;
650
+ };
651
+
652
+ /**
653
+ * If the thing is a FormData object, return true, otherwise return false.
654
+ *
655
+ * @param {unknown} thing - The thing to check.
656
+ *
657
+ * @returns {boolean}
658
+ */
659
+ function isSpecCompliantForm(thing) {
660
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
661
+ }
662
+
663
+ const toJSONObject = (obj) => {
664
+ const stack = new Array(10);
665
+
666
+ const visit = (source, i) => {
667
+
668
+ if (isObject(source)) {
669
+ if (stack.indexOf(source) >= 0) {
670
+ return;
671
+ }
672
+
673
+ if(!('toJSON' in source)) {
674
+ stack[i] = source;
675
+ const target = isArray(source) ? [] : {};
676
+
677
+ forEach(source, (value, key) => {
678
+ const reducedValue = visit(value, i + 1);
679
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
680
+ });
681
+
682
+ stack[i] = undefined;
683
+
684
+ return target;
685
+ }
686
+ }
687
+
688
+ return source;
689
+ };
690
+
691
+ return visit(obj, 0);
692
+ };
693
+
694
+ const isAsyncFn = kindOfTest('AsyncFunction');
695
+
696
+ const isThenable = (thing) =>
697
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
698
+
699
+ // original code
700
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
701
+
702
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
703
+ if (setImmediateSupported) {
704
+ return setImmediate;
705
+ }
706
+
707
+ return postMessageSupported ? ((token, callbacks) => {
708
+ _global.addEventListener("message", ({source, data}) => {
709
+ if (source === _global && data === token) {
710
+ callbacks.length && callbacks.shift()();
711
+ }
712
+ }, false);
713
+
714
+ return (cb) => {
715
+ callbacks.push(cb);
716
+ _global.postMessage(token, "*");
717
+ }
718
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
719
+ })(
720
+ typeof setImmediate === 'function',
721
+ isFunction(_global.postMessage)
722
+ );
723
+
724
+ const asap = typeof queueMicrotask !== 'undefined' ?
725
+ queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
726
+
727
+ // *********************
728
+
729
+ const utils$1 = {
730
+ isArray,
731
+ isArrayBuffer,
732
+ isBuffer,
733
+ isFormData,
734
+ isArrayBufferView,
735
+ isString,
736
+ isNumber,
737
+ isBoolean,
738
+ isObject,
739
+ isPlainObject,
740
+ isReadableStream,
741
+ isRequest,
742
+ isResponse,
743
+ isHeaders,
744
+ isUndefined,
745
+ isDate,
746
+ isFile,
747
+ isBlob,
748
+ isRegExp,
749
+ isFunction,
750
+ isStream,
751
+ isURLSearchParams,
752
+ isTypedArray,
753
+ isFileList,
754
+ forEach,
755
+ merge,
756
+ extend,
757
+ trim,
758
+ stripBOM,
759
+ inherits,
760
+ toFlatObject,
761
+ kindOf,
762
+ kindOfTest,
763
+ endsWith,
764
+ toArray,
765
+ forEachEntry,
766
+ matchAll,
767
+ isHTMLForm,
768
+ hasOwnProperty,
769
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
770
+ reduceDescriptors,
771
+ freezeMethods,
772
+ toObjectSet,
773
+ toCamelCase,
774
+ noop,
775
+ toFiniteNumber,
776
+ findKey,
777
+ global: _global,
778
+ isContextDefined,
779
+ ALPHABET,
780
+ generateString,
781
+ isSpecCompliantForm,
782
+ toJSONObject,
783
+ isAsyncFn,
784
+ isThenable,
785
+ setImmediate: _setImmediate,
786
+ asap
787
+ };
788
+
789
+ /**
790
+ * Create an Error with the specified message, config, error code, request and response.
791
+ *
792
+ * @param {string} message The error message.
793
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
794
+ * @param {Object} [config] The config.
795
+ * @param {Object} [request] The request.
796
+ * @param {Object} [response] The response.
797
+ *
798
+ * @returns {Error} The created error.
799
+ */
800
+ function AxiosError(message, code, config, request, response) {
801
+ Error.call(this);
802
+
803
+ if (Error.captureStackTrace) {
804
+ Error.captureStackTrace(this, this.constructor);
805
+ } else {
806
+ this.stack = (new Error()).stack;
807
+ }
808
+
809
+ this.message = message;
810
+ this.name = 'AxiosError';
811
+ code && (this.code = code);
812
+ config && (this.config = config);
813
+ request && (this.request = request);
814
+ response && (this.response = response);
815
+ }
816
+
817
+ utils$1.inherits(AxiosError, Error, {
818
+ toJSON: function toJSON() {
819
+ return {
820
+ // Standard
821
+ message: this.message,
822
+ name: this.name,
823
+ // Microsoft
824
+ description: this.description,
825
+ number: this.number,
826
+ // Mozilla
827
+ fileName: this.fileName,
828
+ lineNumber: this.lineNumber,
829
+ columnNumber: this.columnNumber,
830
+ stack: this.stack,
831
+ // Axios
832
+ config: utils$1.toJSONObject(this.config),
833
+ code: this.code,
834
+ status: this.response && this.response.status ? this.response.status : null
835
+ };
836
+ }
837
+ });
838
+
839
+ const prototype$1 = AxiosError.prototype;
840
+ const descriptors = {};
841
+
842
+ [
843
+ 'ERR_BAD_OPTION_VALUE',
844
+ 'ERR_BAD_OPTION',
845
+ 'ECONNABORTED',
846
+ 'ETIMEDOUT',
847
+ 'ERR_NETWORK',
848
+ 'ERR_FR_TOO_MANY_REDIRECTS',
849
+ 'ERR_DEPRECATED',
850
+ 'ERR_BAD_RESPONSE',
851
+ 'ERR_BAD_REQUEST',
852
+ 'ERR_CANCELED',
853
+ 'ERR_NOT_SUPPORT',
854
+ 'ERR_INVALID_URL'
855
+ // eslint-disable-next-line func-names
856
+ ].forEach(code => {
857
+ descriptors[code] = {value: code};
858
+ });
859
+
860
+ Object.defineProperties(AxiosError, descriptors);
861
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
862
+
863
+ // eslint-disable-next-line func-names
864
+ AxiosError.from = (error, code, config, request, response, customProps) => {
865
+ const axiosError = Object.create(prototype$1);
866
+
867
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
868
+ return obj !== Error.prototype;
869
+ }, prop => {
870
+ return prop !== 'isAxiosError';
871
+ });
872
+
873
+ AxiosError.call(axiosError, error.message, code, config, request, response);
874
+
875
+ axiosError.cause = error;
876
+
877
+ axiosError.name = error.name;
878
+
879
+ customProps && Object.assign(axiosError, customProps);
880
+
881
+ return axiosError;
882
+ };
883
+
884
+ /**
885
+ * Determines if the given thing is a array or js object.
886
+ *
887
+ * @param {string} thing - The object or array to be visited.
888
+ *
889
+ * @returns {boolean}
890
+ */
891
+ function isVisitable(thing) {
892
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
893
+ }
894
+
895
+ /**
896
+ * It removes the brackets from the end of a string
897
+ *
898
+ * @param {string} key - The key of the parameter.
899
+ *
900
+ * @returns {string} the key without the brackets.
901
+ */
902
+ function removeBrackets(key) {
903
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
904
+ }
905
+
906
+ /**
907
+ * It takes a path, a key, and a boolean, and returns a string
908
+ *
909
+ * @param {string} path - The path to the current key.
910
+ * @param {string} key - The key of the current object being iterated over.
911
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
912
+ *
913
+ * @returns {string} The path to the current key.
914
+ */
915
+ function renderKey(path, key, dots) {
916
+ if (!path) return key;
917
+ return path.concat(key).map(function each(token, i) {
918
+ // eslint-disable-next-line no-param-reassign
919
+ token = removeBrackets(token);
920
+ return !dots && i ? '[' + token + ']' : token;
921
+ }).join(dots ? '.' : '');
922
+ }
923
+
924
+ /**
925
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
926
+ *
927
+ * @param {Array<any>} arr - The array to check
928
+ *
929
+ * @returns {boolean}
930
+ */
931
+ function isFlatArray(arr) {
932
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
933
+ }
934
+
935
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
936
+ return /^is[A-Z]/.test(prop);
937
+ });
938
+
939
+ /**
940
+ * Convert a data object to FormData
941
+ *
942
+ * @param {Object} obj
943
+ * @param {?Object} [formData]
944
+ * @param {?Object} [options]
945
+ * @param {Function} [options.visitor]
946
+ * @param {Boolean} [options.metaTokens = true]
947
+ * @param {Boolean} [options.dots = false]
948
+ * @param {?Boolean} [options.indexes = false]
949
+ *
950
+ * @returns {Object}
951
+ **/
952
+
953
+ /**
954
+ * It converts an object into a FormData object
955
+ *
956
+ * @param {Object<any, any>} obj - The object to convert to form data.
957
+ * @param {string} formData - The FormData object to append to.
958
+ * @param {Object<string, any>} options
959
+ *
960
+ * @returns
961
+ */
962
+ function toFormData(obj, formData, options) {
963
+ if (!utils$1.isObject(obj)) {
964
+ throw new TypeError('target must be an object');
965
+ }
966
+
967
+ // eslint-disable-next-line no-param-reassign
968
+ formData = formData || new (FormData__default["default"] || FormData)();
969
+
970
+ // eslint-disable-next-line no-param-reassign
971
+ options = utils$1.toFlatObject(options, {
972
+ metaTokens: true,
973
+ dots: false,
974
+ indexes: false
975
+ }, false, function defined(option, source) {
976
+ // eslint-disable-next-line no-eq-null,eqeqeq
977
+ return !utils$1.isUndefined(source[option]);
978
+ });
979
+
980
+ const metaTokens = options.metaTokens;
981
+ // eslint-disable-next-line no-use-before-define
982
+ const visitor = options.visitor || defaultVisitor;
983
+ const dots = options.dots;
984
+ const indexes = options.indexes;
985
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
986
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
987
+
988
+ if (!utils$1.isFunction(visitor)) {
989
+ throw new TypeError('visitor must be a function');
990
+ }
991
+
992
+ function convertValue(value) {
993
+ if (value === null) return '';
994
+
995
+ if (utils$1.isDate(value)) {
996
+ return value.toISOString();
997
+ }
998
+
999
+ if (!useBlob && utils$1.isBlob(value)) {
1000
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1001
+ }
1002
+
1003
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1004
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1005
+ }
1006
+
1007
+ return value;
1008
+ }
1009
+
1010
+ /**
1011
+ * Default visitor.
1012
+ *
1013
+ * @param {*} value
1014
+ * @param {String|Number} key
1015
+ * @param {Array<String|Number>} path
1016
+ * @this {FormData}
1017
+ *
1018
+ * @returns {boolean} return true to visit the each prop of the value recursively
1019
+ */
1020
+ function defaultVisitor(value, key, path) {
1021
+ let arr = value;
1022
+
1023
+ if (value && !path && typeof value === 'object') {
1024
+ if (utils$1.endsWith(key, '{}')) {
1025
+ // eslint-disable-next-line no-param-reassign
1026
+ key = metaTokens ? key : key.slice(0, -2);
1027
+ // eslint-disable-next-line no-param-reassign
1028
+ value = JSON.stringify(value);
1029
+ } else if (
1030
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1031
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1032
+ )) {
1033
+ // eslint-disable-next-line no-param-reassign
1034
+ key = removeBrackets(key);
1035
+
1036
+ arr.forEach(function each(el, index) {
1037
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
1038
+ // eslint-disable-next-line no-nested-ternary
1039
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1040
+ convertValue(el)
1041
+ );
1042
+ });
1043
+ return false;
1044
+ }
1045
+ }
1046
+
1047
+ if (isVisitable(value)) {
1048
+ return true;
1049
+ }
1050
+
1051
+ formData.append(renderKey(path, key, dots), convertValue(value));
1052
+
1053
+ return false;
1054
+ }
1055
+
1056
+ const stack = [];
1057
+
1058
+ const exposedHelpers = Object.assign(predicates, {
1059
+ defaultVisitor,
1060
+ convertValue,
1061
+ isVisitable
1062
+ });
1063
+
1064
+ function build(value, path) {
1065
+ if (utils$1.isUndefined(value)) return;
1066
+
1067
+ if (stack.indexOf(value) !== -1) {
1068
+ throw Error('Circular reference detected in ' + path.join('.'));
1069
+ }
1070
+
1071
+ stack.push(value);
1072
+
1073
+ utils$1.forEach(value, function each(el, key) {
1074
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1075
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1076
+ );
1077
+
1078
+ if (result === true) {
1079
+ build(el, path ? path.concat(key) : [key]);
1080
+ }
1081
+ });
1082
+
1083
+ stack.pop();
1084
+ }
1085
+
1086
+ if (!utils$1.isObject(obj)) {
1087
+ throw new TypeError('data must be an object');
1088
+ }
1089
+
1090
+ build(obj);
1091
+
1092
+ return formData;
1093
+ }
1094
+
1095
+ /**
1096
+ * It encodes a string by replacing all characters that are not in the unreserved set with
1097
+ * their percent-encoded equivalents
1098
+ *
1099
+ * @param {string} str - The string to encode.
1100
+ *
1101
+ * @returns {string} The encoded string.
1102
+ */
1103
+ function encode$1(str) {
1104
+ const charMap = {
1105
+ '!': '%21',
1106
+ "'": '%27',
1107
+ '(': '%28',
1108
+ ')': '%29',
1109
+ '~': '%7E',
1110
+ '%20': '+',
1111
+ '%00': '\x00'
1112
+ };
1113
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1114
+ return charMap[match];
1115
+ });
1116
+ }
1117
+
1118
+ /**
1119
+ * It takes a params object and converts it to a FormData object
1120
+ *
1121
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1122
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1123
+ *
1124
+ * @returns {void}
1125
+ */
1126
+ function AxiosURLSearchParams(params, options) {
1127
+ this._pairs = [];
1128
+
1129
+ params && toFormData(params, this, options);
1130
+ }
1131
+
1132
+ const prototype = AxiosURLSearchParams.prototype;
1133
+
1134
+ prototype.append = function append(name, value) {
1135
+ this._pairs.push([name, value]);
1136
+ };
1137
+
1138
+ prototype.toString = function toString(encoder) {
1139
+ const _encode = encoder ? function(value) {
1140
+ return encoder.call(this, value, encode$1);
1141
+ } : encode$1;
1142
+
1143
+ return this._pairs.map(function each(pair) {
1144
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
1145
+ }, '').join('&');
1146
+ };
1147
+
1148
+ /**
1149
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1150
+ * URI encoded counterparts
1151
+ *
1152
+ * @param {string} val The value to be encoded.
1153
+ *
1154
+ * @returns {string} The encoded value.
1155
+ */
1156
+ function encode(val) {
1157
+ return encodeURIComponent(val).
1158
+ replace(/%3A/gi, ':').
1159
+ replace(/%24/g, '$').
1160
+ replace(/%2C/gi, ',').
1161
+ replace(/%20/g, '+').
1162
+ replace(/%5B/gi, '[').
1163
+ replace(/%5D/gi, ']');
1164
+ }
1165
+
1166
+ /**
1167
+ * Build a URL by appending params to the end
1168
+ *
1169
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1170
+ * @param {object} [params] The params to be appended
1171
+ * @param {?object} options
1172
+ *
1173
+ * @returns {string} The formatted url
1174
+ */
1175
+ function buildURL(url, params, options) {
1176
+ /*eslint no-param-reassign:0*/
1177
+ if (!params) {
1178
+ return url;
1179
+ }
1180
+
1181
+ const _encode = options && options.encode || encode;
1182
+
1183
+ const serializeFn = options && options.serialize;
1184
+
1185
+ let serializedParams;
1186
+
1187
+ if (serializeFn) {
1188
+ serializedParams = serializeFn(params, options);
1189
+ } else {
1190
+ serializedParams = utils$1.isURLSearchParams(params) ?
1191
+ params.toString() :
1192
+ new AxiosURLSearchParams(params, options).toString(_encode);
1193
+ }
1194
+
1195
+ if (serializedParams) {
1196
+ const hashmarkIndex = url.indexOf("#");
1197
+
1198
+ if (hashmarkIndex !== -1) {
1199
+ url = url.slice(0, hashmarkIndex);
1200
+ }
1201
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1202
+ }
1203
+
1204
+ return url;
1205
+ }
1206
+
1207
+ class InterceptorManager {
1208
+ constructor() {
1209
+ this.handlers = [];
1210
+ }
1211
+
1212
+ /**
1213
+ * Add a new interceptor to the stack
1214
+ *
1215
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1216
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1217
+ *
1218
+ * @return {Number} An ID used to remove interceptor later
1219
+ */
1220
+ use(fulfilled, rejected, options) {
1221
+ this.handlers.push({
1222
+ fulfilled,
1223
+ rejected,
1224
+ synchronous: options ? options.synchronous : false,
1225
+ runWhen: options ? options.runWhen : null
1226
+ });
1227
+ return this.handlers.length - 1;
1228
+ }
1229
+
1230
+ /**
1231
+ * Remove an interceptor from the stack
1232
+ *
1233
+ * @param {Number} id The ID that was returned by `use`
1234
+ *
1235
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1236
+ */
1237
+ eject(id) {
1238
+ if (this.handlers[id]) {
1239
+ this.handlers[id] = null;
1240
+ }
1241
+ }
1242
+
1243
+ /**
1244
+ * Clear all interceptors from the stack
1245
+ *
1246
+ * @returns {void}
1247
+ */
1248
+ clear() {
1249
+ if (this.handlers) {
1250
+ this.handlers = [];
1251
+ }
1252
+ }
1253
+
1254
+ /**
1255
+ * Iterate over all the registered interceptors
1256
+ *
1257
+ * This method is particularly useful for skipping over any
1258
+ * interceptors that may have become `null` calling `eject`.
1259
+ *
1260
+ * @param {Function} fn The function to call for each interceptor
1261
+ *
1262
+ * @returns {void}
1263
+ */
1264
+ forEach(fn) {
1265
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1266
+ if (h !== null) {
1267
+ fn(h);
1268
+ }
1269
+ });
1270
+ }
1271
+ }
1272
+
1273
+ const InterceptorManager$1 = InterceptorManager;
1274
+
1275
+ const transitionalDefaults = {
1276
+ silentJSONParsing: true,
1277
+ forcedJSONParsing: true,
1278
+ clarifyTimeoutError: false
1279
+ };
1280
+
1281
+ const URLSearchParams = url__default["default"].URLSearchParams;
1282
+
1283
+ const platform$1 = {
1284
+ isNode: true,
1285
+ classes: {
1286
+ URLSearchParams,
1287
+ FormData: FormData__default["default"],
1288
+ Blob: typeof Blob !== 'undefined' && Blob || null
1289
+ },
1290
+ protocols: [ 'http', 'https', 'file', 'data' ]
1291
+ };
1292
+
1293
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1294
+
1295
+ /**
1296
+ * Determine if we're running in a standard browser environment
1297
+ *
1298
+ * This allows axios to run in a web worker, and react-native.
1299
+ * Both environments support XMLHttpRequest, but not fully standard globals.
1300
+ *
1301
+ * web workers:
1302
+ * typeof window -> undefined
1303
+ * typeof document -> undefined
1304
+ *
1305
+ * react-native:
1306
+ * navigator.product -> 'ReactNative'
1307
+ * nativescript
1308
+ * navigator.product -> 'NativeScript' or 'NS'
1309
+ *
1310
+ * @returns {boolean}
1311
+ */
1312
+ const hasStandardBrowserEnv = (
1313
+ (product) => {
1314
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1315
+ })(typeof navigator !== 'undefined' && navigator.product);
1316
+
1317
+ /**
1318
+ * Determine if we're running in a standard browser webWorker environment
1319
+ *
1320
+ * Although the `isStandardBrowserEnv` method indicates that
1321
+ * `allows axios to run in a web worker`, the WebWorker will still be
1322
+ * filtered out due to its judgment standard
1323
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1324
+ * This leads to a problem when axios post `FormData` in webWorker
1325
+ */
1326
+ const hasStandardBrowserWebWorkerEnv = (() => {
1327
+ return (
1328
+ typeof WorkerGlobalScope !== 'undefined' &&
1329
+ // eslint-disable-next-line no-undef
1330
+ self instanceof WorkerGlobalScope &&
1331
+ typeof self.importScripts === 'function'
1332
+ );
1333
+ })();
1334
+
1335
+ const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1336
+
1337
+ const utils = /*#__PURE__*/Object.freeze({
1338
+ __proto__: null,
1339
+ hasBrowserEnv: hasBrowserEnv,
1340
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1341
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1342
+ origin: origin
1343
+ });
1344
+
1345
+ const platform = {
1346
+ ...utils,
1347
+ ...platform$1
1348
+ };
1349
+
1350
+ function toURLEncodedForm(data, options) {
1351
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1352
+ visitor: function(value, key, path, helpers) {
1353
+ if (platform.isNode && utils$1.isBuffer(value)) {
1354
+ this.append(key, value.toString('base64'));
1355
+ return false;
1356
+ }
1357
+
1358
+ return helpers.defaultVisitor.apply(this, arguments);
1359
+ }
1360
+ }, options));
1361
+ }
1362
+
1363
+ /**
1364
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1365
+ *
1366
+ * @param {string} name - The name of the property to get.
1367
+ *
1368
+ * @returns An array of strings.
1369
+ */
1370
+ function parsePropPath(name) {
1371
+ // foo[x][y][z]
1372
+ // foo.x.y.z
1373
+ // foo-x-y-z
1374
+ // foo x y z
1375
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1376
+ return match[0] === '[]' ? '' : match[1] || match[0];
1377
+ });
1378
+ }
1379
+
1380
+ /**
1381
+ * Convert an array to an object.
1382
+ *
1383
+ * @param {Array<any>} arr - The array to convert to an object.
1384
+ *
1385
+ * @returns An object with the same keys and values as the array.
1386
+ */
1387
+ function arrayToObject(arr) {
1388
+ const obj = {};
1389
+ const keys = Object.keys(arr);
1390
+ let i;
1391
+ const len = keys.length;
1392
+ let key;
1393
+ for (i = 0; i < len; i++) {
1394
+ key = keys[i];
1395
+ obj[key] = arr[key];
1396
+ }
1397
+ return obj;
1398
+ }
1399
+
1400
+ /**
1401
+ * It takes a FormData object and returns a JavaScript object
1402
+ *
1403
+ * @param {string} formData The FormData object to convert to JSON.
1404
+ *
1405
+ * @returns {Object<string, any> | null} The converted object.
1406
+ */
1407
+ function formDataToJSON(formData) {
1408
+ function buildPath(path, value, target, index) {
1409
+ let name = path[index++];
1410
+
1411
+ if (name === '__proto__') return true;
1412
+
1413
+ const isNumericKey = Number.isFinite(+name);
1414
+ const isLast = index >= path.length;
1415
+ name = !name && utils$1.isArray(target) ? target.length : name;
1416
+
1417
+ if (isLast) {
1418
+ if (utils$1.hasOwnProp(target, name)) {
1419
+ target[name] = [target[name], value];
1420
+ } else {
1421
+ target[name] = value;
1422
+ }
1423
+
1424
+ return !isNumericKey;
1425
+ }
1426
+
1427
+ if (!target[name] || !utils$1.isObject(target[name])) {
1428
+ target[name] = [];
1429
+ }
1430
+
1431
+ const result = buildPath(path, value, target[name], index);
1432
+
1433
+ if (result && utils$1.isArray(target[name])) {
1434
+ target[name] = arrayToObject(target[name]);
1435
+ }
1436
+
1437
+ return !isNumericKey;
1438
+ }
1439
+
1440
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1441
+ const obj = {};
1442
+
1443
+ utils$1.forEachEntry(formData, (name, value) => {
1444
+ buildPath(parsePropPath(name), value, obj, 0);
1445
+ });
1446
+
1447
+ return obj;
1448
+ }
1449
+
1450
+ return null;
1451
+ }
1452
+
1453
+ /**
1454
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1455
+ * of the input
1456
+ *
1457
+ * @param {any} rawValue - The value to be stringified.
1458
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
1459
+ * @param {Function} encoder - A function that takes a value and returns a string.
1460
+ *
1461
+ * @returns {string} A stringified version of the rawValue.
1462
+ */
1463
+ function stringifySafely(rawValue, parser, encoder) {
1464
+ if (utils$1.isString(rawValue)) {
1465
+ try {
1466
+ (parser || JSON.parse)(rawValue);
1467
+ return utils$1.trim(rawValue);
1468
+ } catch (e) {
1469
+ if (e.name !== 'SyntaxError') {
1470
+ throw e;
1471
+ }
1472
+ }
1473
+ }
1474
+
1475
+ return (encoder || JSON.stringify)(rawValue);
1476
+ }
1477
+
1478
+ const defaults = {
1479
+
1480
+ transitional: transitionalDefaults,
1481
+
1482
+ adapter: ['xhr', 'http', 'fetch'],
1483
+
1484
+ transformRequest: [function transformRequest(data, headers) {
1485
+ const contentType = headers.getContentType() || '';
1486
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
1487
+ const isObjectPayload = utils$1.isObject(data);
1488
+
1489
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
1490
+ data = new FormData(data);
1491
+ }
1492
+
1493
+ const isFormData = utils$1.isFormData(data);
1494
+
1495
+ if (isFormData) {
1496
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1497
+ }
1498
+
1499
+ if (utils$1.isArrayBuffer(data) ||
1500
+ utils$1.isBuffer(data) ||
1501
+ utils$1.isStream(data) ||
1502
+ utils$1.isFile(data) ||
1503
+ utils$1.isBlob(data) ||
1504
+ utils$1.isReadableStream(data)
1505
+ ) {
1506
+ return data;
1507
+ }
1508
+ if (utils$1.isArrayBufferView(data)) {
1509
+ return data.buffer;
1510
+ }
1511
+ if (utils$1.isURLSearchParams(data)) {
1512
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1513
+ return data.toString();
1514
+ }
1515
+
1516
+ let isFileList;
1517
+
1518
+ if (isObjectPayload) {
1519
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1520
+ return toURLEncodedForm(data, this.formSerializer).toString();
1521
+ }
1522
+
1523
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1524
+ const _FormData = this.env && this.env.FormData;
1525
+
1526
+ return toFormData(
1527
+ isFileList ? {'files[]': data} : data,
1528
+ _FormData && new _FormData(),
1529
+ this.formSerializer
1530
+ );
1531
+ }
1532
+ }
1533
+
1534
+ if (isObjectPayload || hasJSONContentType ) {
1535
+ headers.setContentType('application/json', false);
1536
+ return stringifySafely(data);
1537
+ }
1538
+
1539
+ return data;
1540
+ }],
1541
+
1542
+ transformResponse: [function transformResponse(data) {
1543
+ const transitional = this.transitional || defaults.transitional;
1544
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1545
+ const JSONRequested = this.responseType === 'json';
1546
+
1547
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1548
+ return data;
1549
+ }
1550
+
1551
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1552
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
1553
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
1554
+
1555
+ try {
1556
+ return JSON.parse(data);
1557
+ } catch (e) {
1558
+ if (strictJSONParsing) {
1559
+ if (e.name === 'SyntaxError') {
1560
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
1561
+ }
1562
+ throw e;
1563
+ }
1564
+ }
1565
+ }
1566
+
1567
+ return data;
1568
+ }],
1569
+
1570
+ /**
1571
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1572
+ * timeout is not created.
1573
+ */
1574
+ timeout: 0,
1575
+
1576
+ xsrfCookieName: 'XSRF-TOKEN',
1577
+ xsrfHeaderName: 'X-XSRF-TOKEN',
1578
+
1579
+ maxContentLength: -1,
1580
+ maxBodyLength: -1,
1581
+
1582
+ env: {
1583
+ FormData: platform.classes.FormData,
1584
+ Blob: platform.classes.Blob
1585
+ },
1586
+
1587
+ validateStatus: function validateStatus(status) {
1588
+ return status >= 200 && status < 300;
1589
+ },
1590
+
1591
+ headers: {
1592
+ common: {
1593
+ 'Accept': 'application/json, text/plain, */*',
1594
+ 'Content-Type': undefined
1595
+ }
1596
+ }
1597
+ };
1598
+
1599
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1600
+ defaults.headers[method] = {};
1601
+ });
1602
+
1603
+ const defaults$1 = defaults;
1604
+
1605
+ // RawAxiosHeaders whose duplicates are ignored by node
1606
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
1607
+ const ignoreDuplicateOf = utils$1.toObjectSet([
1608
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
1609
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1610
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1611
+ 'referer', 'retry-after', 'user-agent'
1612
+ ]);
1613
+
1614
+ /**
1615
+ * Parse headers into an object
1616
+ *
1617
+ * ```
1618
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
1619
+ * Content-Type: application/json
1620
+ * Connection: keep-alive
1621
+ * Transfer-Encoding: chunked
1622
+ * ```
1623
+ *
1624
+ * @param {String} rawHeaders Headers needing to be parsed
1625
+ *
1626
+ * @returns {Object} Headers parsed into an object
1627
+ */
1628
+ const parseHeaders = rawHeaders => {
1629
+ const parsed = {};
1630
+ let key;
1631
+ let val;
1632
+ let i;
1633
+
1634
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1635
+ i = line.indexOf(':');
1636
+ key = line.substring(0, i).trim().toLowerCase();
1637
+ val = line.substring(i + 1).trim();
1638
+
1639
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1640
+ return;
1641
+ }
1642
+
1643
+ if (key === 'set-cookie') {
1644
+ if (parsed[key]) {
1645
+ parsed[key].push(val);
1646
+ } else {
1647
+ parsed[key] = [val];
1648
+ }
1649
+ } else {
1650
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1651
+ }
1652
+ });
1653
+
1654
+ return parsed;
1655
+ };
1656
+
1657
+ const $internals = Symbol('internals');
1658
+
1659
+ function normalizeHeader(header) {
1660
+ return header && String(header).trim().toLowerCase();
1661
+ }
1662
+
1663
+ function normalizeValue(value) {
1664
+ if (value === false || value == null) {
1665
+ return value;
1666
+ }
1667
+
1668
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
1669
+ }
1670
+
1671
+ function parseTokens(str) {
1672
+ const tokens = Object.create(null);
1673
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1674
+ let match;
1675
+
1676
+ while ((match = tokensRE.exec(str))) {
1677
+ tokens[match[1]] = match[2];
1678
+ }
1679
+
1680
+ return tokens;
1681
+ }
1682
+
1683
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1684
+
1685
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1686
+ if (utils$1.isFunction(filter)) {
1687
+ return filter.call(this, value, header);
1688
+ }
1689
+
1690
+ if (isHeaderNameFilter) {
1691
+ value = header;
1692
+ }
1693
+
1694
+ if (!utils$1.isString(value)) return;
1695
+
1696
+ if (utils$1.isString(filter)) {
1697
+ return value.indexOf(filter) !== -1;
1698
+ }
1699
+
1700
+ if (utils$1.isRegExp(filter)) {
1701
+ return filter.test(value);
1702
+ }
1703
+ }
1704
+
1705
+ function formatHeader(header) {
1706
+ return header.trim()
1707
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1708
+ return char.toUpperCase() + str;
1709
+ });
1710
+ }
1711
+
1712
+ function buildAccessors(obj, header) {
1713
+ const accessorName = utils$1.toCamelCase(' ' + header);
1714
+
1715
+ ['get', 'set', 'has'].forEach(methodName => {
1716
+ Object.defineProperty(obj, methodName + accessorName, {
1717
+ value: function(arg1, arg2, arg3) {
1718
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1719
+ },
1720
+ configurable: true
1721
+ });
1722
+ });
1723
+ }
1724
+
1725
+ class AxiosHeaders {
1726
+ constructor(headers) {
1727
+ headers && this.set(headers);
1728
+ }
1729
+
1730
+ set(header, valueOrRewrite, rewrite) {
1731
+ const self = this;
1732
+
1733
+ function setHeader(_value, _header, _rewrite) {
1734
+ const lHeader = normalizeHeader(_header);
1735
+
1736
+ if (!lHeader) {
1737
+ throw new Error('header name must be a non-empty string');
1738
+ }
1739
+
1740
+ const key = utils$1.findKey(self, lHeader);
1741
+
1742
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1743
+ self[key || _header] = normalizeValue(_value);
1744
+ }
1745
+ }
1746
+
1747
+ const setHeaders = (headers, _rewrite) =>
1748
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1749
+
1750
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1751
+ setHeaders(header, valueOrRewrite);
1752
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1753
+ setHeaders(parseHeaders(header), valueOrRewrite);
1754
+ } else if (utils$1.isHeaders(header)) {
1755
+ for (const [key, value] of header.entries()) {
1756
+ setHeader(value, key, rewrite);
1757
+ }
1758
+ } else {
1759
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1760
+ }
1761
+
1762
+ return this;
1763
+ }
1764
+
1765
+ get(header, parser) {
1766
+ header = normalizeHeader(header);
1767
+
1768
+ if (header) {
1769
+ const key = utils$1.findKey(this, header);
1770
+
1771
+ if (key) {
1772
+ const value = this[key];
1773
+
1774
+ if (!parser) {
1775
+ return value;
1776
+ }
1777
+
1778
+ if (parser === true) {
1779
+ return parseTokens(value);
1780
+ }
1781
+
1782
+ if (utils$1.isFunction(parser)) {
1783
+ return parser.call(this, value, key);
1784
+ }
1785
+
1786
+ if (utils$1.isRegExp(parser)) {
1787
+ return parser.exec(value);
1788
+ }
1789
+
1790
+ throw new TypeError('parser must be boolean|regexp|function');
1791
+ }
1792
+ }
1793
+ }
1794
+
1795
+ has(header, matcher) {
1796
+ header = normalizeHeader(header);
1797
+
1798
+ if (header) {
1799
+ const key = utils$1.findKey(this, header);
1800
+
1801
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1802
+ }
1803
+
1804
+ return false;
1805
+ }
1806
+
1807
+ delete(header, matcher) {
1808
+ const self = this;
1809
+ let deleted = false;
1810
+
1811
+ function deleteHeader(_header) {
1812
+ _header = normalizeHeader(_header);
1813
+
1814
+ if (_header) {
1815
+ const key = utils$1.findKey(self, _header);
1816
+
1817
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1818
+ delete self[key];
1819
+
1820
+ deleted = true;
1821
+ }
1822
+ }
1823
+ }
1824
+
1825
+ if (utils$1.isArray(header)) {
1826
+ header.forEach(deleteHeader);
1827
+ } else {
1828
+ deleteHeader(header);
1829
+ }
1830
+
1831
+ return deleted;
1832
+ }
1833
+
1834
+ clear(matcher) {
1835
+ const keys = Object.keys(this);
1836
+ let i = keys.length;
1837
+ let deleted = false;
1838
+
1839
+ while (i--) {
1840
+ const key = keys[i];
1841
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1842
+ delete this[key];
1843
+ deleted = true;
1844
+ }
1845
+ }
1846
+
1847
+ return deleted;
1848
+ }
1849
+
1850
+ normalize(format) {
1851
+ const self = this;
1852
+ const headers = {};
1853
+
1854
+ utils$1.forEach(this, (value, header) => {
1855
+ const key = utils$1.findKey(headers, header);
1856
+
1857
+ if (key) {
1858
+ self[key] = normalizeValue(value);
1859
+ delete self[header];
1860
+ return;
1861
+ }
1862
+
1863
+ const normalized = format ? formatHeader(header) : String(header).trim();
1864
+
1865
+ if (normalized !== header) {
1866
+ delete self[header];
1867
+ }
1868
+
1869
+ self[normalized] = normalizeValue(value);
1870
+
1871
+ headers[normalized] = true;
1872
+ });
1873
+
1874
+ return this;
1875
+ }
1876
+
1877
+ concat(...targets) {
1878
+ return this.constructor.concat(this, ...targets);
1879
+ }
1880
+
1881
+ toJSON(asStrings) {
1882
+ const obj = Object.create(null);
1883
+
1884
+ utils$1.forEach(this, (value, header) => {
1885
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1886
+ });
1887
+
1888
+ return obj;
1889
+ }
1890
+
1891
+ [Symbol.iterator]() {
1892
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1893
+ }
1894
+
1895
+ toString() {
1896
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
1897
+ }
1898
+
1899
+ get [Symbol.toStringTag]() {
1900
+ return 'AxiosHeaders';
1901
+ }
1902
+
1903
+ static from(thing) {
1904
+ return thing instanceof this ? thing : new this(thing);
1905
+ }
1906
+
1907
+ static concat(first, ...targets) {
1908
+ const computed = new this(first);
1909
+
1910
+ targets.forEach((target) => computed.set(target));
1911
+
1912
+ return computed;
1913
+ }
1914
+
1915
+ static accessor(header) {
1916
+ const internals = this[$internals] = (this[$internals] = {
1917
+ accessors: {}
1918
+ });
1919
+
1920
+ const accessors = internals.accessors;
1921
+ const prototype = this.prototype;
1922
+
1923
+ function defineAccessor(_header) {
1924
+ const lHeader = normalizeHeader(_header);
1925
+
1926
+ if (!accessors[lHeader]) {
1927
+ buildAccessors(prototype, _header);
1928
+ accessors[lHeader] = true;
1929
+ }
1930
+ }
1931
+
1932
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1933
+
1934
+ return this;
1935
+ }
1936
+ }
1937
+
1938
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
1939
+
1940
+ // reserved names hotfix
1941
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
1942
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1943
+ return {
1944
+ get: () => value,
1945
+ set(headerValue) {
1946
+ this[mapped] = headerValue;
1947
+ }
1948
+ }
1949
+ });
1950
+
1951
+ utils$1.freezeMethods(AxiosHeaders);
1952
+
1953
+ const AxiosHeaders$1 = AxiosHeaders;
1954
+
1955
+ /**
1956
+ * Transform the data for a request or a response
1957
+ *
1958
+ * @param {Array|Function} fns A single function or Array of functions
1959
+ * @param {?Object} response The response object
1960
+ *
1961
+ * @returns {*} The resulting transformed data
1962
+ */
1963
+ function transformData(fns, response) {
1964
+ const config = this || defaults$1;
1965
+ const context = response || config;
1966
+ const headers = AxiosHeaders$1.from(context.headers);
1967
+ let data = context.data;
1968
+
1969
+ utils$1.forEach(fns, function transform(fn) {
1970
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
1971
+ });
1972
+
1973
+ headers.normalize();
1974
+
1975
+ return data;
1976
+ }
1977
+
1978
+ function isCancel(value) {
1979
+ return !!(value && value.__CANCEL__);
1980
+ }
1981
+
1982
+ /**
1983
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1984
+ *
1985
+ * @param {string=} message The message.
1986
+ * @param {Object=} config The config.
1987
+ * @param {Object=} request The request.
1988
+ *
1989
+ * @returns {CanceledError} The created error.
1990
+ */
1991
+ function CanceledError(message, config, request) {
1992
+ // eslint-disable-next-line no-eq-null,eqeqeq
1993
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
1994
+ this.name = 'CanceledError';
1995
+ }
1996
+
1997
+ utils$1.inherits(CanceledError, AxiosError, {
1998
+ __CANCEL__: true
1999
+ });
2000
+
2001
+ /**
2002
+ * Resolve or reject a Promise based on response status.
2003
+ *
2004
+ * @param {Function} resolve A function that resolves the promise.
2005
+ * @param {Function} reject A function that rejects the promise.
2006
+ * @param {object} response The response.
2007
+ *
2008
+ * @returns {object} The response.
2009
+ */
2010
+ function settle(resolve, reject, response) {
2011
+ const validateStatus = response.config.validateStatus;
2012
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
2013
+ resolve(response);
2014
+ } else {
2015
+ reject(new AxiosError(
2016
+ 'Request failed with status code ' + response.status,
2017
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2018
+ response.config,
2019
+ response.request,
2020
+ response
2021
+ ));
2022
+ }
2023
+ }
2024
+
2025
+ /**
2026
+ * Determines whether the specified URL is absolute
2027
+ *
2028
+ * @param {string} url The URL to test
2029
+ *
2030
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
2031
+ */
2032
+ function isAbsoluteURL(url) {
2033
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2034
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2035
+ // by any combination of letters, digits, plus, period, or hyphen.
2036
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2037
+ }
2038
+
2039
+ /**
2040
+ * Creates a new URL by combining the specified URLs
2041
+ *
2042
+ * @param {string} baseURL The base URL
2043
+ * @param {string} relativeURL The relative URL
2044
+ *
2045
+ * @returns {string} The combined URL
2046
+ */
2047
+ function combineURLs(baseURL, relativeURL) {
2048
+ return relativeURL
2049
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2050
+ : baseURL;
2051
+ }
2052
+
2053
+ /**
2054
+ * Creates a new URL by combining the baseURL with the requestedURL,
2055
+ * only when the requestedURL is not already an absolute URL.
2056
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
2057
+ *
2058
+ * @param {string} baseURL The base URL
2059
+ * @param {string} requestedURL Absolute or relative URL to combine
2060
+ *
2061
+ * @returns {string} The combined full path
2062
+ */
2063
+ function buildFullPath(baseURL, requestedURL) {
2064
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
2065
+ return combineURLs(baseURL, requestedURL);
2066
+ }
2067
+ return requestedURL;
2068
+ }
2069
+
2070
+ const VERSION = "1.7.4";
2071
+
2072
+ function parseProtocol(url) {
2073
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2074
+ return match && match[1] || '';
2075
+ }
2076
+
2077
+ const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
2078
+
2079
+ /**
2080
+ * Parse data uri to a Buffer or Blob
2081
+ *
2082
+ * @param {String} uri
2083
+ * @param {?Boolean} asBlob
2084
+ * @param {?Object} options
2085
+ * @param {?Function} options.Blob
2086
+ *
2087
+ * @returns {Buffer|Blob}
2088
+ */
2089
+ function fromDataURI(uri, asBlob, options) {
2090
+ const _Blob = options && options.Blob || platform.classes.Blob;
2091
+ const protocol = parseProtocol(uri);
2092
+
2093
+ if (asBlob === undefined && _Blob) {
2094
+ asBlob = true;
2095
+ }
2096
+
2097
+ if (protocol === 'data') {
2098
+ uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
2099
+
2100
+ const match = DATA_URL_PATTERN.exec(uri);
2101
+
2102
+ if (!match) {
2103
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
2104
+ }
2105
+
2106
+ const mime = match[1];
2107
+ const isBase64 = match[2];
2108
+ const body = match[3];
2109
+ const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
2110
+
2111
+ if (asBlob) {
2112
+ if (!_Blob) {
2113
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
2114
+ }
2115
+
2116
+ return new _Blob([buffer], {type: mime});
2117
+ }
2118
+
2119
+ return buffer;
2120
+ }
2121
+
2122
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
2123
+ }
2124
+
2125
+ const kInternals = Symbol('internals');
2126
+
2127
+ class AxiosTransformStream extends stream__default["default"].Transform{
2128
+ constructor(options) {
2129
+ options = utils$1.toFlatObject(options, {
2130
+ maxRate: 0,
2131
+ chunkSize: 64 * 1024,
2132
+ minChunkSize: 100,
2133
+ timeWindow: 500,
2134
+ ticksRate: 2,
2135
+ samplesCount: 15
2136
+ }, null, (prop, source) => {
2137
+ return !utils$1.isUndefined(source[prop]);
2138
+ });
2139
+
2140
+ super({
2141
+ readableHighWaterMark: options.chunkSize
2142
+ });
2143
+
2144
+ const internals = this[kInternals] = {
2145
+ timeWindow: options.timeWindow,
2146
+ chunkSize: options.chunkSize,
2147
+ maxRate: options.maxRate,
2148
+ minChunkSize: options.minChunkSize,
2149
+ bytesSeen: 0,
2150
+ isCaptured: false,
2151
+ notifiedBytesLoaded: 0,
2152
+ ts: Date.now(),
2153
+ bytes: 0,
2154
+ onReadCallback: null
2155
+ };
2156
+
2157
+ this.on('newListener', event => {
2158
+ if (event === 'progress') {
2159
+ if (!internals.isCaptured) {
2160
+ internals.isCaptured = true;
2161
+ }
2162
+ }
2163
+ });
2164
+ }
2165
+
2166
+ _read(size) {
2167
+ const internals = this[kInternals];
2168
+
2169
+ if (internals.onReadCallback) {
2170
+ internals.onReadCallback();
2171
+ }
2172
+
2173
+ return super._read(size);
2174
+ }
2175
+
2176
+ _transform(chunk, encoding, callback) {
2177
+ const internals = this[kInternals];
2178
+ const maxRate = internals.maxRate;
2179
+
2180
+ const readableHighWaterMark = this.readableHighWaterMark;
2181
+
2182
+ const timeWindow = internals.timeWindow;
2183
+
2184
+ const divider = 1000 / timeWindow;
2185
+ const bytesThreshold = (maxRate / divider);
2186
+ const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
2187
+
2188
+ const pushChunk = (_chunk, _callback) => {
2189
+ const bytes = Buffer.byteLength(_chunk);
2190
+ internals.bytesSeen += bytes;
2191
+ internals.bytes += bytes;
2192
+
2193
+ internals.isCaptured && this.emit('progress', internals.bytesSeen);
2194
+
2195
+ if (this.push(_chunk)) {
2196
+ process.nextTick(_callback);
2197
+ } else {
2198
+ internals.onReadCallback = () => {
2199
+ internals.onReadCallback = null;
2200
+ process.nextTick(_callback);
2201
+ };
2202
+ }
2203
+ };
2204
+
2205
+ const transformChunk = (_chunk, _callback) => {
2206
+ const chunkSize = Buffer.byteLength(_chunk);
2207
+ let chunkRemainder = null;
2208
+ let maxChunkSize = readableHighWaterMark;
2209
+ let bytesLeft;
2210
+ let passed = 0;
2211
+
2212
+ if (maxRate) {
2213
+ const now = Date.now();
2214
+
2215
+ if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {
2216
+ internals.ts = now;
2217
+ bytesLeft = bytesThreshold - internals.bytes;
2218
+ internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
2219
+ passed = 0;
2220
+ }
2221
+
2222
+ bytesLeft = bytesThreshold - internals.bytes;
2223
+ }
2224
+
2225
+ if (maxRate) {
2226
+ if (bytesLeft <= 0) {
2227
+ // next time window
2228
+ return setTimeout(() => {
2229
+ _callback(null, _chunk);
2230
+ }, timeWindow - passed);
2231
+ }
2232
+
2233
+ if (bytesLeft < maxChunkSize) {
2234
+ maxChunkSize = bytesLeft;
2235
+ }
2236
+ }
2237
+
2238
+ if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {
2239
+ chunkRemainder = _chunk.subarray(maxChunkSize);
2240
+ _chunk = _chunk.subarray(0, maxChunkSize);
2241
+ }
2242
+
2243
+ pushChunk(_chunk, chunkRemainder ? () => {
2244
+ process.nextTick(_callback, null, chunkRemainder);
2245
+ } : _callback);
2246
+ };
2247
+
2248
+ transformChunk(chunk, function transformNextChunk(err, _chunk) {
2249
+ if (err) {
2250
+ return callback(err);
2251
+ }
2252
+
2253
+ if (_chunk) {
2254
+ transformChunk(_chunk, transformNextChunk);
2255
+ } else {
2256
+ callback(null);
2257
+ }
2258
+ });
2259
+ }
2260
+ }
2261
+
2262
+ const AxiosTransformStream$1 = AxiosTransformStream;
2263
+
2264
+ const {asyncIterator} = Symbol;
2265
+
2266
+ const readBlob = async function* (blob) {
2267
+ if (blob.stream) {
2268
+ yield* blob.stream();
2269
+ } else if (blob.arrayBuffer) {
2270
+ yield await blob.arrayBuffer();
2271
+ } else if (blob[asyncIterator]) {
2272
+ yield* blob[asyncIterator]();
2273
+ } else {
2274
+ yield blob;
2275
+ }
2276
+ };
2277
+
2278
+ const readBlob$1 = readBlob;
2279
+
2280
+ const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
2281
+
2282
+ const textEncoder = new util.TextEncoder();
2283
+
2284
+ const CRLF = '\r\n';
2285
+ const CRLF_BYTES = textEncoder.encode(CRLF);
2286
+ const CRLF_BYTES_COUNT = 2;
2287
+
2288
+ class FormDataPart {
2289
+ constructor(name, value) {
2290
+ const {escapeName} = this.constructor;
2291
+ const isStringValue = utils$1.isString(value);
2292
+
2293
+ let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
2294
+ !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
2295
+ }${CRLF}`;
2296
+
2297
+ if (isStringValue) {
2298
+ value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
2299
+ } else {
2300
+ headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
2301
+ }
2302
+
2303
+ this.headers = textEncoder.encode(headers + CRLF);
2304
+
2305
+ this.contentLength = isStringValue ? value.byteLength : value.size;
2306
+
2307
+ this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
2308
+
2309
+ this.name = name;
2310
+ this.value = value;
2311
+ }
2312
+
2313
+ async *encode(){
2314
+ yield this.headers;
2315
+
2316
+ const {value} = this;
2317
+
2318
+ if(utils$1.isTypedArray(value)) {
2319
+ yield value;
2320
+ } else {
2321
+ yield* readBlob$1(value);
2322
+ }
2323
+
2324
+ yield CRLF_BYTES;
2325
+ }
2326
+
2327
+ static escapeName(name) {
2328
+ return String(name).replace(/[\r\n"]/g, (match) => ({
2329
+ '\r' : '%0D',
2330
+ '\n' : '%0A',
2331
+ '"' : '%22',
2332
+ }[match]));
2333
+ }
2334
+ }
2335
+
2336
+ const formDataToStream = (form, headersHandler, options) => {
2337
+ const {
2338
+ tag = 'form-data-boundary',
2339
+ size = 25,
2340
+ boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
2341
+ } = options || {};
2342
+
2343
+ if(!utils$1.isFormData(form)) {
2344
+ throw TypeError('FormData instance required');
2345
+ }
2346
+
2347
+ if (boundary.length < 1 || boundary.length > 70) {
2348
+ throw Error('boundary must be 10-70 characters long')
2349
+ }
2350
+
2351
+ const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
2352
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
2353
+ let contentLength = footerBytes.byteLength;
2354
+
2355
+ const parts = Array.from(form.entries()).map(([name, value]) => {
2356
+ const part = new FormDataPart(name, value);
2357
+ contentLength += part.size;
2358
+ return part;
2359
+ });
2360
+
2361
+ contentLength += boundaryBytes.byteLength * parts.length;
2362
+
2363
+ contentLength = utils$1.toFiniteNumber(contentLength);
2364
+
2365
+ const computedHeaders = {
2366
+ 'Content-Type': `multipart/form-data; boundary=${boundary}`
2367
+ };
2368
+
2369
+ if (Number.isFinite(contentLength)) {
2370
+ computedHeaders['Content-Length'] = contentLength;
2371
+ }
2372
+
2373
+ headersHandler && headersHandler(computedHeaders);
2374
+
2375
+ return stream.Readable.from((async function *() {
2376
+ for(const part of parts) {
2377
+ yield boundaryBytes;
2378
+ yield* part.encode();
2379
+ }
2380
+
2381
+ yield footerBytes;
2382
+ })());
2383
+ };
2384
+
2385
+ const formDataToStream$1 = formDataToStream;
2386
+
2387
+ class ZlibHeaderTransformStream extends stream__default["default"].Transform {
2388
+ __transform(chunk, encoding, callback) {
2389
+ this.push(chunk);
2390
+ callback();
2391
+ }
2392
+
2393
+ _transform(chunk, encoding, callback) {
2394
+ if (chunk.length !== 0) {
2395
+ this._transform = this.__transform;
2396
+
2397
+ // Add Default Compression headers if no zlib headers are present
2398
+ if (chunk[0] !== 120) { // Hex: 78
2399
+ const header = Buffer.alloc(2);
2400
+ header[0] = 120; // Hex: 78
2401
+ header[1] = 156; // Hex: 9C
2402
+ this.push(header, encoding);
2403
+ }
2404
+ }
2405
+
2406
+ this.__transform(chunk, encoding, callback);
2407
+ }
2408
+ }
2409
+
2410
+ const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
2411
+
2412
+ const callbackify = (fn, reducer) => {
2413
+ return utils$1.isAsyncFn(fn) ? function (...args) {
2414
+ const cb = args.pop();
2415
+ fn.apply(this, args).then((value) => {
2416
+ try {
2417
+ reducer ? cb(null, ...reducer(value)) : cb(null, value);
2418
+ } catch (err) {
2419
+ cb(err);
2420
+ }
2421
+ }, cb);
2422
+ } : fn;
2423
+ };
2424
+
2425
+ const callbackify$1 = callbackify;
2426
+
2427
+ /**
2428
+ * Calculate data maxRate
2429
+ * @param {Number} [samplesCount= 10]
2430
+ * @param {Number} [min= 1000]
2431
+ * @returns {Function}
2432
+ */
2433
+ function speedometer(samplesCount, min) {
2434
+ samplesCount = samplesCount || 10;
2435
+ const bytes = new Array(samplesCount);
2436
+ const timestamps = new Array(samplesCount);
2437
+ let head = 0;
2438
+ let tail = 0;
2439
+ let firstSampleTS;
2440
+
2441
+ min = min !== undefined ? min : 1000;
2442
+
2443
+ return function push(chunkLength) {
2444
+ const now = Date.now();
2445
+
2446
+ const startedAt = timestamps[tail];
2447
+
2448
+ if (!firstSampleTS) {
2449
+ firstSampleTS = now;
2450
+ }
2451
+
2452
+ bytes[head] = chunkLength;
2453
+ timestamps[head] = now;
2454
+
2455
+ let i = tail;
2456
+ let bytesCount = 0;
2457
+
2458
+ while (i !== head) {
2459
+ bytesCount += bytes[i++];
2460
+ i = i % samplesCount;
2461
+ }
2462
+
2463
+ head = (head + 1) % samplesCount;
2464
+
2465
+ if (head === tail) {
2466
+ tail = (tail + 1) % samplesCount;
2467
+ }
2468
+
2469
+ if (now - firstSampleTS < min) {
2470
+ return;
2471
+ }
2472
+
2473
+ const passed = startedAt && now - startedAt;
2474
+
2475
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2476
+ };
2477
+ }
2478
+
2479
+ /**
2480
+ * Throttle decorator
2481
+ * @param {Function} fn
2482
+ * @param {Number} freq
2483
+ * @return {Function}
2484
+ */
2485
+ function throttle(fn, freq) {
2486
+ let timestamp = 0;
2487
+ let threshold = 1000 / freq;
2488
+ let lastArgs;
2489
+ let timer;
2490
+
2491
+ const invoke = (args, now = Date.now()) => {
2492
+ timestamp = now;
2493
+ lastArgs = null;
2494
+ if (timer) {
2495
+ clearTimeout(timer);
2496
+ timer = null;
2497
+ }
2498
+ fn.apply(null, args);
2499
+ };
2500
+
2501
+ const throttled = (...args) => {
2502
+ const now = Date.now();
2503
+ const passed = now - timestamp;
2504
+ if ( passed >= threshold) {
2505
+ invoke(args, now);
2506
+ } else {
2507
+ lastArgs = args;
2508
+ if (!timer) {
2509
+ timer = setTimeout(() => {
2510
+ timer = null;
2511
+ invoke(lastArgs);
2512
+ }, threshold - passed);
2513
+ }
2514
+ }
2515
+ };
2516
+
2517
+ const flush = () => lastArgs && invoke(lastArgs);
2518
+
2519
+ return [throttled, flush];
2520
+ }
2521
+
2522
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2523
+ let bytesNotified = 0;
2524
+ const _speedometer = speedometer(50, 250);
2525
+
2526
+ return throttle(e => {
2527
+ const loaded = e.loaded;
2528
+ const total = e.lengthComputable ? e.total : undefined;
2529
+ const progressBytes = loaded - bytesNotified;
2530
+ const rate = _speedometer(progressBytes);
2531
+ const inRange = loaded <= total;
2532
+
2533
+ bytesNotified = loaded;
2534
+
2535
+ const data = {
2536
+ loaded,
2537
+ total,
2538
+ progress: total ? (loaded / total) : undefined,
2539
+ bytes: progressBytes,
2540
+ rate: rate ? rate : undefined,
2541
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2542
+ event: e,
2543
+ lengthComputable: total != null,
2544
+ [isDownloadStream ? 'download' : 'upload']: true
2545
+ };
2546
+
2547
+ listener(data);
2548
+ }, freq);
2549
+ };
2550
+
2551
+ const progressEventDecorator = (total, throttled) => {
2552
+ const lengthComputable = total != null;
2553
+
2554
+ return [(loaded) => throttled[0]({
2555
+ lengthComputable,
2556
+ total,
2557
+ loaded
2558
+ }), throttled[1]];
2559
+ };
2560
+
2561
+ const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
2562
+
2563
+ const zlibOptions = {
2564
+ flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
2565
+ finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
2566
+ };
2567
+
2568
+ const brotliOptions = {
2569
+ flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
2570
+ finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
2571
+ };
2572
+
2573
+ const isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
2574
+
2575
+ const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"];
2576
+
2577
+ const isHttps = /https:?/;
2578
+
2579
+ const supportedProtocols = platform.protocols.map(protocol => {
2580
+ return protocol + ':';
2581
+ });
2582
+
2583
+ const flushOnFinish = (stream, [throttled, flush]) => {
2584
+ stream
2585
+ .on('end', flush)
2586
+ .on('error', flush);
2587
+
2588
+ return throttled;
2589
+ };
2590
+
2591
+ /**
2592
+ * If the proxy or config beforeRedirects functions are defined, call them with the options
2593
+ * object.
2594
+ *
2595
+ * @param {Object<string, any>} options - The options object that was passed to the request.
2596
+ *
2597
+ * @returns {Object<string, any>}
2598
+ */
2599
+ function dispatchBeforeRedirect(options, responseDetails) {
2600
+ if (options.beforeRedirects.proxy) {
2601
+ options.beforeRedirects.proxy(options);
2602
+ }
2603
+ if (options.beforeRedirects.config) {
2604
+ options.beforeRedirects.config(options, responseDetails);
2605
+ }
2606
+ }
2607
+
2608
+ /**
2609
+ * If the proxy or config afterRedirects functions are defined, call them with the options
2610
+ *
2611
+ * @param {http.ClientRequestArgs} options
2612
+ * @param {AxiosProxyConfig} configProxy configuration from Axios options object
2613
+ * @param {string} location
2614
+ *
2615
+ * @returns {http.ClientRequestArgs}
2616
+ */
2617
+ function setProxy(options, configProxy, location) {
2618
+ let proxy = configProxy;
2619
+ if (!proxy && proxy !== false) {
2620
+ const proxyUrl = proxyFromEnv.getProxyForUrl(location);
2621
+ if (proxyUrl) {
2622
+ proxy = new URL(proxyUrl);
2623
+ }
2624
+ }
2625
+ if (proxy) {
2626
+ // Basic proxy authorization
2627
+ if (proxy.username) {
2628
+ proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');
2629
+ }
2630
+
2631
+ if (proxy.auth) {
2632
+ // Support proxy auth object form
2633
+ if (proxy.auth.username || proxy.auth.password) {
2634
+ proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
2635
+ }
2636
+ const base64 = Buffer
2637
+ .from(proxy.auth, 'utf8')
2638
+ .toString('base64');
2639
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
2640
+ }
2641
+
2642
+ options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
2643
+ const proxyHost = proxy.hostname || proxy.host;
2644
+ options.hostname = proxyHost;
2645
+ // Replace 'host' since options is not a URL object
2646
+ options.host = proxyHost;
2647
+ options.port = proxy.port;
2648
+ options.path = location;
2649
+ if (proxy.protocol) {
2650
+ options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
2651
+ }
2652
+ }
2653
+
2654
+ options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
2655
+ // Configure proxy for redirected request, passing the original config proxy to apply
2656
+ // the exact same logic as if the redirected request was performed by axios directly.
2657
+ setProxy(redirectOptions, configProxy, redirectOptions.href);
2658
+ };
2659
+ }
2660
+
2661
+ const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
2662
+
2663
+ // temporary hotfix
2664
+
2665
+ const wrapAsync = (asyncExecutor) => {
2666
+ return new Promise((resolve, reject) => {
2667
+ let onDone;
2668
+ let isDone;
2669
+
2670
+ const done = (value, isRejected) => {
2671
+ if (isDone) return;
2672
+ isDone = true;
2673
+ onDone && onDone(value, isRejected);
2674
+ };
2675
+
2676
+ const _resolve = (value) => {
2677
+ done(value);
2678
+ resolve(value);
2679
+ };
2680
+
2681
+ const _reject = (reason) => {
2682
+ done(reason, true);
2683
+ reject(reason);
2684
+ };
2685
+
2686
+ asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
2687
+ })
2688
+ };
2689
+
2690
+ const resolveFamily = ({address, family}) => {
2691
+ if (!utils$1.isString(address)) {
2692
+ throw TypeError('address must be a string');
2693
+ }
2694
+ return ({
2695
+ address,
2696
+ family: family || (address.indexOf('.') < 0 ? 6 : 4)
2697
+ });
2698
+ };
2699
+
2700
+ const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
2701
+
2702
+ /*eslint consistent-return:0*/
2703
+ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
2704
+ return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
2705
+ let {data, lookup, family} = config;
2706
+ const {responseType, responseEncoding} = config;
2707
+ const method = config.method.toUpperCase();
2708
+ let isDone;
2709
+ let rejected = false;
2710
+ let req;
2711
+
2712
+ if (lookup) {
2713
+ const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
2714
+ // hotfix to support opt.all option which is required for node 20.x
2715
+ lookup = (hostname, opt, cb) => {
2716
+ _lookup(hostname, opt, (err, arg0, arg1) => {
2717
+ if (err) {
2718
+ return cb(err);
2719
+ }
2720
+
2721
+ const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
2722
+
2723
+ opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
2724
+ });
2725
+ };
2726
+ }
2727
+
2728
+ // temporary internal emitter until the AxiosRequest class will be implemented
2729
+ const emitter = new events.EventEmitter();
2730
+
2731
+ const onFinished = () => {
2732
+ if (config.cancelToken) {
2733
+ config.cancelToken.unsubscribe(abort);
2734
+ }
2735
+
2736
+ if (config.signal) {
2737
+ config.signal.removeEventListener('abort', abort);
2738
+ }
2739
+
2740
+ emitter.removeAllListeners();
2741
+ };
2742
+
2743
+ onDone((value, isRejected) => {
2744
+ isDone = true;
2745
+ if (isRejected) {
2746
+ rejected = true;
2747
+ onFinished();
2748
+ }
2749
+ });
2750
+
2751
+ function abort(reason) {
2752
+ emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
2753
+ }
2754
+
2755
+ emitter.once('abort', reject);
2756
+
2757
+ if (config.cancelToken || config.signal) {
2758
+ config.cancelToken && config.cancelToken.subscribe(abort);
2759
+ if (config.signal) {
2760
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
2761
+ }
2762
+ }
2763
+
2764
+ // Parse url
2765
+ const fullPath = buildFullPath(config.baseURL, config.url);
2766
+ const parsed = new URL(fullPath, utils$1.hasBrowserEnv ? platform.origin : undefined);
2767
+ const protocol = parsed.protocol || supportedProtocols[0];
2768
+
2769
+ if (protocol === 'data:') {
2770
+ let convertedData;
2771
+
2772
+ if (method !== 'GET') {
2773
+ return settle(resolve, reject, {
2774
+ status: 405,
2775
+ statusText: 'method not allowed',
2776
+ headers: {},
2777
+ config
2778
+ });
2779
+ }
2780
+
2781
+ try {
2782
+ convertedData = fromDataURI(config.url, responseType === 'blob', {
2783
+ Blob: config.env && config.env.Blob
2784
+ });
2785
+ } catch (err) {
2786
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
2787
+ }
2788
+
2789
+ if (responseType === 'text') {
2790
+ convertedData = convertedData.toString(responseEncoding);
2791
+
2792
+ if (!responseEncoding || responseEncoding === 'utf8') {
2793
+ convertedData = utils$1.stripBOM(convertedData);
2794
+ }
2795
+ } else if (responseType === 'stream') {
2796
+ convertedData = stream__default["default"].Readable.from(convertedData);
2797
+ }
2798
+
2799
+ return settle(resolve, reject, {
2800
+ data: convertedData,
2801
+ status: 200,
2802
+ statusText: 'OK',
2803
+ headers: new AxiosHeaders$1(),
2804
+ config
2805
+ });
2806
+ }
2807
+
2808
+ if (supportedProtocols.indexOf(protocol) === -1) {
2809
+ return reject(new AxiosError(
2810
+ 'Unsupported protocol ' + protocol,
2811
+ AxiosError.ERR_BAD_REQUEST,
2812
+ config
2813
+ ));
2814
+ }
2815
+
2816
+ const headers = AxiosHeaders$1.from(config.headers).normalize();
2817
+
2818
+ // Set User-Agent (required by some servers)
2819
+ // See https://github.com/axios/axios/issues/69
2820
+ // User-Agent is specified; handle case where no UA header is desired
2821
+ // Only set header if it hasn't been set in config
2822
+ headers.set('User-Agent', 'axios/' + VERSION, false);
2823
+
2824
+ const {onUploadProgress, onDownloadProgress} = config;
2825
+ const maxRate = config.maxRate;
2826
+ let maxUploadRate = undefined;
2827
+ let maxDownloadRate = undefined;
2828
+
2829
+ // support for spec compliant FormData objects
2830
+ if (utils$1.isSpecCompliantForm(data)) {
2831
+ const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
2832
+
2833
+ data = formDataToStream$1(data, (formHeaders) => {
2834
+ headers.set(formHeaders);
2835
+ }, {
2836
+ tag: `axios-${VERSION}-boundary`,
2837
+ boundary: userBoundary && userBoundary[1] || undefined
2838
+ });
2839
+ // support for https://www.npmjs.com/package/form-data api
2840
+ } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
2841
+ headers.set(data.getHeaders());
2842
+
2843
+ if (!headers.hasContentLength()) {
2844
+ try {
2845
+ const knownLength = await util__default["default"].promisify(data.getLength).call(data);
2846
+ Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
2847
+ /*eslint no-empty:0*/
2848
+ } catch (e) {
2849
+ }
2850
+ }
2851
+ } else if (utils$1.isBlob(data)) {
2852
+ data.size && headers.setContentType(data.type || 'application/octet-stream');
2853
+ headers.setContentLength(data.size || 0);
2854
+ data = stream__default["default"].Readable.from(readBlob$1(data));
2855
+ } else if (data && !utils$1.isStream(data)) {
2856
+ if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
2857
+ data = Buffer.from(new Uint8Array(data));
2858
+ } else if (utils$1.isString(data)) {
2859
+ data = Buffer.from(data, 'utf-8');
2860
+ } else {
2861
+ return reject(new AxiosError(
2862
+ 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
2863
+ AxiosError.ERR_BAD_REQUEST,
2864
+ config
2865
+ ));
2866
+ }
2867
+
2868
+ // Add Content-Length header if data exists
2869
+ headers.setContentLength(data.length, false);
2870
+
2871
+ if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
2872
+ return reject(new AxiosError(
2873
+ 'Request body larger than maxBodyLength limit',
2874
+ AxiosError.ERR_BAD_REQUEST,
2875
+ config
2876
+ ));
2877
+ }
2878
+ }
2879
+
2880
+ const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
2881
+
2882
+ if (utils$1.isArray(maxRate)) {
2883
+ maxUploadRate = maxRate[0];
2884
+ maxDownloadRate = maxRate[1];
2885
+ } else {
2886
+ maxUploadRate = maxDownloadRate = maxRate;
2887
+ }
2888
+
2889
+ if (data && (onUploadProgress || maxUploadRate)) {
2890
+ if (!utils$1.isStream(data)) {
2891
+ data = stream__default["default"].Readable.from(data, {objectMode: false});
2892
+ }
2893
+
2894
+ data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
2895
+ maxRate: utils$1.toFiniteNumber(maxUploadRate)
2896
+ })], utils$1.noop);
2897
+
2898
+ onUploadProgress && data.on('progress', flushOnFinish(
2899
+ data,
2900
+ progressEventDecorator(
2901
+ contentLength,
2902
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
2903
+ )
2904
+ ));
2905
+ }
2906
+
2907
+ // HTTP basic authentication
2908
+ let auth = undefined;
2909
+ if (config.auth) {
2910
+ const username = config.auth.username || '';
2911
+ const password = config.auth.password || '';
2912
+ auth = username + ':' + password;
2913
+ }
2914
+
2915
+ if (!auth && parsed.username) {
2916
+ const urlUsername = parsed.username;
2917
+ const urlPassword = parsed.password;
2918
+ auth = urlUsername + ':' + urlPassword;
2919
+ }
2920
+
2921
+ auth && headers.delete('authorization');
2922
+
2923
+ let path;
2924
+
2925
+ try {
2926
+ path = buildURL(
2927
+ parsed.pathname + parsed.search,
2928
+ config.params,
2929
+ config.paramsSerializer
2930
+ ).replace(/^\?/, '');
2931
+ } catch (err) {
2932
+ const customErr = new Error(err.message);
2933
+ customErr.config = config;
2934
+ customErr.url = config.url;
2935
+ customErr.exists = true;
2936
+ return reject(customErr);
2937
+ }
2938
+
2939
+ headers.set(
2940
+ 'Accept-Encoding',
2941
+ 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
2942
+ );
2943
+
2944
+ const options = {
2945
+ path,
2946
+ method: method,
2947
+ headers: headers.toJSON(),
2948
+ agents: { http: config.httpAgent, https: config.httpsAgent },
2949
+ auth,
2950
+ protocol,
2951
+ family,
2952
+ beforeRedirect: dispatchBeforeRedirect,
2953
+ beforeRedirects: {}
2954
+ };
2955
+
2956
+ // cacheable-lookup integration hotfix
2957
+ !utils$1.isUndefined(lookup) && (options.lookup = lookup);
2958
+
2959
+ if (config.socketPath) {
2960
+ options.socketPath = config.socketPath;
2961
+ } else {
2962
+ options.hostname = parsed.hostname;
2963
+ options.port = parsed.port;
2964
+ setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
2965
+ }
2966
+
2967
+ let transport;
2968
+ const isHttpsRequest = isHttps.test(options.protocol);
2969
+ options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
2970
+ if (config.transport) {
2971
+ transport = config.transport;
2972
+ } else if (config.maxRedirects === 0) {
2973
+ transport = isHttpsRequest ? https__default["default"] : http__default["default"];
2974
+ } else {
2975
+ if (config.maxRedirects) {
2976
+ options.maxRedirects = config.maxRedirects;
2977
+ }
2978
+ if (config.beforeRedirect) {
2979
+ options.beforeRedirects.config = config.beforeRedirect;
2980
+ }
2981
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
2982
+ }
2983
+
2984
+ if (config.maxBodyLength > -1) {
2985
+ options.maxBodyLength = config.maxBodyLength;
2986
+ } else {
2987
+ // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
2988
+ options.maxBodyLength = Infinity;
2989
+ }
2990
+
2991
+ if (config.insecureHTTPParser) {
2992
+ options.insecureHTTPParser = config.insecureHTTPParser;
2993
+ }
2994
+
2995
+ // Create the request
2996
+ req = transport.request(options, function handleResponse(res) {
2997
+ if (req.destroyed) return;
2998
+
2999
+ const streams = [res];
3000
+
3001
+ const responseLength = +res.headers['content-length'];
3002
+
3003
+ if (onDownloadProgress || maxDownloadRate) {
3004
+ const transformStream = new AxiosTransformStream$1({
3005
+ maxRate: utils$1.toFiniteNumber(maxDownloadRate)
3006
+ });
3007
+
3008
+ onDownloadProgress && transformStream.on('progress', flushOnFinish(
3009
+ transformStream,
3010
+ progressEventDecorator(
3011
+ responseLength,
3012
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
3013
+ )
3014
+ ));
3015
+
3016
+ streams.push(transformStream);
3017
+ }
3018
+
3019
+ // decompress the response body transparently if required
3020
+ let responseStream = res;
3021
+
3022
+ // return the last request in case of redirects
3023
+ const lastRequest = res.req || req;
3024
+
3025
+ // if decompress disabled we should not decompress
3026
+ if (config.decompress !== false && res.headers['content-encoding']) {
3027
+ // if no content, but headers still say that it is encoded,
3028
+ // remove the header not confuse downstream operations
3029
+ if (method === 'HEAD' || res.statusCode === 204) {
3030
+ delete res.headers['content-encoding'];
3031
+ }
3032
+
3033
+ switch ((res.headers['content-encoding'] || '').toLowerCase()) {
3034
+ /*eslint default-case:0*/
3035
+ case 'gzip':
3036
+ case 'x-gzip':
3037
+ case 'compress':
3038
+ case 'x-compress':
3039
+ // add the unzipper to the body stream processing pipeline
3040
+ streams.push(zlib__default["default"].createUnzip(zlibOptions));
3041
+
3042
+ // remove the content-encoding in order to not confuse downstream operations
3043
+ delete res.headers['content-encoding'];
3044
+ break;
3045
+ case 'deflate':
3046
+ streams.push(new ZlibHeaderTransformStream$1());
3047
+
3048
+ // add the unzipper to the body stream processing pipeline
3049
+ streams.push(zlib__default["default"].createUnzip(zlibOptions));
3050
+
3051
+ // remove the content-encoding in order to not confuse downstream operations
3052
+ delete res.headers['content-encoding'];
3053
+ break;
3054
+ case 'br':
3055
+ if (isBrotliSupported) {
3056
+ streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
3057
+ delete res.headers['content-encoding'];
3058
+ }
3059
+ }
3060
+ }
3061
+
3062
+ responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
3063
+
3064
+ const offListeners = stream__default["default"].finished(responseStream, () => {
3065
+ offListeners();
3066
+ onFinished();
3067
+ });
3068
+
3069
+ const response = {
3070
+ status: res.statusCode,
3071
+ statusText: res.statusMessage,
3072
+ headers: new AxiosHeaders$1(res.headers),
3073
+ config,
3074
+ request: lastRequest
3075
+ };
3076
+
3077
+ if (responseType === 'stream') {
3078
+ response.data = responseStream;
3079
+ settle(resolve, reject, response);
3080
+ } else {
3081
+ const responseBuffer = [];
3082
+ let totalResponseBytes = 0;
3083
+
3084
+ responseStream.on('data', function handleStreamData(chunk) {
3085
+ responseBuffer.push(chunk);
3086
+ totalResponseBytes += chunk.length;
3087
+
3088
+ // make sure the content length is not over the maxContentLength if specified
3089
+ if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
3090
+ // stream.destroy() emit aborted event before calling reject() on Node.js v16
3091
+ rejected = true;
3092
+ responseStream.destroy();
3093
+ reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
3094
+ AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
3095
+ }
3096
+ });
3097
+
3098
+ responseStream.on('aborted', function handlerStreamAborted() {
3099
+ if (rejected) {
3100
+ return;
3101
+ }
3102
+
3103
+ const err = new AxiosError(
3104
+ 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
3105
+ AxiosError.ERR_BAD_RESPONSE,
3106
+ config,
3107
+ lastRequest
3108
+ );
3109
+ responseStream.destroy(err);
3110
+ reject(err);
3111
+ });
3112
+
3113
+ responseStream.on('error', function handleStreamError(err) {
3114
+ if (req.destroyed) return;
3115
+ reject(AxiosError.from(err, null, config, lastRequest));
3116
+ });
3117
+
3118
+ responseStream.on('end', function handleStreamEnd() {
3119
+ try {
3120
+ let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
3121
+ if (responseType !== 'arraybuffer') {
3122
+ responseData = responseData.toString(responseEncoding);
3123
+ if (!responseEncoding || responseEncoding === 'utf8') {
3124
+ responseData = utils$1.stripBOM(responseData);
3125
+ }
3126
+ }
3127
+ response.data = responseData;
3128
+ } catch (err) {
3129
+ return reject(AxiosError.from(err, null, config, response.request, response));
3130
+ }
3131
+ settle(resolve, reject, response);
3132
+ });
3133
+ }
3134
+
3135
+ emitter.once('abort', err => {
3136
+ if (!responseStream.destroyed) {
3137
+ responseStream.emit('error', err);
3138
+ responseStream.destroy();
3139
+ }
3140
+ });
3141
+ });
3142
+
3143
+ emitter.once('abort', err => {
3144
+ reject(err);
3145
+ req.destroy(err);
3146
+ });
3147
+
3148
+ // Handle errors
3149
+ req.on('error', function handleRequestError(err) {
3150
+ // @todo remove
3151
+ // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
3152
+ reject(AxiosError.from(err, null, config, req));
3153
+ });
3154
+
3155
+ // set tcp keep alive to prevent drop connection by peer
3156
+ req.on('socket', function handleRequestSocket(socket) {
3157
+ // default interval of sending ack packet is 1 minute
3158
+ socket.setKeepAlive(true, 1000 * 60);
3159
+ });
3160
+
3161
+ // Handle request timeout
3162
+ if (config.timeout) {
3163
+ // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
3164
+ const timeout = parseInt(config.timeout, 10);
3165
+
3166
+ if (Number.isNaN(timeout)) {
3167
+ reject(new AxiosError(
3168
+ 'error trying to parse `config.timeout` to int',
3169
+ AxiosError.ERR_BAD_OPTION_VALUE,
3170
+ config,
3171
+ req
3172
+ ));
3173
+
3174
+ return;
3175
+ }
3176
+
3177
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
3178
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
3179
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
3180
+ // And then these socket which be hang up will devouring CPU little by little.
3181
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
3182
+ req.setTimeout(timeout, function handleRequestTimeout() {
3183
+ if (isDone) return;
3184
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
3185
+ const transitional = config.transitional || transitionalDefaults;
3186
+ if (config.timeoutErrorMessage) {
3187
+ timeoutErrorMessage = config.timeoutErrorMessage;
3188
+ }
3189
+ reject(new AxiosError(
3190
+ timeoutErrorMessage,
3191
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
3192
+ config,
3193
+ req
3194
+ ));
3195
+ abort();
3196
+ });
3197
+ }
3198
+
3199
+
3200
+ // Send the request
3201
+ if (utils$1.isStream(data)) {
3202
+ let ended = false;
3203
+ let errored = false;
3204
+
3205
+ data.on('end', () => {
3206
+ ended = true;
3207
+ });
3208
+
3209
+ data.once('error', err => {
3210
+ errored = true;
3211
+ req.destroy(err);
3212
+ });
3213
+
3214
+ data.on('close', () => {
3215
+ if (!ended && !errored) {
3216
+ abort(new CanceledError('Request stream has been aborted', config, req));
3217
+ }
3218
+ });
3219
+
3220
+ data.pipe(req);
3221
+ } else {
3222
+ req.end(data);
3223
+ }
3224
+ });
3225
+ };
3226
+
3227
+ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
3228
+
3229
+ // Standard browser envs have full support of the APIs needed to test
3230
+ // whether the request URL is of the same origin as current location.
3231
+ (function standardBrowserEnv() {
3232
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
3233
+ const urlParsingNode = document.createElement('a');
3234
+ let originURL;
3235
+
3236
+ /**
3237
+ * Parse a URL to discover its components
3238
+ *
3239
+ * @param {String} url The URL to be parsed
3240
+ * @returns {Object}
3241
+ */
3242
+ function resolveURL(url) {
3243
+ let href = url;
3244
+
3245
+ if (msie) {
3246
+ // IE needs attribute set twice to normalize properties
3247
+ urlParsingNode.setAttribute('href', href);
3248
+ href = urlParsingNode.href;
3249
+ }
3250
+
3251
+ urlParsingNode.setAttribute('href', href);
3252
+
3253
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
3254
+ return {
3255
+ href: urlParsingNode.href,
3256
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
3257
+ host: urlParsingNode.host,
3258
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
3259
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
3260
+ hostname: urlParsingNode.hostname,
3261
+ port: urlParsingNode.port,
3262
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
3263
+ urlParsingNode.pathname :
3264
+ '/' + urlParsingNode.pathname
3265
+ };
3266
+ }
3267
+
3268
+ originURL = resolveURL(window.location.href);
3269
+
3270
+ /**
3271
+ * Determine if a URL shares the same origin as the current location
3272
+ *
3273
+ * @param {String} requestURL The URL to test
3274
+ * @returns {boolean} True if URL shares the same origin, otherwise false
3275
+ */
3276
+ return function isURLSameOrigin(requestURL) {
3277
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
3278
+ return (parsed.protocol === originURL.protocol &&
3279
+ parsed.host === originURL.host);
3280
+ };
3281
+ })() :
3282
+
3283
+ // Non standard browser envs (web workers, react-native) lack needed support.
3284
+ (function nonStandardBrowserEnv() {
3285
+ return function isURLSameOrigin() {
3286
+ return true;
3287
+ };
3288
+ })();
3289
+
3290
+ const cookies = platform.hasStandardBrowserEnv ?
3291
+
3292
+ // Standard browser envs support document.cookie
3293
+ {
3294
+ write(name, value, expires, path, domain, secure) {
3295
+ const cookie = [name + '=' + encodeURIComponent(value)];
3296
+
3297
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
3298
+
3299
+ utils$1.isString(path) && cookie.push('path=' + path);
3300
+
3301
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
3302
+
3303
+ secure === true && cookie.push('secure');
3304
+
3305
+ document.cookie = cookie.join('; ');
3306
+ },
3307
+
3308
+ read(name) {
3309
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
3310
+ return (match ? decodeURIComponent(match[3]) : null);
3311
+ },
3312
+
3313
+ remove(name) {
3314
+ this.write(name, '', Date.now() - 86400000);
3315
+ }
3316
+ }
3317
+
3318
+ :
3319
+
3320
+ // Non-standard browser env (web workers, react-native) lack needed support.
3321
+ {
3322
+ write() {},
3323
+ read() {
3324
+ return null;
3325
+ },
3326
+ remove() {}
3327
+ };
3328
+
3329
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
3330
+
3331
+ /**
3332
+ * Config-specific merge-function which creates a new config-object
3333
+ * by merging two configuration objects together.
3334
+ *
3335
+ * @param {Object} config1
3336
+ * @param {Object} config2
3337
+ *
3338
+ * @returns {Object} New object resulting from merging config2 to config1
3339
+ */
3340
+ function mergeConfig(config1, config2) {
3341
+ // eslint-disable-next-line no-param-reassign
3342
+ config2 = config2 || {};
3343
+ const config = {};
3344
+
3345
+ function getMergedValue(target, source, caseless) {
3346
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
3347
+ return utils$1.merge.call({caseless}, target, source);
3348
+ } else if (utils$1.isPlainObject(source)) {
3349
+ return utils$1.merge({}, source);
3350
+ } else if (utils$1.isArray(source)) {
3351
+ return source.slice();
3352
+ }
3353
+ return source;
3354
+ }
3355
+
3356
+ // eslint-disable-next-line consistent-return
3357
+ function mergeDeepProperties(a, b, caseless) {
3358
+ if (!utils$1.isUndefined(b)) {
3359
+ return getMergedValue(a, b, caseless);
3360
+ } else if (!utils$1.isUndefined(a)) {
3361
+ return getMergedValue(undefined, a, caseless);
3362
+ }
3363
+ }
3364
+
3365
+ // eslint-disable-next-line consistent-return
3366
+ function valueFromConfig2(a, b) {
3367
+ if (!utils$1.isUndefined(b)) {
3368
+ return getMergedValue(undefined, b);
3369
+ }
3370
+ }
3371
+
3372
+ // eslint-disable-next-line consistent-return
3373
+ function defaultToConfig2(a, b) {
3374
+ if (!utils$1.isUndefined(b)) {
3375
+ return getMergedValue(undefined, b);
3376
+ } else if (!utils$1.isUndefined(a)) {
3377
+ return getMergedValue(undefined, a);
3378
+ }
3379
+ }
3380
+
3381
+ // eslint-disable-next-line consistent-return
3382
+ function mergeDirectKeys(a, b, prop) {
3383
+ if (prop in config2) {
3384
+ return getMergedValue(a, b);
3385
+ } else if (prop in config1) {
3386
+ return getMergedValue(undefined, a);
3387
+ }
3388
+ }
3389
+
3390
+ const mergeMap = {
3391
+ url: valueFromConfig2,
3392
+ method: valueFromConfig2,
3393
+ data: valueFromConfig2,
3394
+ baseURL: defaultToConfig2,
3395
+ transformRequest: defaultToConfig2,
3396
+ transformResponse: defaultToConfig2,
3397
+ paramsSerializer: defaultToConfig2,
3398
+ timeout: defaultToConfig2,
3399
+ timeoutMessage: defaultToConfig2,
3400
+ withCredentials: defaultToConfig2,
3401
+ withXSRFToken: defaultToConfig2,
3402
+ adapter: defaultToConfig2,
3403
+ responseType: defaultToConfig2,
3404
+ xsrfCookieName: defaultToConfig2,
3405
+ xsrfHeaderName: defaultToConfig2,
3406
+ onUploadProgress: defaultToConfig2,
3407
+ onDownloadProgress: defaultToConfig2,
3408
+ decompress: defaultToConfig2,
3409
+ maxContentLength: defaultToConfig2,
3410
+ maxBodyLength: defaultToConfig2,
3411
+ beforeRedirect: defaultToConfig2,
3412
+ transport: defaultToConfig2,
3413
+ httpAgent: defaultToConfig2,
3414
+ httpsAgent: defaultToConfig2,
3415
+ cancelToken: defaultToConfig2,
3416
+ socketPath: defaultToConfig2,
3417
+ responseEncoding: defaultToConfig2,
3418
+ validateStatus: mergeDirectKeys,
3419
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
3420
+ };
3421
+
3422
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
3423
+ const merge = mergeMap[prop] || mergeDeepProperties;
3424
+ const configValue = merge(config1[prop], config2[prop], prop);
3425
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
3426
+ });
3427
+
3428
+ return config;
3429
+ }
3430
+
3431
+ const resolveConfig = (config) => {
3432
+ const newConfig = mergeConfig({}, config);
3433
+
3434
+ let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
3435
+
3436
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
3437
+
3438
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
3439
+
3440
+ // HTTP basic authentication
3441
+ if (auth) {
3442
+ headers.set('Authorization', 'Basic ' +
3443
+ btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
3444
+ );
3445
+ }
3446
+
3447
+ let contentType;
3448
+
3449
+ if (utils$1.isFormData(data)) {
3450
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
3451
+ headers.setContentType(undefined); // Let the browser set it
3452
+ } else if ((contentType = headers.getContentType()) !== false) {
3453
+ // fix semicolon duplication issue for ReactNative FormData implementation
3454
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
3455
+ headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
3456
+ }
3457
+ }
3458
+
3459
+ // Add xsrf header
3460
+ // This is only done if running in a standard browser environment.
3461
+ // Specifically not if we're in a web worker, or react-native.
3462
+
3463
+ if (platform.hasStandardBrowserEnv) {
3464
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
3465
+
3466
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
3467
+ // Add xsrf header
3468
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
3469
+
3470
+ if (xsrfValue) {
3471
+ headers.set(xsrfHeaderName, xsrfValue);
3472
+ }
3473
+ }
3474
+ }
3475
+
3476
+ return newConfig;
3477
+ };
3478
+
3479
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
3480
+
3481
+ const xhrAdapter = isXHRAdapterSupported && function (config) {
3482
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
3483
+ const _config = resolveConfig(config);
3484
+ let requestData = _config.data;
3485
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
3486
+ let {responseType, onUploadProgress, onDownloadProgress} = _config;
3487
+ let onCanceled;
3488
+ let uploadThrottled, downloadThrottled;
3489
+ let flushUpload, flushDownload;
3490
+
3491
+ function done() {
3492
+ flushUpload && flushUpload(); // flush events
3493
+ flushDownload && flushDownload(); // flush events
3494
+
3495
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
3496
+
3497
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
3498
+ }
3499
+
3500
+ let request = new XMLHttpRequest();
3501
+
3502
+ request.open(_config.method.toUpperCase(), _config.url, true);
3503
+
3504
+ // Set the request timeout in MS
3505
+ request.timeout = _config.timeout;
3506
+
3507
+ function onloadend() {
3508
+ if (!request) {
3509
+ return;
3510
+ }
3511
+ // Prepare the response
3512
+ const responseHeaders = AxiosHeaders$1.from(
3513
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
3514
+ );
3515
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
3516
+ request.responseText : request.response;
3517
+ const response = {
3518
+ data: responseData,
3519
+ status: request.status,
3520
+ statusText: request.statusText,
3521
+ headers: responseHeaders,
3522
+ config,
3523
+ request
3524
+ };
3525
+
3526
+ settle(function _resolve(value) {
3527
+ resolve(value);
3528
+ done();
3529
+ }, function _reject(err) {
3530
+ reject(err);
3531
+ done();
3532
+ }, response);
3533
+
3534
+ // Clean up request
3535
+ request = null;
3536
+ }
3537
+
3538
+ if ('onloadend' in request) {
3539
+ // Use onloadend if available
3540
+ request.onloadend = onloadend;
3541
+ } else {
3542
+ // Listen for ready state to emulate onloadend
3543
+ request.onreadystatechange = function handleLoad() {
3544
+ if (!request || request.readyState !== 4) {
3545
+ return;
3546
+ }
3547
+
3548
+ // The request errored out and we didn't get a response, this will be
3549
+ // handled by onerror instead
3550
+ // With one exception: request that using file: protocol, most browsers
3551
+ // will return status as 0 even though it's a successful request
3552
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
3553
+ return;
3554
+ }
3555
+ // readystate handler is calling before onerror or ontimeout handlers,
3556
+ // so we should call onloadend on the next 'tick'
3557
+ setTimeout(onloadend);
3558
+ };
3559
+ }
3560
+
3561
+ // Handle browser request cancellation (as opposed to a manual cancellation)
3562
+ request.onabort = function handleAbort() {
3563
+ if (!request) {
3564
+ return;
3565
+ }
3566
+
3567
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
3568
+
3569
+ // Clean up request
3570
+ request = null;
3571
+ };
3572
+
3573
+ // Handle low level network errors
3574
+ request.onerror = function handleError() {
3575
+ // Real errors are hidden from us by the browser
3576
+ // onerror should only fire if it's a network error
3577
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
3578
+
3579
+ // Clean up request
3580
+ request = null;
3581
+ };
3582
+
3583
+ // Handle timeout
3584
+ request.ontimeout = function handleTimeout() {
3585
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
3586
+ const transitional = _config.transitional || transitionalDefaults;
3587
+ if (_config.timeoutErrorMessage) {
3588
+ timeoutErrorMessage = _config.timeoutErrorMessage;
3589
+ }
3590
+ reject(new AxiosError(
3591
+ timeoutErrorMessage,
3592
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
3593
+ config,
3594
+ request));
3595
+
3596
+ // Clean up request
3597
+ request = null;
3598
+ };
3599
+
3600
+ // Remove Content-Type if data is undefined
3601
+ requestData === undefined && requestHeaders.setContentType(null);
3602
+
3603
+ // Add headers to the request
3604
+ if ('setRequestHeader' in request) {
3605
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3606
+ request.setRequestHeader(key, val);
3607
+ });
3608
+ }
3609
+
3610
+ // Add withCredentials to request if needed
3611
+ if (!utils$1.isUndefined(_config.withCredentials)) {
3612
+ request.withCredentials = !!_config.withCredentials;
3613
+ }
3614
+
3615
+ // Add responseType to request if needed
3616
+ if (responseType && responseType !== 'json') {
3617
+ request.responseType = _config.responseType;
3618
+ }
3619
+
3620
+ // Handle progress if needed
3621
+ if (onDownloadProgress) {
3622
+ ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
3623
+ request.addEventListener('progress', downloadThrottled);
3624
+ }
3625
+
3626
+ // Not all browsers support upload events
3627
+ if (onUploadProgress && request.upload) {
3628
+ ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
3629
+
3630
+ request.upload.addEventListener('progress', uploadThrottled);
3631
+
3632
+ request.upload.addEventListener('loadend', flushUpload);
3633
+ }
3634
+
3635
+ if (_config.cancelToken || _config.signal) {
3636
+ // Handle cancellation
3637
+ // eslint-disable-next-line func-names
3638
+ onCanceled = cancel => {
3639
+ if (!request) {
3640
+ return;
3641
+ }
3642
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
3643
+ request.abort();
3644
+ request = null;
3645
+ };
3646
+
3647
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
3648
+ if (_config.signal) {
3649
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
3650
+ }
3651
+ }
3652
+
3653
+ const protocol = parseProtocol(_config.url);
3654
+
3655
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
3656
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
3657
+ return;
3658
+ }
3659
+
3660
+
3661
+ // Send the request
3662
+ request.send(requestData || null);
3663
+ });
3664
+ };
3665
+
3666
+ const composeSignals = (signals, timeout) => {
3667
+ let controller = new AbortController();
3668
+
3669
+ let aborted;
3670
+
3671
+ const onabort = function (cancel) {
3672
+ if (!aborted) {
3673
+ aborted = true;
3674
+ unsubscribe();
3675
+ const err = cancel instanceof Error ? cancel : this.reason;
3676
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3677
+ }
3678
+ };
3679
+
3680
+ let timer = timeout && setTimeout(() => {
3681
+ onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
3682
+ }, timeout);
3683
+
3684
+ const unsubscribe = () => {
3685
+ if (signals) {
3686
+ timer && clearTimeout(timer);
3687
+ timer = null;
3688
+ signals.forEach(signal => {
3689
+ signal &&
3690
+ (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
3691
+ });
3692
+ signals = null;
3693
+ }
3694
+ };
3695
+
3696
+ signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
3697
+
3698
+ const {signal} = controller;
3699
+
3700
+ signal.unsubscribe = unsubscribe;
3701
+
3702
+ return [signal, () => {
3703
+ timer && clearTimeout(timer);
3704
+ timer = null;
3705
+ }];
3706
+ };
3707
+
3708
+ const composeSignals$1 = composeSignals;
3709
+
3710
+ const streamChunk = function* (chunk, chunkSize) {
3711
+ let len = chunk.byteLength;
3712
+
3713
+ if (!chunkSize || len < chunkSize) {
3714
+ yield chunk;
3715
+ return;
3716
+ }
3717
+
3718
+ let pos = 0;
3719
+ let end;
3720
+
3721
+ while (pos < len) {
3722
+ end = pos + chunkSize;
3723
+ yield chunk.slice(pos, end);
3724
+ pos = end;
3725
+ }
3726
+ };
3727
+
3728
+ const readBytes = async function* (iterable, chunkSize, encode) {
3729
+ for await (const chunk of iterable) {
3730
+ yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
3731
+ }
3732
+ };
3733
+
3734
+ const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
3735
+ const iterator = readBytes(stream, chunkSize, encode);
3736
+
3737
+ let bytes = 0;
3738
+ let done;
3739
+ let _onFinish = (e) => {
3740
+ if (!done) {
3741
+ done = true;
3742
+ onFinish && onFinish(e);
3743
+ }
3744
+ };
3745
+
3746
+ return new ReadableStream({
3747
+ async pull(controller) {
3748
+ try {
3749
+ const {done, value} = await iterator.next();
3750
+
3751
+ if (done) {
3752
+ _onFinish();
3753
+ controller.close();
3754
+ return;
3755
+ }
3756
+
3757
+ let len = value.byteLength;
3758
+ if (onProgress) {
3759
+ let loadedBytes = bytes += len;
3760
+ onProgress(loadedBytes);
3761
+ }
3762
+ controller.enqueue(new Uint8Array(value));
3763
+ } catch (err) {
3764
+ _onFinish(err);
3765
+ throw err;
3766
+ }
3767
+ },
3768
+ cancel(reason) {
3769
+ _onFinish(reason);
3770
+ return iterator.return();
3771
+ }
3772
+ }, {
3773
+ highWaterMark: 2
3774
+ })
3775
+ };
3776
+
3777
+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
3778
+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
3779
+
3780
+ // used only inside the fetch adapter
3781
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
3782
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
3783
+ async (str) => new Uint8Array(await new Response(str).arrayBuffer())
3784
+ );
3785
+
3786
+ const test = (fn, ...args) => {
3787
+ try {
3788
+ return !!fn(...args);
3789
+ } catch (e) {
3790
+ return false
3791
+ }
3792
+ };
3793
+
3794
+ const supportsRequestStream = isReadableStreamSupported && test(() => {
3795
+ let duplexAccessed = false;
3796
+
3797
+ const hasContentType = new Request(platform.origin, {
3798
+ body: new ReadableStream(),
3799
+ method: 'POST',
3800
+ get duplex() {
3801
+ duplexAccessed = true;
3802
+ return 'half';
3803
+ },
3804
+ }).headers.has('Content-Type');
3805
+
3806
+ return duplexAccessed && !hasContentType;
3807
+ });
3808
+
3809
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
3810
+
3811
+ const supportsResponseStream = isReadableStreamSupported &&
3812
+ test(() => utils$1.isReadableStream(new Response('').body));
3813
+
3814
+
3815
+ const resolvers = {
3816
+ stream: supportsResponseStream && ((res) => res.body)
3817
+ };
3818
+
3819
+ isFetchSupported && (((res) => {
3820
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
3821
+ !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
3822
+ (_, config) => {
3823
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
3824
+ });
3825
+ });
3826
+ })(new Response));
3827
+
3828
+ const getBodyLength = async (body) => {
3829
+ if (body == null) {
3830
+ return 0;
3831
+ }
3832
+
3833
+ if(utils$1.isBlob(body)) {
3834
+ return body.size;
3835
+ }
3836
+
3837
+ if(utils$1.isSpecCompliantForm(body)) {
3838
+ return (await new Request(body).arrayBuffer()).byteLength;
3839
+ }
3840
+
3841
+ if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
3842
+ return body.byteLength;
3843
+ }
3844
+
3845
+ if(utils$1.isURLSearchParams(body)) {
3846
+ body = body + '';
3847
+ }
3848
+
3849
+ if(utils$1.isString(body)) {
3850
+ return (await encodeText(body)).byteLength;
3851
+ }
3852
+ };
3853
+
3854
+ const resolveBodyLength = async (headers, body) => {
3855
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
3856
+
3857
+ return length == null ? getBodyLength(body) : length;
3858
+ };
3859
+
3860
+ const fetchAdapter = isFetchSupported && (async (config) => {
3861
+ let {
3862
+ url,
3863
+ method,
3864
+ data,
3865
+ signal,
3866
+ cancelToken,
3867
+ timeout,
3868
+ onDownloadProgress,
3869
+ onUploadProgress,
3870
+ responseType,
3871
+ headers,
3872
+ withCredentials = 'same-origin',
3873
+ fetchOptions
3874
+ } = resolveConfig(config);
3875
+
3876
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
3877
+
3878
+ let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
3879
+ composeSignals$1([signal, cancelToken], timeout) : [];
3880
+
3881
+ let finished, request;
3882
+
3883
+ const onFinish = () => {
3884
+ !finished && setTimeout(() => {
3885
+ composedSignal && composedSignal.unsubscribe();
3886
+ });
3887
+
3888
+ finished = true;
3889
+ };
3890
+
3891
+ let requestContentLength;
3892
+
3893
+ try {
3894
+ if (
3895
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
3896
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
3897
+ ) {
3898
+ let _request = new Request(url, {
3899
+ method: 'POST',
3900
+ body: data,
3901
+ duplex: "half"
3902
+ });
3903
+
3904
+ let contentTypeHeader;
3905
+
3906
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
3907
+ headers.setContentType(contentTypeHeader);
3908
+ }
3909
+
3910
+ if (_request.body) {
3911
+ const [onProgress, flush] = progressEventDecorator(
3912
+ requestContentLength,
3913
+ progressEventReducer(asyncDecorator(onUploadProgress))
3914
+ );
3915
+
3916
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
3917
+ }
3918
+ }
3919
+
3920
+ if (!utils$1.isString(withCredentials)) {
3921
+ withCredentials = withCredentials ? 'include' : 'omit';
3922
+ }
3923
+
3924
+ request = new Request(url, {
3925
+ ...fetchOptions,
3926
+ signal: composedSignal,
3927
+ method: method.toUpperCase(),
3928
+ headers: headers.normalize().toJSON(),
3929
+ body: data,
3930
+ duplex: "half",
3931
+ credentials: withCredentials
3932
+ });
3933
+
3934
+ let response = await fetch(request);
3935
+
3936
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3937
+
3938
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
3939
+ const options = {};
3940
+
3941
+ ['status', 'statusText', 'headers'].forEach(prop => {
3942
+ options[prop] = response[prop];
3943
+ });
3944
+
3945
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3946
+
3947
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
3948
+ responseContentLength,
3949
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
3950
+ ) || [];
3951
+
3952
+ response = new Response(
3953
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
3954
+ flush && flush();
3955
+ isStreamResponse && onFinish();
3956
+ }, encodeText),
3957
+ options
3958
+ );
3959
+ }
3960
+
3961
+ responseType = responseType || 'text';
3962
+
3963
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
3964
+
3965
+ !isStreamResponse && onFinish();
3966
+
3967
+ stopTimeout && stopTimeout();
3968
+
3969
+ return await new Promise((resolve, reject) => {
3970
+ settle(resolve, reject, {
3971
+ data: responseData,
3972
+ headers: AxiosHeaders$1.from(response.headers),
3973
+ status: response.status,
3974
+ statusText: response.statusText,
3975
+ config,
3976
+ request
3977
+ });
3978
+ })
3979
+ } catch (err) {
3980
+ onFinish();
3981
+
3982
+ if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
3983
+ throw Object.assign(
3984
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
3985
+ {
3986
+ cause: err.cause || err
3987
+ }
3988
+ )
3989
+ }
3990
+
3991
+ throw AxiosError.from(err, err && err.code, config, request);
3992
+ }
3993
+ });
3994
+
3995
+ const knownAdapters = {
3996
+ http: httpAdapter,
3997
+ xhr: xhrAdapter,
3998
+ fetch: fetchAdapter
3999
+ };
4000
+
4001
+ utils$1.forEach(knownAdapters, (fn, value) => {
4002
+ if (fn) {
4003
+ try {
4004
+ Object.defineProperty(fn, 'name', {value});
4005
+ } catch (e) {
4006
+ // eslint-disable-next-line no-empty
4007
+ }
4008
+ Object.defineProperty(fn, 'adapterName', {value});
4009
+ }
4010
+ });
4011
+
4012
+ const renderReason = (reason) => `- ${reason}`;
4013
+
4014
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
4015
+
4016
+ const adapters = {
4017
+ getAdapter: (adapters) => {
4018
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
4019
+
4020
+ const {length} = adapters;
4021
+ let nameOrAdapter;
4022
+ let adapter;
4023
+
4024
+ const rejectedReasons = {};
4025
+
4026
+ for (let i = 0; i < length; i++) {
4027
+ nameOrAdapter = adapters[i];
4028
+ let id;
4029
+
4030
+ adapter = nameOrAdapter;
4031
+
4032
+ if (!isResolvedHandle(nameOrAdapter)) {
4033
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
4034
+
4035
+ if (adapter === undefined) {
4036
+ throw new AxiosError(`Unknown adapter '${id}'`);
4037
+ }
4038
+ }
4039
+
4040
+ if (adapter) {
4041
+ break;
4042
+ }
4043
+
4044
+ rejectedReasons[id || '#' + i] = adapter;
4045
+ }
4046
+
4047
+ if (!adapter) {
4048
+
4049
+ const reasons = Object.entries(rejectedReasons)
4050
+ .map(([id, state]) => `adapter ${id} ` +
4051
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
4052
+ );
4053
+
4054
+ let s = length ?
4055
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
4056
+ 'as no adapter specified';
4057
+
4058
+ throw new AxiosError(
4059
+ `There is no suitable adapter to dispatch the request ` + s,
4060
+ 'ERR_NOT_SUPPORT'
4061
+ );
4062
+ }
4063
+
4064
+ return adapter;
4065
+ },
4066
+ adapters: knownAdapters
4067
+ };
4068
+
4069
+ /**
4070
+ * Throws a `CanceledError` if cancellation has been requested.
4071
+ *
4072
+ * @param {Object} config The config that is to be used for the request
4073
+ *
4074
+ * @returns {void}
4075
+ */
4076
+ function throwIfCancellationRequested(config) {
4077
+ if (config.cancelToken) {
4078
+ config.cancelToken.throwIfRequested();
4079
+ }
4080
+
4081
+ if (config.signal && config.signal.aborted) {
4082
+ throw new CanceledError(null, config);
4083
+ }
4084
+ }
4085
+
4086
+ /**
4087
+ * Dispatch a request to the server using the configured adapter.
4088
+ *
4089
+ * @param {object} config The config that is to be used for the request
4090
+ *
4091
+ * @returns {Promise} The Promise to be fulfilled
4092
+ */
4093
+ function dispatchRequest(config) {
4094
+ throwIfCancellationRequested(config);
4095
+
4096
+ config.headers = AxiosHeaders$1.from(config.headers);
4097
+
4098
+ // Transform request data
4099
+ config.data = transformData.call(
4100
+ config,
4101
+ config.transformRequest
4102
+ );
4103
+
4104
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
4105
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
4106
+ }
4107
+
4108
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
4109
+
4110
+ return adapter(config).then(function onAdapterResolution(response) {
4111
+ throwIfCancellationRequested(config);
4112
+
4113
+ // Transform response data
4114
+ response.data = transformData.call(
4115
+ config,
4116
+ config.transformResponse,
4117
+ response
4118
+ );
4119
+
4120
+ response.headers = AxiosHeaders$1.from(response.headers);
4121
+
4122
+ return response;
4123
+ }, function onAdapterRejection(reason) {
4124
+ if (!isCancel(reason)) {
4125
+ throwIfCancellationRequested(config);
4126
+
4127
+ // Transform response data
4128
+ if (reason && reason.response) {
4129
+ reason.response.data = transformData.call(
4130
+ config,
4131
+ config.transformResponse,
4132
+ reason.response
4133
+ );
4134
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
4135
+ }
4136
+ }
4137
+
4138
+ return Promise.reject(reason);
4139
+ });
4140
+ }
4141
+
4142
+ const validators$1 = {};
4143
+
4144
+ // eslint-disable-next-line func-names
4145
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
4146
+ validators$1[type] = function validator(thing) {
4147
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
4148
+ };
4149
+ });
4150
+
4151
+ const deprecatedWarnings = {};
4152
+
4153
+ /**
4154
+ * Transitional option validator
4155
+ *
4156
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
4157
+ * @param {string?} version - deprecated version / removed since version
4158
+ * @param {string?} message - some message with additional info
4159
+ *
4160
+ * @returns {function}
4161
+ */
4162
+ validators$1.transitional = function transitional(validator, version, message) {
4163
+ function formatMessage(opt, desc) {
4164
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
4165
+ }
4166
+
4167
+ // eslint-disable-next-line func-names
4168
+ return (value, opt, opts) => {
4169
+ if (validator === false) {
4170
+ throw new AxiosError(
4171
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
4172
+ AxiosError.ERR_DEPRECATED
4173
+ );
4174
+ }
4175
+
4176
+ if (version && !deprecatedWarnings[opt]) {
4177
+ deprecatedWarnings[opt] = true;
4178
+ // eslint-disable-next-line no-console
4179
+ console.warn(
4180
+ formatMessage(
4181
+ opt,
4182
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
4183
+ )
4184
+ );
4185
+ }
4186
+
4187
+ return validator ? validator(value, opt, opts) : true;
4188
+ };
4189
+ };
4190
+
4191
+ /**
4192
+ * Assert object's properties type
4193
+ *
4194
+ * @param {object} options
4195
+ * @param {object} schema
4196
+ * @param {boolean?} allowUnknown
4197
+ *
4198
+ * @returns {object}
4199
+ */
4200
+
4201
+ function assertOptions(options, schema, allowUnknown) {
4202
+ if (typeof options !== 'object') {
4203
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
4204
+ }
4205
+ const keys = Object.keys(options);
4206
+ let i = keys.length;
4207
+ while (i-- > 0) {
4208
+ const opt = keys[i];
4209
+ const validator = schema[opt];
4210
+ if (validator) {
4211
+ const value = options[opt];
4212
+ const result = value === undefined || validator(value, opt, options);
4213
+ if (result !== true) {
4214
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
4215
+ }
4216
+ continue;
4217
+ }
4218
+ if (allowUnknown !== true) {
4219
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
4220
+ }
4221
+ }
4222
+ }
4223
+
4224
+ const validator = {
4225
+ assertOptions,
4226
+ validators: validators$1
4227
+ };
4228
+
4229
+ const validators = validator.validators;
4230
+
4231
+ /**
4232
+ * Create a new instance of Axios
4233
+ *
4234
+ * @param {Object} instanceConfig The default config for the instance
4235
+ *
4236
+ * @return {Axios} A new instance of Axios
4237
+ */
4238
+ class Axios {
4239
+ constructor(instanceConfig) {
4240
+ this.defaults = instanceConfig;
4241
+ this.interceptors = {
4242
+ request: new InterceptorManager$1(),
4243
+ response: new InterceptorManager$1()
4244
+ };
4245
+ }
4246
+
4247
+ /**
4248
+ * Dispatch a request
4249
+ *
4250
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
4251
+ * @param {?Object} config
4252
+ *
4253
+ * @returns {Promise} The Promise to be fulfilled
4254
+ */
4255
+ async request(configOrUrl, config) {
4256
+ try {
4257
+ return await this._request(configOrUrl, config);
4258
+ } catch (err) {
4259
+ if (err instanceof Error) {
4260
+ let dummy;
4261
+
4262
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
4263
+
4264
+ // slice off the Error: ... line
4265
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
4266
+ try {
4267
+ if (!err.stack) {
4268
+ err.stack = stack;
4269
+ // match without the 2 top stack lines
4270
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
4271
+ err.stack += '\n' + stack;
4272
+ }
4273
+ } catch (e) {
4274
+ // ignore the case where "stack" is an un-writable property
4275
+ }
4276
+ }
4277
+
4278
+ throw err;
4279
+ }
4280
+ }
4281
+
4282
+ _request(configOrUrl, config) {
4283
+ /*eslint no-param-reassign:0*/
4284
+ // Allow for axios('example/url'[, config]) a la fetch API
4285
+ if (typeof configOrUrl === 'string') {
4286
+ config = config || {};
4287
+ config.url = configOrUrl;
4288
+ } else {
4289
+ config = configOrUrl || {};
4290
+ }
4291
+
4292
+ config = mergeConfig(this.defaults, config);
4293
+
4294
+ const {transitional, paramsSerializer, headers} = config;
4295
+
4296
+ if (transitional !== undefined) {
4297
+ validator.assertOptions(transitional, {
4298
+ silentJSONParsing: validators.transitional(validators.boolean),
4299
+ forcedJSONParsing: validators.transitional(validators.boolean),
4300
+ clarifyTimeoutError: validators.transitional(validators.boolean)
4301
+ }, false);
4302
+ }
4303
+
4304
+ if (paramsSerializer != null) {
4305
+ if (utils$1.isFunction(paramsSerializer)) {
4306
+ config.paramsSerializer = {
4307
+ serialize: paramsSerializer
4308
+ };
4309
+ } else {
4310
+ validator.assertOptions(paramsSerializer, {
4311
+ encode: validators.function,
4312
+ serialize: validators.function
4313
+ }, true);
4314
+ }
4315
+ }
4316
+
4317
+ // Set config.method
4318
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
4319
+
4320
+ // Flatten headers
4321
+ let contextHeaders = headers && utils$1.merge(
4322
+ headers.common,
4323
+ headers[config.method]
4324
+ );
4325
+
4326
+ headers && utils$1.forEach(
4327
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
4328
+ (method) => {
4329
+ delete headers[method];
4330
+ }
4331
+ );
4332
+
4333
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
4334
+
4335
+ // filter out skipped interceptors
4336
+ const requestInterceptorChain = [];
4337
+ let synchronousRequestInterceptors = true;
4338
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
4339
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
4340
+ return;
4341
+ }
4342
+
4343
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
4344
+
4345
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
4346
+ });
4347
+
4348
+ const responseInterceptorChain = [];
4349
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
4350
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
4351
+ });
4352
+
4353
+ let promise;
4354
+ let i = 0;
4355
+ let len;
4356
+
4357
+ if (!synchronousRequestInterceptors) {
4358
+ const chain = [dispatchRequest.bind(this), undefined];
4359
+ chain.unshift.apply(chain, requestInterceptorChain);
4360
+ chain.push.apply(chain, responseInterceptorChain);
4361
+ len = chain.length;
4362
+
4363
+ promise = Promise.resolve(config);
4364
+
4365
+ while (i < len) {
4366
+ promise = promise.then(chain[i++], chain[i++]);
4367
+ }
4368
+
4369
+ return promise;
4370
+ }
4371
+
4372
+ len = requestInterceptorChain.length;
4373
+
4374
+ let newConfig = config;
4375
+
4376
+ i = 0;
4377
+
4378
+ while (i < len) {
4379
+ const onFulfilled = requestInterceptorChain[i++];
4380
+ const onRejected = requestInterceptorChain[i++];
4381
+ try {
4382
+ newConfig = onFulfilled(newConfig);
4383
+ } catch (error) {
4384
+ onRejected.call(this, error);
4385
+ break;
4386
+ }
4387
+ }
4388
+
4389
+ try {
4390
+ promise = dispatchRequest.call(this, newConfig);
4391
+ } catch (error) {
4392
+ return Promise.reject(error);
4393
+ }
4394
+
4395
+ i = 0;
4396
+ len = responseInterceptorChain.length;
4397
+
4398
+ while (i < len) {
4399
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
4400
+ }
4401
+
4402
+ return promise;
4403
+ }
4404
+
4405
+ getUri(config) {
4406
+ config = mergeConfig(this.defaults, config);
4407
+ const fullPath = buildFullPath(config.baseURL, config.url);
4408
+ return buildURL(fullPath, config.params, config.paramsSerializer);
4409
+ }
4410
+ }
4411
+
4412
+ // Provide aliases for supported request methods
4413
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
4414
+ /*eslint func-names:0*/
4415
+ Axios.prototype[method] = function(url, config) {
4416
+ return this.request(mergeConfig(config || {}, {
4417
+ method,
4418
+ url,
4419
+ data: (config || {}).data
4420
+ }));
4421
+ };
4422
+ });
4423
+
4424
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
4425
+ /*eslint func-names:0*/
4426
+
4427
+ function generateHTTPMethod(isForm) {
4428
+ return function httpMethod(url, data, config) {
4429
+ return this.request(mergeConfig(config || {}, {
4430
+ method,
4431
+ headers: isForm ? {
4432
+ 'Content-Type': 'multipart/form-data'
4433
+ } : {},
4434
+ url,
4435
+ data
4436
+ }));
4437
+ };
4438
+ }
4439
+
4440
+ Axios.prototype[method] = generateHTTPMethod();
4441
+
4442
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
4443
+ });
4444
+
4445
+ const Axios$1 = Axios;
4446
+
4447
+ /**
4448
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
4449
+ *
4450
+ * @param {Function} executor The executor function.
4451
+ *
4452
+ * @returns {CancelToken}
4453
+ */
4454
+ class CancelToken {
4455
+ constructor(executor) {
4456
+ if (typeof executor !== 'function') {
4457
+ throw new TypeError('executor must be a function.');
4458
+ }
4459
+
4460
+ let resolvePromise;
4461
+
4462
+ this.promise = new Promise(function promiseExecutor(resolve) {
4463
+ resolvePromise = resolve;
4464
+ });
4465
+
4466
+ const token = this;
4467
+
4468
+ // eslint-disable-next-line func-names
4469
+ this.promise.then(cancel => {
4470
+ if (!token._listeners) return;
4471
+
4472
+ let i = token._listeners.length;
4473
+
4474
+ while (i-- > 0) {
4475
+ token._listeners[i](cancel);
4476
+ }
4477
+ token._listeners = null;
4478
+ });
4479
+
4480
+ // eslint-disable-next-line func-names
4481
+ this.promise.then = onfulfilled => {
4482
+ let _resolve;
4483
+ // eslint-disable-next-line func-names
4484
+ const promise = new Promise(resolve => {
4485
+ token.subscribe(resolve);
4486
+ _resolve = resolve;
4487
+ }).then(onfulfilled);
4488
+
4489
+ promise.cancel = function reject() {
4490
+ token.unsubscribe(_resolve);
4491
+ };
4492
+
4493
+ return promise;
4494
+ };
4495
+
4496
+ executor(function cancel(message, config, request) {
4497
+ if (token.reason) {
4498
+ // Cancellation has already been requested
4499
+ return;
4500
+ }
4501
+
4502
+ token.reason = new CanceledError(message, config, request);
4503
+ resolvePromise(token.reason);
4504
+ });
4505
+ }
4506
+
4507
+ /**
4508
+ * Throws a `CanceledError` if cancellation has been requested.
4509
+ */
4510
+ throwIfRequested() {
4511
+ if (this.reason) {
4512
+ throw this.reason;
4513
+ }
4514
+ }
4515
+
4516
+ /**
4517
+ * Subscribe to the cancel signal
4518
+ */
4519
+
4520
+ subscribe(listener) {
4521
+ if (this.reason) {
4522
+ listener(this.reason);
4523
+ return;
4524
+ }
4525
+
4526
+ if (this._listeners) {
4527
+ this._listeners.push(listener);
4528
+ } else {
4529
+ this._listeners = [listener];
4530
+ }
4531
+ }
4532
+
4533
+ /**
4534
+ * Unsubscribe from the cancel signal
4535
+ */
4536
+
4537
+ unsubscribe(listener) {
4538
+ if (!this._listeners) {
4539
+ return;
4540
+ }
4541
+ const index = this._listeners.indexOf(listener);
4542
+ if (index !== -1) {
4543
+ this._listeners.splice(index, 1);
4544
+ }
4545
+ }
4546
+
4547
+ /**
4548
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
4549
+ * cancels the `CancelToken`.
4550
+ */
4551
+ static source() {
4552
+ let cancel;
4553
+ const token = new CancelToken(function executor(c) {
4554
+ cancel = c;
4555
+ });
4556
+ return {
4557
+ token,
4558
+ cancel
4559
+ };
4560
+ }
4561
+ }
4562
+
4563
+ const CancelToken$1 = CancelToken;
4564
+
4565
+ /**
4566
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
4567
+ *
4568
+ * Common use case would be to use `Function.prototype.apply`.
4569
+ *
4570
+ * ```js
4571
+ * function f(x, y, z) {}
4572
+ * var args = [1, 2, 3];
4573
+ * f.apply(null, args);
4574
+ * ```
4575
+ *
4576
+ * With `spread` this example can be re-written.
4577
+ *
4578
+ * ```js
4579
+ * spread(function(x, y, z) {})([1, 2, 3]);
4580
+ * ```
4581
+ *
4582
+ * @param {Function} callback
4583
+ *
4584
+ * @returns {Function}
4585
+ */
4586
+ function spread(callback) {
4587
+ return function wrap(arr) {
4588
+ return callback.apply(null, arr);
4589
+ };
4590
+ }
4591
+
4592
+ /**
4593
+ * Determines whether the payload is an error thrown by Axios
4594
+ *
4595
+ * @param {*} payload The value to test
4596
+ *
4597
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
4598
+ */
4599
+ function isAxiosError(payload) {
4600
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
4601
+ }
4602
+
4603
+ const HttpStatusCode = {
4604
+ Continue: 100,
4605
+ SwitchingProtocols: 101,
4606
+ Processing: 102,
4607
+ EarlyHints: 103,
4608
+ Ok: 200,
4609
+ Created: 201,
4610
+ Accepted: 202,
4611
+ NonAuthoritativeInformation: 203,
4612
+ NoContent: 204,
4613
+ ResetContent: 205,
4614
+ PartialContent: 206,
4615
+ MultiStatus: 207,
4616
+ AlreadyReported: 208,
4617
+ ImUsed: 226,
4618
+ MultipleChoices: 300,
4619
+ MovedPermanently: 301,
4620
+ Found: 302,
4621
+ SeeOther: 303,
4622
+ NotModified: 304,
4623
+ UseProxy: 305,
4624
+ Unused: 306,
4625
+ TemporaryRedirect: 307,
4626
+ PermanentRedirect: 308,
4627
+ BadRequest: 400,
4628
+ Unauthorized: 401,
4629
+ PaymentRequired: 402,
4630
+ Forbidden: 403,
4631
+ NotFound: 404,
4632
+ MethodNotAllowed: 405,
4633
+ NotAcceptable: 406,
4634
+ ProxyAuthenticationRequired: 407,
4635
+ RequestTimeout: 408,
4636
+ Conflict: 409,
4637
+ Gone: 410,
4638
+ LengthRequired: 411,
4639
+ PreconditionFailed: 412,
4640
+ PayloadTooLarge: 413,
4641
+ UriTooLong: 414,
4642
+ UnsupportedMediaType: 415,
4643
+ RangeNotSatisfiable: 416,
4644
+ ExpectationFailed: 417,
4645
+ ImATeapot: 418,
4646
+ MisdirectedRequest: 421,
4647
+ UnprocessableEntity: 422,
4648
+ Locked: 423,
4649
+ FailedDependency: 424,
4650
+ TooEarly: 425,
4651
+ UpgradeRequired: 426,
4652
+ PreconditionRequired: 428,
4653
+ TooManyRequests: 429,
4654
+ RequestHeaderFieldsTooLarge: 431,
4655
+ UnavailableForLegalReasons: 451,
4656
+ InternalServerError: 500,
4657
+ NotImplemented: 501,
4658
+ BadGateway: 502,
4659
+ ServiceUnavailable: 503,
4660
+ GatewayTimeout: 504,
4661
+ HttpVersionNotSupported: 505,
4662
+ VariantAlsoNegotiates: 506,
4663
+ InsufficientStorage: 507,
4664
+ LoopDetected: 508,
4665
+ NotExtended: 510,
4666
+ NetworkAuthenticationRequired: 511,
4667
+ };
4668
+
4669
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
4670
+ HttpStatusCode[value] = key;
4671
+ });
4672
+
4673
+ const HttpStatusCode$1 = HttpStatusCode;
4674
+
4675
+ /**
4676
+ * Create an instance of Axios
4677
+ *
4678
+ * @param {Object} defaultConfig The default config for the instance
4679
+ *
4680
+ * @returns {Axios} A new instance of Axios
4681
+ */
4682
+ function createInstance(defaultConfig) {
4683
+ const context = new Axios$1(defaultConfig);
4684
+ const instance = bind(Axios$1.prototype.request, context);
4685
+
4686
+ // Copy axios.prototype to instance
4687
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
4688
+
4689
+ // Copy context to instance
4690
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
4691
+
4692
+ // Factory for creating new instances
4693
+ instance.create = function create(instanceConfig) {
4694
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
4695
+ };
4696
+
4697
+ return instance;
4698
+ }
4699
+
4700
+ // Create the default instance to be exported
4701
+ const axios = createInstance(defaults$1);
4702
+
4703
+ // Expose Axios class to allow class inheritance
4704
+ axios.Axios = Axios$1;
4705
+
4706
+ // Expose Cancel & CancelToken
4707
+ axios.CanceledError = CanceledError;
4708
+ axios.CancelToken = CancelToken$1;
4709
+ axios.isCancel = isCancel;
4710
+ axios.VERSION = VERSION;
4711
+ axios.toFormData = toFormData;
4712
+
4713
+ // Expose AxiosError class
4714
+ axios.AxiosError = AxiosError;
4715
+
4716
+ // alias for CanceledError for backward compatibility
4717
+ axios.Cancel = axios.CanceledError;
4718
+
4719
+ // Expose all/spread
4720
+ axios.all = function all(promises) {
4721
+ return Promise.all(promises);
4722
+ };
4723
+
4724
+ axios.spread = spread;
4725
+
4726
+ // Expose isAxiosError
4727
+ axios.isAxiosError = isAxiosError;
4728
+
4729
+ // Expose mergeConfig
4730
+ axios.mergeConfig = mergeConfig;
4731
+
4732
+ axios.AxiosHeaders = AxiosHeaders$1;
4733
+
4734
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4735
+
4736
+ axios.getAdapter = adapters.getAdapter;
4737
+
4738
+ axios.HttpStatusCode = HttpStatusCode$1;
4739
+
4740
+ axios.default = axios;
4741
+
4742
+ module.exports = axios;
4743
+ //# sourceMappingURL=axios.cjs.map