@cognigy/webchat 3.42.0 → 3.43.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.
package/OSS_LICENSES.txt CHANGED
@@ -1,4 +1,4 @@
1
- Created on 30-04-2026 at 06:59:50
1
+ Created on 15-05-2026 at 12:21:32
2
2
 
3
3
  {
4
4
  "@babel/code-frame@7.29.0": {
@@ -170,7 +170,7 @@ Created on 30-04-2026 at 06:59:50
170
170
  "licenseFile": "node_modules/@cognigy/socket-client/LICENSE",
171
171
  "copyright": "Copyright (c) 2019 Cognigy GmbH"
172
172
  },
173
- "@cognigy/webchat@3.42.0": {
173
+ "@cognigy/webchat@3.43.0": {
174
174
  "licenses": "MIT*",
175
175
  "repository": "https://github.com/Cognigy/Webchat",
176
176
  "publisher": "Cognigy GmbH",
@@ -528,7 +528,7 @@ Created on 30-04-2026 at 06:59:50
528
528
  "licenseFile": "node_modules/autolinker/LICENSE",
529
529
  "copyright": "Copyright (c) 2014 Gregory Jacobs (http://greg-jacobs.com)"
530
530
  },
531
- "axios@1.15.0": {
531
+ "axios@1.15.2": {
532
532
  "licenses": "MIT",
533
533
  "repository": "https://github.com/axios/axios",
534
534
  "publisher": "Matt Zabriskie",
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * webchat.esm.js v3.42.0
3
- * https://github.com/Cognigy/Webchat/tree/v3.42.0
4
- * https://github.com/Cognigy/Webchat/tree/v3.42.0/OSS_LICENSES.txt
2
+ * webchat.esm.js v3.43.0
3
+ * https://github.com/Cognigy/Webchat/tree/v3.43.0
4
+ * https://github.com/Cognigy/Webchat/tree/v3.43.0/OSS_LICENSES.txt
5
5
  */
6
6
  import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom";
@@ -135860,16 +135860,18 @@ const factory = env => {
135860
135860
  const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? (encoder => str => encoder.encode(str))(new TextEncoder()) : async str => new Uint8Array(await new Request(str).arrayBuffer()));
135861
135861
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
135862
135862
  let duplexAccessed = false;
135863
- const body = new ReadableStream();
135864
- const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.origin, {
135865
- body,
135863
+ const request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.origin, {
135864
+ body: new ReadableStream(),
135866
135865
  method: 'POST',
135867
135866
  get duplex() {
135868
135867
  duplexAccessed = true;
135869
135868
  return 'half';
135870
135869
  }
135871
- }).headers.has('Content-Type');
135872
- body.cancel();
135870
+ });
135871
+ const hasContentType = request.headers.has('Content-Type');
135872
+ if (request.body != null) {
135873
+ request.body.cancel();
135874
+ }
135873
135875
  return duplexAccessed && !hasContentType;
135874
135876
  });
135875
135877
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isReadableStream(new Response('').body));
@@ -135961,6 +135963,15 @@ const factory = env => {
135961
135963
  // Cloudflare Workers throws when credentials are defined
135962
135964
  // see https://github.com/cloudflare/workerd/issues/902
135963
135965
  const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
135966
+
135967
+ // If data is FormData and Content-Type is multipart/form-data without boundary,
135968
+ // delete it so fetch can set it correctly with the boundary
135969
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFormData(data)) {
135970
+ const contentType = headers.getContentType();
135971
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
135972
+ headers.delete('content-type');
135973
+ }
135974
+ }
135964
135975
  const resolvedOptions = {
135965
135976
  ...fetchOptions,
135966
135977
  signal: composedSignal,
@@ -136853,6 +136864,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
136853
136864
  AxiosError.ERR_CANCELED = 'ERR_CANCELED';
136854
136865
  AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
136855
136866
  AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
136867
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
136856
136868
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError);
136857
136869
 
136858
136870
  /***/ },
@@ -136870,38 +136882,37 @@ AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
136870
136882
 
136871
136883
 
136872
136884
  const $internals = Symbol('internals');
