@bitrix24/b24jssdk 1.1.2 → 1.2.0

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 (138) hide show
  1. package/README-AI.md +12 -0
  2. package/dist/esm/_virtual/_commonjsHelpers.mjs +1 -1
  3. package/dist/esm/_virtual/protobuf.mjs +1 -1
  4. package/dist/esm/_virtual/protobuf2.mjs +1 -1
  5. package/dist/esm/core/abstract-b24.mjs +1 -1
  6. package/dist/esm/core/actions/abstract-action.mjs +1 -1
  7. package/dist/esm/core/actions/abstract-batch.mjs +1 -1
  8. package/dist/esm/core/actions/manager.mjs +1 -1
  9. package/dist/esm/core/actions/v2/batch-by-chunk.mjs +1 -1
  10. package/dist/esm/core/actions/v2/batch.mjs +4 -4
  11. package/dist/esm/core/actions/v2/batch.mjs.map +1 -1
  12. package/dist/esm/core/actions/v2/call-list.mjs +1 -1
  13. package/dist/esm/core/actions/v2/call.mjs +1 -1
  14. package/dist/esm/core/actions/v2/fetch-list.mjs +1 -1
  15. package/dist/esm/core/actions/v2/manager-v2.mjs +1 -1
  16. package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
  17. package/dist/esm/core/actions/v3/batch.mjs +4 -4
  18. package/dist/esm/core/actions/v3/batch.mjs.map +1 -1
  19. package/dist/esm/core/actions/v3/call-list.mjs +1 -1
  20. package/dist/esm/core/actions/v3/call.mjs +1 -1
  21. package/dist/esm/core/actions/v3/fetch-list.mjs +1 -1
  22. package/dist/esm/core/actions/v3/manager-v3.mjs +1 -1
  23. package/dist/esm/core/http/abstract-http.mjs +2 -2
  24. package/dist/esm/core/http/ajax-error.mjs +1 -1
  25. package/dist/esm/core/http/ajax-result.mjs +1 -1
  26. package/dist/esm/core/http/limiters/adaptive-delayer.mjs +1 -1
  27. package/dist/esm/core/http/limiters/manager.mjs +30 -1
  28. package/dist/esm/core/http/limiters/manager.mjs.map +1 -1
  29. package/dist/esm/core/http/limiters/operating-limiter.mjs +1 -1
  30. package/dist/esm/core/http/limiters/params-factory.mjs +1 -1
  31. package/dist/esm/core/http/limiters/rate-limiter.mjs +1 -1
  32. package/dist/esm/core/http/redact.mjs +1 -1
  33. package/dist/esm/core/http/v2.mjs +2 -2
  34. package/dist/esm/core/http/v3.mjs +2 -2
  35. package/dist/esm/core/interaction/batch/abstract-interaction-batch.mjs +1 -1
  36. package/dist/esm/core/interaction/batch/parse-row.mjs +1 -1
  37. package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs +1 -1
  38. package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +1 -1
  39. package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs +1 -1
  40. package/dist/esm/core/interaction/batch/processing/v2/as-object.mjs +1 -1
  41. package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs +1 -1
  42. package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs +1 -1
  43. package/dist/esm/core/interaction/batch/processing/v3/as-object.mjs +1 -1
  44. package/dist/esm/core/interaction/batch/v2.mjs +1 -1
  45. package/dist/esm/core/interaction/batch/v3.mjs +1 -1
  46. package/dist/esm/core/language/list.mjs +1 -1
  47. package/dist/esm/core/request-id-generator.mjs +1 -1
  48. package/dist/esm/core/result.mjs +1 -1
  49. package/dist/esm/core/sdk-error.mjs +1 -1
  50. package/dist/esm/core/tools/abstract-tool.mjs +1 -1
  51. package/dist/esm/core/tools/healthcheck.mjs +1 -1
  52. package/dist/esm/core/tools/manager.mjs +1 -1
  53. package/dist/esm/core/tools/ping.mjs +1 -1
  54. package/dist/esm/core/version-manager.mjs +1 -1
  55. package/dist/esm/frame/auth.mjs +1 -1
  56. package/dist/esm/frame/b24.mjs +1 -1
  57. package/dist/esm/frame/dialog.mjs +1 -1
  58. package/dist/esm/frame/frame.mjs +1 -1
  59. package/dist/esm/frame/message/commands.mjs +1 -1
  60. package/dist/esm/frame/message/controller.mjs +1 -1
  61. package/dist/esm/frame/options.mjs +1 -1
  62. package/dist/esm/frame/parent.mjs +1 -1
  63. package/dist/esm/frame/placement.mjs +1 -1
  64. package/dist/esm/frame/slider.mjs +1 -1
  65. package/dist/esm/helper/abstract-helper.mjs +1 -1
  66. package/dist/esm/helper/app-manager.mjs +1 -1
  67. package/dist/esm/helper/currency-manager.mjs +1 -1
  68. package/dist/esm/helper/helper-manager.mjs +1 -1
  69. package/dist/esm/helper/license-manager.mjs +1 -1
  70. package/dist/esm/helper/options-manager.mjs +1 -1
  71. package/dist/esm/helper/payment-manager.mjs +1 -1
  72. package/dist/esm/helper/profile-manager.mjs +1 -1
  73. package/dist/esm/helper/use-b24-helper.mjs +1 -1
  74. package/dist/esm/hook/auth.mjs +1 -1
  75. package/dist/esm/hook/b24.mjs +1 -1
  76. package/dist/esm/index.d.mts +6 -6
  77. package/dist/esm/index.d.ts +6 -6
  78. package/dist/esm/index.mjs +1 -1
  79. package/dist/esm/loader-b24frame.mjs +1 -1
  80. package/dist/esm/logger/abstract-logger.mjs +1 -1
  81. package/dist/esm/logger/browser.mjs +1 -1
  82. package/dist/esm/logger/formatter/abstract-formatter.mjs +1 -1
  83. package/dist/esm/logger/formatter/json-formatter.mjs +1 -1
  84. package/dist/esm/logger/formatter/line-formatter.mjs +1 -1
  85. package/dist/esm/logger/formatter/telegram-formatter.mjs +1 -1
  86. package/dist/esm/logger/handler/abstract-handler.mjs +1 -1
  87. package/dist/esm/logger/handler/consola-adapter.mjs +1 -1
  88. package/dist/esm/logger/handler/console-handler.mjs +1 -1
  89. package/dist/esm/logger/handler/console-v2-handler.mjs +1 -1
  90. package/dist/esm/logger/handler/memory-handler.mjs +1 -1
  91. package/dist/esm/logger/handler/stream-handler.mjs +1 -1
  92. package/dist/esm/logger/handler/telegram-handler.mjs +1 -1
  93. package/dist/esm/logger/handler/winston-adapter.mjs +1 -1
  94. package/dist/esm/logger/logger-factory.mjs +1 -1
  95. package/dist/esm/logger/logger.mjs +1 -1
  96. package/dist/esm/logger/null-logger.mjs +1 -1
  97. package/dist/esm/logger/processor/memory-usage-processor.mjs +1 -1
  98. package/dist/esm/logger/processor/pid-processor.mjs +1 -1
  99. package/dist/esm/oauth/auth.mjs +1 -1
  100. package/dist/esm/oauth/b24.mjs +1 -1
  101. package/dist/esm/oauth/refresh-token-error.mjs +1 -1
  102. package/dist/esm/pullClient/abstract-connector.mjs +1 -1
  103. package/dist/esm/pullClient/channel-manager.mjs +1 -1
  104. package/dist/esm/pullClient/client.mjs +1 -1
  105. package/dist/esm/pullClient/errors.mjs +1 -1
  106. package/dist/esm/pullClient/json-rpc.mjs +1 -1
  107. package/dist/esm/pullClient/long-polling-connector.mjs +1 -1
  108. package/dist/esm/pullClient/protobuf/index.mjs +1 -1
  109. package/dist/esm/pullClient/protobuf/model.mjs +1 -1
  110. package/dist/esm/pullClient/protobuf/protobuf.mjs +53 -53
  111. package/dist/esm/pullClient/protobuf/protobuf.mjs.map +1 -1
  112. package/dist/esm/pullClient/shared-config.mjs +1 -1
  113. package/dist/esm/pullClient/storage-manager.mjs +1 -1
  114. package/dist/esm/pullClient/web-socket-connector.mjs +1 -1
  115. package/dist/esm/tools/browser.mjs +1 -1
  116. package/dist/esm/tools/environment.mjs +1 -1
  117. package/dist/esm/tools/formatters/iban.mjs +1 -1
  118. package/dist/esm/tools/formatters/numbers.mjs +1 -1
  119. package/dist/esm/tools/index.mjs +1 -1
  120. package/dist/esm/tools/scroll-size.mjs +1 -1
  121. package/dist/esm/tools/text.mjs +1 -1
  122. package/dist/esm/tools/type.mjs +1 -1
  123. package/dist/esm/tools/use-formatters.mjs +1 -1
  124. package/dist/esm/tools/uuidv7.mjs +1 -1
  125. package/dist/esm/types/b24-helper.mjs +1 -1
  126. package/dist/esm/types/b24.mjs +1 -1
  127. package/dist/esm/types/bizproc/index.mjs +1 -1
  128. package/dist/esm/types/catalog/index.mjs +1 -1
  129. package/dist/esm/types/common.mjs +1 -1
  130. package/dist/esm/types/crm/entity-type.mjs +1 -1
  131. package/dist/esm/types/crm/productrow.mjs +1 -1
  132. package/dist/esm/types/logger.mjs +1 -1
  133. package/dist/esm/types/pull.mjs +1 -1
  134. package/dist/umd/index.js +1666 -1241
  135. package/dist/umd/index.js.map +1 -1
  136. package/dist/umd/index.min.js +28 -28
  137. package/dist/umd/index.min.js.map +1 -1
  138. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @package @bitrix24/b24jssdk
3
- * @version 1.1.2
3
+ * @version 1.2.0
4
4
  * @copyright (c) 2026 Bitrix24
5
5
  * @license MIT
6
6
  * @see https://github.com/bitrix24/b24jssdk
@@ -11726,6 +11726,10 @@ ${this.stack}`;
11726
11726
  this.#logError(this.#operatingLimiter.getTitle(), requestId, "OPERATION_TIME_LIMIT", error.message, method, wait);
11727
11727
  return wait;
11728
11728
  }
11729
+ if (this.#isNonRetryableClientError(error)) {
11730
+ this.#logNonRetryableClientError(requestId, error?.code ? `${error.code}` : "?", error?.message ?? "", method, Number(error?.status ?? 0));
11731
+ return 0;
11732
+ }
11729
11733
  if (!this.#isNeedThrowError(error)) {
11730
11734
  const baseDelay = await this.#getErrorBackoff(requestId);
11731
11735
  const maxDelay = Math.max(3e4, baseDelay);
@@ -11767,6 +11771,20 @@ ${this.stack}`;
11767
11771
  async #handleOperatingLimitError(requestId, method, params, _error) {
11768
11772
  return this.#operatingLimiter.getTimeToFree(requestId, method, params, _error);
11769
11773
  }
11774
+ /**
11775
+ * Checks if the error is a non-retryable client error (HTTP 4xx).
11776
+ *
11777
+ * `429` is excluded — it is handled as a rate/operating limit and is retried
11778
+ * with backoff. `408` (request timeout) is excluded — it is transient and is
11779
+ * governed by `retryOnNetworkError`.
11780
+ */
11781
+ #isNonRetryableClientError(error) {
11782
+ const status = Number(error?.status ?? 0);
11783
+ if (Number.isNaN(status)) {
11784
+ return false;
11785
+ }
11786
+ return status >= 400 && status < 500 && status !== 408 && status !== 429;
11787
+ }
11770
11788
  /**
11771
11789
  * Checks whether attempts should be stopped if errors are encountered that are unclear.
11772
11790
  */
