@zuplo/cli 6.69.4 → 6.69.6

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 (428) hide show
  1. package/dist/__tests__/integration/custom-domain.integration.test.js +4 -4
  2. package/dist/__tests__/integration/custom-domain.integration.test.js.map +1 -1
  3. package/dist/__tests__/integration/jest-mocks-setup.js +30 -10
  4. package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
  5. package/dist/__tests__/integration/list.integration.test.js +2 -2
  6. package/dist/__tests__/integration/list.integration.test.js.map +1 -1
  7. package/dist/__tests__/integration/tunnel.integration.test.js +14 -14
  8. package/dist/__tests__/integration/tunnel.integration.test.js.map +1 -1
  9. package/dist/__tests__/integration/variable.integration.test.js +4 -4
  10. package/dist/__tests__/integration/variable.integration.test.js.map +1 -1
  11. package/dist/__tests__/integration/whoami.integration.test.js +2 -5
  12. package/dist/__tests__/integration/whoami.integration.test.js.map +1 -1
  13. package/dist/cli.js +12 -6
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cmds/custom-domain/index.d.ts.map +1 -1
  16. package/dist/cmds/custom-domain/index.js +6 -10
  17. package/dist/cmds/custom-domain/index.js.map +1 -1
  18. package/dist/cmds/mtls-certificates/index.d.ts.map +1 -1
  19. package/dist/cmds/mtls-certificates/index.js +8 -12
  20. package/dist/cmds/mtls-certificates/index.js.map +1 -1
  21. package/dist/cmds/open-api/index.d.ts.map +1 -1
  22. package/dist/cmds/open-api/index.js +2 -5
  23. package/dist/cmds/open-api/index.js.map +1 -1
  24. package/dist/cmds/project/index.d.ts.map +1 -1
  25. package/dist/cmds/project/index.js +2 -5
  26. package/dist/cmds/project/index.js.map +1 -1
  27. package/dist/cmds/proxies/index.d.ts +4 -4
  28. package/dist/cmds/proxies/index.d.ts.map +1 -1
  29. package/dist/cmds/proxies/index.js +6 -10
  30. package/dist/cmds/proxies/index.js.map +1 -1
  31. package/dist/cmds/source/index.d.ts.map +1 -1
  32. package/dist/cmds/source/index.js +2 -9
  33. package/dist/cmds/source/index.js.map +1 -1
  34. package/dist/cmds/source/migrate.d.ts +4 -4
  35. package/dist/cmds/source/migrate.d.ts.map +1 -1
  36. package/dist/cmds/source/migrate.js +3 -6
  37. package/dist/cmds/source/migrate.js.map +1 -1
  38. package/dist/cmds/tunnel/index.d.ts.map +1 -1
  39. package/dist/cmds/tunnel/index.js +8 -12
  40. package/dist/cmds/tunnel/index.js.map +1 -1
  41. package/dist/cmds/tunnel/services/index.d.ts.map +1 -1
  42. package/dist/cmds/tunnel/services/index.js +2 -5
  43. package/dist/cmds/tunnel/services/index.js.map +1 -1
  44. package/dist/cmds/variable/index.d.ts.map +1 -1
  45. package/dist/cmds/variable/index.js +2 -5
  46. package/dist/cmds/variable/index.js.map +1 -1
  47. package/dist/common/api/client.d.ts +40 -0
  48. package/dist/common/api/client.d.ts.map +1 -0
  49. package/dist/common/api/client.js +92 -0
  50. package/dist/common/api/client.js.map +1 -0
  51. package/dist/common/handler.d.ts +4 -1
  52. package/dist/common/handler.d.ts.map +1 -1
  53. package/dist/common/handler.js +11 -2
  54. package/dist/common/handler.js.map +1 -1
  55. package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
  56. package/dist/common/middleware/get-environment-param.js +2 -18
  57. package/dist/common/middleware/get-environment-param.js.map +1 -1
  58. package/dist/common/output.d.ts +4 -0
  59. package/dist/common/output.d.ts.map +1 -1
  60. package/dist/common/output.js +4 -1
  61. package/dist/common/output.js.map +1 -1
  62. package/dist/common/utils/build-environment-prompt-choices.d.ts +13 -0
  63. package/dist/common/utils/build-environment-prompt-choices.d.ts.map +1 -0
  64. package/dist/common/utils/build-environment-prompt-choices.js +66 -0
  65. package/dist/common/utils/build-environment-prompt-choices.js.map +1 -0
  66. package/dist/common/utils/build-environment-prompt-choices.test.d.ts +2 -0
  67. package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +1 -0
  68. package/dist/common/utils/build-environment-prompt-choices.test.js +97 -0
  69. package/dist/common/utils/build-environment-prompt-choices.test.js.map +1 -0
  70. package/dist/common/utils/pretty-print-environment-prompt.d.ts +1 -4
  71. package/dist/common/utils/pretty-print-environment-prompt.d.ts.map +1 -1
  72. package/dist/common/utils/pretty-print-environment-prompt.js +3 -8
  73. package/dist/common/utils/pretty-print-environment-prompt.js.map +1 -1
  74. package/dist/common/utils/pretty-print-environment-prompt.test.js +15 -17
  75. package/dist/common/utils/pretty-print-environment-prompt.test.js.map +1 -1
  76. package/dist/common/utils/sort-environments-for-prompt.d.ts +5 -0
  77. package/dist/common/utils/sort-environments-for-prompt.d.ts.map +1 -0
  78. package/dist/common/utils/sort-environments-for-prompt.js +27 -0
  79. package/dist/common/utils/sort-environments-for-prompt.js.map +1 -0
  80. package/dist/common/utils/sort-environments-for-prompt.test.d.ts +2 -0
  81. package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +1 -0
  82. package/dist/common/utils/sort-environments-for-prompt.test.js +82 -0
  83. package/dist/common/utils/sort-environments-for-prompt.test.js.map +1 -0
  84. package/dist/custom-domain/create/handler.d.ts.map +1 -1
  85. package/dist/custom-domain/create/handler.js +12 -27
  86. package/dist/custom-domain/create/handler.js.map +1 -1
  87. package/dist/custom-domain/delete/handler.d.ts.map +1 -1
  88. package/dist/custom-domain/delete/handler.js +25 -54
  89. package/dist/custom-domain/delete/handler.js.map +1 -1
  90. package/dist/custom-domain/list/handler.d.ts.map +1 -1
  91. package/dist/custom-domain/list/handler.js +15 -29
  92. package/dist/custom-domain/list/handler.js.map +1 -1
  93. package/dist/custom-domain/update/handler.d.ts.map +1 -1
  94. package/dist/custom-domain/update/handler.js +12 -27
  95. package/dist/custom-domain/update/handler.js.map +1 -1
  96. package/dist/list/handler.d.ts.map +1 -1
  97. package/dist/list/handler.js +41 -59
  98. package/dist/list/handler.js.map +1 -1
  99. package/dist/mtls-certificates/create/handler.d.ts.map +1 -1
  100. package/dist/mtls-certificates/create/handler.js +9 -23
  101. package/dist/mtls-certificates/create/handler.js.map +1 -1
  102. package/dist/mtls-certificates/delete/handler.d.ts.map +1 -1
  103. package/dist/mtls-certificates/delete/handler.js +8 -20
  104. package/dist/mtls-certificates/delete/handler.js.map +1 -1
  105. package/dist/mtls-certificates/describe/handler.d.ts.map +1 -1
  106. package/dist/mtls-certificates/describe/handler.js +17 -31
  107. package/dist/mtls-certificates/describe/handler.js.map +1 -1
  108. package/dist/mtls-certificates/disable/handler.d.ts.map +1 -1
  109. package/dist/mtls-certificates/disable/handler.js +9 -26
  110. package/dist/mtls-certificates/disable/handler.js.map +1 -1
  111. package/dist/mtls-certificates/list/handler.d.ts.map +1 -1
  112. package/dist/mtls-certificates/list/handler.js +22 -36
  113. package/dist/mtls-certificates/list/handler.js.map +1 -1
  114. package/dist/mtls-certificates/update/handler.d.ts.map +1 -1
  115. package/dist/mtls-certificates/update/handler.js +14 -29
  116. package/dist/mtls-certificates/update/handler.js.map +1 -1
  117. package/dist/proxies/create/handler.d.ts.map +1 -1
  118. package/dist/proxies/create/handler.js +9 -22
  119. package/dist/proxies/create/handler.js.map +1 -1
  120. package/dist/proxies/delete/handler.d.ts.map +1 -1
  121. package/dist/proxies/delete/handler.js +8 -21
  122. package/dist/proxies/delete/handler.js.map +1 -1
  123. package/dist/proxies/describe/handler.d.ts.map +1 -1
  124. package/dist/proxies/describe/handler.js +7 -22
  125. package/dist/proxies/describe/handler.js.map +1 -1
  126. package/dist/proxies/update/handler.d.ts.map +1 -1
  127. package/dist/proxies/update/handler.js +9 -22
  128. package/dist/proxies/update/handler.js.map +1 -1
  129. package/dist/tsconfig.tsbuildinfo +1 -1
  130. package/dist/tunnel/create/handler.d.ts.map +1 -1
  131. package/dist/tunnel/create/handler.js +8 -22
  132. package/dist/tunnel/create/handler.js.map +1 -1
  133. package/dist/tunnel/delete/handler.d.ts.map +1 -1
  134. package/dist/tunnel/delete/handler.js +16 -30
  135. package/dist/tunnel/delete/handler.js.map +1 -1
  136. package/dist/tunnel/describe/handler.d.ts.map +1 -1
  137. package/dist/tunnel/describe/handler.js +7 -21
  138. package/dist/tunnel/describe/handler.js.map +1 -1
  139. package/dist/tunnel/list/handler.d.ts.map +1 -1
  140. package/dist/tunnel/list/handler.js +13 -28
  141. package/dist/tunnel/list/handler.js.map +1 -1
  142. package/dist/tunnel/rotate-token/handler.d.ts.map +1 -1
  143. package/dist/tunnel/rotate-token/handler.js +7 -21
  144. package/dist/tunnel/rotate-token/handler.js.map +1 -1
  145. package/dist/tunnel/services/describe/handler.d.ts.map +1 -1
  146. package/dist/tunnel/services/describe/handler.js +7 -21
  147. package/dist/tunnel/services/describe/handler.js.map +1 -1
  148. package/dist/tunnel/services/update/handler.d.ts.map +1 -1
  149. package/dist/tunnel/services/update/handler.js +18 -32
  150. package/dist/tunnel/services/update/handler.js.map +1 -1
  151. package/dist/variable/create/handler.d.ts.map +1 -1
  152. package/dist/variable/create/handler.js +9 -24
  153. package/dist/variable/create/handler.js.map +1 -1
  154. package/dist/variable/update/handler.d.ts.map +1 -1
  155. package/dist/variable/update/handler.js +9 -24
  156. package/dist/variable/update/handler.js.map +1 -1
  157. package/dist/whoami/handler.d.ts.map +1 -1
  158. package/dist/whoami/handler.js +6 -18
  159. package/dist/whoami/handler.js.map +1 -1
  160. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/README.md +1 -5
  161. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -1
  162. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +21 -6
  163. package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/package.json +1 -1
  164. package/node_modules/@zuplo/core/index.minified.js +141 -137
  165. package/node_modules/@zuplo/core/package.json +1 -1
  166. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/ci.yml +1 -1
  167. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
  168. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/LICENSE +1 -3
  169. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +60 -44
  170. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/index.js +2 -2
  171. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/package.json +7 -7
  172. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/anyof.test.js +20 -0
  173. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/array.test.js +22 -0
  174. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/debug-mode.test.js +21 -0
  175. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/if-then-else.test.js +72 -0
  176. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/invalidSchema.test.js +20 -0
  177. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
  178. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -57
  179. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/oneof.test.js +20 -0
  180. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/ref.test.js +31 -0
  181. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/typebox.test.js +1 -1
  182. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/types/{index.test-d.ts → index.tst.ts} +17 -17
  183. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
  184. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
  185. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
  186. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
  187. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
  188. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
  189. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
  190. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
  191. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
  192. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
  193. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
  194. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
  195. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
  196. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
  197. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
  198. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
  199. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
  200. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
  201. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
  202. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
  203. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +10 -16
  204. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
  205. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  206. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
  207. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
  208. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
  209. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
  210. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
  211. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
  212. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
  213. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
  214. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
  215. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
  216. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
  217. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
  218. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
  219. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
  220. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
  221. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
  222. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
  223. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
  224. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
  225. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
  226. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
  227. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
  228. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
  229. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
  230. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
  231. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
  232. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
  233. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
  234. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
  235. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
  236. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
  237. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
  238. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
  239. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
  240. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
  241. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
  242. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
  243. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +9 -15
  244. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
  245. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  246. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
  247. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
  248. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
  249. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
  250. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
  251. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
  252. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
  253. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +9 -15
  254. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
  255. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
  256. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
  257. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
  258. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
  259. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
  260. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
  261. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
  262. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
  263. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +8 -0
  264. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
  265. package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +44 -16
  266. package/node_modules/@zuplo/graphql/package.json +1 -1
  267. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  268. package/node_modules/@zuplo/otel/package.json +1 -1
  269. package/node_modules/@zuplo/runtime/out/esm/index.js +54 -54
  270. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  271. package/node_modules/@zuplo/runtime/out/types/index.d.ts +4 -0
  272. package/node_modules/@zuplo/runtime/package.json +1 -1
  273. package/node_modules/axios/CHANGELOG.md +32 -6
  274. package/node_modules/axios/README.md +356 -20
  275. package/node_modules/axios/dist/axios.js +1389 -1071
  276. package/node_modules/axios/dist/axios.js.map +1 -1
  277. package/node_modules/axios/dist/axios.min.js +3 -3
  278. package/node_modules/axios/dist/axios.min.js.map +1 -1
  279. package/node_modules/axios/dist/browser/axios.cjs +1486 -1123
  280. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  281. package/node_modules/axios/dist/esm/axios.js +1488 -1124
  282. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  283. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  284. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  285. package/node_modules/axios/dist/node/axios.cjs +1230 -871
  286. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  287. package/node_modules/axios/index.d.cts +25 -13
  288. package/node_modules/axios/index.d.ts +21 -4
  289. package/node_modules/axios/index.js +2 -0
  290. package/node_modules/axios/lib/adapters/adapters.js +4 -2
  291. package/node_modules/axios/lib/adapters/fetch.js +126 -10
  292. package/node_modules/axios/lib/adapters/http.js +178 -59
  293. package/node_modules/axios/lib/adapters/xhr.js +6 -2
  294. package/node_modules/axios/lib/core/Axios.js +7 -3
  295. package/node_modules/axios/lib/core/AxiosError.js +86 -1
  296. package/node_modules/axios/lib/core/AxiosHeaders.js +3 -0
  297. package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
  298. package/node_modules/axios/lib/core/mergeConfig.js +6 -3
  299. package/node_modules/axios/lib/core/settle.js +7 -11
  300. package/node_modules/axios/lib/defaults/index.js +1 -1
  301. package/node_modules/axios/lib/env/data.js +1 -1
  302. package/node_modules/axios/lib/helpers/buildURL.js +1 -1
  303. package/node_modules/axios/lib/helpers/cookies.js +14 -2
  304. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
  305. package/node_modules/axios/lib/helpers/formDataToStream.js +1 -1
  306. package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
  307. package/node_modules/axios/lib/helpers/resolveConfig.js +33 -17
  308. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +26 -1
  309. package/node_modules/axios/lib/helpers/validator.js +1 -1
  310. package/node_modules/axios/lib/utils.js +27 -15
  311. package/node_modules/axios/package.json +17 -24
  312. package/node_modules/fast-uri/.github/workflows/ci.yml +12 -7
  313. package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
  314. package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
  315. package/node_modules/fast-uri/LICENSE +1 -3
  316. package/node_modules/fast-uri/README.md +13 -4
  317. package/node_modules/fast-uri/index.js +90 -24
  318. package/node_modules/fast-uri/lib/utils.js +129 -22
  319. package/node_modules/fast-uri/package.json +3 -4
  320. package/node_modules/fast-uri/test/equal.test.js +9 -0
  321. package/node_modules/fast-uri/test/parse.test.js +5 -0
  322. package/node_modules/fast-uri/test/resolve.test.js +9 -0
  323. package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
  324. package/node_modules/fast-uri/test/security.test.js +133 -0
  325. package/node_modules/is-core-module/CHANGELOG.md +244 -113
  326. package/node_modules/is-core-module/README.md +1 -1
  327. package/node_modules/is-core-module/core.json +12 -12
  328. package/node_modules/is-core-module/package.json +5 -5
  329. package/node_modules/is-core-module/test/index.js +101 -0
  330. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
  331. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
  332. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
  333. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
  334. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
  335. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
  336. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
  337. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
  338. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
  339. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
  340. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
  341. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
  342. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
  343. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
  344. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
  345. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
  346. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
  347. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
  348. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
  349. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
  350. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +10 -16
  351. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
  352. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  353. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
  354. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
  355. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
  356. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
  357. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
  358. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
  359. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
  360. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
  361. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
  362. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
  363. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
  364. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
  365. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
  366. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
  367. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
  368. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
  369. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
  370. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
  371. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
  372. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
  373. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
  374. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
  375. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
  376. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
  377. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
  378. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
  379. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
  380. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
  381. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
  382. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
  383. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
  384. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
  385. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
  386. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
  387. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
  388. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
  389. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
  390. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +9 -15
  391. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
  392. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  393. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
  394. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
  395. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
  396. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
  397. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
  398. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
  399. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
  400. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +9 -15
  401. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
  402. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
  403. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
  404. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
  405. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
  406. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
  407. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
  408. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
  409. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
  410. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +8 -0
  411. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
  412. package/node_modules/rimraf/node_modules/lru-cache/package.json +44 -16
  413. package/package.json +6 -6
  414. package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/stale.yml +0 -21
  415. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
  416. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
  417. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
  418. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
  419. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
  420. package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
  421. package/node_modules/fast-uri/.github/.stale.yml +0 -21
  422. package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
  423. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
  424. package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
  425. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
  426. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
  427. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
  428. package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors */
1
+ /*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors */
2
2
  /**
3
3
  * Create a bound version of a function with a specified `this` context
4
4
  *
@@ -202,9 +202,9 @@ const isFile = kindOfTest('File');
202
202
  * also have a `name` and `type` attribute to specify filename and content type
203
203
  *
204
204
  * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
205
- *
205
+ *
206
206
  * @param {*} value The value to test
207
- *
207
+ *
208
208
  * @returns {boolean} True if value is a React Native Blob, otherwise false
209
209
  */
210
210
  const isReactNativeBlob = (value) => {
@@ -214,9 +214,9 @@ const isReactNativeBlob = (value) => {
214
214
  /**
215
215
  * Determine if environment is React Native
216
216
  * ReactNative `FormData` has a non-standard `getParts()` method
217
- *
217
+ *
218
218
  * @param {*} formData The formData to test
219
- *
219
+ *
220
220
  * @returns {boolean} True if environment is React Native, otherwise false
221
221
  */
222
222
  const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
@@ -235,7 +235,7 @@ const isBlob = kindOfTest('Blob');
235
235
  *
236
236
  * @param {*} val The value to test
237
237
  *
238
- * @returns {boolean} True if value is a File, otherwise false
238
+ * @returns {boolean} True if value is a FileList, otherwise false
239
239
  */
240
240
  const isFileList = kindOfTest('FileList');
241
241
 
@@ -269,14 +269,16 @@ const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
269
269
  const isFormData = (thing) => {
270
270
  if (!thing) return false;
271
271
  if (FormDataCtor && thing instanceof FormDataCtor) return true;
272
- // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
272
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
273
273
  const proto = getPrototypeOf(thing);
274
274
  if (!proto || proto === Object.prototype) return false;
275
275
  if (!isFunction$1(thing.append)) return false;
276
276
  const kind = kindOf(thing);
277
- return kind === 'formdata' ||
277
+ return (
278
+ kind === 'formdata' ||
278
279
  // detect form-data instance
279
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
280
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
281
+ );
280
282
  };
281
283
 
282
284
  /**
@@ -411,7 +413,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
411
413
  *
412
414
  * @returns {Object} Result of all merge properties
413
415
  */
414
- function merge(/* obj1, obj2, obj3, ... */) {
416
+ function merge(...objs) {
415
417
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
416
418
  const result = {};
417
419
  const assignValue = (val, key) => {
@@ -421,8 +423,12 @@ function merge(/* obj1, obj2, obj3, ... */) {
421
423
  }
422
424
 
423
425
  const targetKey = (caseless && findKey(result, key)) || key;
424
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
425
- result[targetKey] = merge(result[targetKey], val);
426
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
427
+ // chain, so a polluted Object.prototype value could surface here and get
428
+ // copied into the merged result.
429
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
430
+ if (isPlainObject(existing) && isPlainObject(val)) {
431
+ result[targetKey] = merge(existing, val);
426
432
  } else if (isPlainObject(val)) {
427
433
  result[targetKey] = merge({}, val);
428
434
  } else if (isArray(val)) {
@@ -432,8 +438,8 @@ function merge(/* obj1, obj2, obj3, ... */) {
432
438
  }
433
439
  };
434
440
 
435
- for (let i = 0, l = arguments.length; i < l; i++) {
436
- arguments[i] && forEach(arguments[i], assignValue);
441
+ for (let i = 0, l = objs.length; i < l; i++) {
442
+ objs[i] && forEach(objs[i], assignValue);
437
443
  }
438
444
  return result;
439
445
  }
@@ -455,6 +461,9 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
455
461
  (val, key) => {
456
462
  if (thisArg && isFunction$1(val)) {
457
463
  Object.defineProperty(a, key, {
464
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
465
+ // hijack defineProperty's accessor-vs-data resolution.
466
+ __proto__: null,
458
467
  value: bind(val, thisArg),
459
468
  writable: true,
460
469
  enumerable: true,
@@ -462,6 +471,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
462
471
  });
463
472
  } else {
464
473
  Object.defineProperty(a, key, {
474
+ __proto__: null,
465
475
  value: val,
466
476
  writable: true,
467
477
  enumerable: true,
@@ -500,12 +510,14 @@ const stripBOM = (content) => {
500
510
  const inherits = (constructor, superConstructor, props, descriptors) => {
501
511
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
502
512
  Object.defineProperty(constructor.prototype, 'constructor', {
513
+ __proto__: null,
503
514
  value: constructor,
504
515
  writable: true,
505
516
  enumerable: false,
506
517
  configurable: true,
507
518
  });
508
519
  Object.defineProperty(constructor, 'super', {
520
+ __proto__: null,
509
521
  value: superConstructor.prototype,
510
522
  });
511
523
  props && Object.assign(constructor.prototype, props);
@@ -687,7 +699,7 @@ const reduceDescriptors = (obj, reducer) => {
687
699
  const freezeMethods = (obj) => {
688
700
  reduceDescriptors(obj, (descriptor, name) => {
689
701
  // skip restricted props in strict mode
690
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
702
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
691
703
  return false;
692
704
  }
693
705
 
@@ -928,1312 +940,1399 @@ var utils$1 = {
928
940
  isIterable,
929
941
  };
930
942
 
931
- let AxiosError$1 = class AxiosError extends Error {
932
- static from(error, code, config, request, response, customProps) {
933
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
934
- axiosError.cause = error;
935
- axiosError.name = error.name;
943
+ // RawAxiosHeaders whose duplicates are ignored by node
944
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
945
+ const ignoreDuplicateOf = utils$1.toObjectSet([
946
+ 'age',
947
+ 'authorization',
948
+ 'content-length',
949
+ 'content-type',
950
+ 'etag',
951
+ 'expires',
952
+ 'from',
953
+ 'host',
954
+ 'if-modified-since',
955
+ 'if-unmodified-since',
956
+ 'last-modified',
957
+ 'location',
958
+ 'max-forwards',
959
+ 'proxy-authorization',
960
+ 'referer',
961
+ 'retry-after',
962
+ 'user-agent',
963
+ ]);
936
964
 
937
- // Preserve status from the original error if not already set from response
938
- if (error.status != null && axiosError.status == null) {
939
- axiosError.status = error.status;
940
- }
965
+ /**
966
+ * Parse headers into an object
967
+ *
968
+ * ```
969
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
970
+ * Content-Type: application/json
971
+ * Connection: keep-alive
972
+ * Transfer-Encoding: chunked
973
+ * ```
974
+ *
975
+ * @param {String} rawHeaders Headers needing to be parsed
976
+ *
977
+ * @returns {Object} Headers parsed into an object
978
+ */
979
+ var parseHeaders = (rawHeaders) => {
980
+ const parsed = {};
981
+ let key;
982
+ let val;
983
+ let i;
941
984
 
942
- customProps && Object.assign(axiosError, customProps);
943
- return axiosError;
944
- }
985
+ rawHeaders &&
986
+ rawHeaders.split('\n').forEach(function parser(line) {
987
+ i = line.indexOf(':');
988
+ key = line.substring(0, i).trim().toLowerCase();
989
+ val = line.substring(i + 1).trim();
945
990
 
946
- /**
947
- * Create an Error with the specified message, config, error code, request and response.
948
- *
949
- * @param {string} message The error message.
950
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
951
- * @param {Object} [config] The config.
952
- * @param {Object} [request] The request.
953
- * @param {Object} [response] The response.
954
- *
955
- * @returns {Error} The created error.
956
- */
957
- constructor(message, code, config, request, response) {
958
- super(message);
991
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
992
+ return;
993
+ }
959
994
 
960
- // Make message enumerable to maintain backward compatibility
961
- // The native Error constructor sets message as non-enumerable,
962
- // but axios < v1.13.3 had it as enumerable
963
- Object.defineProperty(this, 'message', {
964
- value: message,
965
- enumerable: true,
966
- writable: true,
967
- configurable: true,
995
+ if (key === 'set-cookie') {
996
+ if (parsed[key]) {
997
+ parsed[key].push(val);
998
+ } else {
999
+ parsed[key] = [val];
1000
+ }
1001
+ } else {
1002
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1003
+ }
968
1004
  });
969
1005
 
970
- this.name = 'AxiosError';
971
- this.isAxiosError = true;
972
- code && (this.code = code);
973
- config && (this.config = config);
974
- request && (this.request = request);
975
- if (response) {
976
- this.response = response;
977
- this.status = response.status;
1006
+ return parsed;
1007
+ };
1008
+
1009
+ const $internals = Symbol('internals');
1010
+
1011
+ const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1012
+
1013
+ function trimSPorHTAB(str) {
1014
+ let start = 0;
1015
+ let end = str.length;
1016
+
1017
+ while (start < end) {
1018
+ const code = str.charCodeAt(start);
1019
+
1020
+ if (code !== 0x09 && code !== 0x20) {
1021
+ break;
978
1022
  }
979
- }
980
1023
 
981
- toJSON() {
982
- return {
983
- // Standard
984
- message: this.message,
985
- name: this.name,
986
- // Microsoft
987
- description: this.description,
988
- number: this.number,
989
- // Mozilla
990
- fileName: this.fileName,
991
- lineNumber: this.lineNumber,
992
- columnNumber: this.columnNumber,
993
- stack: this.stack,
994
- // Axios
995
- config: utils$1.toJSONObject(this.config),
996
- code: this.code,
997
- status: this.status,
998
- };
1024
+ start += 1;
999
1025
  }
1000
- };
1001
1026
 
1002
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1003
- AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1004
- AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1005
- AxiosError$1.ECONNABORTED = 'ECONNABORTED';
1006
- AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
1007
- AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
1008
- AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1009
- AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
1010
- AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1011
- AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1012
- AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
1013
- AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1014
- AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
1015
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
1027
+ while (end > start) {
1028
+ const code = str.charCodeAt(end - 1);
1016
1029
 
1017
- // eslint-disable-next-line strict
1018
- var httpAdapter = null;
1030
+ if (code !== 0x09 && code !== 0x20) {
1031
+ break;
1032
+ }
1019
1033
 
1020
- /**
1021
- * Determines if the given thing is a array or js object.
1022
- *
1023
- * @param {string} thing - The object or array to be visited.
1024
- *
1025
- * @returns {boolean}
1026
- */
1027
- function isVisitable(thing) {
1028
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1029
- }
1034
+ end -= 1;
1035
+ }
1030
1036
 
1031
- /**
1032
- * It removes the brackets from the end of a string
1033
- *
1034
- * @param {string} key - The key of the parameter.
1035
- *
1036
- * @returns {string} the key without the brackets.
1037
- */
1038
- function removeBrackets(key) {
1039
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1037
+ return start === 0 && end === str.length ? str : str.slice(start, end);
1040
1038
  }
1041
1039
 
1042
- /**
1043
- * It takes a path, a key, and a boolean, and returns a string
1044
- *
1045
- * @param {string} path - The path to the current key.
1046
- * @param {string} key - The key of the current object being iterated over.
1047
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1048
- *
1049
- * @returns {string} The path to the current key.
1050
- */
1051
- function renderKey(path, key, dots) {
1052
- if (!path) return key;
1053
- return path
1054
- .concat(key)
1055
- .map(function each(token, i) {
1056
- // eslint-disable-next-line no-param-reassign
1057
- token = removeBrackets(token);
1058
- return !dots && i ? '[' + token + ']' : token;
1059
- })
1060
- .join(dots ? '.' : '');
1040
+ function normalizeHeader(header) {
1041
+ return header && String(header).trim().toLowerCase();
1061
1042
  }
1062
1043
 
1063
- /**
1064
- * If the array is an array and none of its elements are visitable, then it's a flat array.
1065
- *
1066
- * @param {Array<any>} arr - The array to check
1067
- *
1068
- * @returns {boolean}
1069
- */
1070
- function isFlatArray(arr) {
1071
- return utils$1.isArray(arr) && !arr.some(isVisitable);
1044
+ function sanitizeHeaderValue(str) {
1045
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1072
1046
  }
1073
1047
 
1074
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1075
- return /^is[A-Z]/.test(prop);
1076
- });
1077
-
1078
- /**
1079
- * Convert a data object to FormData
1080
- *
1081
- * @param {Object} obj
1082
- * @param {?Object} [formData]
1083
- * @param {?Object} [options]
1084
- * @param {Function} [options.visitor]
1085
- * @param {Boolean} [options.metaTokens = true]
1086
- * @param {Boolean} [options.dots = false]
1087
- * @param {?Boolean} [options.indexes = false]
1088
- *
1089
- * @returns {Object}
1090
- **/
1091
-
1092
- /**
1093
- * It converts an object into a FormData object
1094
- *
1095
- * @param {Object<any, any>} obj - The object to convert to form data.
1096
- * @param {string} formData - The FormData object to append to.
1097
- * @param {Object<string, any>} options
1098
- *
1099
- * @returns
1100
- */
1101
- function toFormData$1(obj, formData, options) {
1102
- if (!utils$1.isObject(obj)) {
1103
- throw new TypeError('target must be an object');
1048
+ function normalizeValue(value) {
1049
+ if (value === false || value == null) {
1050
+ return value;
1104
1051
  }
1105
1052
 
1106
- // eslint-disable-next-line no-param-reassign
1107
- formData = formData || new (FormData)();
1053
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
1054
+ }
1108
1055
 
1109
- // eslint-disable-next-line no-param-reassign
1110
- options = utils$1.toFlatObject(
1111
- options,
1112
- {
1113
- metaTokens: true,
1114
- dots: false,
1115
- indexes: false,
1116
- },
1117
- false,
1118
- function defined(option, source) {
1119
- // eslint-disable-next-line no-eq-null,eqeqeq
1120
- return !utils$1.isUndefined(source[option]);
1121
- }
1122
- );
1123
-
1124
- const metaTokens = options.metaTokens;
1125
- // eslint-disable-next-line no-use-before-define
1126
- const visitor = options.visitor || defaultVisitor;
1127
- const dots = options.dots;
1128
- const indexes = options.indexes;
1129
- const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
1130
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
1131
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1056
+ function parseTokens(str) {
1057
+ const tokens = Object.create(null);
1058
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1059
+ let match;
1132
1060
 
1133
- if (!utils$1.isFunction(visitor)) {
1134
- throw new TypeError('visitor must be a function');
1061
+ while ((match = tokensRE.exec(str))) {
1062
+ tokens[match[1]] = match[2];
1135
1063
  }
1136
1064
 
1137
- function convertValue(value) {
1138
- if (value === null) return '';
1139
-
1140
- if (utils$1.isDate(value)) {
1141
- return value.toISOString();
1142
- }
1143
-
1144
- if (utils$1.isBoolean(value)) {
1145
- return value.toString();
1146
- }
1065
+ return tokens;
1066
+ }
1147
1067
 
1148
- if (!useBlob && utils$1.isBlob(value)) {
1149
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1150
- }
1068
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1151
1069
 
1152
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1153
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1154
- }
1070
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1071
+ if (utils$1.isFunction(filter)) {
1072
+ return filter.call(this, value, header);
1073
+ }
1155
1074
 
1156
- return value;
1075
+ if (isHeaderNameFilter) {
1076
+ value = header;
1157
1077
  }
1158
1078
 
1159
- /**
1160
- * Default visitor.
1161
- *
1162
- * @param {*} value
1163
- * @param {String|Number} key
1164
- * @param {Array<String|Number>} path
1165
- * @this {FormData}
1166
- *
1167
- * @returns {boolean} return true to visit the each prop of the value recursively
1168
- */
1169
- function defaultVisitor(value, key, path) {
1170
- let arr = value;
1079
+ if (!utils$1.isString(value)) return;
1171
1080
 
1172
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
1173
- formData.append(renderKey(path, key, dots), convertValue(value));
1174
- return false;
1175
- }
1081
+ if (utils$1.isString(filter)) {
1082
+ return value.indexOf(filter) !== -1;
1083
+ }
1176
1084
 
1177
- if (value && !path && typeof value === 'object') {
1178
- if (utils$1.endsWith(key, '{}')) {
1179
- // eslint-disable-next-line no-param-reassign
1180
- key = metaTokens ? key : key.slice(0, -2);
1181
- // eslint-disable-next-line no-param-reassign
1182
- value = JSON.stringify(value);
1183
- } else if (
1184
- (utils$1.isArray(value) && isFlatArray(value)) ||
1185
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
1186
- ) {
1187
- // eslint-disable-next-line no-param-reassign
1188
- key = removeBrackets(key);
1085
+ if (utils$1.isRegExp(filter)) {
1086
+ return filter.test(value);
1087
+ }
1088
+ }
1189
1089
 
1190
- arr.forEach(function each(el, index) {
1191
- !(utils$1.isUndefined(el) || el === null) &&
1192
- formData.append(
1193
- // eslint-disable-next-line no-nested-ternary
1194
- indexes === true
1195
- ? renderKey([key], index, dots)
1196
- : indexes === null
1197
- ? key
1198
- : key + '[]',
1199
- convertValue(el)
1200
- );
1201
- });
1202
- return false;
1203
- }
1204
- }
1090
+ function formatHeader(header) {
1091
+ return header
1092
+ .trim()
1093
+ .toLowerCase()
1094
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1095
+ return char.toUpperCase() + str;
1096
+ });
1097
+ }
1205
1098
 
1206
- if (isVisitable(value)) {
1207
- return true;
1208
- }
1099
+ function buildAccessors(obj, header) {
1100
+ const accessorName = utils$1.toCamelCase(' ' + header);
1209
1101
 
1210
- formData.append(renderKey(path, key, dots), convertValue(value));
1102
+ ['get', 'set', 'has'].forEach((methodName) => {
1103
+ Object.defineProperty(obj, methodName + accessorName, {
1104
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1105
+ // this data descriptor into an accessor descriptor on the way in.
1106
+ __proto__: null,
1107
+ value: function (arg1, arg2, arg3) {
1108
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1109
+ },
1110
+ configurable: true,
1111
+ });
1112
+ });
1113
+ }
1211
1114
 
1212
- return false;
1115
+ let AxiosHeaders$1 = class AxiosHeaders {
1116
+ constructor(headers) {
1117
+ headers && this.set(headers);
1213
1118
  }
1214
1119
 
1215
- const stack = [];
1120
+ set(header, valueOrRewrite, rewrite) {
1121
+ const self = this;
1216
1122
 
1217
- const exposedHelpers = Object.assign(predicates, {
1218
- defaultVisitor,
1219
- convertValue,
1220
- isVisitable,
1221
- });
1123
+ function setHeader(_value, _header, _rewrite) {
1124
+ const lHeader = normalizeHeader(_header);
1222
1125
 
1223
- function build(value, path, depth = 0) {
1224
- if (utils$1.isUndefined(value)) return;
1126
+ if (!lHeader) {
1127
+ throw new Error('header name must be a non-empty string');
1128
+ }
1225
1129
 
1226
- if (depth > maxDepth) {
1227
- throw new AxiosError$1(
1228
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
1229
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
1230
- );
1231
- }
1130
+ const key = utils$1.findKey(self, lHeader);
1232
1131
 
1233
- if (stack.indexOf(value) !== -1) {
1234
- throw Error('Circular reference detected in ' + path.join('.'));
1132
+ if (
1133
+ !key ||
1134
+ self[key] === undefined ||
1135
+ _rewrite === true ||
1136
+ (_rewrite === undefined && self[key] !== false)
1137
+ ) {
1138
+ self[key || _header] = normalizeValue(_value);
1139
+ }
1235
1140
  }
1236
1141
 
1237
- stack.push(value);
1142
+ const setHeaders = (headers, _rewrite) =>
1143
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1238
1144
 
1239
- utils$1.forEach(value, function each(el, key) {
1240
- const result =
1241
- !(utils$1.isUndefined(el) || el === null) &&
1242
- visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
1145
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1146
+ setHeaders(header, valueOrRewrite);
1147
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1148
+ setHeaders(parseHeaders(header), valueOrRewrite);
1149
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
1150
+ let obj = {},
1151
+ dest,
1152
+ key;
1153
+ for (const entry of header) {
1154
+ if (!utils$1.isArray(entry)) {
1155
+ throw TypeError('Object iterator must return a key-value pair');
1156
+ }
1243
1157
 
1244
- if (result === true) {
1245
- build(el, path ? path.concat(key) : [key], depth + 1);
1158
+ obj[(key = entry[0])] = (dest = obj[key])
1159
+ ? utils$1.isArray(dest)
1160
+ ? [...dest, entry[1]]
1161
+ : [dest, entry[1]]
1162
+ : entry[1];
1246
1163
  }
1247
- });
1248
1164
 
1249
- stack.pop();
1250
- }
1165
+ setHeaders(obj, valueOrRewrite);
1166
+ } else {
1167
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1168
+ }
1251
1169
 
1252
- if (!utils$1.isObject(obj)) {
1253
- throw new TypeError('data must be an object');
1170
+ return this;
1254
1171
  }
1255
1172
 
1256
- build(obj);
1257
-
1258
- return formData;
1259
- }
1173
+ get(header, parser) {
1174
+ header = normalizeHeader(header);
1260
1175
 
1261
- /**
1262
- * It encodes a string by replacing all characters that are not in the unreserved set with
1263
- * their percent-encoded equivalents
1264
- *
1265
- * @param {string} str - The string to encode.
1266
- *
1267
- * @returns {string} The encoded string.
1268
- */
1269
- function encode$1(str) {
1270
- const charMap = {
1271
- '!': '%21',
1272
- "'": '%27',
1273
- '(': '%28',
1274
- ')': '%29',
1275
- '~': '%7E',
1276
- '%20': '+',
1277
- };
1278
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
1279
- return charMap[match];
1280
- });
1281
- }
1176
+ if (header) {
1177
+ const key = utils$1.findKey(this, header);
1282
1178
 
1283
- /**
1284
- * It takes a params object and converts it to a FormData object
1285
- *
1286
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1287
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1288
- *
1289
- * @returns {void}
1290
- */
1291
- function AxiosURLSearchParams(params, options) {
1292
- this._pairs = [];
1179
+ if (key) {
1180
+ const value = this[key];
1293
1181
 
1294
- params && toFormData$1(params, this, options);
1295
- }
1182
+ if (!parser) {
1183
+ return value;
1184
+ }
1296
1185
 
1297
- const prototype = AxiosURLSearchParams.prototype;
1186
+ if (parser === true) {
1187
+ return parseTokens(value);
1188
+ }
1298
1189
 
1299
- prototype.append = function append(name, value) {
1300
- this._pairs.push([name, value]);
1301
- };
1190
+ if (utils$1.isFunction(parser)) {
1191
+ return parser.call(this, value, key);
1192
+ }
1302
1193
 
1303
- prototype.toString = function toString(encoder) {
1304
- const _encode = encoder
1305
- ? function (value) {
1306
- return encoder.call(this, value, encode$1);
1194
+ if (utils$1.isRegExp(parser)) {
1195
+ return parser.exec(value);
1196
+ }
1197
+
1198
+ throw new TypeError('parser must be boolean|regexp|function');
1307
1199
  }
1308
- : encode$1;
1200
+ }
1201
+ }
1309
1202
 
1310
- return this._pairs
1311
- .map(function each(pair) {
1312
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1313
- }, '')
1314
- .join('&');
1315
- };
1203
+ has(header, matcher) {
1204
+ header = normalizeHeader(header);
1316
1205
 
1317
- /**
1318
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
1319
- * their plain counterparts (`:`, `$`, `,`, `+`).
1320
- *
1321
- * @param {string} val The value to be encoded.
1322
- *
1323
- * @returns {string} The encoded value.
1324
- */
1325
- function encode(val) {
1326
- return encodeURIComponent(val)
1327
- .replace(/%3A/gi, ':')
1328
- .replace(/%24/g, '$')
1329
- .replace(/%2C/gi, ',')
1330
- .replace(/%20/g, '+');
1331
- }
1206
+ if (header) {
1207
+ const key = utils$1.findKey(this, header);
1332
1208
 
1333
- /**
1334
- * Build a URL by appending params to the end
1335
- *
1336
- * @param {string} url The base of the url (e.g., http://www.google.com)
1337
- * @param {object} [params] The params to be appended
1338
- * @param {?(object|Function)} options
1339
- *
1340
- * @returns {string} The formatted url
1341
- */
1342
- function buildURL(url, params, options) {
1343
- if (!params) {
1344
- return url;
1209
+ return !!(
1210
+ key &&
1211
+ this[key] !== undefined &&
1212
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
1213
+ );
1214
+ }
1215
+
1216
+ return false;
1345
1217
  }
1346
1218
 
1347
- const _encode = (options && options.encode) || encode;
1219
+ delete(header, matcher) {
1220
+ const self = this;
1221
+ let deleted = false;
1348
1222
 
1349
- const _options = utils$1.isFunction(options)
1350
- ? {
1351
- serialize: options,
1352
- }
1353
- : options;
1223
+ function deleteHeader(_header) {
1224
+ _header = normalizeHeader(_header);
1354
1225
 
1355
- const serializeFn = _options && _options.serialize;
1226
+ if (_header) {
1227
+ const key = utils$1.findKey(self, _header);
1356
1228
 
1357
- let serializedParams;
1229
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1230
+ delete self[key];
1358
1231
 
1359
- if (serializeFn) {
1360
- serializedParams = serializeFn(params, _options);
1361
- } else {
1362
- serializedParams = utils$1.isURLSearchParams(params)
1363
- ? params.toString()
1364
- : new AxiosURLSearchParams(params, _options).toString(_encode);
1232
+ deleted = true;
1233
+ }
1234
+ }
1235
+ }
1236
+
1237
+ if (utils$1.isArray(header)) {
1238
+ header.forEach(deleteHeader);
1239
+ } else {
1240
+ deleteHeader(header);
1241
+ }
1242
+
1243
+ return deleted;
1365
1244
  }
1366
1245
 
1367
- if (serializedParams) {
1368
- const hashmarkIndex = url.indexOf('#');
1246
+ clear(matcher) {
1247
+ const keys = Object.keys(this);
1248
+ let i = keys.length;
1249
+ let deleted = false;
1369
1250
 
1370
- if (hashmarkIndex !== -1) {
1371
- url = url.slice(0, hashmarkIndex);
1251
+ while (i--) {
1252
+ const key = keys[i];
1253
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1254
+ delete this[key];
1255
+ deleted = true;
1256
+ }
1372
1257
  }
1373
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1258
+
1259
+ return deleted;
1374
1260
  }
1375
1261
 
1376
- return url;
1377
- }
1262
+ normalize(format) {
1263
+ const self = this;
1264
+ const headers = {};
1378
1265
 
1379
- class InterceptorManager {
1380
- constructor() {
1381
- this.handlers = [];
1266
+ utils$1.forEach(this, (value, header) => {
1267
+ const key = utils$1.findKey(headers, header);
1268
+
1269
+ if (key) {
1270
+ self[key] = normalizeValue(value);
1271
+ delete self[header];
1272
+ return;
1273
+ }
1274
+
1275
+ const normalized = format ? formatHeader(header) : String(header).trim();
1276
+
1277
+ if (normalized !== header) {
1278
+ delete self[header];
1279
+ }
1280
+
1281
+ self[normalized] = normalizeValue(value);
1282
+
1283
+ headers[normalized] = true;
1284
+ });
1285
+
1286
+ return this;
1382
1287
  }
1383
1288
 
1384
- /**
1385
- * Add a new interceptor to the stack
1386
- *
1387
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1388
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1389
- * @param {Object} options The options for the interceptor, synchronous and runWhen
1390
- *
1391
- * @return {Number} An ID used to remove interceptor later
1392
- */
1393
- use(fulfilled, rejected, options) {
1394
- this.handlers.push({
1395
- fulfilled,
1396
- rejected,
1397
- synchronous: options ? options.synchronous : false,
1398
- runWhen: options ? options.runWhen : null,
1289
+ concat(...targets) {
1290
+ return this.constructor.concat(this, ...targets);
1291
+ }
1292
+
1293
+ toJSON(asStrings) {
1294
+ const obj = Object.create(null);
1295
+
1296
+ utils$1.forEach(this, (value, header) => {
1297
+ value != null &&
1298
+ value !== false &&
1299
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1399
1300
  });
1400
- return this.handlers.length - 1;
1301
+
1302
+ return obj;
1401
1303
  }
1402
1304
 
1403
- /**
1404
- * Remove an interceptor from the stack
1405
- *
1406
- * @param {Number} id The ID that was returned by `use`
1407
- *
1408
- * @returns {void}
1409
- */
1410
- eject(id) {
1411
- if (this.handlers[id]) {
1412
- this.handlers[id] = null;
1413
- }
1305
+ [Symbol.iterator]() {
1306
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1414
1307
  }
1415
1308
 
1416
- /**
1417
- * Clear all interceptors from the stack
1418
- *
1419
- * @returns {void}
1420
- */
1421
- clear() {
1422
- if (this.handlers) {
1423
- this.handlers = [];
1424
- }
1309
+ toString() {
1310
+ return Object.entries(this.toJSON())
1311
+ .map(([header, value]) => header + ': ' + value)
1312
+ .join('\n');
1425
1313
  }
1426
1314
 
1427
- /**
1428
- * Iterate over all the registered interceptors
1429
- *
1430
- * This method is particularly useful for skipping over any
1431
- * interceptors that may have become `null` calling `eject`.
1432
- *
1433
- * @param {Function} fn The function to call for each interceptor
1434
- *
1435
- * @returns {void}
1436
- */
1437
- forEach(fn) {
1438
- utils$1.forEach(this.handlers, function forEachHandler(h) {
1439
- if (h !== null) {
1440
- fn(h);
1441
- }
1442
- });
1315
+ getSetCookie() {
1316
+ return this.get('set-cookie') || [];
1443
1317
  }
1444
- }
1445
1318
 
1446
- var transitionalDefaults = {
1447
- silentJSONParsing: true,
1448
- forcedJSONParsing: true,
1449
- clarifyTimeoutError: false,
1450
- legacyInterceptorReqResOrdering: true,
1451
- };
1319
+ get [Symbol.toStringTag]() {
1320
+ return 'AxiosHeaders';
1321
+ }
1452
1322
 
1453
- var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1323
+ static from(thing) {
1324
+ return thing instanceof this ? thing : new this(thing);
1325
+ }
1454
1326
 
1455
- var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1327
+ static concat(first, ...targets) {
1328
+ const computed = new this(first);
1456
1329
 
1457
- var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1330
+ targets.forEach((target) => computed.set(target));
1458
1331
 
1459
- var platform$1 = {
1460
- isBrowser: true,
1461
- classes: {
1462
- URLSearchParams: URLSearchParams$1,
1463
- FormData: FormData$1,
1464
- Blob: Blob$1,
1465
- },
1466
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
1467
- };
1332
+ return computed;
1333
+ }
1468
1334
 
1469
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1335
+ static accessor(header) {
1336
+ const internals =
1337
+ (this[$internals] =
1338
+ this[$internals] =
1339
+ {
1340
+ accessors: {},
1341
+ });
1470
1342
 
1471
- const _navigator = (typeof navigator === 'object' && navigator) || undefined;
1343
+ const accessors = internals.accessors;
1344
+ const prototype = this.prototype;
1472
1345
 
1473
- /**
1474
- * Determine if we're running in a standard browser environment
1475
- *
1476
- * This allows axios to run in a web worker, and react-native.
1477
- * Both environments support XMLHttpRequest, but not fully standard globals.
1478
- *
1479
- * web workers:
1480
- * typeof window -> undefined
1481
- * typeof document -> undefined
1482
- *
1483
- * react-native:
1484
- * navigator.product -> 'ReactNative'
1485
- * nativescript
1486
- * navigator.product -> 'NativeScript' or 'NS'
1487
- *
1488
- * @returns {boolean}
1489
- */
1490
- const hasStandardBrowserEnv =
1491
- hasBrowserEnv &&
1492
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1493
-
1494
- /**
1495
- * Determine if we're running in a standard browser webWorker environment
1496
- *
1497
- * Although the `isStandardBrowserEnv` method indicates that
1498
- * `allows axios to run in a web worker`, the WebWorker will still be
1499
- * filtered out due to its judgment standard
1500
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1501
- * This leads to a problem when axios post `FormData` in webWorker
1502
- */
1503
- const hasStandardBrowserWebWorkerEnv = (() => {
1504
- return (
1505
- typeof WorkerGlobalScope !== 'undefined' &&
1506
- // eslint-disable-next-line no-undef
1507
- self instanceof WorkerGlobalScope &&
1508
- typeof self.importScripts === 'function'
1509
- );
1510
- })();
1346
+ function defineAccessor(_header) {
1347
+ const lHeader = normalizeHeader(_header);
1511
1348
 
1512
- const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
1349
+ if (!accessors[lHeader]) {
1350
+ buildAccessors(prototype, _header);
1351
+ accessors[lHeader] = true;
1352
+ }
1353
+ }
1513
1354
 
1514
- var utils = /*#__PURE__*/Object.freeze({
1515
- __proto__: null,
1516
- hasBrowserEnv: hasBrowserEnv,
1517
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1518
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1519
- navigator: _navigator,
1520
- origin: origin
1521
- });
1355
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1522
1356
 
1523
- var platform = {
1524
- ...utils,
1525
- ...platform$1,
1357
+ return this;
1358
+ }
1526
1359
  };
1527
1360
 
1528
- function toURLEncodedForm(data, options) {
1529
- return toFormData$1(data, new platform.classes.URLSearchParams(), {
1530
- visitor: function (value, key, path, helpers) {
1531
- if (platform.isNode && utils$1.isBuffer(value)) {
1532
- this.append(key, value.toString('base64'));
1533
- return false;
1534
- }
1361
+ AxiosHeaders$1.accessor([
1362
+ 'Content-Type',
1363
+ 'Content-Length',
1364
+ 'Accept',
1365
+ 'Accept-Encoding',
1366
+ 'User-Agent',
1367
+ 'Authorization',
1368
+ ]);
1535
1369
 
1536
- return helpers.defaultVisitor.apply(this, arguments);
1370
+ // reserved names hotfix
1371
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
1372
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1373
+ return {
1374
+ get: () => value,
1375
+ set(headerValue) {
1376
+ this[mapped] = headerValue;
1537
1377
  },
1538
- ...options,
1539
- });
1540
- }
1378
+ };
1379
+ });
1541
1380
 
1542
- /**
1543
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1544
- *
1545
- * @param {string} name - The name of the property to get.
1546
- *
1547
- * @returns An array of strings.
1548
- */
1549
- function parsePropPath(name) {
1550
- // foo[x][y][z]
1551
- // foo.x.y.z
1552
- // foo-x-y-z
1553
- // foo x y z
1554
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
1555
- return match[0] === '[]' ? '' : match[1] || match[0];
1556
- });
1557
- }
1381
+ utils$1.freezeMethods(AxiosHeaders$1);
1558
1382
 
1559
- /**
1560
- * Convert an array to an object.
1561
- *
1562
- * @param {Array<any>} arr - The array to convert to an object.
1563
- *
1564
- * @returns An object with the same keys and values as the array.
1565
- */
1566
- function arrayToObject(arr) {
1567
- const obj = {};
1568
- const keys = Object.keys(arr);
1569
- let i;
1570
- const len = keys.length;
1571
- let key;
1572
- for (i = 0; i < len; i++) {
1573
- key = keys[i];
1574
- obj[key] = arr[key];
1383
+ const REDACTED = '[REDACTED ****]';
1384
+
1385
+ function hasOwnOrPrototypeToJSON(source) {
1386
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
1387
+ return true;
1575
1388
  }
1576
- return obj;
1389
+
1390
+ let prototype = Object.getPrototypeOf(source);
1391
+
1392
+ while (prototype && prototype !== Object.prototype) {
1393
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
1394
+ return true;
1395
+ }
1396
+
1397
+ prototype = Object.getPrototypeOf(prototype);
1398
+ }
1399
+
1400
+ return false;
1577
1401
  }
1578
1402
 
1579
- /**
1580
- * It takes a FormData object and returns a JavaScript object
1581
- *
1582
- * @param {string} formData The FormData object to convert to JSON.
1583
- *
1584
- * @returns {Object<string, any> | null} The converted object.
1585
- */
1586
- function formDataToJSON(formData) {
1587
- function buildPath(path, value, target, index) {
1588
- let name = path[index++];
1403
+ // Build a plain-object snapshot of `config` and replace the value of any key
1404
+ // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
1405
+ // and AxiosHeaders, and short-circuits on circular references.
1406
+ function redactConfig(config, redactKeys) {
1407
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
1408
+ const seen = [];
1589
1409
 
1590
- if (name === '__proto__') return true;
1410
+ const visit = (source) => {
1411
+ if (source === null || typeof source !== 'object') return source;
1412
+ if (utils$1.isBuffer(source)) return source;
1413
+ if (seen.indexOf(source) !== -1) return undefined;
1591
1414
 
1592
- const isNumericKey = Number.isFinite(+name);
1593
- const isLast = index >= path.length;
1594
- name = !name && utils$1.isArray(target) ? target.length : name;
1415
+ if (source instanceof AxiosHeaders$1) {
1416
+ source = source.toJSON();
1417
+ }
1595
1418
 
1596
- if (isLast) {
1597
- if (utils$1.hasOwnProp(target, name)) {
1598
- target[name] = utils$1.isArray(target[name])
1599
- ? target[name].concat(value)
1600
- : [target[name], value];
1601
- } else {
1602
- target[name] = value;
1419
+ seen.push(source);
1420
+
1421
+ let result;
1422
+ if (utils$1.isArray(source)) {
1423
+ result = [];
1424
+ source.forEach((v, i) => {
1425
+ const reducedValue = visit(v);
1426
+ if (!utils$1.isUndefined(reducedValue)) {
1427
+ result[i] = reducedValue;
1428
+ }
1429
+ });
1430
+ } else {
1431
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
1432
+ seen.pop();
1433
+ return source;
1603
1434
  }
1604
1435
 
1605
- return !isNumericKey;
1436
+ result = Object.create(null);
1437
+ for (const [key, value] of Object.entries(source)) {
1438
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
1439
+ if (!utils$1.isUndefined(reducedValue)) {
1440
+ result[key] = reducedValue;
1441
+ }
1442
+ }
1606
1443
  }
1607
1444
 
1608
- if (!target[name] || !utils$1.isObject(target[name])) {
1609
- target[name] = [];
1610
- }
1445
+ seen.pop();
1446
+ return result;
1447
+ };
1611
1448
 
1612
- const result = buildPath(path, value, target[name], index);
1449
+ return visit(config);
1450
+ }
1613
1451
 
1614
- if (result && utils$1.isArray(target[name])) {
1615
- target[name] = arrayToObject(target[name]);
1452
+ let AxiosError$1 = class AxiosError extends Error {
1453
+ static from(error, code, config, request, response, customProps) {
1454
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1455
+ axiosError.cause = error;
1456
+ axiosError.name = error.name;
1457
+
1458
+ // Preserve status from the original error if not already set from response
1459
+ if (error.status != null && axiosError.status == null) {
1460
+ axiosError.status = error.status;
1616
1461
  }
1617
1462
 
1618
- return !isNumericKey;
1463
+ customProps && Object.assign(axiosError, customProps);
1464
+ return axiosError;
1619
1465
  }
1620
1466
 
1621
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1622
- const obj = {};
1467
+ /**
1468
+ * Create an Error with the specified message, config, error code, request and response.
1469
+ *
1470
+ * @param {string} message The error message.
1471
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
1472
+ * @param {Object} [config] The config.
1473
+ * @param {Object} [request] The request.
1474
+ * @param {Object} [response] The response.
1475
+ *
1476
+ * @returns {Error} The created error.
1477
+ */
1478
+ constructor(message, code, config, request, response) {
1479
+ super(message);
1623
1480
 
1624
- utils$1.forEachEntry(formData, (name, value) => {
1625
- buildPath(parsePropPath(name), value, obj, 0);
1481
+ // Make message enumerable to maintain backward compatibility
1482
+ // The native Error constructor sets message as non-enumerable,
1483
+ // but axios < v1.13.3 had it as enumerable
1484
+ Object.defineProperty(this, 'message', {
1485
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1486
+ // this data descriptor into an accessor descriptor on the way in.
1487
+ __proto__: null,
1488
+ value: message,
1489
+ enumerable: true,
1490
+ writable: true,
1491
+ configurable: true,
1626
1492
  });
1627
1493
 
1628
- return obj;
1494
+ this.name = 'AxiosError';
1495
+ this.isAxiosError = true;
1496
+ code && (this.code = code);
1497
+ config && (this.config = config);
1498
+ request && (this.request = request);
1499
+ if (response) {
1500
+ this.response = response;
1501
+ this.status = response.status;
1502
+ }
1629
1503
  }
1630
1504
 
1631
- return null;
1632
- }
1505
+ toJSON() {
1506
+ // Opt-in redaction: when the request config carries a `redact` array, the
1507
+ // value of any matching key (case-insensitive, at any depth) is replaced
1508
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
1509
+ // existing serialization behavior unchanged.
1510
+ const config = this.config;
1511
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
1512
+ const serializedConfig =
1513
+ utils$1.isArray(redactKeys) && redactKeys.length > 0
1514
+ ? redactConfig(config, redactKeys)
1515
+ : utils$1.toJSONObject(config);
1633
1516
 
1634
- const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
1517
+ return {
1518
+ // Standard
1519
+ message: this.message,
1520
+ name: this.name,
1521
+ // Microsoft
1522
+ description: this.description,
1523
+ number: this.number,
1524
+ // Mozilla
1525
+ fileName: this.fileName,
1526
+ lineNumber: this.lineNumber,
1527
+ columnNumber: this.columnNumber,
1528
+ stack: this.stack,
1529
+ // Axios
1530
+ config: serializedConfig,
1531
+ code: this.code,
1532
+ status: this.status,
1533
+ };
1534
+ }
1535
+ };
1536
+
1537
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1538
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1539
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1540
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
1541
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
1542
+ AxiosError$1.ECONNREFUSED = 'ECONNREFUSED';
1543
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
1544
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1545
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
1546
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1547
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1548
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
1549
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1550
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
1551
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
1552
+
1553
+ // eslint-disable-next-line strict
1554
+ var httpAdapter = null;
1635
1555
 
1636
1556
  /**
1637
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1638
- * of the input
1557
+ * Determines if the given thing is a array or js object.
1639
1558
  *
1640
- * @param {any} rawValue - The value to be stringified.
1641
- * @param {Function} parser - A function that parses a string into a JavaScript object.
1642
- * @param {Function} encoder - A function that takes a value and returns a string.
1559
+ * @param {string} thing - The object or array to be visited.
1643
1560
  *
1644
- * @returns {string} A stringified version of the rawValue.
1561
+ * @returns {boolean}
1645
1562
  */
1646
- function stringifySafely(rawValue, parser, encoder) {
1647
- if (utils$1.isString(rawValue)) {
1648
- try {
1649
- (parser || JSON.parse)(rawValue);
1650
- return utils$1.trim(rawValue);
1651
- } catch (e) {
1652
- if (e.name !== 'SyntaxError') {
1653
- throw e;
1654
- }
1655
- }
1656
- }
1563
+ function isVisitable(thing) {
1564
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1565
+ }
1657
1566
 
1658
- return (encoder || JSON.stringify)(rawValue);
1567
+ /**
1568
+ * It removes the brackets from the end of a string
1569
+ *
1570
+ * @param {string} key - The key of the parameter.
1571
+ *
1572
+ * @returns {string} the key without the brackets.
1573
+ */
1574
+ function removeBrackets(key) {
1575
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1659
1576
  }
1660
1577
 
1661
- const defaults = {
1662
- transitional: transitionalDefaults,
1578
+ /**
1579
+ * It takes a path, a key, and a boolean, and returns a string
1580
+ *
1581
+ * @param {string} path - The path to the current key.
1582
+ * @param {string} key - The key of the current object being iterated over.
1583
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1584
+ *
1585
+ * @returns {string} The path to the current key.
1586
+ */
1587
+ function renderKey(path, key, dots) {
1588
+ if (!path) return key;
1589
+ return path
1590
+ .concat(key)
1591
+ .map(function each(token, i) {
1592
+ // eslint-disable-next-line no-param-reassign
1593
+ token = removeBrackets(token);
1594
+ return !dots && i ? '[' + token + ']' : token;
1595
+ })
1596
+ .join(dots ? '.' : '');
1597
+ }
1663
1598
 
1664
- adapter: ['xhr', 'http', 'fetch'],
1599
+ /**
1600
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
1601
+ *
1602
+ * @param {Array<any>} arr - The array to check
1603
+ *
1604
+ * @returns {boolean}
1605
+ */
1606
+ function isFlatArray(arr) {
1607
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
1608
+ }
1665
1609
 
1666
- transformRequest: [
1667
- function transformRequest(data, headers) {
1668
- const contentType = headers.getContentType() || '';
1669
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
1670
- const isObjectPayload = utils$1.isObject(data);
1610
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1611
+ return /^is[A-Z]/.test(prop);
1612
+ });
1671
1613
 
1672
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
1673
- data = new FormData(data);
1674
- }
1614
+ /**
1615
+ * Convert a data object to FormData
1616
+ *
1617
+ * @param {Object} obj
1618
+ * @param {?Object} [formData]
1619
+ * @param {?Object} [options]
1620
+ * @param {Function} [options.visitor]
1621
+ * @param {Boolean} [options.metaTokens = true]
1622
+ * @param {Boolean} [options.dots = false]
1623
+ * @param {?Boolean} [options.indexes = false]
1624
+ *
1625
+ * @returns {Object}
1626
+ **/
1675
1627
 
1676
- const isFormData = utils$1.isFormData(data);
1628
+ /**
1629
+ * It converts an object into a FormData object
1630
+ *
1631
+ * @param {Object<any, any>} obj - The object to convert to form data.
1632
+ * @param {string} formData - The FormData object to append to.
1633
+ * @param {Object<string, any>} options
1634
+ *
1635
+ * @returns
1636
+ */
1637
+ function toFormData$1(obj, formData, options) {
1638
+ if (!utils$1.isObject(obj)) {
1639
+ throw new TypeError('target must be an object');
1640
+ }
1677
1641
 
1678
- if (isFormData) {
1679
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1680
- }
1642
+ // eslint-disable-next-line no-param-reassign
1643
+ formData = formData || new (FormData)();
1681
1644
 
1682
- if (
1683
- utils$1.isArrayBuffer(data) ||
1684
- utils$1.isBuffer(data) ||
1685
- utils$1.isStream(data) ||
1686
- utils$1.isFile(data) ||
1687
- utils$1.isBlob(data) ||
1688
- utils$1.isReadableStream(data)
1689
- ) {
1690
- return data;
1691
- }
1692
- if (utils$1.isArrayBufferView(data)) {
1693
- return data.buffer;
1694
- }
1695
- if (utils$1.isURLSearchParams(data)) {
1696
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1697
- return data.toString();
1698
- }
1645
+ // eslint-disable-next-line no-param-reassign
1646
+ options = utils$1.toFlatObject(
1647
+ options,
1648
+ {
1649
+ metaTokens: true,
1650
+ dots: false,
1651
+ indexes: false,
1652
+ },
1653
+ false,
1654
+ function defined(option, source) {
1655
+ // eslint-disable-next-line no-eq-null,eqeqeq
1656
+ return !utils$1.isUndefined(source[option]);
1657
+ }
1658
+ );
1699
1659
 
1700
- let isFileList;
1660
+ const metaTokens = options.metaTokens;
1661
+ // eslint-disable-next-line no-use-before-define
1662
+ const visitor = options.visitor || defaultVisitor;
1663
+ const dots = options.dots;
1664
+ const indexes = options.indexes;
1665
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
1666
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
1667
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1701
1668
 
1702
- if (isObjectPayload) {
1703
- const formSerializer = own(this, 'formSerializer');
1704
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1705
- return toURLEncodedForm(data, formSerializer).toString();
1706
- }
1669
+ if (!utils$1.isFunction(visitor)) {
1670
+ throw new TypeError('visitor must be a function');
1671
+ }
1707
1672
 
1708
- if (
1709
- (isFileList = utils$1.isFileList(data)) ||
1710
- contentType.indexOf('multipart/form-data') > -1
1711
- ) {
1712
- const env = own(this, 'env');
1713
- const _FormData = env && env.FormData;
1673
+ function convertValue(value) {
1674
+ if (value === null) return '';
1714
1675
 
1715
- return toFormData$1(
1716
- isFileList ? { 'files[]': data } : data,
1717
- _FormData && new _FormData(),
1718
- formSerializer
1719
- );
1720
- }
1721
- }
1676
+ if (utils$1.isDate(value)) {
1677
+ return value.toISOString();
1678
+ }
1722
1679
 
1723
- if (isObjectPayload || hasJSONContentType) {
1724
- headers.setContentType('application/json', false);
1725
- return stringifySafely(data);
1726
- }
1680
+ if (utils$1.isBoolean(value)) {
1681
+ return value.toString();
1682
+ }
1727
1683
 
1728
- return data;
1729
- },
1730
- ],
1684
+ if (!useBlob && utils$1.isBlob(value)) {
1685
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1686
+ }
1731
1687
 
1732
- transformResponse: [
1733
- function transformResponse(data) {
1734
- const transitional = own(this, 'transitional') || defaults.transitional;
1735
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1736
- const responseType = own(this, 'responseType');
1737
- const JSONRequested = responseType === 'json';
1688
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1689
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1690
+ }
1738
1691
 
1739
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1740
- return data;
1741
- }
1692
+ return value;
1693
+ }
1742
1694
 
1743
- if (
1744
- data &&
1745
- utils$1.isString(data) &&
1746
- ((forcedJSONParsing && !responseType) || JSONRequested)
1747
- ) {
1748
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
1749
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
1695
+ /**
1696
+ * Default visitor.
1697
+ *
1698
+ * @param {*} value
1699
+ * @param {String|Number} key
1700
+ * @param {Array<String|Number>} path
1701
+ * @this {FormData}
1702
+ *
1703
+ * @returns {boolean} return true to visit the each prop of the value recursively
1704
+ */
1705
+ function defaultVisitor(value, key, path) {
1706
+ let arr = value;
1750
1707
 
1751
- try {
1752
- return JSON.parse(data, own(this, 'parseReviver'));
1753
- } catch (e) {
1754
- if (strictJSONParsing) {
1755
- if (e.name === 'SyntaxError') {
1756
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
1757
- }
1758
- throw e;
1759
- }
1760
- }
1761
- }
1708
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
1709
+ formData.append(renderKey(path, key, dots), convertValue(value));
1710
+ return false;
1711
+ }
1762
1712
 
1763
- return data;
1764
- },
1765
- ],
1713
+ if (value && !path && typeof value === 'object') {
1714
+ if (utils$1.endsWith(key, '{}')) {
1715
+ // eslint-disable-next-line no-param-reassign
1716
+ key = metaTokens ? key : key.slice(0, -2);
1717
+ // eslint-disable-next-line no-param-reassign
1718
+ value = JSON.stringify(value);
1719
+ } else if (
1720
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1721
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
1722
+ ) {
1723
+ // eslint-disable-next-line no-param-reassign
1724
+ key = removeBrackets(key);
1766
1725
 
1767
- /**
1768
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1769
- * timeout is not created.
1770
- */
1771
- timeout: 0,
1726
+ arr.forEach(function each(el, index) {
1727
+ !(utils$1.isUndefined(el) || el === null) &&
1728
+ formData.append(
1729
+ // eslint-disable-next-line no-nested-ternary
1730
+ indexes === true
1731
+ ? renderKey([key], index, dots)
1732
+ : indexes === null
1733
+ ? key
1734
+ : key + '[]',
1735
+ convertValue(el)
1736
+ );
1737
+ });
1738
+ return false;
1739
+ }
1740
+ }
1772
1741
 
1773
- xsrfCookieName: 'XSRF-TOKEN',
1774
- xsrfHeaderName: 'X-XSRF-TOKEN',
1742
+ if (isVisitable(value)) {
1743
+ return true;
1744
+ }
1775
1745
 
1776
- maxContentLength: -1,
1777
- maxBodyLength: -1,
1746
+ formData.append(renderKey(path, key, dots), convertValue(value));
1778
1747
 
1779
- env: {
1780
- FormData: platform.classes.FormData,
1781
- Blob: platform.classes.Blob,
1782
- },
1748
+ return false;
1749
+ }
1783
1750
 
1784
- validateStatus: function validateStatus(status) {
1785
- return status >= 200 && status < 300;
1786
- },
1751
+ const stack = [];
1787
1752
 
1788
- headers: {
1789
- common: {
1790
- Accept: 'application/json, text/plain, */*',
1791
- 'Content-Type': undefined,
1792
- },
1793
- },
1794
- };
1753
+ const exposedHelpers = Object.assign(predicates, {
1754
+ defaultVisitor,
1755
+ convertValue,
1756
+ isVisitable,
1757
+ });
1795
1758
 
1796
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1797
- defaults.headers[method] = {};
1798
- });
1759
+ function build(value, path, depth = 0) {
1760
+ if (utils$1.isUndefined(value)) return;
1799
1761
 
1800
- // RawAxiosHeaders whose duplicates are ignored by node
1801
- // c.f. https://nodejs.org/api/http.html#http_message_headers
1802
- const ignoreDuplicateOf = utils$1.toObjectSet([
1803
- 'age',
1804
- 'authorization',
1805
- 'content-length',
1806
- 'content-type',
1807
- 'etag',
1808
- 'expires',
1809
- 'from',
1810
- 'host',
1811
- 'if-modified-since',
1812
- 'if-unmodified-since',
1813
- 'last-modified',
1814
- 'location',
1815
- 'max-forwards',
1816
- 'proxy-authorization',
1817
- 'referer',
1818
- 'retry-after',
1819
- 'user-agent',
1820
- ]);
1762
+ if (depth > maxDepth) {
1763
+ throw new AxiosError$1(
1764
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
1765
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
1766
+ );
1767
+ }
1821
1768
 
1822
- /**
1823
- * Parse headers into an object
1824
- *
1825
- * ```
1826
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
1827
- * Content-Type: application/json
1828
- * Connection: keep-alive
1829
- * Transfer-Encoding: chunked
1830
- * ```
1831
- *
1832
- * @param {String} rawHeaders Headers needing to be parsed
1833
- *
1834
- * @returns {Object} Headers parsed into an object
1835
- */
1836
- var parseHeaders = (rawHeaders) => {
1837
- const parsed = {};
1838
- let key;
1839
- let val;
1840
- let i;
1769
+ if (stack.indexOf(value) !== -1) {
1770
+ throw Error('Circular reference detected in ' + path.join('.'));
1771
+ }
1841
1772
 
1842
- rawHeaders &&
1843
- rawHeaders.split('\n').forEach(function parser(line) {
1844
- i = line.indexOf(':');
1845
- key = line.substring(0, i).trim().toLowerCase();
1846
- val = line.substring(i + 1).trim();
1773
+ stack.push(value);
1847
1774
 
1848
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1849
- return;
1850
- }
1775
+ utils$1.forEach(value, function each(el, key) {
1776
+ const result =
1777
+ !(utils$1.isUndefined(el) || el === null) &&
1778
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
1851
1779
 
1852
- if (key === 'set-cookie') {
1853
- if (parsed[key]) {
1854
- parsed[key].push(val);
1855
- } else {
1856
- parsed[key] = [val];
1857
- }
1858
- } else {
1859
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1780
+ if (result === true) {
1781
+ build(el, path ? path.concat(key) : [key], depth + 1);
1860
1782
  }
1861
1783
  });
1862
1784
 
1863
- return parsed;
1864
- };
1785
+ stack.pop();
1786
+ }
1865
1787
 
1866
- const $internals = Symbol('internals');
1788
+ if (!utils$1.isObject(obj)) {
1789
+ throw new TypeError('data must be an object');
1790
+ }
1867
1791
 
1868
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1792
+ build(obj);
1869
1793
 
1870
- function trimSPorHTAB(str) {
1871
- let start = 0;
1872
- let end = str.length;
1794
+ return formData;
1795
+ }
1873
1796
 
1874
- while (start < end) {
1875
- const code = str.charCodeAt(start);
1797
+ /**
1798
+ * It encodes a string by replacing all characters that are not in the unreserved set with
1799
+ * their percent-encoded equivalents
1800
+ *
1801
+ * @param {string} str - The string to encode.
1802
+ *
1803
+ * @returns {string} The encoded string.
1804
+ */
1805
+ function encode$1(str) {
1806
+ const charMap = {
1807
+ '!': '%21',
1808
+ "'": '%27',
1809
+ '(': '%28',
1810
+ ')': '%29',
1811
+ '~': '%7E',
1812
+ '%20': '+',
1813
+ };
1814
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
1815
+ return charMap[match];
1816
+ });
1817
+ }
1876
1818
 
1877
- if (code !== 0x09 && code !== 0x20) {
1878
- break;
1879
- }
1819
+ /**
1820
+ * It takes a params object and converts it to a FormData object
1821
+ *
1822
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1823
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1824
+ *
1825
+ * @returns {void}
1826
+ */
1827
+ function AxiosURLSearchParams(params, options) {
1828
+ this._pairs = [];
1829
+
1830
+ params && toFormData$1(params, this, options);
1831
+ }
1832
+
1833
+ const prototype = AxiosURLSearchParams.prototype;
1834
+
1835
+ prototype.append = function append(name, value) {
1836
+ this._pairs.push([name, value]);
1837
+ };
1880
1838
 
1881
- start += 1;
1882
- }
1839
+ prototype.toString = function toString(encoder) {
1840
+ const _encode = encoder
1841
+ ? function (value) {
1842
+ return encoder.call(this, value, encode$1);
1843
+ }
1844
+ : encode$1;
1883
1845
 
1884
- while (end > start) {
1885
- const code = str.charCodeAt(end - 1);
1846
+ return this._pairs
1847
+ .map(function each(pair) {
1848
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
1849
+ }, '')
1850
+ .join('&');
1851
+ };
1886
1852
 
1887
- if (code !== 0x09 && code !== 0x20) {
1888
- break;
1889
- }
1853
+ /**
1854
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
1855
+ * their plain counterparts (`:`, `$`, `,`, `+`).
1856
+ *
1857
+ * @param {string} val The value to be encoded.
1858
+ *
1859
+ * @returns {string} The encoded value.
1860
+ */
1861
+ function encode(val) {
1862
+ return encodeURIComponent(val)
1863
+ .replace(/%3A/gi, ':')
1864
+ .replace(/%24/g, '$')
1865
+ .replace(/%2C/gi, ',')
1866
+ .replace(/%20/g, '+');
1867
+ }
1890
1868
 
1891
- end -= 1;
1869
+ /**
1870
+ * Build a URL by appending params to the end
1871
+ *
1872
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1873
+ * @param {object} [params] The params to be appended
1874
+ * @param {?(object|Function)} options
1875
+ *
1876
+ * @returns {string} The formatted url
1877
+ */
1878
+ function buildURL(url, params, options) {
1879
+ if (!params) {
1880
+ return url;
1892
1881
  }
1893
1882
 
1894
- return start === 0 && end === str.length ? str : str.slice(start, end);
1895
- }
1883
+ const _encode = (options && options.encode) || encode;
1896
1884
 
1897
- function normalizeHeader(header) {
1898
- return header && String(header).trim().toLowerCase();
1899
- }
1885
+ const _options = utils$1.isFunction(options)
1886
+ ? {
1887
+ serialize: options,
1888
+ }
1889
+ : options;
1900
1890
 
1901
- function sanitizeHeaderValue(str) {
1902
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1903
- }
1891
+ const serializeFn = _options && _options.serialize;
1904
1892
 
1905
- function normalizeValue(value) {
1906
- if (value === false || value == null) {
1907
- return value;
1908
- }
1893
+ let serializedParams;
1909
1894
 
1910
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
1911
- }
1895
+ if (serializeFn) {
1896
+ serializedParams = serializeFn(params, _options);
1897
+ } else {
1898
+ serializedParams = utils$1.isURLSearchParams(params)
1899
+ ? params.toString()
1900
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
1901
+ }
1912
1902
 
1913
- function parseTokens(str) {
1914
- const tokens = Object.create(null);
1915
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1916
- let match;
1903
+ if (serializedParams) {
1904
+ const hashmarkIndex = url.indexOf('#');
1917
1905
 
1918
- while ((match = tokensRE.exec(str))) {
1919
- tokens[match[1]] = match[2];
1906
+ if (hashmarkIndex !== -1) {
1907
+ url = url.slice(0, hashmarkIndex);
1908
+ }
1909
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1920
1910
  }
1921
1911
 
1922
- return tokens;
1912
+ return url;
1923
1913
  }
1924
1914
 
1925
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1926
-
1927
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1928
- if (utils$1.isFunction(filter)) {
1929
- return filter.call(this, value, header);
1915
+ class InterceptorManager {
1916
+ constructor() {
1917
+ this.handlers = [];
1930
1918
  }
1931
1919
 
1932
- if (isHeaderNameFilter) {
1933
- value = header;
1920
+ /**
1921
+ * Add a new interceptor to the stack
1922
+ *
1923
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1924
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1925
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
1926
+ *
1927
+ * @return {Number} An ID used to remove interceptor later
1928
+ */
1929
+ use(fulfilled, rejected, options) {
1930
+ this.handlers.push({
1931
+ fulfilled,
1932
+ rejected,
1933
+ synchronous: options ? options.synchronous : false,
1934
+ runWhen: options ? options.runWhen : null,
1935
+ });
1936
+ return this.handlers.length - 1;
1934
1937
  }
1935
1938
 
1936
- if (!utils$1.isString(value)) return;
1937
-
1938
- if (utils$1.isString(filter)) {
1939
- return value.indexOf(filter) !== -1;
1939
+ /**
1940
+ * Remove an interceptor from the stack
1941
+ *
1942
+ * @param {Number} id The ID that was returned by `use`
1943
+ *
1944
+ * @returns {void}
1945
+ */
1946
+ eject(id) {
1947
+ if (this.handlers[id]) {
1948
+ this.handlers[id] = null;
1949
+ }
1940
1950
  }
1941
1951
 
1942
- if (utils$1.isRegExp(filter)) {
1943
- return filter.test(value);
1952
+ /**
1953
+ * Clear all interceptors from the stack
1954
+ *
1955
+ * @returns {void}
1956
+ */
1957
+ clear() {
1958
+ if (this.handlers) {
1959
+ this.handlers = [];
1960
+ }
1944
1961
  }
1945
- }
1946
1962
 
1947
- function formatHeader(header) {
1948
- return header
1949
- .trim()
1950
- .toLowerCase()
1951
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1952
- return char.toUpperCase() + str;
1963
+ /**
1964
+ * Iterate over all the registered interceptors
1965
+ *
1966
+ * This method is particularly useful for skipping over any
1967
+ * interceptors that may have become `null` calling `eject`.
1968
+ *
1969
+ * @param {Function} fn The function to call for each interceptor
1970
+ *
1971
+ * @returns {void}
1972
+ */
1973
+ forEach(fn) {
1974
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1975
+ if (h !== null) {
1976
+ fn(h);
1977
+ }
1953
1978
  });
1979
+ }
1954
1980
  }
1955
1981
 
1956
- function buildAccessors(obj, header) {
1957
- const accessorName = utils$1.toCamelCase(' ' + header);
1958
-
1959
- ['get', 'set', 'has'].forEach((methodName) => {
1960
- Object.defineProperty(obj, methodName + accessorName, {
1961
- value: function (arg1, arg2, arg3) {
1962
- return this[methodName].call(this, header, arg1, arg2, arg3);
1963
- },
1964
- configurable: true,
1965
- });
1966
- });
1967
- }
1982
+ var transitionalDefaults = {
1983
+ silentJSONParsing: true,
1984
+ forcedJSONParsing: true,
1985
+ clarifyTimeoutError: false,
1986
+ legacyInterceptorReqResOrdering: true,
1987
+ };
1968
1988
 
1969
- let AxiosHeaders$1 = class AxiosHeaders {
1970
- constructor(headers) {
1971
- headers && this.set(headers);
1972
- }
1989
+ var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1973
1990
 
1974
- set(header, valueOrRewrite, rewrite) {
1975
- const self = this;
1991
+ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1976
1992
 
1977
- function setHeader(_value, _header, _rewrite) {
1978
- const lHeader = normalizeHeader(_header);
1993
+ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1979
1994
 
1980
- if (!lHeader) {
1981
- throw new Error('header name must be a non-empty string');
1982
- }
1995
+ var platform$1 = {
1996
+ isBrowser: true,
1997
+ classes: {
1998
+ URLSearchParams: URLSearchParams$1,
1999
+ FormData: FormData$1,
2000
+ Blob: Blob$1,
2001
+ },
2002
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
2003
+ };
1983
2004
 
1984
- const key = utils$1.findKey(self, lHeader);
2005
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1985
2006
 
1986
- if (
1987
- !key ||
1988
- self[key] === undefined ||
1989
- _rewrite === true ||
1990
- (_rewrite === undefined && self[key] !== false)
1991
- ) {
1992
- self[key || _header] = normalizeValue(_value);
1993
- }
1994
- }
2007
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
1995
2008
 
1996
- const setHeaders = (headers, _rewrite) =>
1997
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2009
+ /**
2010
+ * Determine if we're running in a standard browser environment
2011
+ *
2012
+ * This allows axios to run in a web worker, and react-native.
2013
+ * Both environments support XMLHttpRequest, but not fully standard globals.
2014
+ *
2015
+ * web workers:
2016
+ * typeof window -> undefined
2017
+ * typeof document -> undefined
2018
+ *
2019
+ * react-native:
2020
+ * navigator.product -> 'ReactNative'
2021
+ * nativescript
2022
+ * navigator.product -> 'NativeScript' or 'NS'
2023
+ *
2024
+ * @returns {boolean}
2025
+ */
2026
+ const hasStandardBrowserEnv =
2027
+ hasBrowserEnv &&
2028
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1998
2029
 
1999
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
2000
- setHeaders(header, valueOrRewrite);
2001
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2002
- setHeaders(parseHeaders(header), valueOrRewrite);
2003
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
2004
- let obj = {},
2005
- dest,
2006
- key;
2007
- for (const entry of header) {
2008
- if (!utils$1.isArray(entry)) {
2009
- throw TypeError('Object iterator must return a key-value pair');
2010
- }
2030
+ /**
2031
+ * Determine if we're running in a standard browser webWorker environment
2032
+ *
2033
+ * Although the `isStandardBrowserEnv` method indicates that
2034
+ * `allows axios to run in a web worker`, the WebWorker will still be
2035
+ * filtered out due to its judgment standard
2036
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
2037
+ * This leads to a problem when axios post `FormData` in webWorker
2038
+ */
2039
+ const hasStandardBrowserWebWorkerEnv = (() => {
2040
+ return (
2041
+ typeof WorkerGlobalScope !== 'undefined' &&
2042
+ // eslint-disable-next-line no-undef
2043
+ self instanceof WorkerGlobalScope &&
2044
+ typeof self.importScripts === 'function'
2045
+ );
2046
+ })();
2011
2047
 
2012
- obj[(key = entry[0])] = (dest = obj[key])
2013
- ? utils$1.isArray(dest)
2014
- ? [...dest, entry[1]]
2015
- : [dest, entry[1]]
2016
- : entry[1];
2017
- }
2048
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
2018
2049
 
2019
- setHeaders(obj, valueOrRewrite);
2020
- } else {
2021
- header != null && setHeader(valueOrRewrite, header, rewrite);
2022
- }
2050
+ var utils = /*#__PURE__*/Object.freeze({
2051
+ __proto__: null,
2052
+ hasBrowserEnv: hasBrowserEnv,
2053
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
2054
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
2055
+ navigator: _navigator,
2056
+ origin: origin
2057
+ });
2023
2058
 
2024
- return this;
2025
- }
2059
+ var platform = {
2060
+ ...utils,
2061
+ ...platform$1,
2062
+ };
2026
2063
 
2027
- get(header, parser) {
2028
- header = normalizeHeader(header);
2064
+ function toURLEncodedForm(data, options) {
2065
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
2066
+ visitor: function (value, key, path, helpers) {
2067
+ if (platform.isNode && utils$1.isBuffer(value)) {
2068
+ this.append(key, value.toString('base64'));
2069
+ return false;
2070
+ }
2029
2071
 
2030
- if (header) {
2031
- const key = utils$1.findKey(this, header);
2072
+ return helpers.defaultVisitor.apply(this, arguments);
2073
+ },
2074
+ ...options,
2075
+ });
2076
+ }
2032
2077
 
2033
- if (key) {
2034
- const value = this[key];
2078
+ /**
2079
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
2080
+ *
2081
+ * @param {string} name - The name of the property to get.
2082
+ *
2083
+ * @returns An array of strings.
2084
+ */
2085
+ function parsePropPath(name) {
2086
+ // foo[x][y][z]
2087
+ // foo.x.y.z
2088
+ // foo-x-y-z
2089
+ // foo x y z
2090
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
2091
+ return match[0] === '[]' ? '' : match[1] || match[0];
2092
+ });
2093
+ }
2035
2094
 
2036
- if (!parser) {
2037
- return value;
2038
- }
2095
+ /**
2096
+ * Convert an array to an object.
2097
+ *
2098
+ * @param {Array<any>} arr - The array to convert to an object.
2099
+ *
2100
+ * @returns An object with the same keys and values as the array.
2101
+ */
2102
+ function arrayToObject(arr) {
2103
+ const obj = {};
2104
+ const keys = Object.keys(arr);
2105
+ let i;
2106
+ const len = keys.length;
2107
+ let key;
2108
+ for (i = 0; i < len; i++) {
2109
+ key = keys[i];
2110
+ obj[key] = arr[key];
2111
+ }
2112
+ return obj;
2113
+ }
2039
2114
 
2040
- if (parser === true) {
2041
- return parseTokens(value);
2042
- }
2115
+ /**
2116
+ * It takes a FormData object and returns a JavaScript object
2117
+ *
2118
+ * @param {string} formData The FormData object to convert to JSON.
2119
+ *
2120
+ * @returns {Object<string, any> | null} The converted object.
2121
+ */
2122
+ function formDataToJSON(formData) {
2123
+ function buildPath(path, value, target, index) {
2124
+ let name = path[index++];
2043
2125
 
2044
- if (utils$1.isFunction(parser)) {
2045
- return parser.call(this, value, key);
2046
- }
2126
+ if (name === '__proto__') return true;
2047
2127
 
2048
- if (utils$1.isRegExp(parser)) {
2049
- return parser.exec(value);
2050
- }
2128
+ const isNumericKey = Number.isFinite(+name);
2129
+ const isLast = index >= path.length;
2130
+ name = !name && utils$1.isArray(target) ? target.length : name;
2051
2131
 
2052
- throw new TypeError('parser must be boolean|regexp|function');
2132
+ if (isLast) {
2133
+ if (utils$1.hasOwnProp(target, name)) {
2134
+ target[name] = utils$1.isArray(target[name])
2135
+ ? target[name].concat(value)
2136
+ : [target[name], value];
2137
+ } else {
2138
+ target[name] = value;
2053
2139
  }
2140
+
2141
+ return !isNumericKey;
2054
2142
  }
2055
- }
2056
2143
 
2057
- has(header, matcher) {
2058
- header = normalizeHeader(header);
2144
+ if (!target[name] || !utils$1.isObject(target[name])) {
2145
+ target[name] = [];
2146
+ }
2059
2147
 
2060
- if (header) {
2061
- const key = utils$1.findKey(this, header);
2148
+ const result = buildPath(path, value, target[name], index);
2062
2149
 
2063
- return !!(
2064
- key &&
2065
- this[key] !== undefined &&
2066
- (!matcher || matchHeaderValue(this, this[key], key, matcher))
2067
- );
2150
+ if (result && utils$1.isArray(target[name])) {
2151
+ target[name] = arrayToObject(target[name]);
2068
2152
  }
2069
2153
 
2070
- return false;
2154
+ return !isNumericKey;
2071
2155
  }
2072
2156
 
2073
- delete(header, matcher) {
2074
- const self = this;
2075
- let deleted = false;
2076
-
2077
- function deleteHeader(_header) {
2078
- _header = normalizeHeader(_header);
2079
-
2080
- if (_header) {
2081
- const key = utils$1.findKey(self, _header);
2082
-
2083
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
2084
- delete self[key];
2085
-
2086
- deleted = true;
2087
- }
2088
- }
2089
- }
2157
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
2158
+ const obj = {};
2090
2159
 
2091
- if (utils$1.isArray(header)) {
2092
- header.forEach(deleteHeader);
2093
- } else {
2094
- deleteHeader(header);
2095
- }
2160
+ utils$1.forEachEntry(formData, (name, value) => {
2161
+ buildPath(parsePropPath(name), value, obj, 0);
2162
+ });
2096
2163
 
2097
- return deleted;
2164
+ return obj;
2098
2165
  }
2099
2166
 
2100
- clear(matcher) {
2101
- const keys = Object.keys(this);
2102
- let i = keys.length;
2103
- let deleted = false;
2167
+ return null;
2168
+ }
2104
2169
 
2105
- while (i--) {
2106
- const key = keys[i];
2107
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
2108
- delete this[key];
2109
- deleted = true;
2170
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
2171
+
2172
+ /**
2173
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
2174
+ * of the input
2175
+ *
2176
+ * @param {any} rawValue - The value to be stringified.
2177
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
2178
+ * @param {Function} encoder - A function that takes a value and returns a string.
2179
+ *
2180
+ * @returns {string} A stringified version of the rawValue.
2181
+ */
2182
+ function stringifySafely(rawValue, parser, encoder) {
2183
+ if (utils$1.isString(rawValue)) {
2184
+ try {
2185
+ (parser || JSON.parse)(rawValue);
2186
+ return utils$1.trim(rawValue);
2187
+ } catch (e) {
2188
+ if (e.name !== 'SyntaxError') {
2189
+ throw e;
2110
2190
  }
2111
2191
  }
2112
-
2113
- return deleted;
2114
2192
  }
2115
2193
 
2116
- normalize(format) {
2117
- const self = this;
2118
- const headers = {};
2194
+ return (encoder || JSON.stringify)(rawValue);
2195
+ }
2119
2196
 
2120
- utils$1.forEach(this, (value, header) => {
2121
- const key = utils$1.findKey(headers, header);
2197
+ const defaults = {
2198
+ transitional: transitionalDefaults,
2122
2199
 
2123
- if (key) {
2124
- self[key] = normalizeValue(value);
2125
- delete self[header];
2126
- return;
2127
- }
2200
+ adapter: ['xhr', 'http', 'fetch'],
2128
2201
 
2129
- const normalized = format ? formatHeader(header) : String(header).trim();
2202
+ transformRequest: [
2203
+ function transformRequest(data, headers) {
2204
+ const contentType = headers.getContentType() || '';
2205
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
2206
+ const isObjectPayload = utils$1.isObject(data);
2130
2207
 
2131
- if (normalized !== header) {
2132
- delete self[header];
2208
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
2209
+ data = new FormData(data);
2133
2210
  }
2134
2211
 
2135
- self[normalized] = normalizeValue(value);
2136
-
2137
- headers[normalized] = true;
2138
- });
2212
+ const isFormData = utils$1.isFormData(data);
2139
2213
 
2140
- return this;
2141
- }
2214
+ if (isFormData) {
2215
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2216
+ }
2142
2217
 
2143
- concat(...targets) {
2144
- return this.constructor.concat(this, ...targets);
2145
- }
2218
+ if (
2219
+ utils$1.isArrayBuffer(data) ||
2220
+ utils$1.isBuffer(data) ||
2221
+ utils$1.isStream(data) ||
2222
+ utils$1.isFile(data) ||
2223
+ utils$1.isBlob(data) ||
2224
+ utils$1.isReadableStream(data)
2225
+ ) {
2226
+ return data;
2227
+ }
2228
+ if (utils$1.isArrayBufferView(data)) {
2229
+ return data.buffer;
2230
+ }
2231
+ if (utils$1.isURLSearchParams(data)) {
2232
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
2233
+ return data.toString();
2234
+ }
2146
2235
 
2147
- toJSON(asStrings) {
2148
- const obj = Object.create(null);
2236
+ let isFileList;
2149
2237
 
2150
- utils$1.forEach(this, (value, header) => {
2151
- value != null &&
2152
- value !== false &&
2153
- (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
2154
- });
2238
+ if (isObjectPayload) {
2239
+ const formSerializer = own(this, 'formSerializer');
2240
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
2241
+ return toURLEncodedForm(data, formSerializer).toString();
2242
+ }
2155
2243
 
2156
- return obj;
2157
- }
2244
+ if (
2245
+ (isFileList = utils$1.isFileList(data)) ||
2246
+ contentType.indexOf('multipart/form-data') > -1
2247
+ ) {
2248
+ const env = own(this, 'env');
2249
+ const _FormData = env && env.FormData;
2158
2250
 
2159
- [Symbol.iterator]() {
2160
- return Object.entries(this.toJSON())[Symbol.iterator]();
2161
- }
2251
+ return toFormData$1(
2252
+ isFileList ? { 'files[]': data } : data,
2253
+ _FormData && new _FormData(),
2254
+ formSerializer
2255
+ );
2256
+ }
2257
+ }
2162
2258
 
2163
- toString() {
2164
- return Object.entries(this.toJSON())
2165
- .map(([header, value]) => header + ': ' + value)
2166
- .join('\n');
2167
- }
2259
+ if (isObjectPayload || hasJSONContentType) {
2260
+ headers.setContentType('application/json', false);
2261
+ return stringifySafely(data);
2262
+ }
2168
2263
 
2169
- getSetCookie() {
2170
- return this.get('set-cookie') || [];
2171
- }
2264
+ return data;
2265
+ },
2266
+ ],
2172
2267
 
2173
- get [Symbol.toStringTag]() {
2174
- return 'AxiosHeaders';
2175
- }
2268
+ transformResponse: [
2269
+ function transformResponse(data) {
2270
+ const transitional = own(this, 'transitional') || defaults.transitional;
2271
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2272
+ const responseType = own(this, 'responseType');
2273
+ const JSONRequested = responseType === 'json';
2176
2274
 
2177
- static from(thing) {
2178
- return thing instanceof this ? thing : new this(thing);
2179
- }
2275
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
2276
+ return data;
2277
+ }
2180
2278
 
2181
- static concat(first, ...targets) {
2182
- const computed = new this(first);
2279
+ if (
2280
+ data &&
2281
+ utils$1.isString(data) &&
2282
+ ((forcedJSONParsing && !responseType) || JSONRequested)
2283
+ ) {
2284
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
2285
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
2183
2286
 
2184
- targets.forEach((target) => computed.set(target));
2287
+ try {
2288
+ return JSON.parse(data, own(this, 'parseReviver'));
2289
+ } catch (e) {
2290
+ if (strictJSONParsing) {
2291
+ if (e.name === 'SyntaxError') {
2292
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
2293
+ }
2294
+ throw e;
2295
+ }
2296
+ }
2297
+ }
2185
2298
 
2186
- return computed;
2187
- }
2299
+ return data;
2300
+ },
2301
+ ],
2188
2302
 
2189
- static accessor(header) {
2190
- const internals =
2191
- (this[$internals] =
2192
- this[$internals] =
2193
- {
2194
- accessors: {},
2195
- });
2303
+ /**
2304
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
2305
+ * timeout is not created.
2306
+ */
2307
+ timeout: 0,
2196
2308
 
2197
- const accessors = internals.accessors;
2198
- const prototype = this.prototype;
2309
+ xsrfCookieName: 'XSRF-TOKEN',
2310
+ xsrfHeaderName: 'X-XSRF-TOKEN',
2199
2311
 
2200
- function defineAccessor(_header) {
2201
- const lHeader = normalizeHeader(_header);
2312
+ maxContentLength: -1,
2313
+ maxBodyLength: -1,
2202
2314
 
2203
- if (!accessors[lHeader]) {
2204
- buildAccessors(prototype, _header);
2205
- accessors[lHeader] = true;
2206
- }
2207
- }
2315
+ env: {
2316
+ FormData: platform.classes.FormData,
2317
+ Blob: platform.classes.Blob,
2318
+ },
2208
2319
 
2209
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2320
+ validateStatus: function validateStatus(status) {
2321
+ return status >= 200 && status < 300;
2322
+ },
2210
2323
 
2211
- return this;
2212
- }
2324
+ headers: {
2325
+ common: {
2326
+ Accept: 'application/json, text/plain, */*',
2327
+ 'Content-Type': undefined,
2328
+ },
2329
+ },
2213
2330
  };
2214
2331
 
2215
- AxiosHeaders$1.accessor([
2216
- 'Content-Type',
2217
- 'Content-Length',
2218
- 'Accept',
2219
- 'Accept-Encoding',
2220
- 'User-Agent',
2221
- 'Authorization',
2222
- ]);
2223
-
2224
- // reserved names hotfix
2225
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
2226
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2227
- return {
2228
- get: () => value,
2229
- set(headerValue) {
2230
- this[mapped] = headerValue;
2231
- },
2232
- };
2332
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
2333
+ defaults.headers[method] = {};
2233
2334
  });
2234
2335
 
2235
- utils$1.freezeMethods(AxiosHeaders$1);
2236
-
2237
2336
  /**
2238
2337
  * Transform the data for a request or a response
2239
2338
  *
@@ -2292,22 +2391,18 @@ function settle(resolve, reject, response) {
2292
2391
  if (!response.status || !validateStatus || validateStatus(response.status)) {
2293
2392
  resolve(response);
2294
2393
  } else {
2295
- reject(
2296
- new AxiosError$1(
2297
- 'Request failed with status code ' + response.status,
2298
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
2299
- Math.floor(response.status / 100) - 4
2300
- ],
2301
- response.config,
2302
- response.request,
2303
- response
2304
- )
2305
- );
2394
+ reject(new AxiosError$1(
2395
+ 'Request failed with status code ' + response.status,
2396
+ response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
2397
+ response.config,
2398
+ response.request,
2399
+ response
2400
+ ));
2306
2401
  }
2307
2402
  }
2308
2403
 
2309
2404
  function parseProtocol(url) {
2310
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2405
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
2311
2406
  return (match && match[1]) || '';
2312
2407
  }
2313
2408
 
@@ -2498,8 +2593,20 @@ var cookies = platform.hasStandardBrowserEnv
2498
2593
 
2499
2594
  read(name) {
2500
2595
  if (typeof document === 'undefined') return null;
2501
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
2502
- return match ? decodeURIComponent(match[1]) : null;
2596
+ // Match name=value by splitting on the semicolon separator instead of building a
2597
+ // RegExp from `name` interpolating an unescaped string into a RegExp would let
2598
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
2599
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
2600
+ // "; ", so ignore optional whitespace before each cookie name.
2601
+ const cookies = document.cookie.split(';');
2602
+ for (let i = 0; i < cookies.length; i++) {
2603
+ const cookie = cookies[i].replace(/^\s+/, '');
2604
+ const eq = cookie.indexOf('=');
2605
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
2606
+ return decodeURIComponent(cookie.slice(eq + 1));
2607
+ }
2608
+ }
2609
+ return null;
2503
2610
  },
2504
2611
 
2505
2612
  remove(name) {
@@ -2581,11 +2688,14 @@ function mergeConfig$1(config1, config2) {
2581
2688
  config2 = config2 || {};
2582
2689
 
2583
2690
  // Use a null-prototype object so that downstream reads such as `config.auth`
2584
- // or `config.baseURL` cannot inherit polluted values from Object.prototype
2585
- // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
2586
- // own slot to preserve ergonomics for user code that relies on it.
2691
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
2692
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
2693
+ // ergonomics for user code that relies on it.
2587
2694
  const config = Object.create(null);
2588
2695
  Object.defineProperty(config, 'hasOwnProperty', {
2696
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
2697
+ // this data descriptor into an accessor descriptor on the way in.
2698
+ __proto__: null,
2589
2699
  value: Object.prototype.hasOwnProperty,
2590
2700
  enumerable: false,
2591
2701
  writable: true,
@@ -2682,11 +2792,39 @@ function mergeConfig$1(config1, config2) {
2682
2792
  return config;
2683
2793
  }
2684
2794
 
2795
+ const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
2796
+
2797
+ function setFormDataHeaders(headers, formHeaders, policy) {
2798
+ if (policy !== 'content-only') {
2799
+ headers.set(formHeaders);
2800
+ return;
2801
+ }
2802
+
2803
+ Object.entries(formHeaders).forEach(([key, val]) => {
2804
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
2805
+ headers.set(key, val);
2806
+ }
2807
+ });
2808
+ }
2809
+
2810
+ /**
2811
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
2812
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
2813
+ *
2814
+ * @param {string} str The string to encode
2815
+ *
2816
+ * @returns {string} UTF-8 bytes as a Latin-1 string
2817
+ */
2818
+ const encodeUTF8 = (str) =>
2819
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
2820
+ String.fromCharCode(parseInt(hex, 16))
2821
+ );
2822
+
2685
2823
  var resolveConfig = (config) => {
2686
2824
  const newConfig = mergeConfig$1({}, config);
2687
2825
 
2688
2826
  // Read only own properties to prevent prototype pollution gadgets
2689
- // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
2827
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
2690
2828
  const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
2691
2829
 
2692
2830
  const data = own('data');
@@ -2712,11 +2850,7 @@ var resolveConfig = (config) => {
2712
2850
  headers.set(
2713
2851
  'Authorization',
2714
2852
  'Basic ' +
2715
- btoa(
2716
- (auth.username || '') +
2717
- ':' +
2718
- (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
2719
- )
2853
+ btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
2720
2854
  );
2721
2855
  }
2722
2856
 
@@ -2725,14 +2859,7 @@ var resolveConfig = (config) => {
2725
2859
  headers.setContentType(undefined); // browser handles it
2726
2860
  } else if (utils$1.isFunction(data.getHeaders)) {
2727
2861
  // Node.js FormData (like form-data package)
2728
- const formHeaders = data.getHeaders();
2729
- // Only set safe headers to avoid overwriting security headers
2730
- const allowedHeaders = ['content-type', 'content-length'];
2731
- Object.entries(formHeaders).forEach(([key, val]) => {
2732
- if (allowedHeaders.includes(key.toLowerCase())) {
2733
- headers.set(key, val);
2734
- }
2735
- });
2862
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
2736
2863
  }
2737
2864
  }
2738
2865
 
@@ -2747,10 +2874,9 @@ var resolveConfig = (config) => {
2747
2874
 
2748
2875
  // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
2749
2876
  // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
2750
- // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
2877
+ // the XSRF token cross-origin.
2751
2878
  const shouldSendXSRF =
2752
- withXSRFToken === true ||
2753
- (withXSRFToken == null && isURLSameOrigin(newConfig.url));
2879
+ withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
2754
2880
 
2755
2881
  if (shouldSendXSRF) {
2756
2882
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -2846,7 +2972,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2846
2972
  // will return status as 0 even though it's a successful request
2847
2973
  if (
2848
2974
  request.status === 0 &&
2849
- !(request.responseURL && request.responseURL.indexOf('file:') === 0)
2975
+ !(request.responseURL && request.responseURL.startsWith('file:'))
2850
2976
  ) {
2851
2977
  return;
2852
2978
  }
@@ -2863,6 +2989,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2863
2989
  }
2864
2990
 
2865
2991
  reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2992
+ done();
2866
2993
 
2867
2994
  // Clean up request
2868
2995
  request = null;
@@ -2878,6 +3005,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2878
3005
  // attach the underlying event for consumers who want details
2879
3006
  err.event = event || null;
2880
3007
  reject(err);
3008
+ done();
2881
3009
  request = null;
2882
3010
  };
2883
3011
 
@@ -2898,6 +3026,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2898
3026
  request
2899
3027
  )
2900
3028
  );
3029
+ done();
2901
3030
 
2902
3031
  // Clean up request
2903
3032
  request = null;
@@ -2947,6 +3076,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2947
3076
  }
2948
3077
  reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2949
3078
  request.abort();
3079
+ done();
2950
3080
  request = null;
2951
3081
  };
2952
3082
 
@@ -2960,7 +3090,7 @@ var xhrAdapter = isXHRAdapterSupported &&
2960
3090
 
2961
3091
  const protocol = parseProtocol(_config.url);
2962
3092
 
2963
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
3093
+ if (protocol && !platform.protocols.includes(protocol)) {
2964
3094
  reject(
2965
3095
  new AxiosError$1(
2966
3096
  'Unsupported protocol ' + protocol + ':',
@@ -3117,16 +3247,112 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
3117
3247
  );
3118
3248
  };
3119
3249
 
3120
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
3250
+ /**
3251
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
3252
+ * - For base64: compute exact decoded size using length and padding;
3253
+ * handle %XX at the character-count level (no string allocation).
3254
+ * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
3255
+ *
3256
+ * @param {string} url
3257
+ * @returns {number}
3258
+ */
3259
+ function estimateDataURLDecodedBytes(url) {
3260
+ if (!url || typeof url !== 'string') return 0;
3261
+ if (!url.startsWith('data:')) return 0;
3262
+
3263
+ const comma = url.indexOf(',');
3264
+ if (comma < 0) return 0;
3265
+
3266
+ const meta = url.slice(5, comma);
3267
+ const body = url.slice(comma + 1);
3268
+ const isBase64 = /;base64/i.test(meta);
3269
+
3270
+ if (isBase64) {
3271
+ let effectiveLen = body.length;
3272
+ const len = body.length; // cache length
3273
+
3274
+ for (let i = 0; i < len; i++) {
3275
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
3276
+ const a = body.charCodeAt(i + 1);
3277
+ const b = body.charCodeAt(i + 2);
3278
+ const isHex =
3279
+ ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
3280
+ ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
3281
+
3282
+ if (isHex) {
3283
+ effectiveLen -= 2;
3284
+ i += 2;
3285
+ }
3286
+ }
3287
+ }
3121
3288
 
3122
- const { isFunction } = utils$1;
3289
+ let pad = 0;
3290
+ let idx = len - 1;
3291
+
3292
+ const tailIsPct3D = (j) =>
3293
+ j >= 2 &&
3294
+ body.charCodeAt(j - 2) === 37 && // '%'
3295
+ body.charCodeAt(j - 1) === 51 && // '3'
3296
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
3297
+
3298
+ if (idx >= 0) {
3299
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
3300
+ pad++;
3301
+ idx--;
3302
+ } else if (tailIsPct3D(idx)) {
3303
+ pad++;
3304
+ idx -= 3;
3305
+ }
3306
+ }
3307
+
3308
+ if (pad === 1 && idx >= 0) {
3309
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
3310
+ pad++;
3311
+ } else if (tailIsPct3D(idx)) {
3312
+ pad++;
3313
+ }
3314
+ }
3315
+
3316
+ const groups = Math.floor(effectiveLen / 4);
3317
+ const bytes = groups * 3 - (pad || 0);
3318
+ return bytes > 0 ? bytes : 0;
3319
+ }
3320
+
3321
+ if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
3322
+ return Buffer.byteLength(body, 'utf8');
3323
+ }
3324
+
3325
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
3326
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
3327
+ // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
3328
+ // but 3 UTF-8 bytes).
3329
+ let bytes = 0;
3330
+ for (let i = 0, len = body.length; i < len; i++) {
3331
+ const c = body.charCodeAt(i);
3332
+ if (c < 0x80) {
3333
+ bytes += 1;
3334
+ } else if (c < 0x800) {
3335
+ bytes += 2;
3336
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
3337
+ const next = body.charCodeAt(i + 1);
3338
+ if (next >= 0xdc00 && next <= 0xdfff) {
3339
+ bytes += 4;
3340
+ i++;
3341
+ } else {
3342
+ bytes += 3;
3343
+ }
3344
+ } else {
3345
+ bytes += 3;
3346
+ }
3347
+ }
3348
+ return bytes;
3349
+ }
3350
+
3351
+ const VERSION$1 = "1.16.0";
3123
3352
 
3124
- const globalFetchAPI = (({ Request, Response }) => ({
3125
- Request,
3126
- Response,
3127
- }))(utils$1.global);
3353
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
3128
3354
 
3129
- const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
3355
+ const { isFunction } = utils$1;
3130
3356
 
3131
3357
  const test = (fn, ...args) => {
3132
3358
  try {
@@ -3137,11 +3363,17 @@ const test = (fn, ...args) => {
3137
3363
  };
3138
3364
 
3139
3365
  const factory = (env) => {
3366
+ const globalObject = utils$1.global ?? globalThis;
3367
+ const { ReadableStream, TextEncoder } = globalObject;
3368
+
3140
3369
  env = utils$1.merge.call(
3141
3370
  {
3142
3371
  skipUndefined: true,
3143
3372
  },
3144
- globalFetchAPI,
3373
+ {
3374
+ Request: globalObject.Request,
3375
+ Response: globalObject.Response,
3376
+ },
3145
3377
  env
3146
3378
  );
3147
3379
 
@@ -3154,7 +3386,7 @@ const factory = (env) => {
3154
3386
  return false;
3155
3387
  }
3156
3388
 
3157
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
3389
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
3158
3390
 
3159
3391
  const encodeText =
3160
3392
  isFetchSupported &&
@@ -3172,7 +3404,7 @@ const factory = (env) => {
3172
3404
  let duplexAccessed = false;
3173
3405
 
3174
3406
  const request = new Request(platform.origin, {
3175
- body: new ReadableStream$1(),
3407
+ body: new ReadableStream(),
3176
3408
  method: 'POST',
3177
3409
  get duplex() {
3178
3410
  duplexAccessed = true;
@@ -3268,8 +3500,13 @@ const factory = (env) => {
3268
3500
  headers,
3269
3501
  withCredentials = 'same-origin',
3270
3502
  fetchOptions,
3503
+ maxContentLength,
3504
+ maxBodyLength,
3271
3505
  } = resolveConfig(config);
3272
3506
 
3507
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
3508
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
3509
+
3273
3510
  let _fetch = envFetch || fetch;
3274
3511
 
3275
3512
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
@@ -3291,6 +3528,41 @@ const factory = (env) => {
3291
3528
  let requestContentLength;
3292
3529
 
3293
3530
  try {
3531
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
3532
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
3533
+ // "if (protocol === 'data:')" branch).
3534
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
3535
+ const estimated = estimateDataURLDecodedBytes(url);
3536
+ if (estimated > maxContentLength) {
3537
+ throw new AxiosError$1(
3538
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3539
+ AxiosError$1.ERR_BAD_RESPONSE,
3540
+ config,
3541
+ request
3542
+ );
3543
+ }
3544
+ }
3545
+
3546
+ // Enforce maxBodyLength against the outbound request body before dispatch.
3547
+ // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
3548
+ // maxBodyLength limit'). Skip when the body length cannot be determined
3549
+ // (e.g. a live ReadableStream supplied by the caller).
3550
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
3551
+ const outboundLength = await resolveBodyLength(headers, data);
3552
+ if (
3553
+ typeof outboundLength === 'number' &&
3554
+ isFinite(outboundLength) &&
3555
+ outboundLength > maxBodyLength
3556
+ ) {
3557
+ throw new AxiosError$1(
3558
+ 'Request body larger than maxBodyLength limit',
3559
+ AxiosError$1.ERR_BAD_REQUEST,
3560
+ config,
3561
+ request
3562
+ );
3563
+ }
3564
+ }
3565
+
3294
3566
  if (
3295
3567
  onUploadProgress &&
3296
3568
  supportsRequestStream &&
@@ -3341,6 +3613,9 @@ const factory = (env) => {
3341
3613
  }
3342
3614
  }
3343
3615
 
3616
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
3617
+ headers.set('User-Agent', 'axios/' + VERSION$1, false);
3618
+
3344
3619
  const resolvedOptions = {
3345
3620
  ...fetchOptions,
3346
3621
  signal: composedSignal,
@@ -3357,10 +3632,28 @@ const factory = (env) => {
3357
3632
  ? _fetch(request, fetchOptions)
3358
3633
  : _fetch(url, resolvedOptions));
3359
3634
 
3635
+ // Cheap pre-check: if the server honestly declares a content-length that
3636
+ // already exceeds the cap, reject before we start streaming.
3637
+ if (hasMaxContentLength) {
3638
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3639
+ if (declaredLength != null && declaredLength > maxContentLength) {
3640
+ throw new AxiosError$1(
3641
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3642
+ AxiosError$1.ERR_BAD_RESPONSE,
3643
+ config,
3644
+ request
3645
+ );
3646
+ }
3647
+ }
3648
+
3360
3649
  const isStreamResponse =
3361
3650
  supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3362
3651
 
3363
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
3652
+ if (
3653
+ supportsResponseStream &&
3654
+ response.body &&
3655
+ (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
3656
+ ) {
3364
3657
  const options = {};
3365
3658
 
3366
3659
  ['status', 'statusText', 'headers'].forEach((prop) => {
@@ -3377,8 +3670,24 @@ const factory = (env) => {
3377
3670
  )) ||
3378
3671
  [];
3379
3672
 
3673
+ let bytesRead = 0;
3674
+ const onChunkProgress = (loadedBytes) => {
3675
+ if (hasMaxContentLength) {
3676
+ bytesRead = loadedBytes;
3677
+ if (bytesRead > maxContentLength) {
3678
+ throw new AxiosError$1(
3679
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3680
+ AxiosError$1.ERR_BAD_RESPONSE,
3681
+ config,
3682
+ request
3683
+ );
3684
+ }
3685
+ }
3686
+ onProgress && onProgress(loadedBytes);
3687
+ };
3688
+
3380
3689
  response = new Response(
3381
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
3690
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
3382
3691
  flush && flush();
3383
3692
  unsubscribe && unsubscribe();
3384
3693
  }),
@@ -3393,6 +3702,33 @@ const factory = (env) => {
3393
3702
  config
3394
3703
  );
3395
3704
 
3705
+ // Fallback enforcement for environments without ReadableStream support
3706
+ // (legacy runtimes). Detect materialized size from typed output; skip
3707
+ // streams/Response passthrough since the user will read those themselves.
3708
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
3709
+ let materializedSize;
3710
+ if (responseData != null) {
3711
+ if (typeof responseData.byteLength === 'number') {
3712
+ materializedSize = responseData.byteLength;
3713
+ } else if (typeof responseData.size === 'number') {
3714
+ materializedSize = responseData.size;
3715
+ } else if (typeof responseData === 'string') {
3716
+ materializedSize =
3717
+ typeof TextEncoder === 'function'
3718
+ ? new TextEncoder().encode(responseData).byteLength
3719
+ : responseData.length;
3720
+ }
3721
+ }
3722
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
3723
+ throw new AxiosError$1(
3724
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
3725
+ AxiosError$1.ERR_BAD_RESPONSE,
3726
+ config,
3727
+ request
3728
+ );
3729
+ }
3730
+ }
3731
+
3396
3732
  !isStreamResponse && unsubscribe && unsubscribe();
3397
3733
 
3398
3734
  return await new Promise((resolve, reject) => {
@@ -3408,6 +3744,17 @@ const factory = (env) => {
3408
3744
  } catch (err) {
3409
3745
  unsubscribe && unsubscribe();
3410
3746
 
3747
+ // Safari can surface fetch aborts as a DOMException-like object whose
3748
+ // branded getters throw. Prefer our composed signal reason before reading
3749
+ // the caught error, preserving timeout vs cancellation semantics.
3750
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
3751
+ const canceledError = composedSignal.reason;
3752
+ canceledError.config = config;
3753
+ request && (canceledError.request = request);
3754
+ err !== canceledError && (canceledError.cause = err);
3755
+ throw canceledError;
3756
+ }
3757
+
3411
3758
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3412
3759
  throw Object.assign(
3413
3760
  new AxiosError$1(
@@ -3476,11 +3823,13 @@ const knownAdapters = {
3476
3823
  utils$1.forEach(knownAdapters, (fn, value) => {
3477
3824
  if (fn) {
3478
3825
  try {
3479
- Object.defineProperty(fn, 'name', { value });
3826
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
3827
+ // these data descriptors into accessor descriptors on the way in.
3828
+ Object.defineProperty(fn, 'name', { __proto__: null, value });
3480
3829
  } catch (e) {
3481
3830
  // eslint-disable-next-line no-empty
3482
3831
  }
3483
- Object.defineProperty(fn, 'adapterName', { value });
3832
+ Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
3484
3833
  }
3485
3834
  });
3486
3835
 
@@ -3622,8 +3971,15 @@ function dispatchRequest(config) {
3622
3971
  function onAdapterResolution(response) {
3623
3972
  throwIfCancellationRequested(config);
3624
3973
 
3625
- // Transform response data
3626
- response.data = transformData.call(config, config.transformResponse, response);
3974
+ // Expose the current response on config so that transformResponse can
3975
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
3976
+ // We clean it up afterwards to avoid polluting the config object.
3977
+ config.response = response;
3978
+ try {
3979
+ response.data = transformData.call(config, config.transformResponse, response);
3980
+ } finally {
3981
+ delete config.response;
3982
+ }
3627
3983
 
3628
3984
  response.headers = AxiosHeaders$1.from(response.headers);
3629
3985
 
@@ -3635,11 +3991,16 @@ function dispatchRequest(config) {
3635
3991
 
3636
3992
  // Transform response data
3637
3993
  if (reason && reason.response) {
3638
- reason.response.data = transformData.call(
3639
- config,
3640
- config.transformResponse,
3641
- reason.response
3642
- );
3994
+ config.response = reason.response;
3995
+ try {
3996
+ reason.response.data = transformData.call(
3997
+ config,
3998
+ config.transformResponse,
3999
+ reason.response
4000
+ );
4001
+ } finally {
4002
+ delete config.response;
4003
+ }
3643
4004
  reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
3644
4005
  }
3645
4006
  }
@@ -3649,8 +4010,6 @@ function dispatchRequest(config) {
3649
4010
  );
3650
4011
  }
3651
4012
 
3652
- const VERSION$1 = "1.15.2";
3653
-
3654
4013
  const validators$1 = {};
3655
4014
 
3656
4015
  // eslint-disable-next-line func-names
@@ -3735,7 +4094,7 @@ function assertOptions(options, schema, allowUnknown) {
3735
4094
  while (i-- > 0) {
3736
4095
  const opt = keys[i];
3737
4096
  // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
3738
- // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
4097
+ // a non-function validator and cause a TypeError.
3739
4098
  const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
3740
4099
  if (validator) {
3741
4100
  const value = options[opt];
@@ -3895,7 +4254,7 @@ let Axios$1 = class Axios {
3895
4254
  let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
3896
4255
 
3897
4256
  headers &&
3898
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
4257
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
3899
4258
  delete headers[method];
3900
4259
  });
3901
4260
 
@@ -3998,7 +4357,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
3998
4357
  };
3999
4358
  });
4000
4359
 
4001
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
4360
+ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
4002
4361
  function generateHTTPMethod(isForm) {
4003
4362
  return function httpMethod(url, data, config) {
4004
4363
  return this.request(
@@ -4018,7 +4377,11 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
4018
4377
 
4019
4378
  Axios$1.prototype[method] = generateHTTPMethod();
4020
4379
 
4021
- Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
4380
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
4381
+ // its semantics, so no queryForm shorthand is generated.
4382
+ if (method !== 'query') {
4383
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
4384
+ }
4022
4385
  });
4023
4386
 
4024
4387
  /**
@@ -4352,7 +4715,8 @@ const {
4352
4715
  formToJSON,
4353
4716
  getAdapter,
4354
4717
  mergeConfig,
4718
+ create,
4355
4719
  } = axios;
4356
4720
 
4357
- export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
4721
+ export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, create, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
4358
4722
  //# sourceMappingURL=axios.js.map