136873
- const isValidHeaderValue = value => !/[\r\n]/.test(value);
136874
- function assertValidHeaderValue(value, header) {
136875
- if (value === false || value == null) {
136876
- return;
136877
- }
136878
- if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(value)) {
136879
- value.forEach(v => assertValidHeaderValue(v, header));
136880
- return;
136885
+ const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
136886
+ function trimSPorHTAB(str) {
136887
+ let start = 0;
136888
+ let end = str.length;
136889
+ while (start < end) {
136890
+ const code = str.charCodeAt(start);
136891
+ if (code !== 0x09 && code !== 0x20) {
136892
+ break;
136893
+ }
136894
+ start += 1;
136881
136895
  }
136882
- if (!isValidHeaderValue(String(value))) {
136883
- throw new Error(`Invalid character in header content ["${header}"]`);
136896
+ while (end > start) {
136897
+ const code = str.charCodeAt(end - 1);
136898
+ if (code !== 0x09 && code !== 0x20) {
136899
+ break;
136900
+ }
136901
+ end -= 1;
136884
136902
  }
136903
+ return start === 0 && end === str.length ? str : str.slice(start, end);
136885
136904
  }
136886
136905
  function normalizeHeader(header) {
136887
136906
  return header && String(header).trim().toLowerCase();
136888
136907
  }
136889
- function stripTrailingCRLF(str) {
136890
- let end = str.length;
136891
- while (end > 0) {
136892
- const charCode = str.charCodeAt(end - 1);
136893
- if (charCode !== 10 && charCode !== 13) {
136894
- break;
136895
- }
136896
- end -= 1;
136897
- }
136898
- return end === str.length ? str : str.slice(0, end);
136908
+ function sanitizeHeaderValue(str) {
136909
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
136899
136910
  }
136900
136911
  function normalizeValue(value) {
136901
136912
  if (value === false || value == null) {
136902
136913
  return value;
136903
136914
  }
136904
- return _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
136915
+ return _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
136905
136916
  }
136906
136917
  function parseTokens(str) {
136907
136918
  const tokens = Object.create(null);
@@ -136957,7 +136968,6 @@ class AxiosHeaders {
136957
136968
  }
136958
136969
  const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.findKey(self, lHeader);
136959
136970
  if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
136960
- assertValidHeaderValue(_value, _header);
136961
136971
  self[key || _header] = normalizeValue(_value);
136962
136972
  }
136963
136973
  }
@@ -137235,7 +137245,7 @@ class InterceptorManager {
137235
137245
  */
137236
137246
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
137237
137247
  let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(requestedURL);
137238
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
137248
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
137239
137249
  return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(baseURL, requestedURL);
137240
137250
  }
137241
137251
  return requestedURL;
@@ -137348,7 +137358,18 @@ const headersToObject = thing => thing instanceof _AxiosHeaders_js__WEBPACK_IMPO
137348
137358
  function mergeConfig(config1, config2) {
137349
137359
  // eslint-disable-next-line no-param-reassign
137350
137360
  config2 = config2 || {};
137351
- const config = {};
137361
+
137362
+ // Use a null-prototype object so that downstream reads such as `config.auth`
137363
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype
137364
+ // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
137365
+ // own slot to preserve ergonomics for user code that relies on it.
137366
+ const config = Object.create(null);
137367
+ Object.defineProperty(config, 'hasOwnProperty', {
137368
+ value: Object.prototype.hasOwnProperty,
137369
+ enumerable: false,
137370
+ writable: true,
137371
+ configurable: true
137372
+ });
137352
137373
  function getMergedValue(target, source, prop, caseless) {
137353
137374
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isPlainObject(source)) {
137354
137375
  return _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.merge.call({
@@ -137387,9 +137408,9 @@ function mergeConfig(config1, config2) {
137387
137408
 
137388
137409
  // eslint-disable-next-line consistent-return
137389
137410
  function mergeDirectKeys(a, b, prop) {
137390
- if (prop in config2) {
137411
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(config2, prop)) {
137391
137412
  return getMergedValue(a, b);
137392
- } else if (prop in config1) {
137413
+ } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(config1, prop)) {
137393
137414
  return getMergedValue(undefined, a);
137394
137415
  }
137395
137416
  }
@@ -137420,6 +137441,7 @@ function mergeConfig(config1, config2) {
137420
137441
  httpsAgent: defaultToConfig2,
137421
137442
  cancelToken: defaultToConfig2,
137422
137443
  socketPath: defaultToConfig2,
137444
+ allowedSocketPaths: defaultToConfig2,
137423
137445
  responseEncoding: defaultToConfig2,
137424
137446
  validateStatus: mergeDirectKeys,
137425
137447
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
@@ -137430,7 +137452,9 @@ function mergeConfig(config1, config2) {
137430
137452
  }), function computeConfigValue(prop) {
137431
137453
  if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
137432
137454
  const merge = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
137433
- const configValue = merge(config1[prop], config2[prop], prop);
137455
+ const a = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(config1, prop) ? config1[prop] : undefined;
137456
+ const b = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(config2, prop) ? config2[prop] : undefined;
137457
+ const configValue = merge(a, b, prop);
137434
137458
  _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
137435
137459
  });
137436
137460
  return config;
@@ -137528,6 +137552,7 @@ function transformData(fns, response) {
137528
137552
 
137529
137553
 
137530
137554
 
137555
+ const own = (obj, key) => obj != null && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(obj, key) ? obj[key] : undefined;
137531
137556
 
137532
137557
  /**
137533
137558
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
@@ -137578,14 +137603,16 @@ const defaults = {
137578
137603
  }
137579
137604
  let isFileList;
137580
137605
  if (isObjectPayload) {
137606
+ const formSerializer = own(this, 'formSerializer');
137581
137607
  if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
137582
- return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(data, this.formSerializer).toString();
137608
+ return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(data, formSerializer).toString();
137583
137609
  }
137584
137610
  if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
137585
- const _FormData = this.env && this.env.FormData;
137611
+ const env = own(this, 'env');
137612
+ const _FormData = env && env.FormData;
137586
137613
  return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(isFileList ? {
137587
137614
  'files[]': data
137588
- } : data, _FormData && new _FormData(), this.formSerializer);
137615
+ } : data, _FormData && new _FormData(), formSerializer);
137589
137616
  }
137590
137617
  }
137591
137618
  if (isObjectPayload || hasJSONContentType) {
@@ -137595,21 +137622,22 @@ const defaults = {
137595
137622
  return data;
137596
137623
  }],
137597
137624
  transformResponse: [function transformResponse(data) {
137598
- const transitional = this.transitional || defaults.transitional;
137625
+ const transitional = own(this, 'transitional') || defaults.transitional;
137599
137626
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
137600
- const JSONRequested = this.responseType === 'json';
137627
+ const responseType = own(this, 'responseType');
137628
+ const JSONRequested = responseType === 'json';
137601
137629
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isResponse(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isReadableStream(data)) {
137602
137630
  return data;
137603
137631
  }
137604
- if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
137632
+ if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
137605
137633
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
137606
137634
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
137607
137635
  try {
137608
- return JSON.parse(data, this.parseReviver);
137636
+ return JSON.parse(data, own(this, 'parseReviver'));
137609
137637
  } catch (e) {
137610
137638
  if (strictJSONParsing) {
137611
137639
  if (e.name === 'SyntaxError') {
137612
- throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.ERR_BAD_RESPONSE, this, null, this.response);
137640
+ throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
137613
137641
  }
137614
137642
  throw e;
137615
137643
  }
@@ -137670,7 +137698,7 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(['delete', 'g
137670
137698
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
137671
137699
  /* harmony export */ x: () => (/* binding */ VERSION)
137672
137700
  /* harmony export */ });
137673
- const VERSION = "1.15.0";
137701
+ const VERSION = "1.15.2";
137674
137702
 
137675
137703
  /***/ },
137676
137704
 
@@ -137700,10 +137728,9 @@ function encode(str) {
137700
137728
  '(': '%28',
137701
137729
  ')': '%29',
137702
137730
  '~': '%7E',
137703
- '%20': '+',
137704
- '%00': '\x00'
137731
+ '%20': '+'
137705
137732
  };
137706
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
137733
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
137707
137734
  return charMap[match];
137708
137735
  });
137709
137736
  }
