@openclaw/slack 2026.7.2-beta.3 → 2026.7.2-beta.5

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