videomail-client 13.6.9 → 13.6.11

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.
@@ -6046,7 +6046,7 @@ var __webpack_modules__ = {
6046
6046
  val = options.strictNullHandling ? null : '';
6047
6047
  } else {
6048
6048
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
6049
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6049
+ if (null !== key) val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6050
6050
  return options.decoder(encodedVal, defaults.decoder, charset, 'value');
6051
6051
  });
6052
6052
  }
@@ -6054,9 +6054,11 @@ var __webpack_modules__ = {
6054
6054
  if (part.indexOf('[]=') > -1) val = isArray(val) ? [
6055
6055
  val
6056
6056
  ] : val;
6057
- var existing = has.call(obj, key);
6058
- if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val);
6059
- else if (!existing || 'last' === options.duplicates) obj[key] = val;
6057
+ if (null !== key) {
6058
+ var existing = has.call(obj, key);
6059
+ if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
6060
+ else if (!existing || 'last' === options.duplicates) obj[key] = val;
6061
+ }
6060
6062
  }
6061
6063
  return obj;
6062
6064
  };
@@ -6070,7 +6072,7 @@ var __webpack_modules__ = {
6070
6072
  for(var i = chain.length - 1; i >= 0; --i){
6071
6073
  var obj;
6072
6074
  var root = chain[i];
6073
- if ('[]' === root && options.parseArrays) obj = options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf);
6075
+ if ('[]' === root && options.parseArrays) obj = utils.isOverflow(leaf) ? leaf : options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
6074
6076
  else {
6075
6077
  obj = options.plainObjects ? {
6076
6078
  __proto__: null
@@ -6091,12 +6093,19 @@ var __webpack_modules__ = {
6091
6093
  }
6092
6094
  return leaf;
6093
6095
  };
6094
- var parseKeys = function(givenKey, val, options, valuesParsed) {
6095
- if (!givenKey) return;
6096
+ var splitKeyIntoSegments = function(givenKey, options) {
6096
6097
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
6098
+ if (options.depth <= 0) {
6099
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
6100
+ if (!options.allowPrototypes) return;
6101
+ }
6102
+ return [
6103
+ key
6104
+ ];
6105
+ }
6097
6106
  var brackets = /(\[[^[\]]*])/;
6098
6107
  var child = /(\[[^[\]]*])/g;
6099
- var segment = options.depth > 0 && brackets.exec(key);
6108
+ var segment = brackets.exec(key);
6100
6109
  var parent = segment ? key.slice(0, segment.index) : key;
6101
6110
  var keys = [];
6102
6111
  if (parent) {
@@ -6106,9 +6115,10 @@ var __webpack_modules__ = {
6106
6115
  keys.push(parent);
6107
6116
  }
6108
6117
  var i = 0;
6109
- while(options.depth > 0 && null !== (segment = child.exec(key)) && i < options.depth){
6118
+ while(null !== (segment = child.exec(key)) && i < options.depth){
6110
6119
  i += 1;
6111
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
6120
+ var segmentContent = segment[1].slice(1, -1);
6121
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
6112
6122
  if (!options.allowPrototypes) return;
6113
6123
  }
6114
6124
  keys.push(segment[1]);
@@ -6117,6 +6127,12 @@ var __webpack_modules__ = {
6117
6127
  if (true === options.strictDepth) throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
6118
6128
  keys.push('[' + key.slice(segment.index) + ']');
6119
6129
  }
6130
+ return keys;
6131
+ };
6132
+ var parseKeys = function(givenKey, val, options, valuesParsed) {
6133
+ if (!givenKey) return;
6134
+ var keys = splitKeyIntoSegments(givenKey, options);
6135
+ if (!keys) return;
6120
6136
  return parseObject(keys, val, options, valuesParsed);
6121
6137
  };
6122
6138
  var normalizeParseOptions = function(opts) {
@@ -6367,8 +6383,23 @@ var __webpack_modules__ = {
6367
6383
  "./node_modules/qs/lib/utils.js" (module, __unused_rspack_exports, __webpack_require__) {
6368
6384
  "use strict";
6369
6385
  var formats = __webpack_require__("./node_modules/qs/lib/formats.js");
6386
+ var getSideChannel = __webpack_require__("./node_modules/side-channel/index.js");
6370
6387
  var has = Object.prototype.hasOwnProperty;
6371
6388
  var isArray = Array.isArray;
6389
+ var overflowChannel = getSideChannel();
6390
+ var markOverflow = function(obj, maxIndex) {
6391
+ overflowChannel.set(obj, maxIndex);
6392
+ return obj;
6393
+ };
6394
+ var isOverflow = function(obj) {
6395
+ return overflowChannel.has(obj);
6396
+ };
6397
+ var getMaxIndex = function(obj) {
6398
+ return overflowChannel.get(obj);
6399
+ };
6400
+ var setMaxIndex = function(obj, maxIndex) {
6401
+ overflowChannel.set(obj, maxIndex);
6402
+ };
6372
6403
  var hexTable = function() {
6373
6404
  var array = [];
6374
6405
  for(var i = 0; i < 256; ++i)array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
@@ -6400,12 +6431,32 @@ var __webpack_modules__ = {
6400
6431
  target,
6401
6432
  source
6402
6433
  ];
6403
- else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6434
+ else if (isOverflow(target)) {
6435
+ var newIndex = getMaxIndex(target) + 1;
6436
+ target[newIndex] = source;
6437
+ setMaxIndex(target, newIndex);
6438
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6404
6439
  return target;
6405
6440
  }
6406
- if (!target || 'object' != typeof target) return [
6407
- target
6408
- ].concat(source);
6441
+ if (!target || 'object' != typeof target) {
6442
+ if (isOverflow(source)) {
6443
+ var sourceKeys = Object.keys(source);
6444
+ var result = options && options.plainObjects ? {
6445
+ __proto__: null,
6446
+ 0: target
6447
+ } : {
6448
+ 0: target
6449
+ };
6450
+ for(var m = 0; m < sourceKeys.length; m++){
6451
+ var oldKey = parseInt(sourceKeys[m], 10);
6452
+ result[oldKey + 1] = source[sourceKeys[m]];
6453
+ }
6454
+ return markOverflow(result, getMaxIndex(source) + 1);
6455
+ }
6456
+ return [
6457
+ target
6458
+ ].concat(source);
6459
+ }
6409
6460
  var mergeTarget = target;
6410
6461
  if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
6411
6462
  if (isArray(target) && isArray(source)) {
@@ -6515,8 +6566,18 @@ var __webpack_modules__ = {
6515
6566
  if (!obj || 'object' != typeof obj) return false;
6516
6567
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
6517
6568
  };
6518
- var combine = function(a, b) {
6519
- return [].concat(a, b);
6569
+ var combine = function(a, b, arrayLimit, plainObjects) {
6570
+ if (isOverflow(a)) {
6571
+ var newIndex = getMaxIndex(a) + 1;
6572
+ a[newIndex] = b;
6573
+ setMaxIndex(a, newIndex);
6574
+ return a;
6575
+ }
6576
+ var result = [].concat(a, b);
6577
+ if (result.length > arrayLimit) return markOverflow(arrayToObject(result, {
6578
+ plainObjects: plainObjects
6579
+ }), result.length - 1);
6580
+ return result;
6520
6581
  };
6521
6582
  var maybeMap = function(val, fn) {
6522
6583
  if (isArray(val)) {
@@ -6534,6 +6595,7 @@ var __webpack_modules__ = {
6534
6595
  decode: decode,
6535
6596
  encode: encode,
6536
6597
  isBuffer: isBuffer,
6598
+ isOverflow: isOverflow,
6537
6599
  isRegExp: isRegExp,
6538
6600
  maybeMap: maybeMap,
6539
6601
  merge: merge
@@ -7187,7 +7249,12 @@ var __webpack_modules__ = {
7187
7249
  this.emit('request', this);
7188
7250
  xhr.send(void 0 === data ? null : data);
7189
7251
  };
7190
- request.agent = ()=>new Agent();
7252
+ const proxyAgent = new Proxy(Agent, {
7253
+ apply (target, thisArg, argumentsList) {
7254
+ return new target(...argumentsList);
7255
+ }
7256
+ });
7257
+ request.agent = proxyAgent;
7191
7258
  for (const method of [
7192
7259
  'GET',
7193
7260
  'POST',
@@ -10664,7 +10731,7 @@ var __webpack_exports__ = {};
10664
10731
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10665
10732
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10666
10733
  var package_namespaceObject = {
10667
- rE: "13.6.9"
10734
+ rE: "13.6.11"
10668
10735
  };
10669
10736
  function isAudioEnabled(options) {
10670
10737
  return Boolean(options.audio.enabled);
@@ -15007,6 +15074,7 @@ var __webpack_exports__ = {};
15007
15074
  reportErrors: true,
15008
15075
  disableFormWhenSubmitting: true,
15009
15076
  fakeUaString: void 0,
15077
+ recalculateDimensionsOnWindowResize: false,
15010
15078
  versions: {
15011
15079
  videomailNinjaFormPlugin: void 0
15012
15080
  }
@@ -16449,7 +16517,7 @@ var __webpack_exports__ = {};
16449
16517
  return dimension;
16450
16518
  }
16451
16519
  const dimensions_calculateHeight = calculateHeight;
16452
- function calculateWidth(responsive, videoHeight, options, ratio) {
16520
+ function calculateWidth(responsive, options, videoHeight, ratio) {
16453
16521
  const dimension = {
16454
16522
  unit: "px"
16455
16523
  };
@@ -16845,14 +16913,11 @@ var __webpack_exports__ = {};
16845
16913
  return videoWidth && videoWidth > 0;
16846
16914
  }
16847
16915
  getRawWidth(responsive) {
16848
- let rawWidth = this.getVideoWidth();
16916
+ let rawWidth;
16849
16917
  const widthDimension = {
16850
16918
  unit: "px"
16851
16919
  };
16852
- if (this.options.video.width || this.options.video.height) if (responsive) {
16853
- const dimension = this.recorder.calculateWidth(responsive);
16854
- rawWidth = dimension.value;
16855
- } else rawWidth = this.options.video.width;
16920
+ rawWidth = responsive ? this.getVideoWidth() : this.options.video.width ? this.options.video.width : this.getVideoWidth();
16856
16921
  if (responsive) {
16857
16922
  const widthDimension = this.recorder.limitWidth(rawWidth);
16858
16923
  rawWidth = null == widthDimension ? void 0 : widthDimension.value;
@@ -16862,32 +16927,12 @@ var __webpack_exports__ = {};
16862
16927
  }
16863
16928
  getRawHeight(responsive) {
16864
16929
  let rawHeight;
16865
- if (this.options.video.width || this.options.video.height) {
16866
- const heightDimension = this.recorder.calculateHeight(responsive);
16867
- rawHeight = heightDimension.value;
16868
- if (void 0 === rawHeight) throw error_createError({
16869
- message: "Undefined height",
16870
- explanation: "Calculated raw height cannot be undefined.",
16871
- options: this.options
16872
- });
16873
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16874
- message: "Invalid height",
16875
- explanation: `Calculated raw height of ${rawHeight} cannot be less than 1!`,
16876
- options: this.options
16877
- });
16878
- } else {
16879
- rawHeight = this.getVideoHeight();
16880
- if (void 0 === rawHeight) throw error_createError({
16881
- message: "Bad dimensions",
16882
- explanation: "Raw video height from DOM element cannot be undefined.",
16883
- options: this.options
16884
- });
16885
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16886
- message: "Bad dimensions",
16887
- explanation: "Raw video height from DOM element cannot be less than 1.",
16888
- options: this.options
16889
- });
16890
- }
16930
+ if (responsive) {
16931
+ rawHeight = this.options.video.height || this.getVideoHeight();
16932
+ const ratio = this.recorder.getRatio();
16933
+ const rawWidth = this.getRawWidth(responsive);
16934
+ if (void 0 !== ratio && rawWidth.value) rawHeight = rawWidth.value * ratio;
16935
+ } else rawHeight = this.options.video.height ? this.options.video.height : this.getVideoHeight();
16891
16936
  if (responsive) {
16892
16937
  const heightDimension = this.recorder.limitHeight(rawHeight);
16893
16938
  rawHeight = heightDimension.value;
@@ -17842,8 +17887,8 @@ var __webpack_exports__ = {};
17842
17887
  if (void 0 !== height && this.options.video.width) {
17843
17888
  const ratio = this.getRatio();
17844
17889
  if (void 0 !== ratio) {
17845
- const maxHeight = this.options.video.width * ratio;
17846
- height = Math.min(maxHeight, height);
17890
+ const idealHeight = this.options.video.width * ratio;
17891
+ height = Math.min(idealHeight, height);
17847
17892
  }
17848
17893
  }
17849
17894
  recorderHeight = {
@@ -17874,7 +17919,8 @@ var __webpack_exports__ = {};
17874
17919
  let videoHeight;
17875
17920
  if (this.userMedia) videoHeight = this.userMedia.getVideoHeight();
17876
17921
  else if (this.recorderElement) videoHeight = this.recorderElement.videoHeight || this.recorderElement.height;
17877
- return dimensions_calculateWidth(responsive, videoHeight, this.options, this.getRatio());
17922
+ const ratio = this.getRatio();
17923
+ return dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17878
17924
  }
17879
17925
  calculateHeight(responsive) {
17880
17926
  let videoDimension;
@@ -17963,7 +18009,7 @@ var __webpack_exports__ = {};
17963
18009
  height = this.videomail.height;
17964
18010
  if (width) ratio = height / width;
17965
18011
  }
17966
- if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
18012
+ if (!width) width = dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17967
18013
  if (!height) {
17968
18014
  let element = this.visuals.getElement();
17969
18015
  if (!element) element = document.body;
@@ -18600,7 +18646,7 @@ var __webpack_exports__ = {};
18600
18646
  }
18601
18647
  initEvents(playerOnly = false) {
18602
18648
  this.options.logger.debug(`Container: initEvents (playerOnly = ${playerOnly})`);
18603
- window.addEventListener("resize", ()=>{
18649
+ if (this.options.recalculateDimensionsOnWindowResize) window.addEventListener("resize", ()=>{
18604
18650
  if (!this.built) return;
18605
18651
  this.emit("WINDOW_RESIZE", "container");
18606
18652
  });
package/dist/esm/index.js CHANGED
@@ -3563,7 +3563,7 @@ const constants = {
3563
3563
  }
3564
3564
  };
3565
3565
  var package_namespaceObject = {
3566
- rE: "13.6.9"
3566
+ rE: "13.6.11"
3567
3567
  };
3568
3568
  function isAudioEnabled(options) {
3569
3569
  return Boolean(options.audio.enabled);
@@ -4508,6 +4508,7 @@ const options_options = {
4508
4508
  reportErrors: true,
4509
4509
  disableFormWhenSubmitting: true,
4510
4510
  fakeUaString: void 0,
4511
+ recalculateDimensionsOnWindowResize: false,
4511
4512
  versions: {
4512
4513
  videomailNinjaFormPlugin: void 0
4513
4514
  }
@@ -5773,7 +5774,7 @@ function calculateHeight(responsive, videoWidth, options, ratio, element) {
5773
5774
  return dimension;
5774
5775
  }
5775
5776
  const dimensions_calculateHeight = calculateHeight;
5776
- function calculateWidth(responsive, videoHeight, options, ratio) {
5777
+ function calculateWidth(responsive, options, videoHeight, ratio) {
5777
5778
  const dimension = {
5778
5779
  unit: "px"
5779
5780
  };
@@ -6139,14 +6140,11 @@ class UserMedia extends util_Despot {
6139
6140
  return videoWidth && videoWidth > 0;
6140
6141
  }
6141
6142
  getRawWidth(responsive) {
6142
- let rawWidth = this.getVideoWidth();
6143
+ let rawWidth;
6143
6144
  const widthDimension = {
6144
6145
  unit: "px"
6145
6146
  };
6146
- if (this.options.video.width || this.options.video.height) if (responsive) {
6147
- const dimension = this.recorder.calculateWidth(responsive);
6148
- rawWidth = dimension.value;
6149
- } else rawWidth = this.options.video.width;
6147
+ rawWidth = responsive ? this.getVideoWidth() : this.options.video.width ? this.options.video.width : this.getVideoWidth();
6150
6148
  if (responsive) {
6151
6149
  const widthDimension = this.recorder.limitWidth(rawWidth);
6152
6150
  rawWidth = widthDimension?.value;
@@ -6156,32 +6154,12 @@ class UserMedia extends util_Despot {
6156
6154
  }
6157
6155
  getRawHeight(responsive) {
6158
6156
  let rawHeight;
6159
- if (this.options.video.width || this.options.video.height) {
6160
- const heightDimension = this.recorder.calculateHeight(responsive);
6161
- rawHeight = heightDimension.value;
6162
- if (void 0 === rawHeight) throw error_createError({
6163
- message: "Undefined height",
6164
- explanation: "Calculated raw height cannot be undefined.",
6165
- options: this.options
6166
- });
6167
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
6168
- message: "Invalid height",
6169
- explanation: `Calculated raw height of ${rawHeight} cannot be less than 1!`,
6170
- options: this.options
6171
- });
6172
- } else {
6173
- rawHeight = this.getVideoHeight();
6174
- if (void 0 === rawHeight) throw error_createError({
6175
- message: "Bad dimensions",
6176
- explanation: "Raw video height from DOM element cannot be undefined.",
6177
- options: this.options
6178
- });
6179
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
6180
- message: "Bad dimensions",
6181
- explanation: "Raw video height from DOM element cannot be less than 1.",
6182
- options: this.options
6183
- });
6184
- }
6157
+ if (responsive) {
6158
+ rawHeight = this.options.video.height || this.getVideoHeight();
6159
+ const ratio = this.recorder.getRatio();
6160
+ const rawWidth = this.getRawWidth(responsive);
6161
+ if (void 0 !== ratio && rawWidth.value) rawHeight = rawWidth.value * ratio;
6162
+ } else rawHeight = this.options.video.height ? this.options.video.height : this.getVideoHeight();
6185
6163
  if (responsive) {
6186
6164
  const heightDimension = this.recorder.limitHeight(rawHeight);
6187
6165
  rawHeight = heightDimension.value;
@@ -7138,8 +7116,8 @@ class Recorder extends util_Despot {
7138
7116
  if (void 0 !== height && this.options.video.width) {
7139
7117
  const ratio = this.getRatio();
7140
7118
  if (void 0 !== ratio) {
7141
- const maxHeight = this.options.video.width * ratio;
7142
- height = Math.min(maxHeight, height);
7119
+ const idealHeight = this.options.video.width * ratio;
7120
+ height = Math.min(idealHeight, height);
7143
7121
  }
7144
7122
  }
7145
7123
  recorderHeight = {
@@ -7170,7 +7148,8 @@ class Recorder extends util_Despot {
7170
7148
  let videoHeight;
7171
7149
  if (this.userMedia) videoHeight = this.userMedia.getVideoHeight();
7172
7150
  else if (this.recorderElement) videoHeight = this.recorderElement.videoHeight || this.recorderElement.height;
7173
- return dimensions_calculateWidth(responsive, videoHeight, this.options, this.getRatio());
7151
+ const ratio = this.getRatio();
7152
+ return dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
7174
7153
  }
7175
7154
  calculateHeight(responsive) {
7176
7155
  let videoDimension;
@@ -7250,7 +7229,7 @@ class Replay extends util_Despot {
7250
7229
  height = this.videomail.height;
7251
7230
  if (width) ratio = height / width;
7252
7231
  }
7253
- if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
7232
+ if (!width) width = dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
7254
7233
  if (!height) {
7255
7234
  let element = this.visuals.getElement();
7256
7235
  if (!element) element = document.body;
@@ -7836,7 +7815,7 @@ class Container extends util_Despot {
7836
7815
  }
7837
7816
  initEvents(playerOnly = false) {
7838
7817
  this.options.logger.debug(`Container: initEvents (playerOnly = ${playerOnly})`);
7839
- window.addEventListener("resize", ()=>{
7818
+ if (this.options.recalculateDimensionsOnWindowResize) window.addEventListener("resize", ()=>{
7840
7819
  if (!this.built) return;
7841
7820
  this.emit("WINDOW_RESIZE", "container");
7842
7821
  });
@@ -116,6 +116,7 @@ export interface VideomailClientOptions {
116
116
  reportErrors: boolean;
117
117
  disableFormWhenSubmitting?: boolean | undefined;
118
118
  fakeUaString?: string | undefined;
119
+ recalculateDimensionsOnWindowResize?: boolean;
119
120
  versions?: {
120
121
  videomailNinjaFormPlugin?: string | undefined;
121
122
  };
@@ -1,4 +1,4 @@
1
1
  import { Dimension } from "../../../types/dimension";
2
2
  import { VideomailClientOptions } from "../../../types/options";
3
- declare function calculateWidth(responsive: boolean, videoHeight: number, options: VideomailClientOptions, ratio?: number): Dimension;
3
+ declare function calculateWidth(responsive: boolean, options: VideomailClientOptions, videoHeight?: number, ratio?: number): Dimension;
4
4
  export default calculateWidth;
@@ -42,7 +42,7 @@ declare class Container extends Despot {
42
42
  private hideMySelf;
43
43
  private submitVideomail;
44
44
  limitWidth(width?: number): import("../types/dimension").Dimension | undefined;
45
- limitHeight(height: number): import("../types/dimension").Dimension;
45
+ limitHeight(height: number | undefined): import("../types/dimension").Dimension;
46
46
  private areVisualsHidden;
47
47
  hasElement(): boolean;
48
48
  getSubmitButton(): HTMLButtonElement | undefined;
@@ -103,14 +103,14 @@ declare class Recorder extends Despot {
103
103
  isUnloaded(): boolean | undefined;
104
104
  getRecorderWidth(responsive: boolean): Dimension | undefined;
105
105
  getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
106
- private getRatio;
106
+ getRatio(): number | undefined;
107
107
  calculateWidth(responsive: boolean): Dimension;
108
108
  calculateHeight(responsive: boolean): Dimension;
109
109
  getRawVisualUserMedia(): HTMLVideoElement | null | undefined;
110
110
  isConnected(): boolean;
111
111
  isConnecting(): boolean;
112
112
  limitWidth(width?: number): Dimension | undefined;
113
- limitHeight(height: number): Dimension;
113
+ limitHeight(height: number | undefined): Dimension;
114
114
  isUserMediaLoaded(): boolean | undefined;
115
115
  }
116
116
  export default Recorder;
@@ -56,7 +56,7 @@ declare class Visuals extends Despot {
56
56
  getRecorderWidth(responsive: boolean): Dimension | undefined;
57
57
  getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
58
58
  limitWidth(width?: number): Dimension | undefined;
59
- limitHeight(height: number): Dimension;
59
+ limitHeight(height: number | undefined): Dimension;
60
60
  getReplay(): Replay;
61
61
  getBoundingClientRect(): DOMRect | undefined;
62
62
  checkTimer(elapsedTime: number): void;
package/dist/umd/index.js CHANGED
@@ -6052,7 +6052,7 @@
6052
6052
  val = options.strictNullHandling ? null : '';
6053
6053
  } else {
6054
6054
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
6055
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6055
+ if (null !== key) val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6056
6056
  return options.decoder(encodedVal, defaults.decoder, charset, 'value');
6057
6057
  });
6058
6058
  }
@@ -6060,9 +6060,11 @@
6060
6060
  if (part.indexOf('[]=') > -1) val = isArray(val) ? [
6061
6061
  val
6062
6062
  ] : val;
6063
- var existing = has.call(obj, key);
6064
- if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val);
6065
- else if (!existing || 'last' === options.duplicates) obj[key] = val;
6063
+ if (null !== key) {
6064
+ var existing = has.call(obj, key);
6065
+ if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
6066
+ else if (!existing || 'last' === options.duplicates) obj[key] = val;
6067
+ }
6066
6068
  }
6067
6069
  return obj;
6068
6070
  };
@@ -6076,7 +6078,7 @@
6076
6078
  for(var i = chain.length - 1; i >= 0; --i){
6077
6079
  var obj;
6078
6080
  var root = chain[i];
6079
- if ('[]' === root && options.parseArrays) obj = options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf);
6081
+ if ('[]' === root && options.parseArrays) obj = utils.isOverflow(leaf) ? leaf : options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
6080
6082
  else {
6081
6083
  obj = options.plainObjects ? {
6082
6084
  __proto__: null
@@ -6097,12 +6099,19 @@
6097
6099
  }
6098
6100
  return leaf;
6099
6101
  };
6100
- var parseKeys = function(givenKey, val, options, valuesParsed) {
6101
- if (!givenKey) return;
6102
+ var splitKeyIntoSegments = function(givenKey, options) {
6102
6103
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
6104
+ if (options.depth <= 0) {
6105
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
6106
+ if (!options.allowPrototypes) return;
6107
+ }
6108
+ return [
6109
+ key
6110
+ ];
6111
+ }
6103
6112
  var brackets = /(\[[^[\]]*])/;
6104
6113
  var child = /(\[[^[\]]*])/g;
6105
- var segment = options.depth > 0 && brackets.exec(key);
6114
+ var segment = brackets.exec(key);
6106
6115
  var parent = segment ? key.slice(0, segment.index) : key;
6107
6116
  var keys = [];
6108
6117
  if (parent) {
@@ -6112,9 +6121,10 @@
6112
6121
  keys.push(parent);
6113
6122
  }
6114
6123
  var i = 0;
6115
- while(options.depth > 0 && null !== (segment = child.exec(key)) && i < options.depth){
6124
+ while(null !== (segment = child.exec(key)) && i < options.depth){
6116
6125
  i += 1;
6117
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
6126
+ var segmentContent = segment[1].slice(1, -1);
6127
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
6118
6128
  if (!options.allowPrototypes) return;
6119
6129
  }
6120
6130
  keys.push(segment[1]);
@@ -6123,6 +6133,12 @@
6123
6133
  if (true === options.strictDepth) throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
6124
6134
  keys.push('[' + key.slice(segment.index) + ']');
6125
6135
  }
6136
+ return keys;
6137
+ };
6138
+ var parseKeys = function(givenKey, val, options, valuesParsed) {
6139
+ if (!givenKey) return;
6140
+ var keys = splitKeyIntoSegments(givenKey, options);
6141
+ if (!keys) return;
6126
6142
  return parseObject(keys, val, options, valuesParsed);
6127
6143
  };
6128
6144
  var normalizeParseOptions = function(opts) {
@@ -6373,8 +6389,23 @@
6373
6389
  "./node_modules/qs/lib/utils.js" (module1, __unused_rspack_exports, __webpack_require__) {
6374
6390
  "use strict";
6375
6391
  var formats = __webpack_require__("./node_modules/qs/lib/formats.js");
6392
+ var getSideChannel = __webpack_require__("./node_modules/side-channel/index.js");
6376
6393
  var has = Object.prototype.hasOwnProperty;
6377
6394
  var isArray = Array.isArray;
6395
+ var overflowChannel = getSideChannel();
6396
+ var markOverflow = function(obj, maxIndex) {
6397
+ overflowChannel.set(obj, maxIndex);
6398
+ return obj;
6399
+ };
6400
+ var isOverflow = function(obj) {
6401
+ return overflowChannel.has(obj);
6402
+ };
6403
+ var getMaxIndex = function(obj) {
6404
+ return overflowChannel.get(obj);
6405
+ };
6406
+ var setMaxIndex = function(obj, maxIndex) {
6407
+ overflowChannel.set(obj, maxIndex);
6408
+ };
6378
6409
  var hexTable = function() {
6379
6410
  var array = [];
6380
6411
  for(var i = 0; i < 256; ++i)array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
@@ -6406,12 +6437,32 @@
6406
6437
  target,
6407
6438
  source
6408
6439
  ];
6409
- else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6440
+ else if (isOverflow(target)) {
6441
+ var newIndex = getMaxIndex(target) + 1;
6442
+ target[newIndex] = source;
6443
+ setMaxIndex(target, newIndex);
6444
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6410
6445
  return target;
6411
6446
  }
6412
- if (!target || 'object' != typeof target) return [
6413
- target
6414
- ].concat(source);
6447
+ if (!target || 'object' != typeof target) {
6448
+ if (isOverflow(source)) {
6449
+ var sourceKeys = Object.keys(source);
6450
+ var result = options && options.plainObjects ? {
6451
+ __proto__: null,
6452
+ 0: target
6453
+ } : {
6454
+ 0: target
6455
+ };
6456
+ for(var m = 0; m < sourceKeys.length; m++){
6457
+ var oldKey = parseInt(sourceKeys[m], 10);
6458
+ result[oldKey + 1] = source[sourceKeys[m]];
6459
+ }
6460
+ return markOverflow(result, getMaxIndex(source) + 1);
6461
+ }
6462
+ return [
6463
+ target
6464
+ ].concat(source);
6465
+ }
6415
6466
  var mergeTarget = target;
6416
6467
  if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
6417
6468
  if (isArray(target) && isArray(source)) {
@@ -6521,8 +6572,18 @@
6521
6572
  if (!obj || 'object' != typeof obj) return false;
6522
6573
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
6523
6574
  };
6524
- var combine = function(a, b) {
6525
- return [].concat(a, b);
6575
+ var combine = function(a, b, arrayLimit, plainObjects) {
6576
+ if (isOverflow(a)) {
6577
+ var newIndex = getMaxIndex(a) + 1;
6578
+ a[newIndex] = b;
6579
+ setMaxIndex(a, newIndex);
6580
+ return a;
6581
+ }
6582
+ var result = [].concat(a, b);
6583
+ if (result.length > arrayLimit) return markOverflow(arrayToObject(result, {
6584
+ plainObjects: plainObjects
6585
+ }), result.length - 1);
6586
+ return result;
6526
6587
  };
6527
6588
  var maybeMap = function(val, fn) {
6528
6589
  if (isArray(val)) {
@@ -6540,6 +6601,7 @@
6540
6601
  decode: decode,
6541
6602
  encode: encode,
6542
6603
  isBuffer: isBuffer,
6604
+ isOverflow: isOverflow,
6543
6605
  isRegExp: isRegExp,
6544
6606
  maybeMap: maybeMap,
6545
6607
  merge: merge
@@ -7193,7 +7255,12 @@
7193
7255
  this.emit('request', this);
7194
7256
  xhr.send(void 0 === data ? null : data);
7195
7257
  };
7196
- request.agent = ()=>new Agent();
7258
+ const proxyAgent = new Proxy(Agent, {
7259
+ apply (target, thisArg, argumentsList) {
7260
+ return new target(...argumentsList);
7261
+ }
7262
+ });
7263
+ request.agent = proxyAgent;
7197
7264
  for (const method of [
7198
7265
  'GET',
7199
7266
  'POST',
@@ -10670,7 +10737,7 @@
10670
10737
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10671
10738
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10672
10739
  var package_namespaceObject = {
10673
- rE: "13.6.9"
10740
+ rE: "13.6.11"
10674
10741
  };
10675
10742
  function isAudioEnabled(options) {
10676
10743
  return Boolean(options.audio.enabled);
@@ -14883,6 +14950,7 @@
14883
14950
  reportErrors: true,
14884
14951
  disableFormWhenSubmitting: true,
14885
14952
  fakeUaString: void 0,
14953
+ recalculateDimensionsOnWindowResize: false,
14886
14954
  versions: {
14887
14955
  videomailNinjaFormPlugin: void 0
14888
14956
  }
@@ -16215,7 +16283,7 @@
16215
16283
  return dimension;
16216
16284
  }
16217
16285
  const dimensions_calculateHeight = calculateHeight;
16218
- function calculateWidth(responsive, videoHeight, options, ratio) {
16286
+ function calculateWidth(responsive, options, videoHeight, ratio) {
16219
16287
  const dimension = {
16220
16288
  unit: "px"
16221
16289
  };
@@ -16594,14 +16662,11 @@
16594
16662
  return videoWidth && videoWidth > 0;
16595
16663
  }
16596
16664
  getRawWidth(responsive) {
16597
- let rawWidth = this.getVideoWidth();
16665
+ let rawWidth;
16598
16666
  const widthDimension = {
16599
16667
  unit: "px"
16600
16668
  };
16601
- if (this.options.video.width || this.options.video.height) if (responsive) {
16602
- const dimension = this.recorder.calculateWidth(responsive);
16603
- rawWidth = dimension.value;
16604
- } else rawWidth = this.options.video.width;
16669
+ rawWidth = responsive ? this.getVideoWidth() : this.options.video.width ? this.options.video.width : this.getVideoWidth();
16605
16670
  if (responsive) {
16606
16671
  const widthDimension = this.recorder.limitWidth(rawWidth);
16607
16672
  rawWidth = widthDimension?.value;
@@ -16611,32 +16676,12 @@
16611
16676
  }
16612
16677
  getRawHeight(responsive) {
16613
16678
  let rawHeight;
16614
- if (this.options.video.width || this.options.video.height) {
16615
- const heightDimension = this.recorder.calculateHeight(responsive);
16616
- rawHeight = heightDimension.value;
16617
- if (void 0 === rawHeight) throw error_createError({
16618
- message: "Undefined height",
16619
- explanation: "Calculated raw height cannot be undefined.",
16620
- options: this.options
16621
- });
16622
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16623
- message: "Invalid height",
16624
- explanation: `Calculated raw height of ${rawHeight} cannot be less than 1!`,
16625
- options: this.options
16626
- });
16627
- } else {
16628
- rawHeight = this.getVideoHeight();
16629
- if (void 0 === rawHeight) throw error_createError({
16630
- message: "Bad dimensions",
16631
- explanation: "Raw video height from DOM element cannot be undefined.",
16632
- options: this.options
16633
- });
16634
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16635
- message: "Bad dimensions",
16636
- explanation: "Raw video height from DOM element cannot be less than 1.",
16637
- options: this.options
16638
- });
16639
- }
16679
+ if (responsive) {
16680
+ rawHeight = this.options.video.height || this.getVideoHeight();
16681
+ const ratio = this.recorder.getRatio();
16682
+ const rawWidth = this.getRawWidth(responsive);
16683
+ if (void 0 !== ratio && rawWidth.value) rawHeight = rawWidth.value * ratio;
16684
+ } else rawHeight = this.options.video.height ? this.options.video.height : this.getVideoHeight();
16640
16685
  if (responsive) {
16641
16686
  const heightDimension = this.recorder.limitHeight(rawHeight);
16642
16687
  rawHeight = heightDimension.value;
@@ -17593,8 +17638,8 @@
17593
17638
  if (void 0 !== height && this.options.video.width) {
17594
17639
  const ratio = this.getRatio();
17595
17640
  if (void 0 !== ratio) {
17596
- const maxHeight = this.options.video.width * ratio;
17597
- height = Math.min(maxHeight, height);
17641
+ const idealHeight = this.options.video.width * ratio;
17642
+ height = Math.min(idealHeight, height);
17598
17643
  }
17599
17644
  }
17600
17645
  recorderHeight = {
@@ -17625,7 +17670,8 @@
17625
17670
  let videoHeight;
17626
17671
  if (this.userMedia) videoHeight = this.userMedia.getVideoHeight();
17627
17672
  else if (this.recorderElement) videoHeight = this.recorderElement.videoHeight || this.recorderElement.height;
17628
- return dimensions_calculateWidth(responsive, videoHeight, this.options, this.getRatio());
17673
+ const ratio = this.getRatio();
17674
+ return dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17629
17675
  }
17630
17676
  calculateHeight(responsive) {
17631
17677
  let videoDimension;
@@ -17705,7 +17751,7 @@
17705
17751
  height = this.videomail.height;
17706
17752
  if (width) ratio = height / width;
17707
17753
  }
17708
- if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
17754
+ if (!width) width = dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17709
17755
  if (!height) {
17710
17756
  let element = this.visuals.getElement();
17711
17757
  if (!element) element = document.body;
@@ -18291,7 +18337,7 @@
18291
18337
  }
18292
18338
  initEvents(playerOnly = false) {
18293
18339
  this.options.logger.debug(`Container: initEvents (playerOnly = ${playerOnly})`);
18294
- window.addEventListener("resize", ()=>{
18340
+ if (this.options.recalculateDimensionsOnWindowResize) window.addEventListener("resize", ()=>{
18295
18341
  if (!this.built) return;
18296
18342
  this.emit("WINDOW_RESIZE", "container");
18297
18343
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "13.6.9",
3
+ "version": "13.6.11",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -69,7 +69,7 @@
69
69
  "is-power-of-two": "1.0.0",
70
70
  "nanoevents": "9.1.0",
71
71
  "serialize-error": "12.0.0",
72
- "superagent": "10.2.3",
72
+ "superagent": "10.3.0",
73
73
  "ua-parser-js": "2.0.7",
74
74
  "websocket-stream": "5.5.2"
75
75
  },
@@ -91,16 +91,16 @@
91
91
  "@types/node": "24.10.1",
92
92
  "@types/superagent": "8.1.9",
93
93
  "@types/ua-parser-js": "0.7.39",
94
- "@vitest/eslint-plugin": "1.6.5",
94
+ "@vitest/eslint-plugin": "1.6.6",
95
95
  "audit-ci": "7.1.0",
96
- "chromatic": "13.3.4",
96
+ "chromatic": "13.3.5",
97
97
  "cross-env": "10.1.0",
98
98
  "eslint": "9.39.2",
99
99
  "eslint-import-resolver-typescript": "4.4.4",
100
100
  "eslint-plugin-de-morgan": "2.0.0",
101
101
  "eslint-plugin-depend": "1.4.0",
102
102
  "eslint-plugin-import-x": "4.16.1",
103
- "eslint-plugin-package-json": "0.88.0",
103
+ "eslint-plugin-package-json": "0.88.1",
104
104
  "eslint-plugin-promise": "7.2.1",
105
105
  "eslint-plugin-regexp": "2.10.0",
106
106
  "eslint-plugin-security": "3.0.1",
@@ -114,12 +114,12 @@
114
114
  "prettier-plugin-curly": "0.4.1",
115
115
  "prettier-plugin-packagejson": "2.5.20",
116
116
  "prettier-plugin-sh": "0.18.0",
117
- "release-it": "19.2.2",
117
+ "release-it": "19.2.3",
118
118
  "storybook": "10.1.11",
119
119
  "storybook-html-rsbuild": "3.2.0",
120
120
  "type-fest": "5.3.1",
121
121
  "typescript": "5.9.3",
122
- "typescript-eslint": "8.51.0",
122
+ "typescript-eslint": "8.52.0",
123
123
  "vitest": "4.0.16"
124
124
  },
125
125
  "engines": {