@@ -138096,7 +138123,7 @@ function formDataToJSON(formData) {
138096
138123
  name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(target) ? target.length : name;
138097
138124
  if (isLast) {
138098
138125
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(target, name)) {
138099
- target[name] = [target[name], value];
138126
+ target[name] = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
138100
138127
  } else {
138101
138128
  target[name] = value;
138102
138129
  }
@@ -138291,19 +138318,19 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
138291
138318
  let bytesNotified = 0;
138292
138319
  const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(50, 250);
138293
138320
  return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(e => {
138294
- const loaded = e.loaded;
138321
+ const rawLoaded = e.loaded;
138295
138322
  const total = e.lengthComputable ? e.total : undefined;
138296
- const progressBytes = loaded - bytesNotified;
138323
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
138324
+ const progressBytes = Math.max(0, loaded - bytesNotified);
138297
138325
  const rate = _speedometer(progressBytes);
138298
- const inRange = loaded <= total;
138299
- bytesNotified = loaded;
138326
+ bytesNotified = Math.max(bytesNotified, loaded);
138300
138327
  const data = {
138301
138328
  loaded,
138302
138329
  total,
138303
138330
  progress: total ? loaded / total : undefined,
138304
138331
  bytes: progressBytes,
138305
138332
  rate: rate ? rate : undefined,
138306
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
138333
+ estimated: rate && total ? (total - loaded) / rate : undefined,
138307
138334
  event: e,
138308
138335
  lengthComputable: total != null,
138309
138336
  [isDownloadStream ? 'download' : 'upload']: true
@@ -138347,16 +138374,21 @@ const asyncDecorator = fn => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__
138347
138374
 
138348
138375
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (config => {
138349
138376
  const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, config);
138350
- let {
138351
- data,
138352
- withXSRFToken,
138353
- xsrfHeaderName,
138354
- xsrfCookieName,
138355
- headers,
138356
- auth
138357
- } = newConfig;
138377
+
138378
+ // Read only own properties to prevent prototype pollution gadgets
138379
+ // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
138380
+ const own = key => _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
138381
+ const data = own('data');
138382
+ let withXSRFToken = own('withXSRFToken');
138383
+ const xsrfHeaderName = own('xsrfHeaderName');
138384
+ const xsrfCookieName = own('xsrfCookieName');
138385
+ let headers = own('headers');
138386
+ const auth = own('auth');
138387
+ const baseURL = own('baseURL');
138388
+ const allowAbsoluteUrls = own('allowAbsoluteUrls');
138389
+ const url = own('url');
138358
138390
  newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.from(headers);
138359
- newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
138391
+ newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer);
138360
138392
 
138361
138393
  // HTTP basic authentication
138362
138394
  if (auth) {
@@ -138383,9 +138415,15 @@ const asyncDecorator = fn => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__
138383
138415
  // Specifically not if we're in a web worker, or react-native.
138384
138416
 
138385
138417
  if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasStandardBrowserEnv) {
138386
- withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
138387
- if (withXSRFToken || withXSRFToken !== false && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(newConfig.url)) {
138388
- // Add xsrf header
138418
+ if (_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFunction(withXSRFToken)) {
138419
+ withXSRFToken = withXSRFToken(newConfig);
138420
+ }
138421
+
138422
+ // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
138423
+ // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
138424
+ // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
138425
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(newConfig.url);
138426
+ if (shouldSendXSRF) {
138389
138427
  const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.read(xsrfCookieName);
138390
138428
  if (xsrfValue) {
138391
138429
  headers.set(xsrfHeaderName, xsrfValue);
@@ -138650,6 +138688,7 @@ function toFormData(obj, formData, options) {
138650
138688
  const dots = options.dots;
138651
138689
  const indexes = options.indexes;
138652
138690
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
138691
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
138653
138692
  const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isSpecCompliantForm(formData);
138654
138693
  if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isFunction(visitor)) {
138655
138694
  throw new TypeError('visitor must be a function');
@@ -138716,8 +138755,11 @@ function toFormData(obj, formData, options) {
138716
138755
  convertValue,
138717
138756
  isVisitable
138718
138757
  });
138719
- function build(value, path) {
138758
+ function build(value, path, depth = 0) {
138720
138759
  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isUndefined(value)) return;
138760
+ if (depth > maxDepth) {
138761
+ throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.ERR_FORM_DATA_DEPTH_EXCEEDED);
138762
+ }
138721
138763
  if (stack.indexOf(value) !== -1) {
138722
138764
  throw Error('Circular reference detected in ' + path.join('.'));
138723
138765
  }
@@ -138725,7 +138767,7 @@ function toFormData(obj, formData, options) {
138725
138767
  _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(value, function each(el, key) {
138726
138768
  const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isUndefined(el) || el === null) && visitor.call(formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isString(key) ? key.trim() : key, path, exposedHelpers);
138727
138769
  if (result === true) {
138728
- build(el, path ? path.concat(key) : [key]);
138770
+ build(el, path ? path.concat(key) : [key], depth + 1);
138729
138771
  }
138730
138772
  });
138731
138773
  stack.pop();
@@ -138935,7 +138977,9 @@ function assertOptions(options, schema, allowUnknown) {
138935
138977
  let i = keys.length;
138936
138978
  while (i-- > 0) {
138937
138979
  const opt = keys[i];
138938
- const validator = schema[opt];
138980
+ // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
138981
+ // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
138982
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
138939
138983
  if (validator) {
138940
138984
  const value = options[opt];
138941
138985
  const result = value === undefined || validator(value, opt, options);
@@ -139342,10 +139386,16 @@ function getGlobal() {
139342
139386
  const G = getGlobal();
139343
139387
  const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
139344
139388
  const isFormData = thing => {
139345
- let kind;
139346
- return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction(thing.append) && ((kind = kindOf(thing)) === 'formdata' ||
139389
+ if (!thing) return false;
139390
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
139391
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
139392
+ const proto = getPrototypeOf(thing);
139393
+ if (!proto || proto === Object.prototype) return false;
139394
+ if (!isFunction(thing.append)) return false;
139395
+ const kind = kindOf(thing);
139396
+ return kind === 'formdata' ||
139347
139397
  // detect form-data instance
139348
- kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]'));
139398
+ kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]';
139349
139399
  };
139350
139400
 
139351
139401
  /**