videomail-client 13.1.1 → 13.1.3

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.
@@ -1,14 +1,14 @@
1
1
  var __webpack_modules__ = {
2
- "./node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[12].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[12].use[2]!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[12].use[3]!./src/styles/main.styl": function(module, __webpack_exports__, __webpack_require__) {
2
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[12].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[12].use[2]!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[12].use[3]!./src/styles/main.styl": function(module, __webpack_exports__, __webpack_require__) {
3
3
  "use strict";
4
4
  __webpack_require__.d(__webpack_exports__, {
5
5
  A: ()=>__WEBPACK_DEFAULT_EXPORT__
6
6
  });
7
- var _node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js");
8
- var _node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
9
- var _node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@rsbuild/core/compiled/css-loader/api.js");
10
- var _node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1__);
11
- var ___CSS_LOADER_EXPORT___ = _node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
7
+ var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js");
8
+ var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
9
+ var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/api.js");
10
+ var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1__);
11
+ var ___CSS_LOADER_EXPORT___ = _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
12
12
  ___CSS_LOADER_EXPORT___.push([
13
13
  module.id,
14
14
  `@keyframes blink {
@@ -10199,7 +10199,7 @@ var __webpack_modules__ = {
10199
10199
  "?aa23": function() {},
10200
10200
  "?9936": function() {},
10201
10201
  "?5f55": function() {},
10202
- "./node_modules/@rsbuild/core/compiled/css-loader/api.js": function(module) {
10202
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/api.js": function(module) {
10203
10203
  "use strict";
10204
10204
  module.exports = function(cssWithMappingToString) {
10205
10205
  var list = [];
@@ -10253,13 +10253,13 @@ var __webpack_modules__ = {
10253
10253
  return list;
10254
10254
  };
10255
10255
  },
10256
- "./node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js": function(module) {
10256
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js": function(module) {
10257
10257
  "use strict";
10258
10258
  module.exports = function(i) {
10259
10259
  return i[1];
10260
10260
  };
10261
10261
  },
10262
- "./node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js": function(module) {
10262
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js": function(module) {
10263
10263
  "use strict";
10264
10264
  var stylesInDOM = [];
10265
10265
  function getIndexByIdentifier(identifier) {
@@ -10338,7 +10338,7 @@ var __webpack_modules__ = {
10338
10338
  };
10339
10339
  };
10340
10340
  },
10341
- "./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js": function(module) {
10341
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js": function(module) {
10342
10342
  "use strict";
10343
10343
  var memo = {};
10344
10344
  function getTarget(target) {
@@ -10360,7 +10360,7 @@ var __webpack_modules__ = {
10360
10360
  }
10361
10361
  module.exports = insertBySelector;
10362
10362
  },
10363
- "./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js": function(module) {
10363
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js": function(module) {
10364
10364
  "use strict";
10365
10365
  function insertStyleElement(options) {
10366
10366
  var element = document.createElement("style");
@@ -10370,7 +10370,7 @@ var __webpack_modules__ = {
10370
10370
  }
10371
10371
  module.exports = insertStyleElement;
10372
10372
  },
10373
- "./node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js": function(module, __unused_webpack_exports, __webpack_require__) {
10373
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js": function(module, __unused_webpack_exports, __webpack_require__) {
10374
10374
  "use strict";
10375
10375
  function setAttributesWithoutAttributes(styleElement) {
10376
10376
  var nonce = __webpack_require__.nc;
@@ -10378,7 +10378,7 @@ var __webpack_modules__ = {
10378
10378
  }
10379
10379
  module.exports = setAttributesWithoutAttributes;
10380
10380
  },
10381
- "./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js": function(module) {
10381
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js": function(module) {
10382
10382
  "use strict";
10383
10383
  function apply(styleElement, options, obj) {
10384
10384
  var css = "";
@@ -10415,7 +10415,7 @@ var __webpack_modules__ = {
10415
10415
  }
10416
10416
  module.exports = domAPI;
10417
10417
  },
10418
- "./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js": function(module) {
10418
+ "./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js": function(module) {
10419
10419
  "use strict";
10420
10420
  function styleTagTransform(css, styleElement) {
10421
10421
  if (styleElement.styleSheet) styleElement.styleSheet.cssText = css;
@@ -10664,7 +10664,7 @@ var __webpack_exports__ = {};
10664
10664
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10665
10665
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10666
10666
  var package_namespaceObject = {
10667
- rE: "13.1.1"
10667
+ rE: "13.1.3"
10668
10668
  };
10669
10669
  var defined = __webpack_require__("./node_modules/defined/index.js");
10670
10670
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -14292,30 +14292,28 @@ var __webpack_exports__ = {};
14292
14292
  else obj[key] = value;
14293
14293
  return obj;
14294
14294
  }
14295
- class Despot {
14296
- emit(eventName) {
14297
- for(var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)params[_key - 1] = arguments[_key];
14295
+ class Despot_Despot {
14296
+ emit(eventName, ...params) {
14298
14297
  const firstParam = params[0];
14299
14298
  const showParams = firstParam && ("object" != typeof firstParam || "object" == typeof firstParam && Object.keys(firstParam).filter(Boolean).length > 0);
14300
14299
  if (showParams) this.options.logger.debug(`${this.name} emits ${eventName} with ${util_pretty(params)}`);
14301
14300
  else this.options.logger.debug(`${this.name} emits ${eventName}`);
14302
14301
  try {
14303
- Despot.EMITTER.emit(eventName, ...params);
14302
+ Despot_Despot.EMITTER.emit(eventName, ...params);
14304
14303
  } catch (exc) {
14305
- if (exc instanceof error_VideomailError) Despot.EMITTER.emit("ERROR", {
14304
+ if (exc instanceof error_VideomailError) Despot_Despot.EMITTER.emit("ERROR", {
14306
14305
  err: exc
14307
14306
  });
14308
- else Despot.EMITTER.emit("ERROR", {
14307
+ else Despot_Despot.EMITTER.emit("ERROR", {
14309
14308
  exc
14310
14309
  });
14311
14310
  }
14312
14311
  }
14313
14312
  on(eventName, callback) {
14314
- return Despot.EMITTER.on(eventName, callback);
14313
+ return Despot_Despot.EMITTER.on(eventName, callback);
14315
14314
  }
14316
14315
  once(eventName, listener) {
14317
- const callback = function() {
14318
- for(var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++)params[_key] = arguments[_key];
14316
+ const callback = (...params)=>{
14319
14317
  unbind();
14320
14318
  params.length > 0 ? listener(...params) : listener();
14321
14319
  };
@@ -14323,13 +14321,13 @@ var __webpack_exports__ = {};
14323
14321
  return unbind;
14324
14322
  }
14325
14323
  static getListeners(eventName) {
14326
- return Despot.EMITTER.events[eventName];
14324
+ return Despot_Despot.EMITTER.events[eventName];
14327
14325
  }
14328
14326
  static removeListener(eventName) {
14329
- delete Despot.EMITTER.events[eventName];
14327
+ delete Despot_Despot.EMITTER.events[eventName];
14330
14328
  }
14331
14329
  static removeAllListeners() {
14332
- Despot.EMITTER.events = {};
14330
+ Despot_Despot.EMITTER.events = {};
14333
14331
  }
14334
14332
  constructor(name, options){
14335
14333
  Despot_define_property(this, "name", void 0);
@@ -14338,8 +14336,13 @@ var __webpack_exports__ = {};
14338
14336
  this.options = options;
14339
14337
  }
14340
14338
  }
14341
- Despot_define_property(Despot, "EMITTER", createNanoEvents());
14342
- const util_Despot = Despot;
14339
+ Despot_define_property(Despot_Despot, "EMITTER", createNanoEvents());
14340
+ const Despot = Despot_Despot;
14341
+ function getValidity(element) {
14342
+ const validity = "validity" in element ? element.validity : void 0;
14343
+ return validity;
14344
+ }
14345
+ const util_getValidity = getValidity;
14343
14346
  function hideElement(element) {
14344
14347
  if (!element) return;
14345
14348
  element.style.setProperty("display", "none", "important");
@@ -14362,6 +14365,32 @@ var __webpack_exports__ = {};
14362
14365
  const trimmedEmails = emails.split(REGEX).map((item)=>item.trim()).filter(Boolean);
14363
14366
  return trimmedEmails;
14364
14367
  }
14368
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
14369
+ try {
14370
+ var info = gen[key](arg);
14371
+ var value = info.value;
14372
+ } catch (error) {
14373
+ reject(error);
14374
+ return;
14375
+ }
14376
+ if (info.done) resolve(value);
14377
+ else Promise.resolve(value).then(_next, _throw);
14378
+ }
14379
+ function _async_to_generator(fn) {
14380
+ return function() {
14381
+ var self1 = this, args = arguments;
14382
+ return new Promise(function(resolve, reject) {
14383
+ var gen = fn.apply(self1, args);
14384
+ function _next(value) {
14385
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
14386
+ }
14387
+ function _throw(err) {
14388
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
14389
+ }
14390
+ _next(void 0);
14391
+ });
14392
+ };
14393
+ }
14365
14394
  function form_define_property(obj, key, value) {
14366
14395
  if (key in obj) Object.defineProperty(obj, key, {
14367
14396
  value: value,
@@ -14377,7 +14406,7 @@ var __webpack_exports__ = {};
14377
14406
  PUT: "put",
14378
14407
  GET: "get"
14379
14408
  };
14380
- class Form extends util_Despot {
14409
+ class Form extends Despot {
14381
14410
  getData() {
14382
14411
  return getFormData(this.formElement, {
14383
14412
  includeDisabled: true
@@ -14544,7 +14573,7 @@ var __webpack_exports__ = {};
14544
14573
  unload() {
14545
14574
  this.options.logger.debug("Form: unload()");
14546
14575
  this.removeAllInputListeners();
14547
- util_Despot.removeAllListeners();
14576
+ Despot.removeAllListeners();
14548
14577
  this.stopListeningToSubmitEvents();
14549
14578
  this.resetForm();
14550
14579
  }
@@ -14565,32 +14594,34 @@ var __webpack_exports__ = {};
14565
14594
  const submitButton = this.container.getSubmitButton();
14566
14595
  if (submitButton) submitButton.onclick = null;
14567
14596
  }
14568
- async doTheSubmit(e) {
14569
- if (e) {
14570
- this.options.logger.debug(`Form: doTheSubmit(${util_pretty(e)})`);
14571
- e.preventDefault();
14572
- } else this.options.logger.debug("Form: doTheSubmit()");
14573
- var _this_formElement_getAttribute;
14574
- const url = null != (_this_formElement_getAttribute = this.formElement.getAttribute("action")) ? _this_formElement_getAttribute : this.options.apiUrl;
14575
- const method = this.formElement.getAttribute("method");
14576
- let chosenMethod;
14577
- switch(method){
14578
- case FormMethod.POST:
14579
- chosenMethod = FormMethod.POST;
14580
- break;
14581
- case FormMethod.PUT:
14582
- chosenMethod = FormMethod.PUT;
14583
- break;
14584
- default:
14585
- chosenMethod = FormMethod.POST;
14586
- }
14587
- if (this.container.hasElement()) await this.container.submitAll(this.getData(), chosenMethod, url);
14588
- return false;
14597
+ doTheSubmit(e) {
14598
+ return _async_to_generator(function*() {
14599
+ if (e) {
14600
+ this.options.logger.debug(`Form: doTheSubmit(${util_pretty(e)})`);
14601
+ e.preventDefault();
14602
+ } else this.options.logger.debug("Form: doTheSubmit()");
14603
+ var _this_formElement_getAttribute;
14604
+ const url = null != (_this_formElement_getAttribute = this.formElement.getAttribute("action")) ? _this_formElement_getAttribute : this.options.apiUrl;
14605
+ const method = this.formElement.getAttribute("method");
14606
+ let chosenMethod;
14607
+ switch(method){
14608
+ case FormMethod.POST:
14609
+ chosenMethod = FormMethod.POST;
14610
+ break;
14611
+ case FormMethod.PUT:
14612
+ chosenMethod = FormMethod.PUT;
14613
+ break;
14614
+ default:
14615
+ chosenMethod = FormMethod.POST;
14616
+ }
14617
+ if (this.container.hasElement()) yield this.container.submitAll(this.getData(), chosenMethod, url);
14618
+ return false;
14619
+ }).call(this);
14589
14620
  }
14590
14621
  getInvalidElement() {
14591
14622
  const elements = this.getRegisteredFormElements();
14592
14623
  for (const element of elements){
14593
- const validity = "validity" in element ? element.validity : void 0;
14624
+ const validity = util_getValidity(element);
14594
14625
  if (!(null == validity ? void 0 : validity.valid)) return element;
14595
14626
  }
14596
14627
  return null;
@@ -14622,6 +14653,32 @@ var __webpack_exports__ = {};
14622
14653
  }
14623
14654
  }
14624
14655
  const wrappers_form = Form;
14656
+ function resource_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
14657
+ try {
14658
+ var info = gen[key](arg);
14659
+ var value = info.value;
14660
+ } catch (error) {
14661
+ reject(error);
14662
+ return;
14663
+ }
14664
+ if (info.done) resolve(value);
14665
+ else Promise.resolve(value).then(_next, _throw);
14666
+ }
14667
+ function resource_async_to_generator(fn) {
14668
+ return function() {
14669
+ var self1 = this, args = arguments;
14670
+ return new Promise(function(resolve, reject) {
14671
+ var gen = fn.apply(self1, args);
14672
+ function _next(value) {
14673
+ resource_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
14674
+ }
14675
+ function _throw(err) {
14676
+ resource_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
14677
+ }
14678
+ _next(void 0);
14679
+ });
14680
+ };
14681
+ }
14625
14682
  function resource_define_property(obj, key, value) {
14626
14683
  if (key in obj) Object.defineProperty(obj, key, {
14627
14684
  value: value,
@@ -14632,6 +14689,19 @@ var __webpack_exports__ = {};
14632
14689
  else obj[key] = value;
14633
14690
  return obj;
14634
14691
  }
14692
+ function _object_spread(target) {
14693
+ for(var i = 1; i < arguments.length; i++){
14694
+ var source = null != arguments[i] ? arguments[i] : {};
14695
+ var ownKeys = Object.keys(source);
14696
+ if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
14697
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
14698
+ }));
14699
+ ownKeys.forEach(function(key) {
14700
+ resource_define_property(target, key, source[key]);
14701
+ });
14702
+ }
14703
+ return target;
14704
+ }
14635
14705
  function findOriginalExc(exc) {
14636
14706
  if (exc instanceof Error && "response" in exc) {
14637
14707
  const response = exc.response;
@@ -14658,9 +14728,7 @@ var __webpack_exports__ = {};
14658
14728
  return videomail;
14659
14729
  }
14660
14730
  applyDefaultValues(videomail) {
14661
- let newVideomail = {
14662
- ...videomail
14663
- };
14731
+ let newVideomail = _object_spread({}, videomail);
14664
14732
  newVideomail = this.applyDefaultValue(newVideomail, "from");
14665
14733
  newVideomail = this.applyDefaultValue(newVideomail, "to");
14666
14734
  newVideomail = this.applyDefaultValue(newVideomail, "cc");
@@ -14669,121 +14737,137 @@ var __webpack_exports__ = {};
14669
14737
  newVideomail = this.applyDefaultValue(newVideomail, "body");
14670
14738
  return newVideomail;
14671
14739
  }
14672
- async get(identifierName, identifierValue) {
14673
- const url = `${this.options.apiUrl}/videomail/${identifierName}/${identifierValue}/snapshot`;
14674
- try {
14675
- const request = await client_default()("get", url).type("json").set("Accept", "application/json").withCredentials().set("Timezone-Id", this.timezoneId).set(constants.SITE_NAME_LABEL, this.options.siteName).timeout(this.options.timeouts.connection);
14676
- const videomail = request.body;
14677
- return videomail;
14678
- } catch (exc) {
14679
- throw error_createError({
14680
- exc: findOriginalExc(exc),
14681
- options: this.options
14682
- });
14683
- }
14684
- }
14685
- async write(method, videomail) {
14686
- const queryParams = {
14687
- [constants.SITE_NAME_LABEL]: this.options.siteName
14688
- };
14689
- let url = `${this.options.apiUrl}/videomail/`;
14690
- if (method === FormMethod.PUT && videomail.key) url += videomail.key;
14691
- try {
14692
- const request = await client_default()(method, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(videomail).timeout(this.options.timeouts.connection);
14693
- return request;
14694
- } catch (exc) {
14695
- throw error_createError({
14696
- exc: findOriginalExc(exc),
14697
- options: this.options
14698
- });
14699
- }
14700
- }
14701
- async getByAlias(alias) {
14702
- return await this.get("alias", alias);
14703
- }
14704
- async getByKey(key) {
14705
- return await this.get("key", key);
14740
+ get(identifierName, identifierValue) {
14741
+ return resource_async_to_generator(function*() {
14742
+ const url = `${this.options.apiUrl}/videomail/${identifierName}/${identifierValue}/snapshot`;
14743
+ try {
14744
+ const request = yield client_default()("get", url).type("json").set("Accept", "application/json").withCredentials().set("Timezone-Id", this.timezoneId).set(constants.SITE_NAME_LABEL, this.options.siteName).timeout(this.options.timeouts.connection);
14745
+ const videomail = request.body;
14746
+ return videomail;
14747
+ } catch (exc) {
14748
+ throw error_createError({
14749
+ exc: findOriginalExc(exc),
14750
+ options: this.options
14751
+ });
14752
+ }
14753
+ }).call(this);
14706
14754
  }
14707
- async reportError(err) {
14708
- const queryParams = {
14709
- [constants.SITE_NAME_LABEL]: this.options.siteName
14710
- };
14711
- const url = `${this.options.apiUrl}/client-error/`;
14712
- try {
14713
- var _this_options_versions;
14714
- const fullVideomailErrorData = {
14715
- browser: err.browser,
14716
- code: err.code,
14717
- cookie: err.cookie,
14718
- cpu: err.cpu,
14719
- device: err.device,
14720
- engine: err.engine,
14721
- err: serializeError(err.err),
14722
- explanation: err.explanation,
14723
- location: err.location,
14724
- logLines: err.logLines,
14725
- orientation: err.orientation,
14726
- os: err.os,
14727
- screen: err.screen,
14728
- siteName: err.siteName,
14729
- status: err.status,
14730
- title: err.title,
14731
- message: err.message,
14732
- stack: err.stack,
14733
- versions: {
14734
- videomailClient: package_namespaceObject.rE,
14735
- videomailNinjaFormPlugin: null == (_this_options_versions = this.options.versions) ? void 0 : _this_options_versions.videomailNinjaFormPlugin
14736
- }
14755
+ write(method, videomail) {
14756
+ return resource_async_to_generator(function*() {
14757
+ const queryParams = {
14758
+ [constants.SITE_NAME_LABEL]: this.options.siteName
14737
14759
  };
14738
- await client_default()(FormMethod.POST, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(fullVideomailErrorData).timeout(this.options.timeouts.connection);
14739
- } catch (exc) {
14740
- console.error(exc);
14741
- }
14742
- }
14743
- async post(videomail) {
14744
- const newVideomail = this.applyDefaultValues(videomail);
14745
- newVideomail[constants.VERSION_LABEL] = package_namespaceObject.rE;
14746
- try {
14747
- let res;
14748
- if (this.options.callbacks.adjustFormDataBeforePosting) {
14749
- const adjustedVideomail = this.options.callbacks.adjustFormDataBeforePosting(newVideomail);
14750
- res = await this.write(FormMethod.POST, adjustedVideomail);
14751
- } else res = await this.write(FormMethod.POST, newVideomail);
14752
- return res;
14753
- } catch (exc) {
14754
- throw error_createError({
14755
- exc: findOriginalExc(exc),
14756
- options: this.options
14757
- });
14758
- }
14759
- }
14760
- async put(videomail) {
14761
- return await this.write(FormMethod.PUT, videomail);
14760
+ let url = `${this.options.apiUrl}/videomail/`;
14761
+ if (method === FormMethod.PUT && videomail.key) url += videomail.key;
14762
+ try {
14763
+ const request = yield client_default()(method, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(videomail).timeout(this.options.timeouts.connection);
14764
+ return request;
14765
+ } catch (exc) {
14766
+ throw error_createError({
14767
+ exc: findOriginalExc(exc),
14768
+ options: this.options
14769
+ });
14770
+ }
14771
+ }).call(this);
14772
+ }
14773
+ getByAlias(alias) {
14774
+ return resource_async_to_generator(function*() {
14775
+ return yield this.get("alias", alias);
14776
+ }).call(this);
14777
+ }
14778
+ getByKey(key) {
14779
+ return resource_async_to_generator(function*() {
14780
+ return yield this.get("key", key);
14781
+ }).call(this);
14782
+ }
14783
+ reportError(err) {
14784
+ return resource_async_to_generator(function*() {
14785
+ const queryParams = {
14786
+ [constants.SITE_NAME_LABEL]: this.options.siteName
14787
+ };
14788
+ const url = `${this.options.apiUrl}/client-error/`;
14789
+ try {
14790
+ var _this_options_versions;
14791
+ const fullVideomailErrorData = {
14792
+ browser: err.browser,
14793
+ code: err.code,
14794
+ cookie: err.cookie,
14795
+ cpu: err.cpu,
14796
+ device: err.device,
14797
+ engine: err.engine,
14798
+ err: serializeError(err.err),
14799
+ explanation: err.explanation,
14800
+ location: err.location,
14801
+ logLines: err.logLines,
14802
+ orientation: err.orientation,
14803
+ os: err.os,
14804
+ screen: err.screen,
14805
+ siteName: err.siteName,
14806
+ status: err.status,
14807
+ title: err.title,
14808
+ message: err.message,
14809
+ stack: err.stack,
14810
+ versions: {
14811
+ videomailClient: package_namespaceObject.rE,
14812
+ videomailNinjaFormPlugin: null == (_this_options_versions = this.options.versions) ? void 0 : _this_options_versions.videomailNinjaFormPlugin
14813
+ }
14814
+ };
14815
+ yield client_default()(FormMethod.POST, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(fullVideomailErrorData).timeout(this.options.timeouts.connection);
14816
+ } catch (exc) {
14817
+ console.error(exc);
14818
+ }
14819
+ }).call(this);
14762
14820
  }
14763
- async form(formData, url) {
14764
- let formType;
14765
- switch(this.options.enctype){
14766
- case constants["public"].ENC_TYPE_APP_JSON:
14767
- formType = "json";
14768
- break;
14769
- case constants["public"].ENC_TYPE_FORM:
14770
- formType = "form";
14771
- break;
14772
- default:
14821
+ post(videomail) {
14822
+ return resource_async_to_generator(function*() {
14823
+ const newVideomail = this.applyDefaultValues(videomail);
14824
+ newVideomail[constants.VERSION_LABEL] = package_namespaceObject.rE;
14825
+ try {
14826
+ let res;
14827
+ if (this.options.callbacks.adjustFormDataBeforePosting) {
14828
+ const adjustedVideomail = this.options.callbacks.adjustFormDataBeforePosting(newVideomail);
14829
+ res = yield this.write(FormMethod.POST, adjustedVideomail);
14830
+ } else res = yield this.write(FormMethod.POST, newVideomail);
14831
+ return res;
14832
+ } catch (exc) {
14773
14833
  throw error_createError({
14774
- err: new Error(`Invalid enctype given: ${this.options.enctype}`),
14834
+ exc: findOriginalExc(exc),
14775
14835
  options: this.options
14776
14836
  });
14777
- }
14778
- try {
14779
- const res = await client_default().post(url).type(formType).set("Timezone-Id", this.timezoneId).send(formData).timeout(this.options.timeouts.connection);
14780
- return res;
14781
- } catch (exc) {
14782
- throw error_createError({
14783
- exc: findOriginalExc(exc),
14784
- options: this.options
14785
- });
14786
- }
14837
+ }
14838
+ }).call(this);
14839
+ }
14840
+ put(videomail) {
14841
+ return resource_async_to_generator(function*() {
14842
+ return yield this.write(FormMethod.PUT, videomail);
14843
+ }).call(this);
14844
+ }
14845
+ form(formData, url) {
14846
+ return resource_async_to_generator(function*() {
14847
+ let formType;
14848
+ switch(this.options.enctype){
14849
+ case constants["public"].ENC_TYPE_APP_JSON:
14850
+ formType = "json";
14851
+ break;
14852
+ case constants["public"].ENC_TYPE_FORM:
14853
+ formType = "form";
14854
+ break;
14855
+ default:
14856
+ throw error_createError({
14857
+ err: new Error(`Invalid enctype given: ${this.options.enctype}`),
14858
+ options: this.options
14859
+ });
14860
+ }
14861
+ try {
14862
+ const res = yield client_default().post(url).type(formType).set("Timezone-Id", this.timezoneId).send(formData).timeout(this.options.timeouts.connection);
14863
+ return res;
14864
+ } catch (exc) {
14865
+ throw error_createError({
14866
+ exc: findOriginalExc(exc),
14867
+ options: this.options
14868
+ });
14869
+ }
14870
+ }).call(this);
14787
14871
  }
14788
14872
  constructor(options){
14789
14873
  resource_define_property(this, "options", void 0);
@@ -14943,8 +15027,7 @@ var __webpack_exports__ = {};
14943
15027
  this.stack.push(`[${level}] ${line}`);
14944
15028
  return line;
14945
15029
  }
14946
- debug() {
14947
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
15030
+ debug(...args) {
14948
15031
  const output = this.lifo("debug", args);
14949
15032
  if (this.options.verbose) if (this.browser.isFirefox()) this.logger.debug(output);
14950
15033
  else if (this.logger.groupCollapsed) {
@@ -14954,16 +15037,13 @@ var __webpack_exports__ = {};
14954
15037
  } else if (this.logger.debug) this.logger.debug(output);
14955
15038
  else console.log(output);
14956
15039
  }
14957
- error() {
14958
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
15040
+ error(...args) {
14959
15041
  this.logger.error(this.lifo("error", args));
14960
15042
  }
14961
- warn() {
14962
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
15043
+ warn(...args) {
14963
15044
  this.logger.warn(this.lifo("warn", args));
14964
15045
  }
14965
- info() {
14966
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
15046
+ info(...args) {
14967
15047
  this.logger.info(this.lifo("info", args));
14968
15048
  }
14969
15049
  getLines() {
@@ -14985,8 +15065,7 @@ var __webpack_exports__ = {};
14985
15065
  return "test" === isTest_process.env.ENVIRON;
14986
15066
  }
14987
15067
  const util_isTest = isTest;
14988
- function mergeWithDefaultOptions_mergeWithDefaultOptions() {
14989
- let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
15068
+ function mergeWithDefaultOptions_mergeWithDefaultOptions(options = {}) {
14990
15069
  const newOptions = cjs_default()(src_options, options, {
14991
15070
  arrayMerge (_destination, source) {
14992
15071
  return source;
@@ -14998,19 +15077,19 @@ var __webpack_exports__ = {};
14998
15077
  return newOptions;
14999
15078
  }
15000
15079
  const mergeWithDefaultOptions = mergeWithDefaultOptions_mergeWithDefaultOptions;
15001
- var injectStylesIntoStyleTag = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
15080
+ var injectStylesIntoStyleTag = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
15002
15081
  var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
15003
- var styleDomAPI = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js");
15082
+ var styleDomAPI = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js");
15004
15083
  var styleDomAPI_default = /*#__PURE__*/ __webpack_require__.n(styleDomAPI);
15005
- var insertBySelector = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js");
15084
+ var insertBySelector = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js");
15006
15085
  var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
15007
- var setAttributesWithoutAttributes = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js");
15086
+ var setAttributesWithoutAttributes = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js");
15008
15087
  var setAttributesWithoutAttributes_default = /*#__PURE__*/ __webpack_require__.n(setAttributesWithoutAttributes);
15009
- var insertStyleElement = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js");
15088
+ var insertStyleElement = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js");
15010
15089
  var insertStyleElement_default = /*#__PURE__*/ __webpack_require__.n(insertStyleElement);
15011
- var styleTagTransform = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js");
15090
+ var styleTagTransform = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js");
15012
15091
  var styleTagTransform_default = /*#__PURE__*/ __webpack_require__.n(styleTagTransform);
15013
- var main = __webpack_require__("./node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[12].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[12].use[2]!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[12].use[3]!./src/styles/main.styl");
15092
+ var main = __webpack_require__("./node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[12].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[12].use[2]!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[12].use[3]!./src/styles/main.styl");
15014
15093
  var main_options = {};
15015
15094
  main_options.styleTagTransform = styleTagTransform_default();
15016
15095
  main_options.setAttributes = setAttributesWithoutAttributes_default();
@@ -15089,7 +15168,7 @@ var __webpack_exports__ = {};
15089
15168
  else obj[key] = value;
15090
15169
  return obj;
15091
15170
  }
15092
- class Buttons extends util_Despot {
15171
+ class Buttons extends Despot {
15093
15172
  replaceClickHandler(element, clickHandler) {
15094
15173
  const wrappedClickHandler = (ev)=>{
15095
15174
  ev.preventDefault();
@@ -15135,8 +15214,7 @@ var __webpack_exports__ = {};
15135
15214
  html_disableElement(radioButtonElement);
15136
15215
  return radioButtonElement;
15137
15216
  }
15138
- makeButton(buttonClass, text, clickHandler, show, id, type, selector) {
15139
- let disabled = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : true;
15217
+ makeButton(buttonClass, text, clickHandler, show, id, type, selector, disabled = true) {
15140
15218
  let buttonElement;
15141
15219
  if (id) buttonElement = document.querySelector(`#${id}`);
15142
15220
  else if (selector) buttonElement = document.querySelector(selector);
@@ -15464,13 +15542,12 @@ var __webpack_exports__ = {};
15464
15542
  if (this.built) {
15465
15543
  this.reset();
15466
15544
  this.options.logger.debug("Buttons: unload()");
15467
- util_Despot.removeAllListeners();
15545
+ Despot.removeAllListeners();
15468
15546
  this.hide();
15469
15547
  this.built = false;
15470
15548
  }
15471
15549
  }
15472
- hide() {
15473
- let deep = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
15550
+ hide(deep = false) {
15474
15551
  html_hideElement(this.buttonsElement);
15475
15552
  if (deep) {
15476
15553
  html_hideElement(this.recordButton);
@@ -15591,7 +15668,7 @@ var __webpack_exports__ = {};
15591
15668
  else obj[key] = value;
15592
15669
  return obj;
15593
15670
  }
15594
- class FacingMode extends util_Despot {
15671
+ class FacingMode extends Despot {
15595
15672
  initEvents() {
15596
15673
  this.on("ERROR", ()=>{
15597
15674
  this.hide();
@@ -15886,7 +15963,7 @@ var __webpack_exports__ = {};
15886
15963
  else obj[key] = value;
15887
15964
  return obj;
15888
15965
  }
15889
- class RecorderInsides extends util_Despot {
15966
+ class RecorderInsides extends Despot {
15890
15967
  startRecording() {
15891
15968
  this.recordTimer.start();
15892
15969
  }
@@ -16002,9 +16079,8 @@ var __webpack_exports__ = {};
16002
16079
  return obj;
16003
16080
  }
16004
16081
  const NOTIFIER_MESSAGE_ID = "notifierMessage";
16005
- class Notifier extends util_Despot {
16006
- onStopping() {
16007
- let limitReached = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
16082
+ class Notifier extends Despot {
16083
+ onStopping(limitReached = false) {
16008
16084
  let lead = "";
16009
16085
  this.visuals.beginWaiting();
16010
16086
  if (limitReached) {
@@ -16182,8 +16258,7 @@ var __webpack_exports__ = {};
16182
16258
  isBuilt() {
16183
16259
  return this.built;
16184
16260
  }
16185
- notify(message, explanation) {
16186
- let notifyOptions = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
16261
+ notify(message, explanation, notifyOptions = {}) {
16187
16262
  const params = [
16188
16263
  message,
16189
16264
  explanation
@@ -16496,7 +16571,7 @@ var __webpack_exports__ = {};
16496
16571
  return obj;
16497
16572
  }
16498
16573
  const EVENT_ASCII = "|—O—|";
16499
- class UserMedia extends util_Despot {
16574
+ class UserMedia extends Despot {
16500
16575
  attachMediaStream(stream) {
16501
16576
  this.currentVisualStream = stream;
16502
16577
  if (this.rawVisualUserMedia) this.rawVisualUserMedia.srcObject = stream;
@@ -16544,7 +16619,7 @@ var __webpack_exports__ = {};
16544
16619
  }
16545
16620
  audioRecord(audioCallback) {
16546
16621
  var _this_audioRecorder;
16547
- util_Despot.removeListener("SENDING_FIRST_FRAME");
16622
+ Despot.removeListener("SENDING_FIRST_FRAME");
16548
16623
  null == (_this_audioRecorder = this.audioRecorder) || _this_audioRecorder.record(audioCallback);
16549
16624
  }
16550
16625
  init(localMediaStream, videoCallback, audioCallback, endedEarlyCallback, switchingFacingMode) {
@@ -16560,7 +16635,7 @@ var __webpack_exports__ = {};
16560
16635
  var _this_rawVisualUserMedia, _this_rawVisualUserMedia1;
16561
16636
  this.options.logger.debug("UserMedia: unloadAllEventListeners()");
16562
16637
  this.unloadRemainingEventListeners();
16563
- util_Despot.removeListener("SENDING_FIRST_FRAME");
16638
+ Despot.removeListener("SENDING_FIRST_FRAME");
16564
16639
  null == (_this_rawVisualUserMedia = this.rawVisualUserMedia) || _this_rawVisualUserMedia.removeEventListener("play", onPlay);
16565
16640
  null == (_this_rawVisualUserMedia1 = this.rawVisualUserMedia) || _this_rawVisualUserMedia1.removeEventListener("loadedmetadata", onLoadedMetaData);
16566
16641
  };
@@ -16803,7 +16878,7 @@ var __webpack_exports__ = {};
16803
16878
  return obj;
16804
16879
  }
16805
16880
  const PIPE_SYMBOL = "°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸ ";
16806
- class Recorder extends util_Despot {
16881
+ class Recorder extends Despot {
16807
16882
  writeStream(buffer, opts) {
16808
16883
  if (this.stream) if (this.stream.destroyed) {
16809
16884
  this.stopPings();
@@ -17075,7 +17150,7 @@ var __webpack_exports__ = {};
17075
17150
  this.clearUserMediaTimeout();
17076
17151
  const characteristics = null == (_this_userMedia = this.userMedia) ? void 0 : _this_userMedia.getCharacteristics();
17077
17152
  this.options.logger.debug(`Recorder: userMediaErrorCallback(), name: ${err.name}, message: ${err.message} and Webcam characteristics: ${characteristics ? util_pretty(characteristics) : "none"}`);
17078
- const errorListeners = util_Despot.getListeners("ERROR");
17153
+ const errorListeners = Despot.getListeners("ERROR");
17079
17154
  if (null == errorListeners ? void 0 : errorListeners.length) {
17080
17155
  if (err.name !== error_VideomailError.MEDIA_DEVICE_NOT_SUPPORTED) {
17081
17156
  const videomailError = error_createError({
@@ -17178,7 +17253,7 @@ var __webpack_exports__ = {};
17178
17253
  this.clearUserMediaTimeout();
17179
17254
  this.options.logger.debug("Recorder: failed to load genuine user media");
17180
17255
  this.userMediaLoading = false;
17181
- const errorListeners = util_Despot.getListeners("ERROR");
17256
+ const errorListeners = Despot.getListeners("ERROR");
17182
17257
  if (null == errorListeners ? void 0 : errorListeners.length) this.emit("ERROR", {
17183
17258
  exc
17184
17259
  });
@@ -17738,7 +17813,7 @@ var __webpack_exports__ = {};
17738
17813
  else obj[key] = value;
17739
17814
  return obj;
17740
17815
  }
17741
- class Replay extends util_Despot {
17816
+ class Replay extends Despot {
17742
17817
  buildElement(replayParentElement) {
17743
17818
  const videoSelector = `video.${this.options.selectors.replayClass}`;
17744
17819
  this.replayElement = replayParentElement.querySelector(videoSelector);
@@ -17788,8 +17863,7 @@ var __webpack_exports__ = {};
17788
17863
  if (height > 0) this.replayElement.style.height = `${height}px`;
17789
17864
  else this.replayElement.style.height = "auto";
17790
17865
  }
17791
- setVideomail(newVideomail) {
17792
- let playerOnly = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
17866
+ setVideomail(newVideomail, playerOnly = false) {
17793
17867
  var _this_videomail_recordingStats;
17794
17868
  this.videomail = newVideomail;
17795
17869
  if (this.videomail.mp4) this.setMp4Source(this.videomail.mp4);
@@ -17806,8 +17880,7 @@ var __webpack_exports__ = {};
17806
17880
  const hasAudio = void 0 !== sampleRate ? sampleRate > 0 : false;
17807
17881
  this.show(width, height, hasAudio, playerOnly);
17808
17882
  }
17809
- show(videomailWidth, videomailHeight, hasAudio) {
17810
- let playerOnly = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : false;
17883
+ show(videomailWidth, videomailHeight, hasAudio, playerOnly = false) {
17811
17884
  var _this_videomail, _this_videomail1, _this_videomail2;
17812
17885
  if (!this.replayElement) return;
17813
17886
  if (this.isShown()) return;
@@ -17889,7 +17962,7 @@ var __webpack_exports__ = {};
17889
17962
  }
17890
17963
  unload(params) {
17891
17964
  this.options.logger.debug("Replay: unload()");
17892
- util_Despot.removeAllListeners();
17965
+ Despot.removeAllListeners();
17893
17966
  if (null == params ? void 0 : params.startingOver) this.hide();
17894
17967
  else {
17895
17968
  var _this_replayElement;
@@ -18009,7 +18082,7 @@ var __webpack_exports__ = {};
18009
18082
  else obj[key] = value;
18010
18083
  return obj;
18011
18084
  }
18012
- class Visuals extends util_Despot {
18085
+ class Visuals extends Despot {
18013
18086
  buildNoScriptTag() {
18014
18087
  let noScriptElement = this.container.querySelector("noscript");
18015
18088
  if (noScriptElement) {
@@ -18019,8 +18092,7 @@ var __webpack_exports__ = {};
18019
18092
  null == (_this_visualsElement = this.visualsElement) || _this_visualsElement.appendChild(noScriptElement);
18020
18093
  }
18021
18094
  }
18022
- buildChildren() {
18023
- let playerOnly = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false, visualsElement = arguments.length > 1 ? arguments[1] : void 0;
18095
+ buildChildren(playerOnly = false, visualsElement) {
18024
18096
  if (!visualsElement) throw new Error("Unable to build children without a visuals element");
18025
18097
  this.options.logger.debug(`Visuals: buildChildren (playerOnly = ${playerOnly}, visualsElement="${util_pretty(visualsElement)}"})`);
18026
18098
  this.buildNoScriptTag();
@@ -18030,8 +18102,7 @@ var __webpack_exports__ = {};
18030
18102
  }
18031
18103
  this.replay.build(visualsElement);
18032
18104
  }
18033
- initEvents() {
18034
- let playerOnly = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
18105
+ initEvents(playerOnly = false) {
18035
18106
  if (!playerOnly) {
18036
18107
  this.options.logger.debug(`Visuals: initEvents (playerOnly = ${playerOnly})`);
18037
18108
  this.on("USER_MEDIA_READY", ()=>{
@@ -18079,8 +18150,7 @@ var __webpack_exports__ = {};
18079
18150
  isCountingDown() {
18080
18151
  return this.recorderInsides.isCountingDown();
18081
18152
  }
18082
- build() {
18083
- let playerOnly = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false, parentElement = arguments.length > 1 ? arguments[1] : void 0;
18153
+ build(playerOnly = false, parentElement) {
18084
18154
  const parentElementInfo = parentElement ? `, parentElement="${util_pretty(parentElement)}"` : "";
18085
18155
  this.options.logger.debug(`Visuals: build (playerOnly = ${playerOnly}${parentElementInfo})`);
18086
18156
  if (parentElement) this.visualsElement = parentElement.querySelector(`.${this.options.selectors.visualsClass}`);
@@ -18120,8 +18190,7 @@ var __webpack_exports__ = {};
18120
18190
  this.recorder.stop(params);
18121
18191
  this.recorderInsides.hidePause();
18122
18192
  }
18123
- back() {
18124
- let keepHidden = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false, cb = arguments.length > 1 ? arguments[1] : void 0;
18193
+ back(keepHidden = false, cb) {
18125
18194
  this.options.logger.debug(`Visuals: back(keepHidden = ${keepHidden})`);
18126
18195
  this.replay.hide();
18127
18196
  this.notifier.hide();
@@ -18229,8 +18298,7 @@ var __webpack_exports__ = {};
18229
18298
  getRecorderWidth(responsive) {
18230
18299
  return this.recorder.getRecorderWidth(responsive);
18231
18300
  }
18232
- getRecorderHeight(responsive) {
18233
- let useBoundingClientRect = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
18301
+ getRecorderHeight(responsive, useBoundingClientRect = false) {
18234
18302
  return this.recorder.getRecorderHeight(responsive, useBoundingClientRect);
18235
18303
  }
18236
18304
  limitWidth(width) {
@@ -18289,6 +18357,32 @@ var __webpack_exports__ = {};
18289
18357
  }
18290
18358
  }
18291
18359
  const wrappers_visuals = Visuals;
18360
+ function container_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
18361
+ try {
18362
+ var info = gen[key](arg);
18363
+ var value = info.value;
18364
+ } catch (error) {
18365
+ reject(error);
18366
+ return;
18367
+ }
18368
+ if (info.done) resolve(value);
18369
+ else Promise.resolve(value).then(_next, _throw);
18370
+ }
18371
+ function container_async_to_generator(fn) {
18372
+ return function() {
18373
+ var self1 = this, args = arguments;
18374
+ return new Promise(function(resolve, reject) {
18375
+ var gen = fn.apply(self1, args);
18376
+ function _next(value) {
18377
+ container_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
18378
+ }
18379
+ function _throw(err) {
18380
+ container_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
18381
+ }
18382
+ _next(void 0);
18383
+ });
18384
+ };
18385
+ }
18292
18386
  function container_define_property(obj, key, value) {
18293
18387
  if (key in obj) Object.defineProperty(obj, key, {
18294
18388
  value: value,
@@ -18299,9 +18393,8 @@ var __webpack_exports__ = {};
18299
18393
  else obj[key] = value;
18300
18394
  return obj;
18301
18395
  }
18302
- class Container extends util_Despot {
18303
- buildChildren() {
18304
- let playerOnly = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false, parentElement = arguments.length > 1 ? arguments[1] : void 0;
18396
+ class Container extends Despot {
18397
+ buildChildren(playerOnly = false, parentElement) {
18305
18398
  const parentElementInfo = parentElement ? `, parentElement="${util_pretty(parentElement)}"` : "";
18306
18399
  this.options.logger.debug(`Container: buildChildren (playerOnly = ${playerOnly}${parentElementInfo})`);
18307
18400
  if (this.containerElement) this.containerElement.classList.add(this.options.selectors.containerClass);
@@ -18376,8 +18469,7 @@ var __webpack_exports__ = {};
18376
18469
  if (this.options.displayErrors && params.err) this.visuals.error(params.err);
18377
18470
  else this.visuals.reset();
18378
18471
  }
18379
- initEvents() {
18380
- let playerOnly = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
18472
+ initEvents(playerOnly = false) {
18381
18473
  this.options.logger.debug(`Container: initEvents (playerOnly = ${playerOnly})`);
18382
18474
  if (this.options.enableAutoUnload) window.addEventListener("beforeunload", (e)=>{
18383
18475
  this.unload({
@@ -18443,21 +18535,23 @@ var __webpack_exports__ = {};
18443
18535
  hideMySelf() {
18444
18536
  html_hideElement(this.containerElement);
18445
18537
  }
18446
- async submitVideomail(formInputs, method) {
18447
- var _this_form;
18448
- const videomailFormData = null == (_this_form = this.form) ? void 0 : _this_form.transformFormData(formInputs);
18449
- if (!videomailFormData) throw new Error("No videomail form data defined");
18450
- if (method === FormMethod.POST) {
18451
- videomailFormData.recordingStats = this.visuals.getRecordingStats();
18452
- videomailFormData.width = this.visuals.getRecorderWidth(true);
18453
- videomailFormData.height = this.visuals.getRecorderHeight(true);
18454
- return await this.resource.post(videomailFormData);
18455
- }
18456
- if (method === FormMethod.PUT) return await this.resource.put(videomailFormData);
18457
- throw error_createError({
18458
- message: `Unsupported form method ${method}, unable to submit videomail.`,
18459
- options: this.options
18460
- });
18538
+ submitVideomail(formInputs, method) {
18539
+ return container_async_to_generator(function*() {
18540
+ var _this_form;
18541
+ const videomailFormData = null == (_this_form = this.form) ? void 0 : _this_form.transformFormData(formInputs);
18542
+ if (!videomailFormData) throw new Error("No videomail form data defined");
18543
+ if (method === FormMethod.POST) {
18544
+ videomailFormData.recordingStats = this.visuals.getRecordingStats();
18545
+ videomailFormData.width = this.visuals.getRecorderWidth(true);
18546
+ videomailFormData.height = this.visuals.getRecorderHeight(true);
18547
+ return yield this.resource.post(videomailFormData);
18548
+ }
18549
+ if (method === FormMethod.PUT) return yield this.resource.put(videomailFormData);
18550
+ throw error_createError({
18551
+ message: `Unsupported form method ${method}, unable to submit videomail.`,
18552
+ options: this.options
18553
+ });
18554
+ }).call(this);
18461
18555
  }
18462
18556
  limitWidth(width) {
18463
18557
  if (!this.containerElement) return;
@@ -18508,7 +18602,7 @@ var __webpack_exports__ = {};
18508
18602
  exc
18509
18603
  });
18510
18604
  } finally{
18511
- util_Despot.removeAllListeners();
18605
+ Despot.removeAllListeners();
18512
18606
  this.built = this.submitted = false;
18513
18607
  }
18514
18608
  }
@@ -18575,8 +18669,7 @@ var __webpack_exports__ = {};
18575
18669
  pause(params) {
18576
18670
  this.visuals.pause(params);
18577
18671
  }
18578
- validate(event) {
18579
- let force = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
18672
+ validate(event, force = false) {
18580
18673
  let runValidation = true;
18581
18674
  let valid = true;
18582
18675
  if (this.built) if (this.options.enableAutoValidation) {
@@ -18609,12 +18702,13 @@ var __webpack_exports__ = {};
18609
18702
  const invalidInput = this.form.getInvalidElement();
18610
18703
  if (invalidInput) {
18611
18704
  const name = invalidInput.getAttribute("name");
18705
+ const validity = util_getValidity(invalidInput);
18612
18706
  valid = false;
18613
18707
  if (name) {
18614
- whyInvalid = `Input "${name}" seems wrong 🤔`;
18615
18708
  invalidData = {
18616
18709
  [name]: invalidInput.getAttribute("value")
18617
18710
  };
18711
+ whyInvalid = (null == validity ? void 0 : validity.valueMissing) ? `Please fill out field "${name}" ⚠️` : `Input "${name}" seems wrong 🤔`;
18618
18712
  }
18619
18713
  } else if (!this.areVisualsHidden() && !visualsValid) {
18620
18714
  if (this.buttonsAreReady() || this.isRecording() || this.isPaused() || this.isCountingDown()) {
@@ -18678,46 +18772,48 @@ var __webpack_exports__ = {};
18678
18772
  buttonsAreReady() {
18679
18773
  return this.buttons.isReady();
18680
18774
  }
18681
- async submitAll(formData, method, url) {
18682
- let response;
18683
- try {
18684
- const hasVideomailKey = Boolean(formData[this.options.selectors.keyInputName]);
18685
- if (!hasVideomailKey && !this.options.enableAutoSubmission) return;
18686
- const output = [
18687
- method,
18688
- url
18689
- ].filter(Boolean).join(": ");
18690
- this.options.logger.debug(`Container: submitAll(${output})`);
18691
- this.beginWaiting();
18692
- if (this.options.disableFormWhenSubmitting) this.disableForm(true);
18693
- this.emit("SUBMITTING");
18694
- if (hasVideomailKey) {
18695
- response = await this.submitVideomail(formData, method);
18696
- this.submitted = true;
18697
- this.emit("SUBMITTED", {
18698
- videomail: response.body.videomail,
18699
- response
18775
+ submitAll(formData, method, url) {
18776
+ return container_async_to_generator(function*() {
18777
+ let response;
18778
+ try {
18779
+ const hasVideomailKey = Boolean(formData[this.options.selectors.keyInputName]);
18780
+ if (!hasVideomailKey && !this.options.enableAutoSubmission) return;
18781
+ const output = [
18782
+ method,
18783
+ url
18784
+ ].filter(Boolean).join(": ");
18785
+ this.options.logger.debug(`Container: submitAll(${output})`);
18786
+ this.beginWaiting();
18787
+ if (this.options.disableFormWhenSubmitting) this.disableForm(true);
18788
+ this.emit("SUBMITTING");
18789
+ if (hasVideomailKey) {
18790
+ response = yield this.submitVideomail(formData, method);
18791
+ this.submitted = true;
18792
+ this.emit("SUBMITTED", {
18793
+ videomail: response.body.videomail,
18794
+ response
18795
+ });
18796
+ } else {
18797
+ response = yield this.resource.form(formData, url);
18798
+ this.submitted = true;
18799
+ this.emit("SUBMITTED", {
18800
+ videomail: response.body,
18801
+ response
18802
+ });
18803
+ }
18804
+ } catch (exc) {
18805
+ const err = error_createError({
18806
+ exc,
18807
+ options: this.options
18700
18808
  });
18701
- } else {
18702
- response = await this.resource.form(formData, url);
18703
- this.submitted = true;
18704
- this.emit("SUBMITTED", {
18705
- videomail: response.body,
18706
- response
18809
+ this.emit("ERROR", {
18810
+ err
18707
18811
  });
18812
+ } finally{
18813
+ if ((null == response ? void 0 : response.text) && "text/html" === response.type) document.body.innerHTML = response.text;
18814
+ this.endWaiting();
18708
18815
  }
18709
- } catch (exc) {
18710
- const err = error_createError({
18711
- exc,
18712
- options: this.options
18713
- });
18714
- this.emit("ERROR", {
18715
- err
18716
- });
18717
- } finally{
18718
- if ((null == response ? void 0 : response.text) && "text/html" === response.type) document.body.innerHTML = response.text;
18719
- this.endWaiting();
18720
- }
18816
+ }).call(this);
18721
18817
  }
18722
18818
  isBuilt() {
18723
18819
  return this.built;
@@ -18753,13 +18849,15 @@ var __webpack_exports__ = {};
18753
18849
  this.options = setAudioEnabled(false, this.options);
18754
18850
  this.emit("DISABLING_AUDIO");
18755
18851
  }
18756
- async submit() {
18757
- this.options.logger.debug("Container: submit()");
18758
- if (this.lastValidation) {
18759
- var _this_form;
18760
- return await (null == (_this_form = this.form) ? void 0 : _this_form.doTheSubmit());
18761
- }
18762
- return false;
18852
+ submit() {
18853
+ return container_async_to_generator(function*() {
18854
+ this.options.logger.debug("Container: submit()");
18855
+ if (this.lastValidation) {
18856
+ var _this_form;
18857
+ return yield null == (_this_form = this.form) ? void 0 : _this_form.doTheSubmit();
18858
+ }
18859
+ return false;
18860
+ }).call(this);
18763
18861
  }
18764
18862
  isCountingDown() {
18765
18863
  return this.visuals.isCountingDown();
@@ -18787,6 +18885,32 @@ var __webpack_exports__ = {};
18787
18885
  }
18788
18886
  }
18789
18887
  const wrappers_container = Container;
18888
+ function client_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
18889
+ try {
18890
+ var info = gen[key](arg);
18891
+ var value = info.value;
18892
+ } catch (error) {
18893
+ reject(error);
18894
+ return;
18895
+ }
18896
+ if (info.done) resolve(value);
18897
+ else Promise.resolve(value).then(_next, _throw);
18898
+ }
18899
+ function client_async_to_generator(fn) {
18900
+ return function() {
18901
+ var self1 = this, args = arguments;
18902
+ return new Promise(function(resolve, reject) {
18903
+ var gen = fn.apply(self1, args);
18904
+ function _next(value) {
18905
+ client_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
18906
+ }
18907
+ function _throw(err) {
18908
+ client_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
18909
+ }
18910
+ _next(void 0);
18911
+ });
18912
+ };
18913
+ }
18790
18914
  function client_define_property(obj, key, value) {
18791
18915
  if (key in obj) Object.defineProperty(obj, key, {
18792
18916
  value: value,
@@ -18797,7 +18921,7 @@ var __webpack_exports__ = {};
18797
18921
  else obj[key] = value;
18798
18922
  return obj;
18799
18923
  }
18800
- class VideomailClient extends util_Despot {
18924
+ class VideomailClient extends Despot {
18801
18925
  validateOptions() {
18802
18926
  const width = this.options.video.width;
18803
18927
  if (void 0 !== width && width % 2 !== 0) throw error_createError({
@@ -18824,8 +18948,7 @@ var __webpack_exports__ = {};
18824
18948
  this.unload(true);
18825
18949
  this.container.startOver(params);
18826
18950
  }
18827
- unload() {
18828
- let startingOver = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
18951
+ unload(startingOver = false) {
18829
18952
  this.container.unload({
18830
18953
  startingOver
18831
18954
  });
@@ -18850,13 +18973,17 @@ var __webpack_exports__ = {};
18850
18973
  hide() {
18851
18974
  this.container.hide();
18852
18975
  }
18853
- async getByAlias(alias) {
18854
- const resource = new src_resource(this.options);
18855
- return await resource.getByAlias(alias);
18976
+ getByAlias(alias) {
18977
+ return client_async_to_generator(function*() {
18978
+ const resource = new src_resource(this.options);
18979
+ return yield resource.getByAlias(alias);
18980
+ }).call(this);
18856
18981
  }
18857
- async getByKey(key) {
18858
- const resource = new src_resource(this.options);
18859
- return await resource.getByKey(key);
18982
+ getByKey(key) {
18983
+ return client_async_to_generator(function*() {
18984
+ const resource = new src_resource(this.options);
18985
+ return yield resource.getByKey(key);
18986
+ }).call(this);
18860
18987
  }
18861
18988
  isDirty() {
18862
18989
  return this.container.isDirty();
@@ -18879,7 +19006,7 @@ var __webpack_exports__ = {};
18879
19006
  constructor(options = {}){
18880
19007
  super("VideomailClient", mergeWithDefaultOptions(options)), client_define_property(this, "container", void 0);
18881
19008
  this.validateOptions();
18882
- util_Despot.removeAllListeners();
19009
+ Despot.removeAllListeners();
18883
19010
  this.container = new wrappers_container(this.options);
18884
19011
  }
18885
19012
  }