@@ -11963,6 +11981,17 @@ ${this.stack}`;
11963
11981
  }
11964
11982
  });
11965
11983
  }
11984
+ #logNonRetryableClientError(requestId, code, message, method, status) {
11985
+ this.getLogger().error(`client error ${status} (${code}) for the ${method} method is not retryable`, {
11986
+ requestId,
11987
+ method,
11988
+ status,
11989
+ error: {
11990
+ code,
11991
+ message
11992
+ }
11993
+ });
11994
+ }
11966
11995
  // endregion ////
11967
11996
  }
11968
11997
 
@@ -12569,7 +12598,7 @@ ${JSON.stringify({
12569
12598
  * const resultData = (response as Result<AjaxResult<{ item: Contact }>[]>).getData()
12570
12599
  * resultData.forEach((resultRow, index) => {
12571
12600
  * if (resultRow.isSuccess) {
12572
- * console.log(`Item ${index + 1}:`, resultRow.getData().result.item)
12601
+ * console.log(`Item ${index + 1}:`, resultRow.getData()!.result.item)
12573
12602
  * }
12574
12603
  * })
12575
12604
  *
@@ -12612,8 +12641,8 @@ ${JSON.stringify({
12612
12641
  * }
12613
12642
  *
12614
12643
  * const results = response.getData() as Record<string, AjaxResult<{ item: Contact } | { item: Deal }>>
12615
- * console.log('Contact:', results.Contact.getData().result.item as Contact)
12616
- * console.log('Deal:', results.Deal.getData().result.item as Deal)
12644
+ * console.log('Contact:', results.Contact.getData()?.result.item as Contact)
12645
+ * console.log('Deal:', results.Deal.getData()?.result.item as Deal)
12617
12646
  *
12618
12647
  * @warning The maximum number of commands in one batch request is 50.
12619
12648
  * @note A batch request executes faster than sequential single calls,
@@ -13094,7 +13123,7 @@ ${JSON.stringify({
13094
13123
  * const resultData = (response as Result<AjaxResult<{ item: TaskItem }>[]>).getData()
13095
13124
  * resultData.forEach((resultRow, index) => {
13096
13125
  * if (resultRow.isSuccess) {
13097
- * console.log(`Item ${index + 1}:`, resultRow.getData().result.item)
13126
+ * console.log(`Item ${index + 1}:`, resultRow.getData()!.result.item)
13098
13127
  * }
13099
13128
  * })
13100
13129
  *
@@ -13133,8 +13162,8 @@ ${JSON.stringify({
13133
13162
  * }
13134
13163
  *
13135
13164
  * const results = response.getData() as Record<string, AjaxResult<{ item: TaskItem } | { items: MainEventLogItem[] }>>
13136
- * console.log('Task:', results.Task.getData().result.item as TaskItem)
13137
- * console.log('MainEventLog:', results.MainEventLog.getData().result.items as MainEventLogItem[])
13165
+ * console.log('Task:', results.Task.getData()?.result.item as TaskItem)
13166
+ * console.log('MainEventLog:', results.MainEventLog.getData()?.result.items as MainEventLogItem[])
13138
13167
  *
13139
13168
  * @warning The maximum number of commands in one batch request is 50.
13140
13169
  * @note A batch request executes faster than sequential single calls,
@@ -13999,9 +14028,9 @@ ${JSON.stringify({
13999
14028
  * also have a `name` and `type` attribute to specify filename and content type
14000
14029
  *
14001
14030
  * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
14002
- *
14031
+ *
14003
14032
  * @param {*} value The value to test
14004
- *
14033
+ *
14005
14034
  * @returns {boolean} True if value is a React Native Blob, otherwise false
14006
14035
  */
14007
14036
  const isReactNativeBlob = (value) => {
@@ -14011,9 +14040,9 @@ ${JSON.stringify({
14011
14040
  /**
14012
14041
  * Determine if environment is React Native
14013
14042
  * ReactNative `FormData` has a non-standard `getParts()` method
14014
- *
14043
+ *
14015
14044
  * @param {*} formData The formData to test
14016
- *
14045
+ *
14017
14046
  * @returns {boolean} True if environment is React Native, otherwise false
14018
14047
  */
14019
14048
  const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
@@ -14032,7 +14061,7 @@ ${JSON.stringify({
14032
14061
  *
14033
14062
  * @param {*} val The value to test
14034
14063
  *
14035
- * @returns {boolean} True if value is a File, otherwise false
14064
+ * @returns {boolean} True if value is a FileList, otherwise false
14036
14065
  */
14037
14066
  const isFileList = kindOfTest('FileList');
14038
14067
 
@@ -14066,14 +14095,16 @@ ${JSON.stringify({
14066
14095
  const isFormData = (thing) => {
14067
14096
  if (!thing) return false;
14068
14097
  if (FormDataCtor && thing instanceof FormDataCtor) return true;
14069
- // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
14098
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
14070
14099
  const proto = getPrototypeOf(thing);
14071
14100
  if (!proto || proto === Object.prototype) return false;
14072
14101
  if (!isFunction$1(thing.append)) return false;
14073
14102
  const kind = kindOf(thing);
14074
- return kind === 'formdata' ||
14103
+ return (
14104
+ kind === 'formdata' ||
14075
14105
  // detect form-data instance
14076
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
14106
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
14107
+ );
14077
14108
  };
14078
14109
 
14079
14110
  /**
@@ -14208,7 +14239,7 @@ ${JSON.stringify({
14208
14239
  *
14209
14240
  * @returns {Object} Result of all merge properties
14210
14241
  */
14211
- function merge(/* obj1, obj2, obj3, ... */) {
14242
+ function merge(...objs) {
14212
14243
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
14213
14244
  const result = {};
14214
14245
  const assignValue = (val, key) => {
@@ -14218,8 +14249,12 @@ ${JSON.stringify({
14218
14249
  }
14219
14250
 
14220
14251
  const targetKey = (caseless && findKey(result, key)) || key;
14221
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
14222
- result[targetKey] = merge(result[targetKey], val);
14252
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
14253
+ // chain, so a polluted Object.prototype value could surface here and get
14254
+ // copied into the merged result.
14255
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
14256
+ if (isPlainObject(existing) && isPlainObject(val)) {
14257
+ result[targetKey] = merge(existing, val);
14223
14258
  } else if (isPlainObject(val)) {
14224
14259
  result[targetKey] = merge({}, val);
14225
14260
  } else if (isArray$2(val)) {
@@ -14229,8 +14264,8 @@ ${JSON.stringify({
14229
14264
  }
14230
14265
  };
14231
14266
 
14232
- for (let i = 0, l = arguments.length; i < l; i++) {
14233
- arguments[i] && forEach(arguments[i], assignValue);
14267
+ for (let i = 0, l = objs.length; i < l; i++) {
14268
+ objs[i] && forEach(objs[i], assignValue);
14234
14269
  }
14235
14270
  return result;
14236
14271
  }
@@ -14252,6 +14287,9 @@ ${JSON.stringify({
14252
14287
  (val, key) => {
14253
14288
  if (thisArg && isFunction$1(val)) {
14254
14289
  Object.defineProperty(a, key, {
14290
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
14291
+ // hijack defineProperty's accessor-vs-data resolution.
14292
+ __proto__: null,
14255
14293
  value: bind(val, thisArg),
14256
14294
  writable: true,
14257
14295
  enumerable: true,
@@ -14259,6 +14297,7 @@ ${JSON.stringify({
14259
14297
  });
14260
14298
  } else {
14261
14299
  Object.defineProperty(a, key, {
14300
+ __proto__: null,
14262
14301
  value: val,
14263
14302
  writable: true,
14264
14303
  enumerable: true,
@@ -14297,12 +14336,14 @@ ${JSON.stringify({
14297
14336
  const inherits = (constructor, superConstructor, props, descriptors) => {
14298
14337
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
14299
14338
  Object.defineProperty(constructor.prototype, 'constructor', {
14339
+ __proto__: null,
14300
14340
  value: constructor,
14301
14341
  writable: true,
14302
14342
  enumerable: false,
14303
14343
  configurable: true,
14304
14344
  });
14305
14345
  Object.defineProperty(constructor, 'super', {
14346
+ __proto__: null,
14306
14347
  value: superConstructor.prototype,
14307
14348
  });
14308
14349
  props && Object.assign(constructor.prototype, props);
@@ -14484,7 +14525,7 @@ ${JSON.stringify({
14484
14525
  const freezeMethods = (obj) => {
14485
14526
  reduceDescriptors(obj, (descriptor, name) => {
14486
14527
  // skip restricted props in strict mode
14487
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
14528
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
14488
14529
  return false;
14489
14530
  }
14490
14531
 
@@ -14558,11 +14599,11 @@ ${JSON.stringify({
14558
14599
  * @returns {Object} The JSON-compatible object.
14559
14600
  */
14560
14601
  const toJSONObject = (obj) => {
14561
- const stack = new Array(10);
14602
+ const visited = new WeakSet();
14562
14603
 
14563
- const visit = (source, i) => {
14604
+ const visit = (source) => {
14564
14605
  if (isObject(source)) {
14565
- if (stack.indexOf(source) >= 0) {
14606
+ if (visited.has(source)) {
14566
14607
  return;
14567
14608
  }
14568
14609
 
@@ -14572,15 +14613,16 @@ ${JSON.stringify({
14572
14613
  }
14573
14614
 
14574
14615
  if (!('toJSON' in source)) {
14575
- stack[i] = source;
14616
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
14617
+ visited.add(source);
14576
14618
  const target = isArray$2(source) ? [] : {};
14577
14619
 
14578
14620
  forEach(source, (value, key) => {
14579
- const reducedValue = visit(value, i + 1);
14621
+ const reducedValue = visit(value);
14580
14622
  !isUndefined(reducedValue) && (target[key] = reducedValue);
14581
14623
  });
14582
14624
 
14583
- stack[i] = undefined;
14625
+ visited.delete(source);
14584
14626
 
14585
14627
  return target;
14586
14628
  }
@@ -14589,7 +14631,7 @@ ${JSON.stringify({
14589
14631
  return source;
14590
14632
  };
14591
14633
 
14592
- return visit(obj, 0);
14634
+ return visit(obj);
14593
14635
  };
14594
14636
 
14595
14637
  /**
@@ -14725,1311 +14767,1422 @@ ${JSON.stringify({
14725
14767
  isIterable,
14726
14768
  };
14727
14769
 
14728
- let AxiosError$1 = class AxiosError extends Error {
14729
- static from(error, code, config, request, response, customProps) {
14730
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
14731
- axiosError.cause = error;
14732
- axiosError.name = error.name;
14770
+ // RawAxiosHeaders whose duplicates are ignored by node
14771
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
14772
+ const ignoreDuplicateOf = utils$1.toObjectSet([
14773
+ 'age',
14774
+ 'authorization',
14775
+ 'content-length',
14776
+ 'content-type',
14777
+ 'etag',
14778
+ 'expires',
14779
+ 'from',
14780
+ 'host',
14781
+ 'if-modified-since',
14782
+ 'if-unmodified-since',
14783
+ 'last-modified',
14784
+ 'location',
14785
+ 'max-forwards',
14786
+ 'proxy-authorization',
14787
+ 'referer',
14788
+ 'retry-after',
14789
+ 'user-agent',
14790
+ ]);
14733
14791
 
14734
- // Preserve status from the original error if not already set from response
14735
- if (error.status != null && axiosError.status == null) {
14736
- axiosError.status = error.status;
14737
- }
14792
+ /**
14793
+ * Parse headers into an object
14794
+ *
14795
+ * ```
14796
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
14797
+ * Content-Type: application/json
14798
+ * Connection: keep-alive
14799
+ * Transfer-Encoding: chunked
14800
+ * ```
14801
+ *
14802
+ * @param {String} rawHeaders Headers needing to be parsed
14803
+ *
14804
+ * @returns {Object} Headers parsed into an object
14805
+ */
14806
+ const parseHeaders = (rawHeaders) => {
14807
+ const parsed = {};
14808
+ let key;
14809
+ let val;
14810
+ let i;
14738
14811
 
14739
- customProps && Object.assign(axiosError, customProps);
14740
- return axiosError;
14741
- }
14812
+ rawHeaders &&
14813
+ rawHeaders.split('\n').forEach(function parser(line) {
14814
+ i = line.indexOf(':');
14815
+ key = line.substring(0, i).trim().toLowerCase();
14816
+ val = line.substring(i + 1).trim();
14742
14817
 
14743
- /**
14744
- * Create an Error with the specified message, config, error code, request and response.
14745
- *
14746
- * @param {string} message The error message.
14747
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
14748
- * @param {Object} [config] The config.
14749
- * @param {Object} [request] The request.
14750
- * @param {Object} [response] The response.
14751
- *
14752
- * @returns {Error} The created error.
14753
- */
14754
- constructor(message, code, config, request, response) {
14755
- super(message);
14818
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
14819
+ return;
14820
+ }
14756
14821
 
14757
- // Make message enumerable to maintain backward compatibility
14758
- // The native Error constructor sets message as non-enumerable,
14759
- // but axios < v1.13.3 had it as enumerable
14760
- Object.defineProperty(this, 'message', {
14761
- value: message,
14762
- enumerable: true,
14763
- writable: true,
14764
- configurable: true,
14822
+ if (key === 'set-cookie') {
14823
+ if (parsed[key]) {
14824
+ parsed[key].push(val);
14825
+ } else {
14826
+ parsed[key] = [val];
14827
+ }
14828
+ } else {
14829
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
14830
+ }
14765
14831
  });
14766
14832
 
14767
- this.name = 'AxiosError';
14768
- this.isAxiosError = true;
14769
- code && (this.code = code);
14770
- config && (this.config = config);
14771
- request && (this.request = request);
14772
- if (response) {
14773
- this.response = response;
14774
- this.status = response.status;
14833
+ return parsed;
14834
+ };
14835
+
14836
+ function trimSPorHTAB(str) {
14837
+ let start = 0;
14838
+ let end = str.length;
14839
+
14840
+ while (start < end) {
14841
+ const code = str.charCodeAt(start);
14842
+
14843
+ if (code !== 0x09 && code !== 0x20) {
14844
+ break;
14775
14845
  }
14846
+
14847
+ start += 1;
14776
14848
  }
14777
14849
 
14778
- toJSON() {
14779
- return {
14780
- // Standard
14781
- message: this.message,
14782
- name: this.name,
14783
- // Microsoft
14784
- description: this.description,
14785
- number: this.number,
14786
- // Mozilla
14787
- fileName: this.fileName,
14788
- lineNumber: this.lineNumber,
14789
- columnNumber: this.columnNumber,
14790
- stack: this.stack,
14791
- // Axios
14792
- config: utils$1.toJSONObject(this.config),
14793
- code: this.code,
14794
- status: this.status,
14795
- };
14850
+ while (end > start) {
14851
+ const code = str.charCodeAt(end - 1);
14852
+
14853
+ if (code !== 0x09 && code !== 0x20) {
14854
+ break;
14855
+ }
14856
+
14857
+ end -= 1;
14796
14858
  }
14797
- };
14798
14859
 
14799
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
14800
- AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
14801
- AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
14802
- AxiosError$1.ECONNABORTED = 'ECONNABORTED';
14803
- AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
14804
- AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
14805
- AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
14806
- AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
14807
- AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
14808
- AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
14809
- AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
14810
- AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
14811
- AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
14812
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
14860
+ return start === 0 && end === str.length ? str : str.slice(start, end);
14861
+ }
14813
14862
 
14814
- // eslint-disable-next-line strict
14815
- const httpAdapter = null;
14863
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
14864
+ // eslint-disable-next-line no-control-regex
14865
+ const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
14866
+ // eslint-disable-next-line no-control-regex
14867
+ const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
14816
14868
 
14817
- /**
14818
- * Determines if the given thing is a array or js object.
14819
- *
14820
- * @param {string} thing - The object or array to be visited.
14821
- *
14822
- * @returns {boolean}
14823
- */
14824
- function isVisitable(thing) {
14825
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
14869
+ function sanitizeValue(value, invalidChars) {
14870
+ if (utils$1.isArray(value)) {
14871
+ return value.map((item) => sanitizeValue(item, invalidChars));
14872
+ }
14873
+
14874
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
14826
14875
  }
14827
14876
 
14828
- /**
14829
- * It removes the brackets from the end of a string
14830
- *
14831
- * @param {string} key - The key of the parameter.
14832
- *
14833
- * @returns {string} the key without the brackets.
14834
- */
14835
- function removeBrackets(key) {
14836
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
14877
+ const sanitizeHeaderValue = (value) =>
14878
+ sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
14879
+
14880
+ const sanitizeByteStringHeaderValue = (value) =>
14881
+ sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
14882
+
14883
+ function toByteStringHeaderObject(headers) {
14884
+ const byteStringHeaders = Object.create(null);
14885
+
14886
+ utils$1.forEach(headers.toJSON(), (value, header) => {
14887
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
14888
+ });
14889
+
14890
+ return byteStringHeaders;
14837
14891
  }
14838
14892
 
14839
- /**
14840
- * It takes a path, a key, and a boolean, and returns a string
14841
- *
14842
- * @param {string} path - The path to the current key.
14843
- * @param {string} key - The key of the current object being iterated over.
14844
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
14845
- *
14846
- * @returns {string} The path to the current key.
14847
- */
14848
- function renderKey(path, key, dots) {
14849
- if (!path) return key;
14850
- return path
14851
- .concat(key)
14852
- .map(function each(token, i) {
14853
- // eslint-disable-next-line no-param-reassign
14854
- token = removeBrackets(token);
14855
- return !dots && i ? '[' + token + ']' : token;
14856
- })
14857
- .join(dots ? '.' : '');
14893
+ const $internals = Symbol('internals');
14894
+
14895
+ function normalizeHeader(header) {
14896
+ return header && String(header).trim().toLowerCase();
14858
14897
  }
14859
14898
 
14860
- /**
14861
- * If the array is an array and none of its elements are visitable, then it's a flat array.
14862
- *
14863
- * @param {Array<any>} arr - The array to check
14864
- *
14865
- * @returns {boolean}
14866
- */
14867
- function isFlatArray(arr) {
14868
- return utils$1.isArray(arr) && !arr.some(isVisitable);
14899
+ function normalizeValue(value) {
14900
+ if (value === false || value == null) {
14901
+ return value;
14902
+ }
14903
+
14904
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
14869
14905
  }
14870
14906
 
14871
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
14872
- return /^is[A-Z]/.test(prop);
14873
- });
14907
+ function parseTokens(str) {
14908
+ const tokens = Object.create(null);
14909
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
14910
+ let match;
14874
14911
 
14875
- /**
14876
- * Convert a data object to FormData
14877
- *
14878
- * @param {Object} obj
14879
- * @param {?Object} [formData]
14880
- * @param {?Object} [options]
14881
- * @param {Function} [options.visitor]
14882
- * @param {Boolean} [options.metaTokens = true]
14883
- * @param {Boolean} [options.dots = false]
14884
- * @param {?Boolean} [options.indexes = false]
14885
- *
14886
- * @returns {Object}
14887
- **/
14888
-
14889
- /**
14890
- * It converts an object into a FormData object
14891
- *
14892
- * @param {Object<any, any>} obj - The object to convert to form data.
14893
- * @param {string} formData - The FormData object to append to.
14894
- * @param {Object<string, any>} options
14895
- *
14896
- * @returns
14897
- */
14898
- function toFormData$1(obj, formData, options) {
14899
- if (!utils$1.isObject(obj)) {
14900
- throw new TypeError('target must be an object');
14912
+ while ((match = tokensRE.exec(str))) {
14913
+ tokens[match[1]] = match[2];
14901
14914
  }
14902
14915
 
14903
- // eslint-disable-next-line no-param-reassign
14904
- formData = formData || new (FormData)();
14916
+ return tokens;
14917
+ }
14905
14918
 
14906
- // eslint-disable-next-line no-param-reassign
14907
- options = utils$1.toFlatObject(
14908
- options,
14909
- {
14910
- metaTokens: true,
14911
- dots: false,
14912
- indexes: false,
14913
- },
14914
- false,
14915
- function defined(option, source) {
14916
- // eslint-disable-next-line no-eq-null,eqeqeq
14917
- return !utils$1.isUndefined(source[option]);
14918
- }
14919
- );
14919
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
14920
14920
 
14921
- const metaTokens = options.metaTokens;
14922
- // eslint-disable-next-line no-use-before-define
14923
- const visitor = options.visitor || defaultVisitor;
14924
- const dots = options.dots;
14925
- const indexes = options.indexes;
14926
- const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
14927
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
14928
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
14921
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
14922
+ if (utils$1.isFunction(filter)) {
14923
+ return filter.call(this, value, header);
14924
+ }
14929
14925
 
14930
- if (!utils$1.isFunction(visitor)) {
14931
- throw new TypeError('visitor must be a function');
14926
+ if (isHeaderNameFilter) {
14927
+ value = header;
14932
14928
  }
14933
14929
 
14934
- function convertValue(value) {
14935
- if (value === null) return '';
14930
+ if (!utils$1.isString(value)) return;
14936
14931
 
14937
- if (utils$1.isDate(value)) {
14938
- return value.toISOString();
14939
- }
14932
+ if (utils$1.isString(filter)) {
14933
+ return value.indexOf(filter) !== -1;
14934
+ }
14940
14935
 
14941
- if (utils$1.isBoolean(value)) {
14942
- return value.toString();
14943
- }
14936
+ if (utils$1.isRegExp(filter)) {
14937
+ return filter.test(value);
14938
+ }
14939
+ }
14944
14940
 
14945
- if (!useBlob && utils$1.isBlob(value)) {
14946
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
14947
- }
14941
+ function formatHeader(header) {
14942
+ return header
14943
+ .trim()
14944
+ .toLowerCase()
14945
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
14946
+ return char.toUpperCase() + str;
14947
+ });
14948
+ }
14948
14949
 
14949
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
14950
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
14951
- }
14950
+ function buildAccessors(obj, header) {
14951
+ const accessorName = utils$1.toCamelCase(' ' + header);
14952
14952
 
14953
- return value;
14953
+ ['get', 'set', 'has'].forEach((methodName) => {
14954
+ Object.defineProperty(obj, methodName + accessorName, {
14955
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
14956
+ // this data descriptor into an accessor descriptor on the way in.
14957
+ __proto__: null,
14958
+ value: function (arg1, arg2, arg3) {
14959
+ return this[methodName].call(this, header, arg1, arg2, arg3);
14960
+ },
14961
+ configurable: true,
14962
+ });
14963
+ });
14964
+ }
14965
+
14966
+ let AxiosHeaders$1 = class AxiosHeaders {
14967
+ constructor(headers) {
14968
+ headers && this.set(headers);
14954
14969
  }
14955
14970
 
14956
- /**
14957
- * Default visitor.
14958
- *
14959
- * @param {*} value
14960
- * @param {String|Number} key
14961
- * @param {Array<String|Number>} path
14962
- * @this {FormData}
14963
- *
14964
- * @returns {boolean} return true to visit the each prop of the value recursively
14965
- */
14966
- function defaultVisitor(value, key, path) {
14967
- let arr = value;
14971
+ set(header, valueOrRewrite, rewrite) {
14972
+ const self = this;
14968
14973
 
14969
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
14970
- formData.append(renderKey(path, key, dots), convertValue(value));
14971
- return false;
14972
- }
14974
+ function setHeader(_value, _header, _rewrite) {
14975
+ const lHeader = normalizeHeader(_header);
14973
14976
 
14974
- if (value && !path && typeof value === 'object') {
14975
- if (utils$1.endsWith(key, '{}')) {
14976
- // eslint-disable-next-line no-param-reassign
14977
- key = metaTokens ? key : key.slice(0, -2);
14978
- // eslint-disable-next-line no-param-reassign
14979
- value = JSON.stringify(value);
14980
- } else if (
14981
- (utils$1.isArray(value) && isFlatArray(value)) ||
14982
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
14983
- ) {
14984
- // eslint-disable-next-line no-param-reassign
14985
- key = removeBrackets(key);
14977
+ if (!lHeader) {
14978
+ throw new Error('header name must be a non-empty string');
14979
+ }
14986
14980
 
14987
- arr.forEach(function each(el, index) {
14988
- !(utils$1.isUndefined(el) || el === null) &&
14989
- formData.append(
14990
- // eslint-disable-next-line no-nested-ternary
14991
- indexes === true
14992
- ? renderKey([key], index, dots)
14993
- : indexes === null
14994
- ? key
14995
- : key + '[]',
14996
- convertValue(el)
14997
- );
14998
- });
14999
- return false;
14981
+ const key = utils$1.findKey(self, lHeader);
14982
+
14983
+ if (
14984
+ !key ||
14985
+ self[key] === undefined ||
14986
+ _rewrite === true ||
14987
+ (_rewrite === undefined && self[key] !== false)
14988
+ ) {
14989
+ self[key || _header] = normalizeValue(_value);
15000
14990
  }
15001
14991
  }
15002
14992
 
15003
- if (isVisitable(value)) {
15004
- return true;
15005
- }
14993
+ const setHeaders = (headers, _rewrite) =>
14994
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15006
14995
 
15007
- formData.append(renderKey(path, key, dots), convertValue(value));
14996
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
14997
+ setHeaders(header, valueOrRewrite);
14998
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
14999
+ setHeaders(parseHeaders(header), valueOrRewrite);
15000
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15001
+ let obj = {},
15002
+ dest,
15003
+ key;
15004
+ for (const entry of header) {
15005
+ if (!utils$1.isArray(entry)) {
15006
+ throw TypeError('Object iterator must return a key-value pair');
15007
+ }
15008
15008
 
15009
- return false;
15009
+ obj[(key = entry[0])] = (dest = obj[key])
15010
+ ? utils$1.isArray(dest)
15011
+ ? [...dest, entry[1]]
15012
+ : [dest, entry[1]]
15013
+ : entry[1];
15014
+ }
15015
+
15016
+ setHeaders(obj, valueOrRewrite);
15017
+ } else {
15018
+ header != null && setHeader(valueOrRewrite, header, rewrite);
15019
+ }
15020
+
15021
+ return this;
15010
15022
  }
15011
15023
 
15012
- const stack = [];
15024
+ get(header, parser) {
15025
+ header = normalizeHeader(header);
15013
15026
 
15014
- const exposedHelpers = Object.assign(predicates, {
15015
- defaultVisitor,
15016
- convertValue,
15017
- isVisitable,
15018
- });
15027
+ if (header) {
15028
+ const key = utils$1.findKey(this, header);
15019
15029
 
15020
- function build(value, path, depth = 0) {
15021
- if (utils$1.isUndefined(value)) return;
15030
+ if (key) {
15031
+ const value = this[key];
15022
15032
 
15023
- if (depth > maxDepth) {
15024
- throw new AxiosError$1(
15025
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
15026
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
15027
- );
15028
- }
15033
+ if (!parser) {
15034
+ return value;
15035
+ }
15029
15036
 
15030
- if (stack.indexOf(value) !== -1) {
15031
- throw Error('Circular reference detected in ' + path.join('.'));
15032
- }
15037
+ if (parser === true) {
15038
+ return parseTokens(value);
15039
+ }
15033
15040
 
15034
- stack.push(value);
15041
+ if (utils$1.isFunction(parser)) {
15042
+ return parser.call(this, value, key);
15043
+ }
15035
15044
 
15036
- utils$1.forEach(value, function each(el, key) {
15037
- const result =
15038
- !(utils$1.isUndefined(el) || el === null) &&
15039
- visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
15045
+ if (utils$1.isRegExp(parser)) {
15046
+ return parser.exec(value);
15047
+ }
15040
15048
 
15041
- if (result === true) {
15042
- build(el, path ? path.concat(key) : [key], depth + 1);
15049
+ throw new TypeError('parser must be boolean|regexp|function');
15043
15050
  }
15044
- });
15045
-
15046
- stack.pop();
15051
+ }
15047
15052
  }
15048
15053
 
15049
- if (!utils$1.isObject(obj)) {
15050
- throw new TypeError('data must be an object');
15051
- }
15054
+ has(header, matcher) {
15055
+ header = normalizeHeader(header);
15052
15056
 
15053
- build(obj);
15057
+ if (header) {
15058
+ const key = utils$1.findKey(this, header);
15054
15059
 
15055
- return formData;
15056
- }
15060
+ return !!(
15061
+ key &&
15062
+ this[key] !== undefined &&
15063
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
15064
+ );
15065
+ }
15057
15066
 
15058
- /**
15059
- * It encodes a string by replacing all characters that are not in the unreserved set with
15060
- * their percent-encoded equivalents
15061
- *
15062
- * @param {string} str - The string to encode.
15063
- *
15064
- * @returns {string} The encoded string.
15065
- */
15066
- function encode$2(str) {
15067
- const charMap = {
15068
- '!': '%21',
15069
- "'": '%27',
15070
- '(': '%28',
15071
- ')': '%29',
15072
- '~': '%7E',
15073
- '%20': '+',
15074
- };
15075
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
15076
- return charMap[match];
15077
- });
15078
- }
15067
+ return false;
15068
+ }
15079
15069
 
15080
- /**
15081
- * It takes a params object and converts it to a FormData object
15082
- *
15083
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
15084
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
15085
- *
15086
- * @returns {void}
15087
- */
15088
- function AxiosURLSearchParams(params, options) {
15089
- this._pairs = [];
15070
+ delete(header, matcher) {
15071
+ const self = this;
15072
+ let deleted = false;
15090
15073
 
15091
- params && toFormData$1(params, this, options);
15092
- }
15074
+ function deleteHeader(_header) {
15075
+ _header = normalizeHeader(_header);
15093
15076
 
15094
- const prototype = AxiosURLSearchParams.prototype;
15077
+ if (_header) {
15078
+ const key = utils$1.findKey(self, _header);
15095
15079
 
15096
- prototype.append = function append(name, value) {
15097
- this._pairs.push([name, value]);
15098
- };
15080
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
15081
+ delete self[key];
15099
15082
 
15100
- prototype.toString = function toString(encoder) {
15101
- const _encode = encoder
15102
- ? function (value) {
15103
- return encoder.call(this, value, encode$2);
15083
+ deleted = true;
15084
+ }
15104
15085
  }
15105
- : encode$2;
15106
-
15107
- return this._pairs
15108
- .map(function each(pair) {
15109
- return _encode(pair[0]) + '=' + _encode(pair[1]);
15110
- }, '')
15111
- .join('&');
15112
- };
15086
+ }
15113
15087
 
15114
- /**
15115
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15116
- * their plain counterparts (`:`, `$`, `,`, `+`).
15117
- *
15118
- * @param {string} val The value to be encoded.
15119
- *
15120
- * @returns {string} The encoded value.
15121
- */
15122
- function encode$1(val) {
15123
- return encodeURIComponent(val)
15124
- .replace(/%3A/gi, ':')
15125
- .replace(/%24/g, '$')
15126
- .replace(/%2C/gi, ',')
15127
- .replace(/%20/g, '+');
15128
- }
15088
+ if (utils$1.isArray(header)) {
15089
+ header.forEach(deleteHeader);
15090
+ } else {
15091
+ deleteHeader(header);
15092
+ }
15129
15093
 
15130
- /**
15131
- * Build a URL by appending params to the end
15132
- *
15133
- * @param {string} url The base of the url (e.g., http://www.google.com)
15134
- * @param {object} [params] The params to be appended
15135
- * @param {?(object|Function)} options
15136
- *
15137
- * @returns {string} The formatted url
15138
- */
15139
- function buildURL(url, params, options) {
15140
- if (!params) {
15141
- return url;
15094
+ return deleted;
15142
15095
  }
15143
15096
 
15144
- const _encode = (options && options.encode) || encode$1;
15097
+ clear(matcher) {
15098
+ const keys = Object.keys(this);
15099
+ let i = keys.length;
15100
+ let deleted = false;
15145
15101
 
15146
- const _options = utils$1.isFunction(options)
15147
- ? {
15148
- serialize: options,
15102
+ while (i--) {
15103
+ const key = keys[i];
15104
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
15105
+ delete this[key];
15106
+ deleted = true;
15149
15107
  }
15150
- : options;
15108
+ }
15151
15109
 
15152
- const serializeFn = _options && _options.serialize;
15110
+ return deleted;
15111
+ }
15153
15112
 
15154
- let serializedParams;
15113
+ normalize(format) {
15114
+ const self = this;
15115
+ const headers = {};
15155
15116
 
15156
- if (serializeFn) {
15157
- serializedParams = serializeFn(params, _options);
15158
- } else {
15159
- serializedParams = utils$1.isURLSearchParams(params)
15160
- ? params.toString()
15161
- : new AxiosURLSearchParams(params, _options).toString(_encode);
15162
- }
15117
+ utils$1.forEach(this, (value, header) => {
15118
+ const key = utils$1.findKey(headers, header);
15163
15119
 
15164
- if (serializedParams) {
15165
- const hashmarkIndex = url.indexOf('#');
15120
+ if (key) {
15121
+ self[key] = normalizeValue(value);
15122
+ delete self[header];
15123
+ return;
15124
+ }
15166
15125
 
15167
- if (hashmarkIndex !== -1) {
15168
- url = url.slice(0, hashmarkIndex);
15169
- }
15170
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
15171
- }
15126
+ const normalized = format ? formatHeader(header) : String(header).trim();
15172
15127
 
15173
- return url;
15174
- }
15128
+ if (normalized !== header) {
15129
+ delete self[header];
15130
+ }
15175
15131
 
15176
- class InterceptorManager {
15177
- constructor() {
15178
- this.handlers = [];
15179
- }
15132
+ self[normalized] = normalizeValue(value);
15180
15133
 
15181
- /**
15182
- * Add a new interceptor to the stack
15183
- *
15184
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
15185
- * @param {Function} rejected The function to handle `reject` for a `Promise`
15186
- * @param {Object} options The options for the interceptor, synchronous and runWhen
15187
- *
15188
- * @return {Number} An ID used to remove interceptor later
15189
- */
15190
- use(fulfilled, rejected, options) {
15191
- this.handlers.push({
15192
- fulfilled,
15193
- rejected,
15194
- synchronous: options ? options.synchronous : false,
15195
- runWhen: options ? options.runWhen : null,
15134
+ headers[normalized] = true;
15196
15135
  });
15197
- return this.handlers.length - 1;
15198
- }
15199
15136
 
15200
- /**
15201
- * Remove an interceptor from the stack
15202
- *
15203
- * @param {Number} id The ID that was returned by `use`
15204
- *
15205
- * @returns {void}
15206
- */
15207
- eject(id) {
15208
- if (this.handlers[id]) {
15209
- this.handlers[id] = null;
15210
- }
15137
+ return this;
15211
15138
  }
15212
15139
 
15213
- /**
15214
- * Clear all interceptors from the stack
15215
- *
15216
- * @returns {void}
15217
- */
15218
- clear() {
15219
- if (this.handlers) {
15220
- this.handlers = [];
15221
- }
15140
+ concat(...targets) {
15141
+ return this.constructor.concat(this, ...targets);
15222
15142
  }
15223
15143
 
15224
- /**
15225
- * Iterate over all the registered interceptors
15226
- *
15227
- * This method is particularly useful for skipping over any
15228
- * interceptors that may have become `null` calling `eject`.
15229
- *
15230
- * @param {Function} fn The function to call for each interceptor
15231
- *
15232
- * @returns {void}
15233
- */
15234
- forEach(fn) {
15235
- utils$1.forEach(this.handlers, function forEachHandler(h) {
15236
- if (h !== null) {
15237
- fn(h);
15238
- }
15144
+ toJSON(asStrings) {
15145
+ const obj = Object.create(null);
15146
+
15147
+ utils$1.forEach(this, (value, header) => {
15148
+ value != null &&
15149
+ value !== false &&
15150
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
15239
15151
  });
15152
+
15153
+ return obj;
15240
15154
  }
15241
- }
15242
15155
 
15243
- const transitionalDefaults = {
15244
- silentJSONParsing: true,
15245
- forcedJSONParsing: true,
15246
- clarifyTimeoutError: false,
15247
- legacyInterceptorReqResOrdering: true,
15248
- };
15156
+ [Symbol.iterator]() {
15157
+ return Object.entries(this.toJSON())[Symbol.iterator]();
15158
+ }
15249
15159
 
15250
- const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
15160
+ toString() {
15161
+ return Object.entries(this.toJSON())
15162
+ .map(([header, value]) => header + ': ' + value)
15163
+ .join('\n');
15164
+ }
15251
15165
 
15252
- const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15166
+ getSetCookie() {
15167
+ return this.get('set-cookie') || [];
15168
+ }
15253
15169
 
15254
- const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15170
+ get [Symbol.toStringTag]() {
15171
+ return 'AxiosHeaders';
15172
+ }
15255
15173
 
15256
- const platform$1 = {
15257
- isBrowser: true,
15258
- classes: {
15259
- URLSearchParams: URLSearchParams$1,
15260
- FormData: FormData$1,
15261
- Blob: Blob$1,
15262
- },
15263
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
15264
- };
15174
+ static from(thing) {
15175
+ return thing instanceof this ? thing : new this(thing);
15176
+ }
15265
15177
 
15266
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15178
+ static concat(first, ...targets) {
15179
+ const computed = new this(first);
15267
15180
 
15268
- const _navigator = (typeof navigator === 'object' && navigator) || undefined;
15181
+ targets.forEach((target) => computed.set(target));
15269
15182
 
15270
- /**
15271
- * Determine if we're running in a standard browser environment
15272
- *
15273
- * This allows axios to run in a web worker, and react-native.
15274
- * Both environments support XMLHttpRequest, but not fully standard globals.
15275
- *
15276
- * web workers:
15277
- * typeof window -> undefined
15278
- * typeof document -> undefined
15279
- *
15280
- * react-native:
15281
- * navigator.product -> 'ReactNative'
15282
- * nativescript
15283
- * navigator.product -> 'NativeScript' or 'NS'
15284
- *
15285
- * @returns {boolean}
15286
- */
15287
- const hasStandardBrowserEnv =
15288
- hasBrowserEnv &&
15289
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
15290
-
15291
- /**
15292
- * Determine if we're running in a standard browser webWorker environment
15293
- *
15294
- * Although the `isStandardBrowserEnv` method indicates that
15295
- * `allows axios to run in a web worker`, the WebWorker will still be
15296
- * filtered out due to its judgment standard
15297
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15298
- * This leads to a problem when axios post `FormData` in webWorker
15299
- */
15300
- const hasStandardBrowserWebWorkerEnv = (() => {
15301
- return (
15302
- typeof WorkerGlobalScope !== 'undefined' &&
15303
- // eslint-disable-next-line no-undef
15304
- self instanceof WorkerGlobalScope &&
15305
- typeof self.importScripts === 'function'
15306
- );
15307
- })();
15183
+ return computed;
15184
+ }
15308
15185
 
15309
- const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
15186
+ static accessor(header) {
15187
+ const internals =
15188
+ (this[$internals] =
15189
+ this[$internals] =
15190
+ {
15191
+ accessors: {},
15192
+ });
15310
15193
 
15311
- const utils = {
15312
- __proto__: null,
15313
- hasBrowserEnv: hasBrowserEnv,
15314
- hasStandardBrowserEnv: hasStandardBrowserEnv,
15315
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
15316
- navigator: _navigator,
15317
- origin: origin
15318
- };
15194
+ const accessors = internals.accessors;
15195
+ const prototype = this.prototype;
15319
15196
 
15320
- const platform = {
15321
- ...utils,
15322
- ...platform$1,
15323
- };
15197
+ function defineAccessor(_header) {
15198
+ const lHeader = normalizeHeader(_header);
15324
15199
 
15325
- function toURLEncodedForm(data, options) {
15326
- return toFormData$1(data, new platform.classes.URLSearchParams(), {
15327
- visitor: function (value, key, path, helpers) {
15328
- if (platform.isNode && utils$1.isBuffer(value)) {
15329
- this.append(key, value.toString('base64'));
15330
- return false;
15200
+ if (!accessors[lHeader]) {
15201
+ buildAccessors(prototype, _header);
15202
+ accessors[lHeader] = true;
15331
15203
  }
15204
+ }
15332
15205
 
15333
- return helpers.defaultVisitor.apply(this, arguments);
15334
- },
15335
- ...options,
15336
- });
15337
- }
15338
-
15339
- /**
15340
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
15341
- *
15342
- * @param {string} name - The name of the property to get.
15343
- *
15344
- * @returns An array of strings.
15345
- */
15346
- function parsePropPath(name) {
15347
- // foo[x][y][z]
15348
- // foo.x.y.z
15349
- // foo-x-y-z
15350
- // foo x y z
15351
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
15352
- return match[0] === '[]' ? '' : match[1] || match[0];
15353
- });
15354
- }
15206
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
15355
15207
 
15356
- /**
15357
- * Convert an array to an object.
15358
- *
15359
- * @param {Array<any>} arr - The array to convert to an object.
15360
- *
15361
- * @returns An object with the same keys and values as the array.
15362
- */
15363
- function arrayToObject(arr) {
15364
- const obj = {};
15365
- const keys = Object.keys(arr);
15366
- let i;
15367
- const len = keys.length;
15368
- let key;
15369
- for (i = 0; i < len; i++) {
15370
- key = keys[i];
15371
- obj[key] = arr[key];
15208
+ return this;
15372
15209
  }
15373
- return obj;
15374
- }
15375
-
15376
- /**
15377
- * It takes a FormData object and returns a JavaScript object
15378
- *
15379
- * @param {string} formData The FormData object to convert to JSON.
15380
- *
15381
- * @returns {Object<string, any> | null} The converted object.
15382
- */
15383
- function formDataToJSON(formData) {
15384
- function buildPath(path, value, target, index) {
15385
- let name = path[index++];
15210
+ };
15386
15211
 
15387
- if (name === '__proto__') return true;
15212
+ AxiosHeaders$1.accessor([
15213
+ 'Content-Type',
15214
+ 'Content-Length',
15215
+ 'Accept',
15216
+ 'Accept-Encoding',
15217
+ 'User-Agent',
15218
+ 'Authorization',
15219
+ ]);
15388
15220
 
15389
- const isNumericKey = Number.isFinite(+name);
15390
- const isLast = index >= path.length;
15391
- name = !name && utils$1.isArray(target) ? target.length : name;
15221
+ // reserved names hotfix
15222
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
15223
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
15224
+ return {
15225
+ get: () => value,
15226
+ set(headerValue) {
15227
+ this[mapped] = headerValue;
15228
+ },
15229
+ };
15230
+ });
15392
15231
 
15393
- if (isLast) {
15394
- if (utils$1.hasOwnProp(target, name)) {
15395
- target[name] = utils$1.isArray(target[name])
15396
- ? target[name].concat(value)
15397
- : [target[name], value];
15398
- } else {
15399
- target[name] = value;
15400
- }
15232
+ utils$1.freezeMethods(AxiosHeaders$1);
15401
15233
 
15402
- return !isNumericKey;
15403
- }
15234
+ const REDACTED = '[REDACTED ****]';
15404
15235
 
15405
- if (!target[name] || !utils$1.isObject(target[name])) {
15406
- target[name] = [];
15407
- }
15236
+ function hasOwnOrPrototypeToJSON(source) {
15237
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
15238
+ return true;
15239
+ }
15408
15240
 
15409
- const result = buildPath(path, value, target[name], index);
15241
+ let prototype = Object.getPrototypeOf(source);
15410
15242
 
15411
- if (result && utils$1.isArray(target[name])) {
15412
- target[name] = arrayToObject(target[name]);
15243
+ while (prototype && prototype !== Object.prototype) {
15244
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
15245
+ return true;
15413
15246
  }
15414
15247
 
15415
- return !isNumericKey;
15248
+ prototype = Object.getPrototypeOf(prototype);
15416
15249
  }
15417
15250
 
15418
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
15419
- const obj = {};
15251
+ return false;
15252
+ }
15420
15253
 
15421
- utils$1.forEachEntry(formData, (name, value) => {
15422
- buildPath(parsePropPath(name), value, obj, 0);
15423
- });
15254
+ // Build a plain-object snapshot of `config` and replace the value of any key
15255
+ // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
15256
+ // and AxiosHeaders, and short-circuits on circular references.
15257
+ function redactConfig(config, redactKeys) {
15258
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
15259
+ const seen = [];
15424
15260
 
15425
- return obj;
15426
- }
15261
+ const visit = (source) => {
15262
+ if (source === null || typeof source !== 'object') return source;
15263
+ if (utils$1.isBuffer(source)) return source;
15264
+ if (seen.indexOf(source) !== -1) return undefined;
15427
15265
 
15428
- return null;
15429
- }
15266
+ if (source instanceof AxiosHeaders$1) {
15267
+ source = source.toJSON();
15268
+ }
15430
15269
 
15431
- const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
15270
+ seen.push(source);
15432
15271
 
15433
- /**
15434
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
15435
- * of the input
15436
- *
15437
- * @param {any} rawValue - The value to be stringified.
15438
- * @param {Function} parser - A function that parses a string into a JavaScript object.
15439
- * @param {Function} encoder - A function that takes a value and returns a string.
15440
- *
15441
- * @returns {string} A stringified version of the rawValue.
15442
- */
15443
- function stringifySafely(rawValue, parser, encoder) {
15444
- if (utils$1.isString(rawValue)) {
15445
- try {
15446
- (parser || JSON.parse)(rawValue);
15447
- return utils$1.trim(rawValue);
15448
- } catch (e) {
15449
- if (e.name !== 'SyntaxError') {
15450
- throw e;
15272
+ let result;
15273
+ if (utils$1.isArray(source)) {
15274
+ result = [];
15275
+ source.forEach((v, i) => {
15276
+ const reducedValue = visit(v);
15277
+ if (!utils$1.isUndefined(reducedValue)) {
15278
+ result[i] = reducedValue;
15279
+ }
15280
+ });
15281
+ } else {
15282
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
15283
+ seen.pop();
15284
+ return source;
15451
15285
  }
15452
- }
15453
- }
15454
15286
 
15455
- return (encoder || JSON.stringify)(rawValue);
15456
- }
15287
+ result = Object.create(null);
15288
+ for (const [key, value] of Object.entries(source)) {
15289
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
15290
+ if (!utils$1.isUndefined(reducedValue)) {
15291
+ result[key] = reducedValue;
15292
+ }
15293
+ }
15294
+ }
15457
15295
 
15458
- const defaults$1 = {
15459
- transitional: transitionalDefaults,
15296
+ seen.pop();
15297
+ return result;
15298
+ };
15460
15299
 
15461
- adapter: ['xhr', 'http', 'fetch'],
15300
+ return visit(config);
15301
+ }
15462
15302
 
15463
- transformRequest: [
15464
- function transformRequest(data, headers) {
15465
- const contentType = headers.getContentType() || '';
15466
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
15467
- const isObjectPayload = utils$1.isObject(data);
15303
+ let AxiosError$1 = class AxiosError extends Error {
15304
+ static from(error, code, config, request, response, customProps) {
15305
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
15306
+ axiosError.cause = error;
15307
+ axiosError.name = error.name;
15468
15308
 
15469
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
15470
- data = new FormData(data);
15471
- }
15309
+ // Preserve status from the original error if not already set from response
15310
+ if (error.status != null && axiosError.status == null) {
15311
+ axiosError.status = error.status;
15312
+ }
15472
15313
 
15473
- const isFormData = utils$1.isFormData(data);
15314
+ customProps && Object.assign(axiosError, customProps);
15315
+ return axiosError;
15316
+ }
15474
15317
 
15475
- if (isFormData) {
15476
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
15477
- }
15318
+ /**
15319
+ * Create an Error with the specified message, config, error code, request and response.
15320
+ *
15321
+ * @param {string} message The error message.
15322
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
15323
+ * @param {Object} [config] The config.
15324
+ * @param {Object} [request] The request.
15325
+ * @param {Object} [response] The response.
15326
+ *
15327
+ * @returns {Error} The created error.
15328
+ */
15329
+ constructor(message, code, config, request, response) {
15330
+ super(message);
15478
15331
 
15479
- if (
15480
- utils$1.isArrayBuffer(data) ||
15481
- utils$1.isBuffer(data) ||
15482
- utils$1.isStream(data) ||
15483
- utils$1.isFile(data) ||
15484
- utils$1.isBlob(data) ||
15485
- utils$1.isReadableStream(data)
15486
- ) {
15487
- return data;
15488
- }
15489
- if (utils$1.isArrayBufferView(data)) {
15490
- return data.buffer;
15491
- }
15492
- if (utils$1.isURLSearchParams(data)) {
15493
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
15494
- return data.toString();
15495
- }
15332
+ // Make message enumerable to maintain backward compatibility
15333
+ // The native Error constructor sets message as non-enumerable,
15334
+ // but axios < v1.13.3 had it as enumerable
15335
+ Object.defineProperty(this, 'message', {
15336
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
15337
+ // this data descriptor into an accessor descriptor on the way in.
15338
+ __proto__: null,
15339
+ value: message,
15340
+ enumerable: true,
15341
+ writable: true,
15342
+ configurable: true,
15343
+ });
15496
15344
 
15497
- let isFileList;
15345
+ this.name = 'AxiosError';
15346
+ this.isAxiosError = true;
15347
+ code && (this.code = code);
15348
+ config && (this.config = config);
15349
+ request && (this.request = request);
15350
+ if (response) {
15351
+ this.response = response;
15352
+ this.status = response.status;
15353
+ }
15354
+ }
15498
15355
 
15499
- if (isObjectPayload) {
15500
- const formSerializer = own(this, 'formSerializer');
15501
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
15502
- return toURLEncodedForm(data, formSerializer).toString();
15503
- }
15356
+ toJSON() {
15357
+ // Opt-in redaction: when the request config carries a `redact` array, the
15358
+ // value of any matching key (case-insensitive, at any depth) is replaced
15359
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
15360
+ // existing serialization behavior unchanged.
15361
+ const config = this.config;
15362
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
15363
+ const serializedConfig =
15364
+ utils$1.isArray(redactKeys) && redactKeys.length > 0
15365
+ ? redactConfig(config, redactKeys)
15366
+ : utils$1.toJSONObject(config);
15504
15367
 
15505
- if (
15506
- (isFileList = utils$1.isFileList(data)) ||
15507
- contentType.indexOf('multipart/form-data') > -1
15508
- ) {
15509
- const env = own(this, 'env');
15510
- const _FormData = env && env.FormData;
15368
+ return {
15369
+ // Standard
15370
+ message: this.message,
15371
+ name: this.name,
15372
+ // Microsoft
15373
+ description: this.description,
15374
+ number: this.number,
15375
+ // Mozilla
15376
+ fileName: this.fileName,
15377
+ lineNumber: this.lineNumber,
15378
+ columnNumber: this.columnNumber,
15379
+ stack: this.stack,
15380
+ // Axios
15381
+ config: serializedConfig,
15382
+ code: this.code,
15383
+ status: this.status,
15384
+ };
15385
+ }
15386
+ };
15511
15387
 
15512
- return toFormData$1(
15513
- isFileList ? { 'files[]': data } : data,
15514
- _FormData && new _FormData(),
15515
- formSerializer
15516
- );
15517
- }
15518
- }
15388
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
15389
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
15390
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
15391
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
15392
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
15393
+ AxiosError$1.ECONNREFUSED = 'ECONNREFUSED';
15394
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
15395
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
15396
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
15397
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
15398
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
15399
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
15400
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
15401
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
15402
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
15519
15403
 
15520
- if (isObjectPayload || hasJSONContentType) {
15521
- headers.setContentType('application/json', false);
15522
- return stringifySafely(data);
15523
- }
15404
+ // eslint-disable-next-line strict
15405
+ const httpAdapter = null;
15524
15406
 
15525
- return data;
15526
- },
15527
- ],
15407
+ /**
15408
+ * Determines if the given thing is a array or js object.
15409
+ *
15410
+ * @param {string} thing - The object or array to be visited.
15411
+ *
15412
+ * @returns {boolean}
15413
+ */
15414
+ function isVisitable(thing) {
15415
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
15416
+ }
15528
15417
 
15529
- transformResponse: [
15530
- function transformResponse(data) {
15531
- const transitional = own(this, 'transitional') || defaults$1.transitional;
15532
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
15533
- const responseType = own(this, 'responseType');
15534
- const JSONRequested = responseType === 'json';
15418
+ /**
15419
+ * It removes the brackets from the end of a string
15420
+ *
15421
+ * @param {string} key - The key of the parameter.
15422
+ *
15423
+ * @returns {string} the key without the brackets.
15424
+ */
15425
+ function removeBrackets(key) {
15426
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
15427
+ }
15535
15428
 
15536
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
15537
- return data;
15538
- }
15429
+ /**
15430
+ * It takes a path, a key, and a boolean, and returns a string
15431
+ *
15432
+ * @param {string} path - The path to the current key.
15433
+ * @param {string} key - The key of the current object being iterated over.
15434
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
15435
+ *
15436
+ * @returns {string} The path to the current key.
15437
+ */
15438
+ function renderKey(path, key, dots) {
15439
+ if (!path) return key;
15440
+ return path
15441
+ .concat(key)
15442
+ .map(function each(token, i) {
15443
+ // eslint-disable-next-line no-param-reassign
15444
+ token = removeBrackets(token);
15445
+ return !dots && i ? '[' + token + ']' : token;
15446
+ })
15447
+ .join(dots ? '.' : '');
15448
+ }
15539
15449
 
15540
- if (
15541
- data &&
15542
- utils$1.isString(data) &&
15543
- ((forcedJSONParsing && !responseType) || JSONRequested)
15544
- ) {
15545
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
15546
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
15450
+ /**
15451
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
15452
+ *
15453
+ * @param {Array<any>} arr - The array to check
15454
+ *
15455
+ * @returns {boolean}
15456
+ */
15457
+ function isFlatArray(arr) {
15458
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
15459
+ }
15547
15460
 
15548
- try {
15549
- return JSON.parse(data, own(this, 'parseReviver'));
15550
- } catch (e) {
15551
- if (strictJSONParsing) {
15552
- if (e.name === 'SyntaxError') {
15553
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
15554
- }
15555
- throw e;
15556
- }
15557
- }
15558
- }
15461
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
15462
+ return /^is[A-Z]/.test(prop);
15463
+ });
15559
15464
 
15560
- return data;
15465
+ /**
15466
+ * Convert a data object to FormData
15467
+ *
15468
+ * @param {Object} obj
15469
+ * @param {?Object} [formData]
15470
+ * @param {?Object} [options]
15471
+ * @param {Function} [options.visitor]
15472
+ * @param {Boolean} [options.metaTokens = true]
15473
+ * @param {Boolean} [options.dots = false]
15474
+ * @param {?Boolean} [options.indexes = false]
15475
+ *
15476
+ * @returns {Object}
15477
+ **/
15478
+
15479
+ /**
15480
+ * It converts an object into a FormData object
15481
+ *
15482
+ * @param {Object<any, any>} obj - The object to convert to form data.
15483
+ * @param {string} formData - The FormData object to append to.
15484
+ * @param {Object<string, any>} options
15485
+ *
15486
+ * @returns
15487
+ */
15488
+ function toFormData$1(obj, formData, options) {
15489
+ if (!utils$1.isObject(obj)) {
15490
+ throw new TypeError('target must be an object');
15491
+ }
15492
+
15493
+ // eslint-disable-next-line no-param-reassign
15494
+ formData = formData || new (FormData)();
15495
+
15496
+ // eslint-disable-next-line no-param-reassign
15497
+ options = utils$1.toFlatObject(
15498
+ options,
15499
+ {
15500
+ metaTokens: true,
15501
+ dots: false,
15502
+ indexes: false,
15561
15503
  },
15562
- ],
15504
+ false,
15505
+ function defined(option, source) {
15506
+ // eslint-disable-next-line no-eq-null,eqeqeq
15507
+ return !utils$1.isUndefined(source[option]);
15508
+ }
15509
+ );
15563
15510
 
15564
- /**
15565
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
15566
- * timeout is not created.
15567
- */
15568
- timeout: 0,
15511
+ const metaTokens = options.metaTokens;
15512
+ // eslint-disable-next-line no-use-before-define
15513
+ const visitor = options.visitor || defaultVisitor;
15514
+ const dots = options.dots;
15515
+ const indexes = options.indexes;
15516
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
15517
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
15518
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
15569
15519
 
15570
- xsrfCookieName: 'XSRF-TOKEN',
15571
- xsrfHeaderName: 'X-XSRF-TOKEN',
15520
+ if (!utils$1.isFunction(visitor)) {
15521
+ throw new TypeError('visitor must be a function');
15522
+ }
15572
15523
 
15573
- maxContentLength: -1,
15574
- maxBodyLength: -1,
15524
+ function convertValue(value) {
15525
+ if (value === null) return '';
15575
15526
 
15576
- env: {
15577
- FormData: platform.classes.FormData,
15578
- Blob: platform.classes.Blob,
15579
- },
15527
+ if (utils$1.isDate(value)) {
15528
+ return value.toISOString();
15529
+ }
15580
15530
 
15581
- validateStatus: function validateStatus(status) {
15582
- return status >= 200 && status < 300;
15583
- },
15531
+ if (utils$1.isBoolean(value)) {
15532
+ return value.toString();
15533
+ }
15584
15534
 
15585
- headers: {
15586
- common: {
15587
- Accept: 'application/json, text/plain, */*',
15588
- 'Content-Type': undefined,
15589
- },
15590
- },
15591
- };
15535
+ if (!useBlob && utils$1.isBlob(value)) {
15536
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
15537
+ }
15592
15538
 
15593
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
15594
- defaults$1.headers[method] = {};
15595
- });
15539
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
15540
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
15541
+ }
15596
15542
 
15597
- // RawAxiosHeaders whose duplicates are ignored by node
15598
- // c.f. https://nodejs.org/api/http.html#http_message_headers
15599
- const ignoreDuplicateOf = utils$1.toObjectSet([
15600
- 'age',
15601
- 'authorization',
15602
- 'content-length',
15603
- 'content-type',
15604
- 'etag',
15605
- 'expires',
15606
- 'from',
15607
- 'host',
15608
- 'if-modified-since',
15609
- 'if-unmodified-since',
15610
- 'last-modified',
15611
- 'location',
15612
- 'max-forwards',
15613
- 'proxy-authorization',
15614
- 'referer',
15615
- 'retry-after',
15616
- 'user-agent',
15617
- ]);
15543
+ return value;
15544
+ }
15618
15545
 
15619
- /**
15620
- * Parse headers into an object
15621
- *
15622
- * ```
15623
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
15624
- * Content-Type: application/json
15625
- * Connection: keep-alive
15626
- * Transfer-Encoding: chunked
15627
- * ```
15628
- *
15629
- * @param {String} rawHeaders Headers needing to be parsed
15630
- *
15631
- * @returns {Object} Headers parsed into an object
15632
- */
15633
- const parseHeaders = (rawHeaders) => {
15634
- const parsed = {};
15635
- let key;
15636
- let val;
15637
- let i;
15546
+ /**
15547
+ * Default visitor.
15548
+ *
15549
+ * @param {*} value
15550
+ * @param {String|Number} key
15551
+ * @param {Array<String|Number>} path
15552
+ * @this {FormData}
15553
+ *
15554
+ * @returns {boolean} return true to visit the each prop of the value recursively
15555
+ */
15556
+ function defaultVisitor(value, key, path) {
15557
+ let arr = value;
15638
15558
 
15639
- rawHeaders &&
15640
- rawHeaders.split('\n').forEach(function parser(line) {
15641
- i = line.indexOf(':');
15642
- key = line.substring(0, i).trim().toLowerCase();
15643
- val = line.substring(i + 1).trim();
15559
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
15560
+ formData.append(renderKey(path, key, dots), convertValue(value));
15561
+ return false;
15562
+ }
15644
15563
 
15645
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
15646
- return;
15647
- }
15564
+ if (value && !path && typeof value === 'object') {
15565
+ if (utils$1.endsWith(key, '{}')) {
15566
+ // eslint-disable-next-line no-param-reassign
15567
+ key = metaTokens ? key : key.slice(0, -2);
15568
+ // eslint-disable-next-line no-param-reassign
15569
+ value = JSON.stringify(value);
15570
+ } else if (
15571
+ (utils$1.isArray(value) && isFlatArray(value)) ||
15572
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
15573
+ ) {
15574
+ // eslint-disable-next-line no-param-reassign
15575
+ key = removeBrackets(key);
15648
15576
 
15649
- if (key === 'set-cookie') {
15650
- if (parsed[key]) {
15651
- parsed[key].push(val);
15652
- } else {
15653
- parsed[key] = [val];
15654
- }
15655
- } else {
15656
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
15577
+ arr.forEach(function each(el, index) {
15578
+ !(utils$1.isUndefined(el) || el === null) &&
15579
+ formData.append(
15580
+ // eslint-disable-next-line no-nested-ternary
15581
+ indexes === true
15582
+ ? renderKey([key], index, dots)
15583
+ : indexes === null
15584
+ ? key
15585
+ : key + '[]',
15586
+ convertValue(el)
15587
+ );
15588
+ });
15589
+ return false;
15657
15590
  }
15658
- });
15591
+ }
15659
15592
 
15660
- return parsed;
15661
- };
15593
+ if (isVisitable(value)) {
15594
+ return true;
15595
+ }
15662
15596
 
15663
- const $internals = Symbol('internals');
15597
+ formData.append(renderKey(path, key, dots), convertValue(value));
15664
15598
 
15665
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
15599
+ return false;
15600
+ }
15666
15601
 
15667
- function trimSPorHTAB(str) {
15668
- let start = 0;
15669
- let end = str.length;
15602
+ const stack = [];
15670
15603
 
15671
- while (start < end) {
15672
- const code = str.charCodeAt(start);
15604
+ const exposedHelpers = Object.assign(predicates, {
15605
+ defaultVisitor,
15606
+ convertValue,
15607
+ isVisitable,
15608
+ });
15673
15609
 
15674
- if (code !== 0x09 && code !== 0x20) {
15675
- break;
15610
+ function build(value, path, depth = 0) {
15611
+ if (utils$1.isUndefined(value)) return;
15612
+
15613
+ if (depth > maxDepth) {
15614
+ throw new AxiosError$1(
15615
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
15616
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
15617
+ );
15676
15618
  }
15677
15619
 
15678
- start += 1;
15679
- }
15620
+ if (stack.indexOf(value) !== -1) {
15621
+ throw Error('Circular reference detected in ' + path.join('.'));
15622
+ }
15680
15623
 
15681
- while (end > start) {
15682
- const code = str.charCodeAt(end - 1);
15624
+ stack.push(value);
15683
15625
 
15684
- if (code !== 0x09 && code !== 0x20) {
15685
- break;
15686
- }
15626
+ utils$1.forEach(value, function each(el, key) {
15627
+ const result =
15628
+ !(utils$1.isUndefined(el) || el === null) &&
15629
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
15687
15630
 
15688
- end -= 1;
15631
+ if (result === true) {
15632
+ build(el, path ? path.concat(key) : [key], depth + 1);
15633
+ }
15634
+ });
15635
+
15636
+ stack.pop();
15689
15637
  }
15690
15638
 
15691
- return start === 0 && end === str.length ? str : str.slice(start, end);
15639
+ if (!utils$1.isObject(obj)) {
15640
+ throw new TypeError('data must be an object');
15641
+ }
15642
+
15643
+ build(obj);
15644
+
15645
+ return formData;
15692
15646
  }
15693
15647
 
15694
- function normalizeHeader(header) {
15695
- return header && String(header).trim().toLowerCase();
15648
+ /**
15649
+ * It encodes a string by replacing all characters that are not in the unreserved set with
15650
+ * their percent-encoded equivalents
15651
+ *
15652
+ * @param {string} str - The string to encode.
15653
+ *
15654
+ * @returns {string} The encoded string.
15655
+ */
15656
+ function encode$2(str) {
15657
+ const charMap = {
15658
+ '!': '%21',
15659
+ "'": '%27',
15660
+ '(': '%28',
15661
+ ')': '%29',
15662
+ '~': '%7E',
15663
+ '%20': '+',
15664
+ };
15665
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
15666
+ return charMap[match];
15667
+ });
15696
15668
  }
15697
15669
 
15698
- function sanitizeHeaderValue(str) {
15699
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
15670
+ /**
15671
+ * It takes a params object and converts it to a FormData object
15672
+ *
15673
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
15674
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
15675
+ *
15676
+ * @returns {void}
15677
+ */
15678
+ function AxiosURLSearchParams(params, options) {
15679
+ this._pairs = [];
15680
+
15681
+ params && toFormData$1(params, this, options);
15682
+ }
15683
+
15684
+ const prototype = AxiosURLSearchParams.prototype;
15685
+
15686
+ prototype.append = function append(name, value) {
15687
+ this._pairs.push([name, value]);
15688
+ };
15689
+
15690
+ prototype.toString = function toString(encoder) {
15691
+ const _encode = encoder
15692
+ ? function (value) {
15693
+ return encoder.call(this, value, encode$2);
15694
+ }
15695
+ : encode$2;
15696
+
15697
+ return this._pairs
15698
+ .map(function each(pair) {
15699
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
15700
+ }, '')
15701
+ .join('&');
15702
+ };
15703
+
15704
+ /**
15705
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15706
+ * their plain counterparts (`:`, `$`, `,`, `+`).
15707
+ *
15708
+ * @param {string} val The value to be encoded.
15709
+ *
15710
+ * @returns {string} The encoded value.
15711
+ */
15712
+ function encode$1(val) {
15713
+ return encodeURIComponent(val)
15714
+ .replace(/%3A/gi, ':')
15715
+ .replace(/%24/g, '$')
15716
+ .replace(/%2C/gi, ',')
15717
+ .replace(/%20/g, '+');
15700
15718
  }
15701
15719
 
15702
- function normalizeValue(value) {
15703
- if (value === false || value == null) {
15704
- return value;
15720
+ /**
15721
+ * Build a URL by appending params to the end
15722
+ *
15723
+ * @param {string} url The base of the url (e.g., http://www.google.com)
15724
+ * @param {object} [params] The params to be appended
15725
+ * @param {?(object|Function)} options
15726
+ *
15727
+ * @returns {string} The formatted url
15728
+ */
15729
+ function buildURL(url, params, options) {
15730
+ if (!params) {
15731
+ return url;
15705
15732
  }
15706
15733
 
15707
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
15708
- }
15709
-
15710
- function parseTokens(str) {
15711
- const tokens = Object.create(null);
15712
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
15713
- let match;
15714
-
15715
- while ((match = tokensRE.exec(str))) {
15716
- tokens[match[1]] = match[2];
15717
- }
15734
+ const _encode = (options && options.encode) || encode$1;
15718
15735
 
15719
- return tokens;
15720
- }
15736
+ const _options = utils$1.isFunction(options)
15737
+ ? {
15738
+ serialize: options,
15739
+ }
15740
+ : options;
15721
15741
 
15722
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
15742
+ const serializeFn = _options && _options.serialize;
15723
15743
 
15724
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15725
- if (utils$1.isFunction(filter)) {
15726
- return filter.call(this, value, header);
15727
- }
15744
+ let serializedParams;
15728
15745
 
15729
- if (isHeaderNameFilter) {
15730
- value = header;
15746
+ if (serializeFn) {
15747
+ serializedParams = serializeFn(params, _options);
15748
+ } else {
15749
+ serializedParams = utils$1.isURLSearchParams(params)
15750
+ ? params.toString()
15751
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
15731
15752
  }
15732
15753
 
15733
- if (!utils$1.isString(value)) return;
15734
-
15735
- if (utils$1.isString(filter)) {
15736
- return value.indexOf(filter) !== -1;
15737
- }
15754
+ if (serializedParams) {
15755
+ const hashmarkIndex = url.indexOf('#');
15738
15756
 
15739
- if (utils$1.isRegExp(filter)) {
15740
- return filter.test(value);
15757
+ if (hashmarkIndex !== -1) {
15758
+ url = url.slice(0, hashmarkIndex);
15759
+ }
15760
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
15741
15761
  }
15742
- }
15743
15762
 
15744
- function formatHeader(header) {
15745
- return header
15746
- .trim()
15747
- .toLowerCase()
15748
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
15749
- return char.toUpperCase() + str;
15750
- });
15763
+ return url;
15751
15764
  }
15752
15765
 
15753
- function buildAccessors(obj, header) {
15754
- const accessorName = utils$1.toCamelCase(' ' + header);
15766
+ class InterceptorManager {
15767
+ constructor() {
15768
+ this.handlers = [];
15769
+ }
15755
15770
 
15756
- ['get', 'set', 'has'].forEach((methodName) => {
15757
- Object.defineProperty(obj, methodName + accessorName, {
15758
- value: function (arg1, arg2, arg3) {
15759
- return this[methodName].call(this, header, arg1, arg2, arg3);
15760
- },
15761
- configurable: true,
15771
+ /**
15772
+ * Add a new interceptor to the stack
15773
+ *
15774
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
15775
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
15776
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
15777
+ *
15778
+ * @return {Number} An ID used to remove interceptor later
15779
+ */
15780
+ use(fulfilled, rejected, options) {
15781
+ this.handlers.push({
15782
+ fulfilled,
15783
+ rejected,
15784
+ synchronous: options ? options.synchronous : false,
15785
+ runWhen: options ? options.runWhen : null,
15762
15786
  });
15763
- });
15764
- }
15765
-
15766
- let AxiosHeaders$1 = class AxiosHeaders {
15767
- constructor(headers) {
15768
- headers && this.set(headers);
15787
+ return this.handlers.length - 1;
15769
15788
  }
15770
15789
 
15771
- set(header, valueOrRewrite, rewrite) {
15772
- const self = this;
15773
-
15774
- function setHeader(_value, _header, _rewrite) {
15775
- const lHeader = normalizeHeader(_header);
15776
-
15777
- if (!lHeader) {
15778
- throw new Error('header name must be a non-empty string');
15779
- }
15790
+ /**
15791
+ * Remove an interceptor from the stack
15792
+ *
15793
+ * @param {Number} id The ID that was returned by `use`
15794
+ *
15795
+ * @returns {void}
15796
+ */
15797
+ eject(id) {
15798
+ if (this.handlers[id]) {
15799
+ this.handlers[id] = null;
15800
+ }
15801
+ }
15780
15802
 
15781
- const key = utils$1.findKey(self, lHeader);
15803
+ /**
15804
+ * Clear all interceptors from the stack
15805
+ *
15806
+ * @returns {void}
15807
+ */
15808
+ clear() {
15809
+ if (this.handlers) {
15810
+ this.handlers = [];
15811
+ }
15812
+ }
15782
15813
 
15783
- if (
15784
- !key ||
15785
- self[key] === undefined ||
15786
- _rewrite === true ||
15787
- (_rewrite === undefined && self[key] !== false)
15788
- ) {
15789
- self[key || _header] = normalizeValue(_value);
15814
+ /**
15815
+ * Iterate over all the registered interceptors
15816
+ *
15817
+ * This method is particularly useful for skipping over any
15818
+ * interceptors that may have become `null` calling `eject`.
15819
+ *
15820
+ * @param {Function} fn The function to call for each interceptor
15821
+ *
15822
+ * @returns {void}
15823
+ */
15824
+ forEach(fn) {
15825
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
15826
+ if (h !== null) {
15827
+ fn(h);
15790
15828
  }
15791
- }
15829
+ });
15830
+ }
15831
+ }
15792
15832
 
15793
- const setHeaders = (headers, _rewrite) =>
15794
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15833
+ const transitionalDefaults = {
15834
+ silentJSONParsing: true,
15835
+ forcedJSONParsing: true,
15836
+ clarifyTimeoutError: false,
15837
+ legacyInterceptorReqResOrdering: true,
15838
+ };
15795
15839
 
15796
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
15797
- setHeaders(header, valueOrRewrite);
15798
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15799
- setHeaders(parseHeaders(header), valueOrRewrite);
15800
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15801
- let obj = {},
15802
- dest,
15803
- key;
15804
- for (const entry of header) {
15805
- if (!utils$1.isArray(entry)) {
15806
- throw TypeError('Object iterator must return a key-value pair');
15807
- }
15840
+ const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
15808
15841
 
15809
- obj[(key = entry[0])] = (dest = obj[key])
15810
- ? utils$1.isArray(dest)
15811
- ? [...dest, entry[1]]
15812
- : [dest, entry[1]]
15813
- : entry[1];
15814
- }
15842
+ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15815
15843
 
15816
- setHeaders(obj, valueOrRewrite);
15817
- } else {
15818
- header != null && setHeader(valueOrRewrite, header, rewrite);
15819
- }
15844
+ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15820
15845
 
15821
- return this;
15822
- }
15846
+ const platform$1 = {
15847
+ isBrowser: true,
15848
+ classes: {
15849
+ URLSearchParams: URLSearchParams$1,
15850
+ FormData: FormData$1,
15851
+ Blob: Blob$1,
15852
+ },
15853
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
15854
+ };
15823
15855
 
15824
- get(header, parser) {
15825
- header = normalizeHeader(header);
15856
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15826
15857
 
15827
- if (header) {
15828
- const key = utils$1.findKey(this, header);
15858
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
15829
15859
 
15830
- if (key) {
15831
- const value = this[key];
15860
+ /**
15861
+ * Determine if we're running in a standard browser environment
15862
+ *
15863
+ * This allows axios to run in a web worker, and react-native.
15864
+ * Both environments support XMLHttpRequest, but not fully standard globals.
15865
+ *
15866
+ * web workers:
15867
+ * typeof window -> undefined
15868
+ * typeof document -> undefined
15869
+ *
15870
+ * react-native:
15871
+ * navigator.product -> 'ReactNative'
15872
+ * nativescript
15873
+ * navigator.product -> 'NativeScript' or 'NS'
15874
+ *
15875
+ * @returns {boolean}
15876
+ */
15877
+ const hasStandardBrowserEnv =
15878
+ hasBrowserEnv &&
15879
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
15832
15880
 
15833
- if (!parser) {
15834
- return value;
15835
- }
15881
+ /**
15882
+ * Determine if we're running in a standard browser webWorker environment
15883
+ *
15884
+ * Although the `isStandardBrowserEnv` method indicates that
15885
+ * `allows axios to run in a web worker`, the WebWorker will still be
15886
+ * filtered out due to its judgment standard
15887
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15888
+ * This leads to a problem when axios post `FormData` in webWorker
15889
+ */
15890
+ const hasStandardBrowserWebWorkerEnv = (() => {
15891
+ return (
15892
+ typeof WorkerGlobalScope !== 'undefined' &&
15893
+ // eslint-disable-next-line no-undef
15894
+ self instanceof WorkerGlobalScope &&
15895
+ typeof self.importScripts === 'function'
15896
+ );
15897
+ })();
15836
15898
 
15837
- if (parser === true) {
15838
- return parseTokens(value);
15839
- }
15899
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
15840
15900
 
15841
- if (utils$1.isFunction(parser)) {
15842
- return parser.call(this, value, key);
15843
- }
15901
+ const utils = {
15902
+ __proto__: null,
15903
+ hasBrowserEnv: hasBrowserEnv,
15904
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
15905
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
15906
+ navigator: _navigator,
15907
+ origin: origin
15908
+ };
15844
15909
 
15845
- if (utils$1.isRegExp(parser)) {
15846
- return parser.exec(value);
15847
- }
15910
+ const platform = {
15911
+ ...utils,
15912
+ ...platform$1,
15913
+ };
15848
15914
 
15849
- throw new TypeError('parser must be boolean|regexp|function');
15915
+ function toURLEncodedForm(data, options) {
15916
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
15917
+ visitor: function (value, key, path, helpers) {
15918
+ if (platform.isNode && utils$1.isBuffer(value)) {
15919
+ this.append(key, value.toString('base64'));
15920
+ return false;
15850
15921
  }
15851
- }
15852
- }
15853
-
15854
- has(header, matcher) {
15855
- header = normalizeHeader(header);
15856
15922
 
15857
- if (header) {
15858
- const key = utils$1.findKey(this, header);
15923
+ return helpers.defaultVisitor.apply(this, arguments);
15924
+ },
15925
+ ...options,
15926
+ });
15927
+ }
15859
15928
 
15860
- return !!(
15861
- key &&
15862
- this[key] !== undefined &&
15863
- (!matcher || matchHeaderValue(this, this[key], key, matcher))
15864
- );
15865
- }
15929
+ /**
15930
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
15931
+ *
15932
+ * @param {string} name - The name of the property to get.
15933
+ *
15934
+ * @returns An array of strings.
15935
+ */
15936
+ function parsePropPath(name) {
15937
+ // foo[x][y][z]
15938
+ // foo.x.y.z
15939
+ // foo-x-y-z
15940
+ // foo x y z
15941
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
15942
+ return match[0] === '[]' ? '' : match[1] || match[0];
15943
+ });
15944
+ }
15866
15945
 
15867
- return false;
15946
+ /**
15947
+ * Convert an array to an object.
15948
+ *
15949
+ * @param {Array<any>} arr - The array to convert to an object.
15950
+ *
15951
+ * @returns An object with the same keys and values as the array.
15952
+ */
15953
+ function arrayToObject(arr) {
15954
+ const obj = {};
15955
+ const keys = Object.keys(arr);
15956
+ let i;
15957
+ const len = keys.length;
15958
+ let key;
15959
+ for (i = 0; i < len; i++) {
15960
+ key = keys[i];
15961
+ obj[key] = arr[key];
15868
15962
  }
15963
+ return obj;
15964
+ }
15869
15965
 
15870
- delete(header, matcher) {
15871
- const self = this;
15872
- let deleted = false;
15873
-
15874
- function deleteHeader(_header) {
15875
- _header = normalizeHeader(_header);
15966
+ /**
15967
+ * It takes a FormData object and returns a JavaScript object
15968
+ *
15969
+ * @param {string} formData The FormData object to convert to JSON.
15970
+ *
15971
+ * @returns {Object<string, any> | null} The converted object.
15972
+ */
15973
+ function formDataToJSON(formData) {
15974
+ function buildPath(path, value, target, index) {
15975
+ let name = path[index++];
15876
15976
 
15877
- if (_header) {
15878
- const key = utils$1.findKey(self, _header);
15977
+ if (name === '__proto__') return true;
15879
15978
 
15880
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
15881
- delete self[key];
15979
+ const isNumericKey = Number.isFinite(+name);
15980
+ const isLast = index >= path.length;
15981
+ name = !name && utils$1.isArray(target) ? target.length : name;
15882
15982
 
15883
- deleted = true;
15884
- }
15983
+ if (isLast) {
15984
+ if (utils$1.hasOwnProp(target, name)) {
15985
+ target[name] = utils$1.isArray(target[name])
15986
+ ? target[name].concat(value)
15987
+ : [target[name], value];
15988
+ } else {
15989
+ target[name] = value;
15885
15990
  }
15991
+
15992
+ return !isNumericKey;
15886
15993
  }
15887
15994
 
15888
- if (utils$1.isArray(header)) {
15889
- header.forEach(deleteHeader);
15890
- } else {
15891
- deleteHeader(header);
15995
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
15996
+ target[name] = [];
15892
15997
  }
15893
15998
 
15894
- return deleted;
15999
+ const result = buildPath(path, value, target[name], index);
16000
+
16001
+ if (result && utils$1.isArray(target[name])) {
16002
+ target[name] = arrayToObject(target[name]);
16003
+ }
16004
+
16005
+ return !isNumericKey;
15895
16006
  }
15896
16007
 
15897
- clear(matcher) {
15898
- const keys = Object.keys(this);
15899
- let i = keys.length;
15900
- let deleted = false;
16008
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
16009
+ const obj = {};
15901
16010
 
15902
- while (i--) {
15903
- const key = keys[i];
15904
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
15905
- delete this[key];
15906
- deleted = true;
15907
- }
15908
- }
16011
+ utils$1.forEachEntry(formData, (name, value) => {
16012
+ buildPath(parsePropPath(name), value, obj, 0);
16013
+ });
15909
16014
 
15910
- return deleted;
16015
+ return obj;
15911
16016
  }
15912
16017
 
15913
- normalize(format) {
15914
- const self = this;
15915
- const headers = {};
16018
+ return null;
16019
+ }
15916
16020
 
15917
- utils$1.forEach(this, (value, header) => {
15918
- const key = utils$1.findKey(headers, header);
16021
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
15919
16022
 
15920
- if (key) {
15921
- self[key] = normalizeValue(value);
15922
- delete self[header];
15923
- return;
16023
+ /**
16024
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
16025
+ * of the input
16026
+ *
16027
+ * @param {any} rawValue - The value to be stringified.
16028
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
16029
+ * @param {Function} encoder - A function that takes a value and returns a string.
16030
+ *
16031
+ * @returns {string} A stringified version of the rawValue.
16032
+ */
16033
+ function stringifySafely(rawValue, parser, encoder) {
16034
+ if (utils$1.isString(rawValue)) {
16035
+ try {
16036
+ (parser || JSON.parse)(rawValue);
16037
+ return utils$1.trim(rawValue);
16038
+ } catch (e) {
16039
+ if (e.name !== 'SyntaxError') {
16040
+ throw e;
15924
16041
  }
16042
+ }
16043
+ }
15925
16044
 
15926
- const normalized = format ? formatHeader(header) : String(header).trim();
16045
+ return (encoder || JSON.stringify)(rawValue);
16046
+ }
15927
16047
 
15928
- if (normalized !== header) {
15929
- delete self[header];
15930
- }
16048
+ const defaults$1 = {
16049
+ transitional: transitionalDefaults,
15931
16050
 
15932
- self[normalized] = normalizeValue(value);
16051
+ adapter: ['xhr', 'http', 'fetch'],
15933
16052
 
15934
- headers[normalized] = true;
15935
- });
16053
+ transformRequest: [
16054
+ function transformRequest(data, headers) {
16055
+ const contentType = headers.getContentType() || '';
16056
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
16057
+ const isObjectPayload = utils$1.isObject(data);
15936
16058
 
15937
- return this;
15938
- }
16059
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
16060
+ data = new FormData(data);
16061
+ }
15939
16062
 
15940
- concat(...targets) {
15941
- return this.constructor.concat(this, ...targets);
15942
- }
16063
+ const isFormData = utils$1.isFormData(data);
15943
16064
 
15944
- toJSON(asStrings) {
15945
- const obj = Object.create(null);
16065
+ if (isFormData) {
16066
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
16067
+ }
15946
16068
 
15947
- utils$1.forEach(this, (value, header) => {
15948
- value != null &&
15949
- value !== false &&
15950
- (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
15951
- });
16069
+ if (
16070
+ utils$1.isArrayBuffer(data) ||
16071
+ utils$1.isBuffer(data) ||
16072
+ utils$1.isStream(data) ||
16073
+ utils$1.isFile(data) ||
16074
+ utils$1.isBlob(data) ||
16075
+ utils$1.isReadableStream(data)
16076
+ ) {
16077
+ return data;
16078
+ }
16079
+ if (utils$1.isArrayBufferView(data)) {
16080
+ return data.buffer;
16081
+ }
16082
+ if (utils$1.isURLSearchParams(data)) {
16083
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
16084
+ return data.toString();
16085
+ }
15952
16086
 
15953
- return obj;
15954
- }
16087
+ let isFileList;
15955
16088
 
15956
- [Symbol.iterator]() {
15957
- return Object.entries(this.toJSON())[Symbol.iterator]();
15958
- }
16089
+ if (isObjectPayload) {
16090
+ const formSerializer = own(this, 'formSerializer');
16091
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
16092
+ return toURLEncodedForm(data, formSerializer).toString();
16093
+ }
15959
16094
 
15960
- toString() {
15961
- return Object.entries(this.toJSON())
15962
- .map(([header, value]) => header + ': ' + value)
15963
- .join('\n');
15964
- }
16095
+ if (
16096
+ (isFileList = utils$1.isFileList(data)) ||
16097
+ contentType.indexOf('multipart/form-data') > -1
16098
+ ) {
16099
+ const env = own(this, 'env');
16100
+ const _FormData = env && env.FormData;
15965
16101
 
15966
- getSetCookie() {
15967
- return this.get('set-cookie') || [];
15968
- }
16102
+ return toFormData$1(
16103
+ isFileList ? { 'files[]': data } : data,
16104
+ _FormData && new _FormData(),
16105
+ formSerializer
16106
+ );
16107
+ }
16108
+ }
15969
16109
 
15970
- get [Symbol.toStringTag]() {
15971
- return 'AxiosHeaders';
15972
- }
16110
+ if (isObjectPayload || hasJSONContentType) {
16111
+ headers.setContentType('application/json', false);
16112
+ return stringifySafely(data);
16113
+ }
15973
16114
 
15974
- static from(thing) {
15975
- return thing instanceof this ? thing : new this(thing);
15976
- }
16115
+ return data;
16116
+ },
16117
+ ],
15977
16118
 
15978
- static concat(first, ...targets) {
15979
- const computed = new this(first);
16119
+ transformResponse: [
16120
+ function transformResponse(data) {
16121
+ const transitional = own(this, 'transitional') || defaults$1.transitional;
16122
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
16123
+ const responseType = own(this, 'responseType');
16124
+ const JSONRequested = responseType === 'json';
15980
16125
 
15981
- targets.forEach((target) => computed.set(target));
16126
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
16127
+ return data;
16128
+ }
15982
16129
 
15983
- return computed;
15984
- }
16130
+ if (
16131
+ data &&
16132
+ utils$1.isString(data) &&
16133
+ ((forcedJSONParsing && !responseType) || JSONRequested)
16134
+ ) {
16135
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
16136
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
15985
16137
 
15986
- static accessor(header) {
15987
- const internals =
15988
- (this[$internals] =
15989
- this[$internals] =
15990
- {
15991
- accessors: {},
15992
- });
16138
+ try {
16139
+ return JSON.parse(data, own(this, 'parseReviver'));
16140
+ } catch (e) {
16141
+ if (strictJSONParsing) {
16142
+ if (e.name === 'SyntaxError') {
16143
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
16144
+ }
16145
+ throw e;
16146
+ }
16147
+ }
16148
+ }
15993
16149
 
15994
- const accessors = internals.accessors;
15995
- const prototype = this.prototype;
16150
+ return data;
16151
+ },
16152
+ ],
15996
16153
 
15997
- function defineAccessor(_header) {
15998
- const lHeader = normalizeHeader(_header);
16154
+ /**
16155
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
16156
+ * timeout is not created.
16157
+ */
16158
+ timeout: 0,
15999
16159
 
16000
- if (!accessors[lHeader]) {
16001
- buildAccessors(prototype, _header);
16002
- accessors[lHeader] = true;
16003
- }
16004
- }
16160
+ xsrfCookieName: 'XSRF-TOKEN',
16161
+ xsrfHeaderName: 'X-XSRF-TOKEN',
16005
16162
 
16006
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16163
+ maxContentLength: -1,
16164
+ maxBodyLength: -1,
16007
16165
 
16008
- return this;
16009
- }
16010
- };
16166
+ env: {
16167
+ FormData: platform.classes.FormData,
16168
+ Blob: platform.classes.Blob,
16169
+ },
16011
16170
 
16012
- AxiosHeaders$1.accessor([
16013
- 'Content-Type',
16014
- 'Content-Length',
16015
- 'Accept',
16016
- 'Accept-Encoding',
16017
- 'User-Agent',
16018
- 'Authorization',
16019
- ]);
16171
+ validateStatus: function validateStatus(status) {
16172
+ return status >= 200 && status < 300;
16173
+ },
16020
16174
 
16021
- // reserved names hotfix
16022
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
16023
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
16024
- return {
16025
- get: () => value,
16026
- set(headerValue) {
16027
- this[mapped] = headerValue;
16175
+ headers: {
16176
+ common: {
16177
+ Accept: 'application/json, text/plain, */*',
16178
+ 'Content-Type': undefined,
16028
16179
  },
16029
- };
16030
- });
16180
+ },
16181
+ };
16031
16182
 
16032
- utils$1.freezeMethods(AxiosHeaders$1);
16183
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
16184
+ defaults$1.headers[method] = {};
16185
+ });
16033
16186
 
16034
16187
  /**
16035
16188
  * Transform the data for a request or a response
@@ -16089,22 +16242,18 @@ ${JSON.stringify({
16089
16242
  if (!response.status || !validateStatus || validateStatus(response.status)) {
16090
16243
  resolve(response);
16091
16244
  } else {
16092
- reject(
16093
- new AxiosError$1(
16094
- 'Request failed with status code ' + response.status,
16095
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
16096
- Math.floor(response.status / 100) - 4
16097
- ],
16098
- response.config,
16099
- response.request,
16100
- response
16101
- )
16102
- );
16245
+ reject(new AxiosError$1(
16246
+ 'Request failed with status code ' + response.status,
16247
+ response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
16248
+ response.config,
16249
+ response.request,
16250
+ response
16251
+ ));
16103
16252
  }
16104
16253
  }
16105
16254
 
16106
16255
  function parseProtocol(url) {
16107
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
16256
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
16108
16257
  return (match && match[1]) || '';
16109
16258
  }
16110
16259
 
@@ -16208,6 +16357,9 @@ ${JSON.stringify({
16208
16357
  const _speedometer = speedometer(50, 250);
16209
16358
 
16210
16359
  return throttle((e) => {
16360
+ if (!e || typeof e.loaded !== 'number') {
16361
+ return;
16362
+ }
16211
16363
  const rawLoaded = e.loaded;
16212
16364
  const total = e.lengthComputable ? e.total : undefined;
16213
16365
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -16295,8 +16447,20 @@ ${JSON.stringify({
16295
16447
 
16296
16448
  read(name) {
16297
16449
  if (typeof document === 'undefined') return null;
16298
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
16299
- return match ? decodeURIComponent(match[1]) : null;
16450
+ // Match name=value by splitting on the semicolon separator instead of building a
16451
+ // RegExp from `name` interpolating an unescaped string into a RegExp would let
16452
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
16453
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
16454
+ // "; ", so ignore optional whitespace before each cookie name.
16455
+ const cookies = document.cookie.split(';');
16456
+ for (let i = 0; i < cookies.length; i++) {
16457
+ const cookie = cookies[i].replace(/^\s+/, '');
16458
+ const eq = cookie.indexOf('=');
16459
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
16460
+ return decodeURIComponent(cookie.slice(eq + 1));
16461
+ }
16462
+ }
16463
+ return null;
16300
16464
  },
16301
16465
 
16302
16466
  remove(name) {
@@ -16378,11 +16542,14 @@ ${JSON.stringify({
16378
16542
  config2 = config2 || {};
16379
16543
 
16380
16544
  // Use a null-prototype object so that downstream reads such as `config.auth`
16381
- // or `config.baseURL` cannot inherit polluted values from Object.prototype
16382
- // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
16383
- // own slot to preserve ergonomics for user code that relies on it.
16545
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
16546
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
16547
+ // ergonomics for user code that relies on it.
16384
16548
  const config = Object.create(null);
16385
16549
  Object.defineProperty(config, 'hasOwnProperty', {
16550
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
16551
+ // this data descriptor into an accessor descriptor on the way in.
16552
+ __proto__: null,
16386
16553
  value: Object.prototype.hasOwnProperty,
16387
16554
  enumerable: false,
16388
16555
  writable: true,
@@ -16479,11 +16646,39 @@ ${JSON.stringify({
16479
16646
  return config;
16480
16647
  }
16481
16648
 
16649
+ const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
16650
+
16651
+ function setFormDataHeaders(headers, formHeaders, policy) {
16652
+ if (policy !== 'content-only') {
16653
+ headers.set(formHeaders);
16654
+ return;
16655
+ }
16656
+
16657
+ Object.entries(formHeaders).forEach(([key, val]) => {
16658
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
16659
+ headers.set(key, val);
16660
+ }
16661
+ });
16662
+ }
16663
+
16664
+ /**
16665
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
16666
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
16667
+ *
16668
+ * @param {string} str The string to encode
16669
+ *
16670
+ * @returns {string} UTF-8 bytes as a Latin-1 string
16671
+ */
16672
+ const encodeUTF8 = (str) =>
16673
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
16674
+ String.fromCharCode(parseInt(hex, 16))
16675
+ );
16676
+
16482
16677
  const resolveConfig = (config) => {
16483
16678
  const newConfig = mergeConfig$1({}, config);
16484
16679
 
16485
16680
  // Read only own properties to prevent prototype pollution gadgets
16486
- // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
16681
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
16487
16682
  const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
16488
16683
 
16489
16684
  const data = own('data');
@@ -16509,11 +16704,7 @@ ${JSON.stringify({
16509
16704
  headers.set(
16510
16705
  'Authorization',
16511
16706
  'Basic ' +
16512
- btoa(
16513
- (auth.username || '') +
16514
- ':' +
16515
- (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
16516
- )
16707
+ btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
16517
16708
  );
16518
16709
  }
16519
16710
 
@@ -16522,14 +16713,7 @@ ${JSON.stringify({
16522
16713
  headers.setContentType(undefined); // browser handles it
16523
16714
  } else if (utils$1.isFunction(data.getHeaders)) {
16524
16715
  // Node.js FormData (like form-data package)
16525
- const formHeaders = data.getHeaders();
16526
- // Only set safe headers to avoid overwriting security headers
16527
- const allowedHeaders = ['content-type', 'content-length'];
16528
- Object.entries(formHeaders).forEach(([key, val]) => {
16529
- if (allowedHeaders.includes(key.toLowerCase())) {
16530
- headers.set(key, val);
16531
- }
16532
- });
16716
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
16533
16717
  }
16534
16718
  }
16535
16719
 
@@ -16544,10 +16728,9 @@ ${JSON.stringify({
16544
16728
 
16545
16729
  // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
16546
16730
  // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
16547
- // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
16731
+ // the XSRF token cross-origin.
16548
16732
  const shouldSendXSRF =
16549
- withXSRFToken === true ||
16550
- (withXSRFToken == null && isURLSameOrigin(newConfig.url));
16733
+ withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
16551
16734
 
16552
16735
  if (shouldSendXSRF) {
16553
16736
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -16643,7 +16826,7 @@ ${JSON.stringify({
16643
16826
  // will return status as 0 even though it's a successful request
16644
16827
  if (
16645
16828
  request.status === 0 &&
16646
- !(request.responseURL && request.responseURL.indexOf('file:') === 0)
16829
+ !(request.responseURL && request.responseURL.startsWith('file:'))
16647
16830
  ) {
16648
16831
  return;
16649
16832
  }
@@ -16660,6 +16843,7 @@ ${JSON.stringify({
16660
16843
  }
16661
16844
 
16662
16845
  reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
16846
+ done();
16663
16847
 
16664
16848
  // Clean up request
16665
16849
  request = null;
@@ -16675,6 +16859,7 @@ ${JSON.stringify({
16675
16859
  // attach the underlying event for consumers who want details
16676
16860
  err.event = event || null;
16677
16861
  reject(err);
16862
+ done();
16678
16863
  request = null;
16679
16864
  };
16680
16865
 
@@ -16695,6 +16880,7 @@ ${JSON.stringify({
16695
16880
  request
16696
16881
  )
16697
16882
  );
16883
+ done();
16698
16884
 
16699
16885
  // Clean up request
16700
16886
  request = null;
@@ -16705,7 +16891,7 @@ ${JSON.stringify({
16705
16891
 
16706
16892
  // Add headers to the request
16707
16893
  if ('setRequestHeader' in request) {
16708
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
16894
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
16709
16895
  request.setRequestHeader(key, val);
16710
16896
  });
16711
16897
  }
@@ -16744,6 +16930,7 @@ ${JSON.stringify({
16744
16930
  }
16745
16931
  reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
16746
16932
  request.abort();
16933
+ done();
16747
16934
  request = null;
16748
16935
  };
16749
16936
 
@@ -16757,7 +16944,7 @@ ${JSON.stringify({
16757
16944
 
16758
16945
  const protocol = parseProtocol(_config.url);
16759
16946
 
16760
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
16947
+ if (protocol && !platform.protocols.includes(protocol)) {
16761
16948
  reject(
16762
16949
  new AxiosError$1(
16763
16950
  'Unsupported protocol ' + protocol + ':',
@@ -16774,54 +16961,55 @@ ${JSON.stringify({
16774
16961
  };
16775
16962
 
16776
16963
  const composeSignals = (signals, timeout) => {
16777
- const { length } = (signals = signals ? signals.filter(Boolean) : []);
16778
-
16779
- if (timeout || length) {
16780
- let controller = new AbortController();
16781
-
16782
- let aborted;
16783
-
16784
- const onabort = function (reason) {
16785
- if (!aborted) {
16786
- aborted = true;
16787
- unsubscribe();
16788
- const err = reason instanceof Error ? reason : this.reason;
16789
- controller.abort(
16790
- err instanceof AxiosError$1
16791
- ? err
16792
- : new CanceledError$1(err instanceof Error ? err.message : err)
16793
- );
16794
- }
16795
- };
16964
+ signals = signals ? signals.filter(Boolean) : [];
16796
16965
 
16797
- let timer =
16798
- timeout &&
16799
- setTimeout(() => {
16800
- timer = null;
16801
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
16802
- }, timeout);
16803
-
16804
- const unsubscribe = () => {
16805
- if (signals) {
16806
- timer && clearTimeout(timer);
16807
- timer = null;
16808
- signals.forEach((signal) => {
16809
- signal.unsubscribe
16810
- ? signal.unsubscribe(onabort)
16811
- : signal.removeEventListener('abort', onabort);
16812
- });
16813
- signals = null;
16814
- }
16815
- };
16966
+ if (!timeout && !signals.length) {
16967
+ return;
16968
+ }
16816
16969
 
16817
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
16970
+ const controller = new AbortController();
16818
16971
 
16819
- const { signal } = controller;
16972
+ let aborted = false;
16820
16973
 
16821
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
16974
+ const onabort = function (reason) {
16975
+ if (!aborted) {
16976
+ aborted = true;
16977
+ unsubscribe();
16978
+ const err = reason instanceof Error ? reason : this.reason;
16979
+ controller.abort(
16980
+ err instanceof AxiosError$1
16981
+ ? err
16982
+ : new CanceledError$1(err instanceof Error ? err.message : err)
16983
+ );
16984
+ }
16985
+ };
16822
16986
 
16823
- return signal;
16824
- }
16987
+ let timer =
16988
+ timeout &&
16989
+ setTimeout(() => {
16990
+ timer = null;
16991
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
16992
+ }, timeout);
16993
+
16994
+ const unsubscribe = () => {
16995
+ if (!signals) { return; }
16996
+ timer && clearTimeout(timer);
16997
+ timer = null;
16998
+ signals.forEach((signal) => {
16999
+ signal.unsubscribe
17000
+ ? signal.unsubscribe(onabort)
17001
+ : signal.removeEventListener('abort', onabort);
17002
+ });
17003
+ signals = null;
17004
+ };
17005
+
17006
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
17007
+
17008
+ const { signal } = controller;
17009
+
17010
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
17011
+
17012
+ return signal;
16825
17013
  };
16826
17014
 
16827
17015
  const streamChunk = function* (chunk, chunkSize) {
@@ -16914,16 +17102,112 @@ ${JSON.stringify({
16914
17102
  );
16915
17103
  };
16916
17104
 
16917
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
17105
+ /**
17106
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
17107
+ * - For base64: compute exact decoded size using length and padding;
17108
+ * handle %XX at the character-count level (no string allocation).
17109
+ * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
17110
+ *
17111
+ * @param {string} url
17112
+ * @returns {number}
17113
+ */
17114
+ function estimateDataURLDecodedBytes(url) {
17115
+ if (!url || typeof url !== 'string') return 0;
17116
+ if (!url.startsWith('data:')) return 0;
17117
+
17118
+ const comma = url.indexOf(',');
17119
+ if (comma < 0) return 0;
17120
+
17121
+ const meta = url.slice(5, comma);
17122
+ const body = url.slice(comma + 1);
17123
+ const isBase64 = /;base64/i.test(meta);
17124
+
17125
+ if (isBase64) {
17126
+ let effectiveLen = body.length;
17127
+ const len = body.length; // cache length
17128
+
17129
+ for (let i = 0; i < len; i++) {
17130
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
17131
+ const a = body.charCodeAt(i + 1);
17132
+ const b = body.charCodeAt(i + 2);
17133
+ const isHex =
17134
+ ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
17135
+ ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
17136
+
17137
+ if (isHex) {
17138
+ effectiveLen -= 2;
17139
+ i += 2;
17140
+ }
17141
+ }
17142
+ }
16918
17143
 
16919
- const { isFunction } = utils$1;
17144
+ let pad = 0;
17145
+ let idx = len - 1;
17146
+
17147
+ const tailIsPct3D = (j) =>
17148
+ j >= 2 &&
17149
+ body.charCodeAt(j - 2) === 37 && // '%'
17150
+ body.charCodeAt(j - 1) === 51 && // '3'
17151
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
17152
+
17153
+ if (idx >= 0) {
17154
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
17155
+ pad++;
17156
+ idx--;
17157
+ } else if (tailIsPct3D(idx)) {
17158
+ pad++;
17159
+ idx -= 3;
17160
+ }
17161
+ }
17162
+
17163
+ if (pad === 1 && idx >= 0) {
17164
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
17165
+ pad++;
17166
+ } else if (tailIsPct3D(idx)) {
17167
+ pad++;
17168
+ }
17169
+ }
17170
+
17171
+ const groups = Math.floor(effectiveLen / 4);
17172
+ const bytes = groups * 3 - (pad || 0);
17173
+ return bytes > 0 ? bytes : 0;
17174
+ }
16920
17175
 
16921
- const globalFetchAPI = (({ Request, Response }) => ({
16922
- Request,
16923
- Response,
16924
- }))(utils$1.global);
17176
+ if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
17177
+ return Buffer.byteLength(body, 'utf8');
17178
+ }
17179
+
17180
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
17181
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
17182
+ // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
17183
+ // but 3 UTF-8 bytes).
17184
+ let bytes = 0;
17185
+ for (let i = 0, len = body.length; i < len; i++) {
17186
+ const c = body.charCodeAt(i);
17187
+ if (c < 0x80) {
17188
+ bytes += 1;
17189
+ } else if (c < 0x800) {
17190
+ bytes += 2;
17191
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
17192
+ const next = body.charCodeAt(i + 1);
17193
+ if (next >= 0xdc00 && next <= 0xdfff) {
17194
+ bytes += 4;
17195
+ i++;
17196
+ } else {
17197
+ bytes += 3;
17198
+ }
17199
+ } else {
17200
+ bytes += 3;
17201
+ }
17202
+ }
17203
+ return bytes;
17204
+ }
17205
+
17206
+ const VERSION$1 = "1.16.1";
17207
+
17208
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
16925
17209
 
16926
- const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
17210
+ const { isFunction } = utils$1;
16927
17211
 
16928
17212
  const test = (fn, ...args) => {
16929
17213
  try {
@@ -16934,11 +17218,20 @@ ${JSON.stringify({
16934
17218
  };
16935
17219
 
16936
17220
  const factory = (env) => {
17221
+ const globalObject =
17222
+ utils$1.global !== undefined && utils$1.global !== null
17223
+ ? utils$1.global
17224
+ : globalThis;
17225
+ const { ReadableStream, TextEncoder } = globalObject;
17226
+
16937
17227
  env = utils$1.merge.call(
16938
17228
  {
16939
17229
  skipUndefined: true,
16940
17230
  },
16941
- globalFetchAPI,
17231
+ {
17232
+ Request: globalObject.Request,
17233
+ Response: globalObject.Response,
17234
+ },
16942
17235
  env
16943
17236
  );
16944
17237
 
@@ -16951,7 +17244,7 @@ ${JSON.stringify({
16951
17244
  return false;
16952
17245
  }
16953
17246
 
16954
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
17247
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
16955
17248
 
16956
17249
  const encodeText =
16957
17250
  isFetchSupported &&
@@ -16969,7 +17262,7 @@ ${JSON.stringify({
16969
17262
  let duplexAccessed = false;
16970
17263
 
16971
17264
  const request = new Request(platform.origin, {
16972
- body: new ReadableStream$1(),
17265
+ body: new ReadableStream(),
16973
17266
  method: 'POST',
16974
17267
  get duplex() {
16975
17268
  duplexAccessed = true;
@@ -17065,8 +17358,13 @@ ${JSON.stringify({
17065
17358
  headers,
17066
17359
  withCredentials = 'same-origin',
17067
17360
  fetchOptions,
17361
+ maxContentLength,
17362
+ maxBodyLength,
17068
17363
  } = resolveConfig(config);
17069
17364
 
17365
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
17366
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
17367
+
17070
17368
  let _fetch = envFetch || fetch;
17071
17369
 
17072
17370
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
@@ -17088,6 +17386,41 @@ ${JSON.stringify({
17088
17386
  let requestContentLength;
17089
17387
 
17090
17388
  try {
17389
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
17390
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
17391
+ // "if (protocol === 'data:')" branch).
17392
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
17393
+ const estimated = estimateDataURLDecodedBytes(url);
17394
+ if (estimated > maxContentLength) {
17395
+ throw new AxiosError$1(
17396
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17397
+ AxiosError$1.ERR_BAD_RESPONSE,
17398
+ config,
17399
+ request
17400
+ );
17401
+ }
17402
+ }
17403
+
17404
+ // Enforce maxBodyLength against the outbound request body before dispatch.
17405
+ // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
17406
+ // maxBodyLength limit'). Skip when the body length cannot be determined
17407
+ // (e.g. a live ReadableStream supplied by the caller).
17408
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
17409
+ const outboundLength = await resolveBodyLength(headers, data);
17410
+ if (
17411
+ typeof outboundLength === 'number' &&
17412
+ isFinite(outboundLength) &&
17413
+ outboundLength > maxBodyLength
17414
+ ) {
17415
+ throw new AxiosError$1(
17416
+ 'Request body larger than maxBodyLength limit',
17417
+ AxiosError$1.ERR_BAD_REQUEST,
17418
+ config,
17419
+ request
17420
+ );
17421
+ }
17422
+ }
17423
+
17091
17424
  if (
17092
17425
  onUploadProgress &&
17093
17426
  supportsRequestStream &&
@@ -17138,11 +17471,14 @@ ${JSON.stringify({
17138
17471
  }
17139
17472
  }
17140
17473
 
17474
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
17475
+ headers.set('User-Agent', 'axios/' + VERSION$1, false);
17476
+
17141
17477
  const resolvedOptions = {
17142
17478
  ...fetchOptions,
17143
17479
  signal: composedSignal,
17144
17480
  method: method.toUpperCase(),
17145
- headers: headers.normalize().toJSON(),
17481
+ headers: toByteStringHeaderObject(headers.normalize()),
17146
17482
  body: data,
17147
17483
  duplex: 'half',
17148
17484
  credentials: isCredentialsSupported ? withCredentials : undefined,
@@ -17154,10 +17490,28 @@ ${JSON.stringify({
17154
17490
  ? _fetch(request, fetchOptions)
17155
17491
  : _fetch(url, resolvedOptions));
17156
17492
 
17493
+ // Cheap pre-check: if the server honestly declares a content-length that
17494
+ // already exceeds the cap, reject before we start streaming.
17495
+ if (hasMaxContentLength) {
17496
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
17497
+ if (declaredLength != null && declaredLength > maxContentLength) {
17498
+ throw new AxiosError$1(
17499
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17500
+ AxiosError$1.ERR_BAD_RESPONSE,
17501
+ config,
17502
+ request
17503
+ );
17504
+ }
17505
+ }
17506
+
17157
17507
  const isStreamResponse =
17158
17508
  supportsResponseStream && (responseType === 'stream' || responseType === 'response');
17159
17509
 
17160
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
17510
+ if (
17511
+ supportsResponseStream &&
17512
+ response.body &&
17513
+ (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
17514
+ ) {
17161
17515
  const options = {};
17162
17516
 
17163
17517
  ['status', 'statusText', 'headers'].forEach((prop) => {
@@ -17174,8 +17528,24 @@ ${JSON.stringify({
17174
17528
  )) ||
17175
17529
  [];
17176
17530
 
17531
+ let bytesRead = 0;
17532
+ const onChunkProgress = (loadedBytes) => {
17533
+ if (hasMaxContentLength) {
17534
+ bytesRead = loadedBytes;
17535
+ if (bytesRead > maxContentLength) {
17536
+ throw new AxiosError$1(
17537
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17538
+ AxiosError$1.ERR_BAD_RESPONSE,
17539
+ config,
17540
+ request
17541
+ );
17542
+ }
17543
+ }
17544
+ onProgress && onProgress(loadedBytes);
17545
+ };
17546
+
17177
17547
  response = new Response(
17178
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
17548
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
17179
17549
  flush && flush();
17180
17550
  unsubscribe && unsubscribe();
17181
17551
  }),
@@ -17190,6 +17560,33 @@ ${JSON.stringify({
17190
17560
  config
17191
17561
  );
17192
17562
 
17563
+ // Fallback enforcement for environments without ReadableStream support
17564
+ // (legacy runtimes). Detect materialized size from typed output; skip
17565
+ // streams/Response passthrough since the user will read those themselves.
17566
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
17567
+ let materializedSize;
17568
+ if (responseData != null) {
17569
+ if (typeof responseData.byteLength === 'number') {
17570
+ materializedSize = responseData.byteLength;
17571
+ } else if (typeof responseData.size === 'number') {
17572
+ materializedSize = responseData.size;
17573
+ } else if (typeof responseData === 'string') {
17574
+ materializedSize =
17575
+ typeof TextEncoder === 'function'
17576
+ ? new TextEncoder().encode(responseData).byteLength
17577
+ : responseData.length;
17578
+ }
17579
+ }
17580
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
17581
+ throw new AxiosError$1(
17582
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17583
+ AxiosError$1.ERR_BAD_RESPONSE,
17584
+ config,
17585
+ request
17586
+ );
17587
+ }
17588
+ }
17589
+
17193
17590
  !isStreamResponse && unsubscribe && unsubscribe();
17194
17591
 
17195
17592
  return await new Promise((resolve, reject) => {
@@ -17205,6 +17602,17 @@ ${JSON.stringify({
17205
17602
  } catch (err) {
17206
17603
  unsubscribe && unsubscribe();
17207
17604
 
17605
+ // Safari can surface fetch aborts as a DOMException-like object whose
17606
+ // branded getters throw. Prefer our composed signal reason before reading
17607
+ // the caught error, preserving timeout vs cancellation semantics.
17608
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
17609
+ const canceledError = composedSignal.reason;
17610
+ canceledError.config = config;
17611
+ request && (canceledError.request = request);
17612
+ err !== canceledError && (canceledError.cause = err);
17613
+ throw canceledError;
17614
+ }
17615
+
17208
17616
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
17209
17617
  throw Object.assign(
17210
17618
  new AxiosError$1(
@@ -17273,11 +17681,13 @@ ${JSON.stringify({
17273
17681
  utils$1.forEach(knownAdapters, (fn, value) => {
17274
17682
  if (fn) {
17275
17683
  try {
17276
- Object.defineProperty(fn, 'name', { value });
17684
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
17685
+ // these data descriptors into accessor descriptors on the way in.
17686
+ Object.defineProperty(fn, 'name', { __proto__: null, value });
17277
17687
  } catch (e) {
17278
17688
  // eslint-disable-next-line no-empty
17279
17689
  }
17280
- Object.defineProperty(fn, 'adapterName', { value });
17690
+ Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
17281
17691
  }
17282
17692
  });
17283
17693
 
@@ -17419,8 +17829,15 @@ ${JSON.stringify({
17419
17829
  function onAdapterResolution(response) {
17420
17830
  throwIfCancellationRequested(config);
17421
17831
 
17422
- // Transform response data
17423
- response.data = transformData.call(config, config.transformResponse, response);
17832
+ // Expose the current response on config so that transformResponse can
17833
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
17834
+ // We clean it up afterwards to avoid polluting the config object.
17835
+ config.response = response;
17836
+ try {
17837
+ response.data = transformData.call(config, config.transformResponse, response);
17838
+ } finally {
17839
+ delete config.response;
17840
+ }
17424
17841
 
17425
17842
  response.headers = AxiosHeaders$1.from(response.headers);
17426
17843
 
@@ -17432,11 +17849,16 @@ ${JSON.stringify({
17432
17849
 
17433
17850
  // Transform response data
17434
17851
  if (reason && reason.response) {
17435
- reason.response.data = transformData.call(
17436
- config,
17437
- config.transformResponse,
17438
- reason.response
17439
- );
17852
+ config.response = reason.response;
17853
+ try {
17854
+ reason.response.data = transformData.call(
17855
+ config,
17856
+ config.transformResponse,
17857
+ reason.response
17858
+ );
17859
+ } finally {
17860
+ delete config.response;
17861
+ }
17440
17862
  reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
17441
17863
  }
17442
17864
  }
@@ -17446,8 +17868,6 @@ ${JSON.stringify({
17446
17868
  );
17447
17869
  }
17448
17870
 
17449
- const VERSION$1 = "1.15.2";
17450
-
17451
17871
  const validators$1 = {};
17452
17872
 
17453
17873
  // eslint-disable-next-line func-names
@@ -17532,7 +17952,7 @@ ${JSON.stringify({
17532
17952
  while (i-- > 0) {
17533
17953
  const opt = keys[i];
17534
17954
  // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
17535
- // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
17955
+ // a non-function validator and cause a TypeError.
17536
17956
  const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
17537
17957
  if (validator) {
17538
17958
  const value = options[opt];
@@ -17692,7 +18112,7 @@ ${JSON.stringify({
17692
18112
  let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
17693
18113
 
17694
18114
  headers &&
17695
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
18115
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
17696
18116
  delete headers[method];
17697
18117
  });
17698
18118
 
@@ -17795,7 +18215,7 @@ ${JSON.stringify({
17795
18215
  };
17796
18216
  });
17797
18217
 
17798
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
18218
+ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
17799
18219
  function generateHTTPMethod(isForm) {
17800
18220
  return function httpMethod(url, data, config) {
17801
18221
  return this.request(
@@ -17815,7 +18235,11 @@ ${JSON.stringify({
17815
18235
 
17816
18236
  Axios$1.prototype[method] = generateHTTPMethod();
17817
18237
 
17818
- Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
18238
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
18239
+ // its semantics, so no queryForm shorthand is generated.
18240
+ if (method !== 'query') {
18241
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
18242
+ }
17819
18243
  });
17820
18244
 
17821
18245
  /**
@@ -18149,6 +18573,7 @@ ${JSON.stringify({
18149
18573
  formToJSON,
18150
18574
  getAdapter,
18151
18575
  mergeConfig,
18576
+ create,
18152
18577
  } = axios;
18153
18578
 
18154
18579
  var __defProp$P = Object.defineProperty;
@@ -18208,7 +18633,7 @@ ${JSON.stringify({
18208
18633
  this._logger = LoggerFactory.createNullLogger();
18209
18634
  const defaultHeaders = {};
18210
18635
  if (this.isServerSide()) {
18211
- defaultHeaders["User-Agent"] = "b24-js-sdk/1.1.2";
18636
+ defaultHeaders["User-Agent"] = "b24-js-sdk/1.2.0";
18212
18637
  }
18213
18638
  this._authActions = authActions;
18214
18639
  this._requestIdGenerator = new RequestIdGenerator();
@@ -19456,7 +19881,7 @@ ${JSON.stringify({
19456
19881
  }
19457
19882
  const queryParams = new URLSearchParams({
19458
19883
  [this._requestIdGenerator.getQueryStringParameterName()]: requestId,
19459
- [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.2",
19884
+ [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.2.0",
19460
19885
  [this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
19461
19886
  });
19462
19887
  return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
@@ -19710,7 +20135,7 @@ ${JSON.stringify({
19710
20135
  const methodUrl = `/${encodeURIComponent(method)}`;
19711
20136
  const queryParams = new URLSearchParams({
19712
20137
  [this._requestIdGenerator.getQueryStringParameterName()]: requestId,
19713
- [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.2",
20138
+ [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.2.0",
19714
20139
  [this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
19715
20140
  });
19716
20141
  return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
@@ -23263,7 +23688,7 @@ ${JSON.stringify({
23263
23688
  var protobuf = $require(entries[0]);
23264
23689
  if (module && module.exports)
23265
23690
  module.exports = protobuf;
23266
- }), "prelude"))({ 1: [function(require2, module2, exports$1) {
23691
+ }), "prelude"))({ 1: [function(require2, module2, exports) {
23267
23692
  module2.exports = asPromise;
23268
23693
  function asPromise(fn, ctx) {
23269
23694
  var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
@@ -23294,8 +23719,8 @@ ${JSON.stringify({
23294
23719
  }, "executor"));
23295
23720
  }
23296
23721
  __name(asPromise, "asPromise");
23297
- }, {}], 2: [function(require2, module2, exports$1) {
23298
- var base64 = exports$1;
23722
+ }, {}], 2: [function(require2, module2, exports) {
23723
+ var base64 = exports;
23299
23724
  base64.length = /* @__PURE__ */ __name(function length(string) {
23300
23725
  var p = string.length;
23301
23726
  if (!p)
@@ -23387,7 +23812,7 @@ ${JSON.stringify({
23387
23812
  base64.test = /* @__PURE__ */ __name(function test(string) {
23388
23813
  return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
23389
23814
  }, "test");
23390
- }, {}], 3: [function(require2, module2, exports$1) {
23815
+ }, {}], 3: [function(require2, module2, exports) {
23391
23816
  module2.exports = codegen;
23392
23817
  function codegen(functionParams, functionName) {
23393
23818
  if (typeof functionParams === "string") {
@@ -23446,7 +23871,7 @@ ${JSON.stringify({
23446
23871
  }
23447
23872
  __name(codegen, "codegen");
23448
23873
  codegen.verbose = false;
23449
- }, {}], 4: [function(require2, module2, exports$1) {
23874
+ }, {}], 4: [function(require2, module2, exports) {
23450
23875
  module2.exports = EventEmitter;
23451
23876
  function EventEmitter() {
23452
23877
  this._listeners = {};
@@ -23487,7 +23912,7 @@ ${JSON.stringify({
23487
23912
  }
23488
23913
  return this;
23489
23914
  }, "emit");
23490
- }, {}], 5: [function(require2, module2, exports$1) {
23915
+ }, {}], 5: [function(require2, module2, exports) {
23491
23916
  module2.exports = fetch;
23492
23917
  var asPromise = require2(1), inquire = require2(7);
23493
23918
  var fs = inquire("fs");
@@ -23532,7 +23957,7 @@ ${JSON.stringify({
23532
23957
  xhr.open("GET", filename);
23533
23958
  xhr.send();
23534
23959
  }, "fetch_xhr");
23535
- }, { "1": 1, "7": 7 }], 6: [function(require2, module2, exports$1) {
23960
+ }, { "1": 1, "7": 7 }], 6: [function(require2, module2, exports) {
23536
23961
  module2.exports = factory(factory);
23537
23962
  function factory(exports2) {
23538
23963
  if (typeof Float32Array !== "undefined") (function() {
@@ -23737,7 +24162,7 @@ ${JSON.stringify({
23737
24162
  return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0;
23738
24163
  }
23739
24164
  __name(readUintBE, "readUintBE");
23740
- }, {}], 7: [function(require2, module2, exports$1) {
24165
+ }, {}], 7: [function(require2, module2, exports) {
23741
24166
  module2.exports = inquire;
23742
24167
  function inquire(moduleName) {
23743
24168
  try {
@@ -23749,8 +24174,8 @@ ${JSON.stringify({
23749
24174
  return null;
23750
24175
  }
23751
24176
  __name(inquire, "inquire");
23752
- }, {}], 8: [function(require2, module2, exports$1) {
23753
- var path = exports$1;
24177
+ }, {}], 8: [function(require2, module2, exports) {
24178
+ var path = exports;
23754
24179
  var isAbsolute = (
23755
24180
  /**
23756
24181
  * Tests if the specified path is absolute.
@@ -23797,7 +24222,7 @@ ${JSON.stringify({
23797
24222
  originPath = normalize(originPath);
23798
24223
  return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
23799
24224
  }, "resolve");
23800
- }, {}], 9: [function(require2, module2, exports$1) {
24225
+ }, {}], 9: [function(require2, module2, exports) {
23801
24226
  module2.exports = pool;
23802
24227
  function pool(alloc, slice, size) {
23803
24228
  var SIZE = size || 8192;
@@ -23818,8 +24243,8 @@ ${JSON.stringify({
23818
24243
  }, "pool_alloc");
23819
24244
  }
23820
24245
  __name(pool, "pool");
23821
- }, {}], 10: [function(require2, module2, exports$1) {
23822
- var utf8 = exports$1;
24246
+ }, {}], 10: [function(require2, module2, exports) {
24247
+ var utf8 = exports;
23823
24248
  utf8.length = /* @__PURE__ */ __name(function utf8_length(string) {
23824
24249
  var len = 0, c = 0;
23825
24250
  for (var i = 0; i < string.length; ++i) {
@@ -23889,7 +24314,7 @@ ${JSON.stringify({
23889
24314
  }
23890
24315
  return offset - start;
23891
24316
  }, "utf8_write");
23892
- }, {}], 11: [function(require2, module2, exports$1) {
24317
+ }, {}], 11: [function(require2, module2, exports) {
23893
24318
  module2.exports = common;
23894
24319
  var commonRe = /\/|\./;
23895
24320
  function common(name, json) {
@@ -24216,8 +24641,8 @@ ${JSON.stringify({
24216
24641
  common.get = /* @__PURE__ */ __name(function get(file) {
24217
24642
  return common[file] || null;
24218
24643
  }, "get");
24219
- }, {}], 12: [function(require2, module2, exports$1) {
24220
- var converter = exports$1;
24644
+ }, {}], 12: [function(require2, module2, exports) {
24645
+ var converter = exports;
24221
24646
  var Enum = require2(15), util = require2(37);
24222
24647
  function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
24223
24648
  if (field.resolvedType) {
@@ -24408,7 +24833,7 @@ ${JSON.stringify({
24408
24833
  }
24409
24834
  return gen("return d");
24410
24835
  }, "toObject");
24411
- }, { "15": 15, "37": 37 }], 13: [function(require2, module2, exports$1) {
24836
+ }, { "15": 15, "37": 37 }], 13: [function(require2, module2, exports) {
24412
24837
  module2.exports = decoder;
24413
24838
  var Enum = require2(15), types = require2(36), util = require2(37);
24414
24839
  function missing(field) {
@@ -24452,7 +24877,7 @@ ${JSON.stringify({
24452
24877
  return gen("return m");
24453
24878
  }
24454
24879
  __name(decoder, "decoder");
24455
- }, { "15": 15, "36": 36, "37": 37 }], 14: [function(require2, module2, exports$1) {
24880
+ }, { "15": 15, "36": 36, "37": 37 }], 14: [function(require2, module2, exports) {
24456
24881
  module2.exports = encoder;
24457
24882
  var Enum = require2(15), types = require2(36), util = require2(37);
24458
24883
  function genTypePartial(gen, field, fieldIndex, ref) {
@@ -24495,7 +24920,7 @@ ${JSON.stringify({
24495
24920
  return gen("return w");
24496
24921
  }
24497
24922
  __name(encoder, "encoder");
24498
- }, { "15": 15, "36": 36, "37": 37 }], 15: [function(require2, module2, exports$1) {
24923
+ }, { "15": 15, "36": 36, "37": 37 }], 15: [function(require2, module2, exports) {
24499
24924
  module2.exports = Enum;
24500
24925
  var ReflectionObject = require2(24);
24501
24926
  ((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum";
@@ -24573,7 +24998,7 @@ ${JSON.stringify({
24573
24998
  Enum.prototype.isReservedName = /* @__PURE__ */ __name(function isReservedName(name) {
24574
24999
  return Namespace.isReservedName(this.reserved, name);
24575
25000
  }, "isReservedName");
24576
- }, { "23": 23, "24": 24, "37": 37 }], 16: [function(require2, module2, exports$1) {
25001
+ }, { "23": 23, "24": 24, "37": 37 }], 16: [function(require2, module2, exports) {
24577
25002
  module2.exports = Field;
24578
25003
  var ReflectionObject = require2(24);
24579
25004
  ((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field";
@@ -24710,7 +25135,7 @@ ${JSON.stringify({
24710
25135
  Field._configure = /* @__PURE__ */ __name(function configure(Type_) {
24711
25136
  Type = Type_;
24712
25137
  }, "configure");
24713
- }, { "15": 15, "24": 24, "36": 36, "37": 37 }], 17: [function(require2, module2, exports$1) {
25138
+ }, { "15": 15, "24": 24, "36": 36, "37": 37 }], 17: [function(require2, module2, exports) {
24714
25139
  var protobuf = module2.exports = require2(18);
24715
25140
  protobuf.build = "light";
24716
25141
  function load(filename, root, callback) {
@@ -24752,8 +25177,8 @@ ${JSON.stringify({
24752
25177
  protobuf.Namespace._configure(protobuf.Type, protobuf.Service);
24753
25178
  protobuf.Root._configure(protobuf.Type);
24754
25179
  protobuf.Field._configure(protobuf.Type);
24755
- }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "18": 18, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "29": 29, "33": 33, "35": 35, "36": 36, "37": 37, "40": 40, "41": 41 }], 18: [function(require2, module2, exports$1) {
24756
- var protobuf = exports$1;
25180
+ }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "18": 18, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "29": 29, "33": 33, "35": 35, "36": 36, "37": 37, "40": 40, "41": 41 }], 18: [function(require2, module2, exports) {
25181
+ var protobuf = exports;
24757
25182
  protobuf.build = "minimal";
24758
25183
  protobuf.Writer = require2(42);
24759
25184
  protobuf.BufferWriter = require2(43);
@@ -24770,14 +25195,14 @@ ${JSON.stringify({
24770
25195
  __name(configure, "configure");
24771
25196
  protobuf.Writer._configure(protobuf.BufferWriter);
24772
25197
  configure();
24773
- }, { "27": 27, "28": 28, "30": 30, "31": 31, "39": 39, "42": 42, "43": 43 }], 19: [function(require2, module2, exports$1) {
25198
+ }, { "27": 27, "28": 28, "30": 30, "31": 31, "39": 39, "42": 42, "43": 43 }], 19: [function(require2, module2, exports) {
24774
25199
  var protobuf = module2.exports = require2(17);
24775
25200
  protobuf.build = "full";
24776
25201
  protobuf.tokenize = require2(34);
24777
25202
  protobuf.parse = require2(26);
24778
25203
  protobuf.common = require2(11);
24779
25204
  protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);
24780
- }, { "11": 11, "17": 17, "26": 26, "34": 34 }], 20: [function(require2, module2, exports$1) {
25205
+ }, { "11": 11, "17": 17, "26": 26, "34": 34 }], 20: [function(require2, module2, exports) {
24781
25206
  module2.exports = MapField;
24782
25207
  var Field = require2(16);
24783
25208
  ((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField";
@@ -24827,7 +25252,7 @@ ${JSON.stringify({
24827
25252
  util.decorateType(prototype.constructor).add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));
24828
25253
  }, "mapFieldDecorator");
24829
25254
  }, "decorateMapField");
24830
- }, { "16": 16, "36": 36, "37": 37 }], 21: [function(require2, module2, exports$1) {
25255
+ }, { "16": 16, "36": 36, "37": 37 }], 21: [function(require2, module2, exports) {
24831
25256
  module2.exports = Message;
24832
25257
  var util = require2(39);
24833
25258
  function Message(properties) {
@@ -24863,7 +25288,7 @@ ${JSON.stringify({
24863
25288
  Message.prototype.toJSON = /* @__PURE__ */ __name(function toJSON() {
24864
25289
  return this.$type.toObject(this, util.toJSONOptions);
24865
25290
  }, "toJSON");
24866
- }, { "39": 39 }], 22: [function(require2, module2, exports$1) {
25291
+ }, { "39": 39 }], 22: [function(require2, module2, exports) {
24867
25292
  module2.exports = Method;
24868
25293
  var ReflectionObject = require2(24);
24869
25294
  ((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method";
@@ -24923,7 +25348,7 @@ ${JSON.stringify({
24923
25348
  this.resolvedResponseType = this.parent.lookupType(this.responseType);
24924
25349
  return ReflectionObject.prototype.resolve.call(this);
24925
25350
  }, "resolve");
24926
- }, { "24": 24, "37": 37 }], 23: [function(require2, module2, exports$1) {
25351
+ }, { "24": 24, "37": 37 }], 23: [function(require2, module2, exports) {
24927
25352
  module2.exports = Namespace;
24928
25353
  var ReflectionObject = require2(24);
24929
25354
  ((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";
@@ -25125,7 +25550,7 @@ ${JSON.stringify({
25125
25550
  Type = Type_;
25126
25551
  Service = Service_;
25127
25552
  };
25128
- }, { "15": 15, "16": 16, "24": 24, "37": 37 }], 24: [function(require2, module2, exports$1) {
25553
+ }, { "15": 15, "16": 16, "24": 24, "37": 37 }], 24: [function(require2, module2, exports) {
25129
25554
  module2.exports = ReflectionObject;
25130
25555
  ReflectionObject.className = "ReflectionObject";
25131
25556
  var util = require2(37);
@@ -25227,7 +25652,7 @@ ${JSON.stringify({
25227
25652
  ReflectionObject._configure = function(Root_) {
25228
25653
  Root = Root_;
25229
25654
  };
25230
- }, { "37": 37 }], 25: [function(require2, module2, exports$1) {
25655
+ }, { "37": 37 }], 25: [function(require2, module2, exports) {
25231
25656
  module2.exports = OneOf;
25232
25657
  var ReflectionObject = require2(24);
25233
25658
  ((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf";
@@ -25321,7 +25746,7 @@ ${JSON.stringify({
25321
25746
  });
25322
25747
  }, "oneOfDecorator");
25323
25748
  }, "decorateOneOf");
25324
- }, { "16": 16, "24": 24, "37": 37 }], 26: [function(require2, module2, exports$1) {
25749
+ }, { "16": 16, "24": 24, "37": 37 }], 26: [function(require2, module2, exports) {
25325
25750
  module2.exports = parse;
25326
25751
  parse.filename = null;
25327
25752
  parse.defaults = { keepCase: false };
@@ -25870,7 +26295,7 @@ ${JSON.stringify({
25870
26295
  };
25871
26296
  }
25872
26297
  __name(parse, "parse");
25873
- }, { "15": 15, "16": 16, "20": 20, "22": 22, "25": 25, "29": 29, "33": 33, "34": 34, "35": 35, "36": 36, "37": 37 }], 27: [function(require2, module2, exports$1) {
26298
+ }, { "15": 15, "16": 16, "20": 20, "22": 22, "25": 25, "29": 29, "33": 33, "34": 34, "35": 35, "36": 36, "37": 37 }], 27: [function(require2, module2, exports) {
25874
26299
  module2.exports = Reader;
25875
26300
  var util = require2(39);
25876
26301
  var BufferReader;
@@ -26085,7 +26510,7 @@ ${JSON.stringify({
26085
26510
  }, "read_sfixed64")
26086
26511
  });
26087
26512
  };
26088
- }, { "39": 39 }], 28: [function(require2, module2, exports$1) {
26513
+ }, { "39": 39 }], 28: [function(require2, module2, exports) {
26089
26514
  module2.exports = BufferReader;
26090
26515
  var Reader = require2(27);
26091
26516
  (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
@@ -26100,7 +26525,7 @@ ${JSON.stringify({
26100
26525
  var len = this.uint32();
26101
26526
  return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));
26102
26527
  }, "read_string_buffer");
26103
- }, { "27": 27, "39": 39 }], 29: [function(require2, module2, exports$1) {
26528
+ }, { "27": 27, "39": 39 }], 29: [function(require2, module2, exports) {
26104
26529
  module2.exports = Root;
26105
26530
  var Namespace = require2(23);
26106
26531
  ((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root";
@@ -26317,12 +26742,12 @@ ${JSON.stringify({
26317
26742
  parse = parse_;
26318
26743
  common = common_;
26319
26744
  };
26320
- }, { "15": 15, "16": 16, "23": 23, "25": 25, "37": 37 }], 30: [function(require2, module2, exports$1) {
26745
+ }, { "15": 15, "16": 16, "23": 23, "25": 25, "37": 37 }], 30: [function(require2, module2, exports) {
26321
26746
  module2.exports = {};
26322
- }, {}], 31: [function(require2, module2, exports$1) {
26323
- var rpc = exports$1;
26747
+ }, {}], 31: [function(require2, module2, exports) {
26748
+ var rpc = exports;
26324
26749
  rpc.Service = require2(32);
26325
- }, { "32": 32 }], 32: [function(require2, module2, exports$1) {
26750
+ }, { "32": 32 }], 32: [function(require2, module2, exports) {
26326
26751
  module2.exports = Service;
26327
26752
  var util = require2(39);
26328
26753
  (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
@@ -26392,7 +26817,7 @@ ${JSON.stringify({
26392
26817
  }
26393
26818
  return this;
26394
26819
  }, "end");
26395
- }, { "39": 39 }], 33: [function(require2, module2, exports$1) {
26820
+ }, { "39": 39 }], 33: [function(require2, module2, exports) {
26396
26821
  module2.exports = Service;
26397
26822
  var Namespace = require2(23);
26398
26823
  ((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service";
@@ -26480,7 +26905,7 @@ ${JSON.stringify({
26480
26905
  }
26481
26906
  return rpcService;
26482
26907
  }, "create");
26483
- }, { "22": 22, "23": 23, "31": 31, "37": 37 }], 34: [function(require2, module2, exports$1) {
26908
+ }, { "22": 22, "23": 23, "31": 31, "37": 37 }], 34: [function(require2, module2, exports) {
26484
26909
  module2.exports = tokenize;
26485
26910
  var delimRe = /[\s{}=;:[\],'"()<>]/g, stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g;
26486
26911
  var setCommentRe = /^ *[*/]+ */, setCommentAltRe = /^\s*\*?\/*/, setCommentSplitRe = /\n/g, whitespaceRe = /\s/, unescapeRe = /\\(.?)/g;
@@ -26711,7 +27136,7 @@ ${JSON.stringify({
26711
27136
  });
26712
27137
  }
26713
27138
  __name(tokenize, "tokenize");
26714
- }, {}], 35: [function(require2, module2, exports$1) {
27139
+ }, {}], 35: [function(require2, module2, exports) {
26715
27140
  module2.exports = Type;
26716
27141
  var Namespace = require2(23);
26717
27142
  ((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type";
@@ -27011,8 +27436,8 @@ ${JSON.stringify({
27011
27436
  util.decorateType(target, typeName);
27012
27437
  }, "typeDecorator");
27013
27438
  }, "decorateType");
27014
- }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "20": 20, "21": 21, "23": 23, "25": 25, "27": 27, "33": 33, "37": 37, "40": 40, "41": 41, "42": 42 }], 36: [function(require2, module2, exports$1) {
27015
- var types = exports$1;
27439
+ }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "20": 20, "21": 21, "23": 23, "25": 25, "27": 27, "33": 33, "37": 37, "40": 40, "41": 41, "42": 42 }], 36: [function(require2, module2, exports) {
27440
+ var types = exports;
27016
27441
  var util = require2(37);
27017
27442
  var s = [
27018
27443
  "double",
@@ -27185,7 +27610,7 @@ ${JSON.stringify({
27185
27610
  /* bool */
27186
27611
  0
27187
27612
  ]);
27188
- }, { "37": 37 }], 37: [function(require2, module2, exports$1) {
27613
+ }, { "37": 37 }], 37: [function(require2, module2, exports) {
27189
27614
  var util = module2.exports = require2(39);
27190
27615
  var roots = require2(30);
27191
27616
  var Type, Enum;
@@ -27266,7 +27691,7 @@ ${JSON.stringify({
27266
27691
  return roots["decorated"] || (roots["decorated"] = new (require2(29))());
27267
27692
  }, "get")
27268
27693
  });
27269
- }, { "15": 15, "29": 29, "3": 3, "30": 30, "35": 35, "39": 39, "5": 5, "8": 8 }], 38: [function(require2, module2, exports$1) {
27694
+ }, { "15": 15, "29": 29, "3": 3, "30": 30, "35": 35, "39": 39, "5": 5, "8": 8 }], 38: [function(require2, module2, exports) {
27270
27695
  module2.exports = LongBits;
27271
27696
  var util = require2(39);
27272
27697
  function LongBits(lo, hi) {
@@ -27363,8 +27788,8 @@ ${JSON.stringify({
27363
27788
  var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24;
27364
27789
  return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10;
27365
27790
  }, "length");
27366
- }, { "39": 39 }], 39: [function(require2, module2, exports$1) {
27367
- var util = exports$1;
27791
+ }, { "39": 39 }], 39: [function(require2, module2, exports) {
27792
+ var util = exports;
27368
27793
  util.asPromise = require2(1);
27369
27794
  util.base64 = require2(2);
27370
27795
  util.EventEmitter = require2(4);
@@ -27512,7 +27937,7 @@ ${JSON.stringify({
27512
27937
  return new Buffer2(size);
27513
27938
  }, "Buffer_allocUnsafe");
27514
27939
  };
27515
- }, { "1": 1, "10": 10, "2": 2, "38": 38, "4": 4, "6": 6, "7": 7, "9": 9 }], 40: [function(require2, module2, exports$1) {
27940
+ }, { "1": 1, "10": 10, "2": 2, "38": 38, "4": 4, "6": 6, "7": 7, "9": 9 }], 40: [function(require2, module2, exports) {
27516
27941
  module2.exports = verifier;
27517
27942
  var Enum = require2(15), util = require2(37);
27518
27943
  function invalid(field, expected) {
@@ -27614,8 +28039,8 @@ ${JSON.stringify({
27614
28039
  return gen("return null");
27615
28040
  }
27616
28041
  __name(verifier, "verifier");
27617
- }, { "15": 15, "37": 37 }], 41: [function(require2, module2, exports$1) {
27618
- var wrappers = exports$1;
28042
+ }, { "15": 15, "37": 37 }], 41: [function(require2, module2, exports) {
28043
+ var wrappers = exports;
27619
28044
  var Message = require2(21);
27620
28045
  wrappers[".google.protobuf.Any"] = {
27621
28046
  fromObject: /* @__PURE__ */ __name(function(object) {
@@ -27646,7 +28071,7 @@ ${JSON.stringify({
27646
28071
  return this.toObject(message, options);
27647
28072
  }, "toObject")
27648
28073
  };
27649
- }, { "21": 21 }], 42: [function(require2, module2, exports$1) {
28074
+ }, { "21": 21 }], 42: [function(require2, module2, exports) {
27650
28075
  module2.exports = Writer;
27651
28076
  var util = require2(39);
27652
28077
  var BufferWriter;
@@ -27833,7 +28258,7 @@ ${JSON.stringify({
27833
28258
  Writer._configure = function(BufferWriter_) {
27834
28259
  BufferWriter = BufferWriter_;
27835
28260
  };
27836
- }, { "39": 39 }], 43: [function(require2, module2, exports$1) {
28261
+ }, { "39": 39 }], 43: [function(require2, module2, exports) {
27837
28262
  module2.exports = BufferWriter;
27838
28263
  var Writer = require2(42);
27839
28264
  (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;