@wistia/wistia-player-react 0.0.44 → 0.0.45

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.
@@ -624,20 +624,20 @@ function _initPlayerEmbed(_ref19) {
624
624
  mediaData
625
625
  });
626
626
  }
627
- function _initPublicApi(_x20, _x21) {
627
+ function _initPublicApi(_x17, _x18) {
628
628
  return _initPublicApi2.apply(this, arguments);
629
629
  }
630
630
  function _initPublicApi2() {
631
- _initPublicApi2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee22(mediaId, options) {
631
+ _initPublicApi2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee21(mediaId, options) {
632
632
  var _this$api58, _this14 = this, _this$api59;
633
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
634
- while (1) switch (_context22.prev = _context22.next) {
633
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
634
+ while (1) switch (_context21.prev = _context21.next) {
635
635
  case 0:
636
- _context22.next = 2;
636
+ _context21.next = 2;
637
637
  return _classPrivateFieldGet(_publicApiScript, this);
638
638
  case 2:
639
639
  if (_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s.PublicApi) {
640
- _context22.next = 5;
640
+ _context21.next = 5;
641
641
  break;
642
642
  }
643
643
  (0, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_14__.WO)("player/failure/init-failed");
@@ -678,9 +678,9 @@ function _initPublicApi2() {
678
678
  });
679
679
  case 8:
680
680
  case "end":
681
- return _context22.stop();
681
+ return _context21.stop();
682
682
  }
683
- }, _callee22, this);
683
+ }, _callee21, this);
684
684
  }));
685
685
  return _initPublicApi2.apply(this, arguments);
686
686
  }
@@ -696,29 +696,29 @@ function _maybeInitializeMux() {
696
696
  return _maybeInitializeMux2.apply(this, arguments);
697
697
  }
698
698
  function _maybeInitializeMux2() {
699
- _maybeInitializeMux2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee23() {
699
+ _maybeInitializeMux2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee22() {
700
700
  var _this15 = this;
701
701
  var shouldRandomEnableMux, shouldEnableMuxForPlayer, embedType, mux;
702
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
703
- while (1) switch (_context23.prev = _context23.next) {
702
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
703
+ while (1) switch (_context22.prev = _context22.next) {
704
704
  case 0:
705
705
  if (this.api) {
706
- _context23.next = 2;
706
+ _context22.next = 2;
707
707
  break;
708
708
  }
709
- return _context23.abrupt("return");
709
+ return _context22.abrupt("return");
710
710
  case 2:
711
711
  shouldRandomEnableMux = (0, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_30__.k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_31__._);
712
712
  shouldEnableMuxForPlayer = (0, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_31__.J)(this.api, shouldRandomEnableMux) && (0, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_15__.D5)();
713
713
  embedType = this.useWebComponent ? "translated-web-component" : "web-component";
714
714
  if (!shouldEnableMuxForPlayer) {
715
- _context23.next = 11;
715
+ _context22.next = 11;
716
716
  break;
717
717
  }
718
- _context23.next = 8;
718
+ _context22.next = 8;
719
719
  return (0, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_7__.$)("assets/external/wistia-mux.js");
720
720
  case 8:
721
- mux = _context23.sent;
721
+ mux = _context22.sent;
722
722
  mux.init(this.api, {
723
723
  embedType
724
724
  });
@@ -731,9 +731,9 @@ function _maybeInitializeMux2() {
731
731
  });
732
732
  case 11:
733
733
  case "end":
734
- return _context23.stop();
734
+ return _context22.stop();
735
735
  }
736
- }, _callee23, this);
736
+ }, _callee22, this);
737
737
  }));
738
738
  return _maybeInitializeMux2.apply(this, arguments);
739
739
  }
@@ -9329,7 +9329,7 @@ var init_wistia_player = __esm({
9329
9329
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
9330
9330
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
9331
9331
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
9332
- var TAGGED_VERSION = "0.0.44";
9332
+ var TAGGED_VERSION = "0.0.45";
9333
9333
  var DEFAULT_PROTOCOL = function() {
9334
9334
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
9335
9335
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -14157,98 +14157,71 @@ var init_wistia_player = __esm({
14157
14157
  _assertClassBrand(_WistiaPlayer_brand, this, _setSyncedEmbedOption).call(this, "wistiaPopover", shouldBePopover);
14158
14158
  }
14159
14159
  }, {
14160
- key: "addToPlaylist",
14160
+ key: "cancelFullscreen",
14161
14161
  value: (
14162
14162
  // --------------------------------------------------
14163
14163
  // Public api methods
14164
14164
  // --------------------------------------------------
14165
14165
  /**
14166
- * Adds a media to the playlist.
14167
- * @param {string} mediaId - the id of the media to add
14168
- * @param {object} options - embed options to apply for this media in the playlist
14169
- * @param {object} position - position to add the media in the playlist
14166
+ * Attempt to enter fullscreen mode.
14170
14167
  * @returns {Promise<void>}
14171
14168
  */
14172
14169
  function() {
14173
- var _addToPlaylist = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(mediaId, options, position) {
14170
+ var _cancelFullscreen = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
14171
+ var _this$api46, _this$api46$_impl, _this3 = this;
14174
14172
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14175
14173
  while (1) switch (_context.prev = _context.next) {
14176
14174
  case 0:
14177
- if (!this.api) {
14178
- _context.next = 3;
14179
- break;
14175
+ if ((0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_26__.n9)(this._fullscreenState.widthBeforeFullscreen)) {
14176
+ this.style.width = this._fullscreenState.widthBeforeFullscreen;
14180
14177
  }
14181
- this.api.addToPlaylist(mediaId, options, position);
14182
- return _context.abrupt("return", Promise.resolve());
14178
+ if ((0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_26__.n9)(this._fullscreenState.heightBeforeFullscreen)) {
14179
+ this.style.height = this._fullscreenState.heightBeforeFullscreen;
14180
+ }
14181
+ return _context.abrupt("return", (_this$api46 = this.api) === null || _this$api46 === void 0 ? void 0 : (_this$api46$_impl = _this$api46._impl) === null || _this$api46$_impl === void 0 ? void 0 : _this$api46$_impl.cancelFullscreen().then(function() {
14182
+ _this3._fullscreenState.heightBeforeFullscreen = void 0;
14183
+ _this3._fullscreenState.widthBeforeFullscreen = void 0;
14184
+ }));
14183
14185
  case 3:
14184
- return _context.abrupt("return", Promise.reject(new Error("Playlist cannot be accessed")));
14185
- case 4:
14186
14186
  case "end":
14187
14187
  return _context.stop();
14188
14188
  }
14189
14189
  }, _callee, this);
14190
14190
  }));
14191
- function addToPlaylist(_x, _x2, _x3) {
14192
- return _addToPlaylist.apply(this, arguments);
14191
+ function cancelFullscreen() {
14192
+ return _cancelFullscreen.apply(this, arguments);
14193
14193
  }
14194
- return addToPlaylist;
14194
+ return cancelFullscreen;
14195
14195
  }()
14196
14196
  )
14197
14197
  /**
14198
- * Attempt to enter fullscreen mode.
14199
- * @returns {Promise<void>}
14198
+ * Creates an overlay with the specified name and options.
14199
+ * @param {string} name - The name of the overlay.
14200
+ * @param {OverlayOptions} options - The options for the overlay.
14201
+ * @returns A promise that resolves when the overlay is created successfully, or rejects with an error if the overlay cannot be defined at this time.
14200
14202
  */
14201
- }, {
14202
- key: "cancelFullscreen",
14203
- value: function() {
14204
- var _cancelFullscreen = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2() {
14205
- var _this$api46, _this$api46$_impl, _this3 = this;
14206
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
14207
- while (1) switch (_context2.prev = _context2.next) {
14208
- case 0:
14209
- if ((0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_26__.n9)(this._fullscreenState.widthBeforeFullscreen)) {
14210
- this.style.width = this._fullscreenState.widthBeforeFullscreen;
14211
- }
14212
- if ((0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_26__.n9)(this._fullscreenState.heightBeforeFullscreen)) {
14213
- this.style.height = this._fullscreenState.heightBeforeFullscreen;
14214
- }
14215
- return _context2.abrupt("return", (_this$api46 = this.api) === null || _this$api46 === void 0 ? void 0 : (_this$api46$_impl = _this$api46._impl) === null || _this$api46$_impl === void 0 ? void 0 : _this$api46$_impl.cancelFullscreen().then(function() {
14216
- _this3._fullscreenState.heightBeforeFullscreen = void 0;
14217
- _this3._fullscreenState.widthBeforeFullscreen = void 0;
14218
- }));
14219
- case 3:
14220
- case "end":
14221
- return _context2.stop();
14222
- }
14223
- }, _callee2, this);
14224
- }));
14225
- function cancelFullscreen() {
14226
- return _cancelFullscreen.apply(this, arguments);
14227
- }
14228
- return cancelFullscreen;
14229
- }()
14230
14203
  }, {
14231
14204
  key: "createOverlay",
14232
14205
  value: function() {
14233
- var _createOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3(name, options) {
14206
+ var _createOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(name, options) {
14234
14207
  var _this$api47, _this$api47$_impl;
14235
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
14236
- while (1) switch (_context3.prev = _context3.next) {
14208
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
14209
+ while (1) switch (_context2.prev = _context2.next) {
14237
14210
  case 0:
14238
14211
  if (!((_this$api47 = this.api) !== null && _this$api47 !== void 0 && (_this$api47$_impl = _this$api47._impl) !== null && _this$api47$_impl !== void 0 && _this$api47$_impl.defineOverlay)) {
14239
- _context3.next = 2;
14212
+ _context2.next = 2;
14240
14213
  break;
14241
14214
  }
14242
- return _context3.abrupt("return", this.api._impl.defineOverlay(name, options));
14215
+ return _context2.abrupt("return", this.api._impl.defineOverlay(name, options));
14243
14216
  case 2:
14244
- return _context3.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be defined at this time"))));
14217
+ return _context2.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be defined at this time"))));
14245
14218
  case 3:
14246
14219
  case "end":
14247
- return _context3.stop();
14220
+ return _context2.stop();
14248
14221
  }
14249
- }, _callee3, this);
14222
+ }, _callee2, this);
14250
14223
  }));
14251
- function createOverlay(_x4, _x5) {
14224
+ function createOverlay(_x, _x2) {
14252
14225
  return _createOverlay.apply(this, arguments);
14253
14226
  }
14254
14227
  return createOverlay;
@@ -14256,36 +14229,36 @@ var init_wistia_player = __esm({
14256
14229
  }, {
14257
14230
  key: "definePlugin",
14258
14231
  value: function() {
14259
- var _definePlugin = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee5(name, options) {
14232
+ var _definePlugin = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4(name, options) {
14260
14233
  var _this4 = this;
14261
14234
  var addPlugin;
14262
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
14263
- while (1) switch (_context5.prev = _context5.next) {
14235
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
14236
+ while (1) switch (_context4.prev = _context4.next) {
14264
14237
  case 0:
14265
14238
  addPlugin = /* @__PURE__ */ function() {
14266
- var _ref13 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4() {
14239
+ var _ref13 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3() {
14267
14240
  var _this4$api$addPlugin, _this4$api;
14268
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
14269
- while (1) switch (_context4.prev = _context4.next) {
14241
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
14242
+ while (1) switch (_context3.prev = _context3.next) {
14270
14243
  case 0:
14271
- return _context4.abrupt("return", (_this4$api$addPlugin = (_this4$api = _this4.api) === null || _this4$api === void 0 ? void 0 : _this4$api.addPlugin(name, options)) !== null && _this4$api$addPlugin !== void 0 ? _this4$api$addPlugin : Promise.reject(new Error("plugin ".concat(name, " cannot be defined"))));
14244
+ return _context3.abrupt("return", (_this4$api$addPlugin = (_this4$api = _this4.api) === null || _this4$api === void 0 ? void 0 : _this4$api.addPlugin(name, options)) !== null && _this4$api$addPlugin !== void 0 ? _this4$api$addPlugin : Promise.reject(new Error("plugin ".concat(name, " cannot be defined"))));
14272
14245
  case 1:
14273
14246
  case "end":
14274
- return _context4.stop();
14247
+ return _context3.stop();
14275
14248
  }
14276
- }, _callee4);
14249
+ }, _callee3);
14277
14250
  }));
14278
14251
  return function addPlugin2() {
14279
14252
  return _ref13.apply(this, arguments);
14280
14253
  };
14281
14254
  }();
14282
14255
  if (!this.api) {
14283
- _context5.next = 3;
14256
+ _context4.next = 3;
14284
14257
  break;
14285
14258
  }
14286
- return _context5.abrupt("return", addPlugin());
14259
+ return _context4.abrupt("return", addPlugin());
14287
14260
  case 3:
14288
- return _context5.abrupt("return", new Promise(function(resolve, reject) {
14261
+ return _context4.abrupt("return", new Promise(function(resolve, reject) {
14289
14262
  var _handler = function handler() {
14290
14263
  _this4.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_27__.c5, _handler);
14291
14264
  addPlugin().then(function(plugin) {
@@ -14302,11 +14275,11 @@ var init_wistia_player = __esm({
14302
14275
  }));
14303
14276
  case 4:
14304
14277
  case "end":
14305
- return _context5.stop();
14278
+ return _context4.stop();
14306
14279
  }
14307
- }, _callee5, this);
14280
+ }, _callee4, this);
14308
14281
  }));
14309
- function definePlugin(_x6, _x7) {
14282
+ function definePlugin(_x3, _x4) {
14310
14283
  return _definePlugin.apply(this, arguments);
14311
14284
  }
14312
14285
  return definePlugin;
@@ -14314,25 +14287,25 @@ var init_wistia_player = __esm({
14314
14287
  }, {
14315
14288
  key: "deleteOverlay",
14316
14289
  value: function() {
14317
- var _deleteOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee6(name) {
14290
+ var _deleteOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee5(name) {
14318
14291
  var _this$api48, _this$api48$_impl;
14319
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
14320
- while (1) switch (_context6.prev = _context6.next) {
14292
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
14293
+ while (1) switch (_context5.prev = _context5.next) {
14321
14294
  case 0:
14322
14295
  if (!((_this$api48 = this.api) !== null && _this$api48 !== void 0 && (_this$api48$_impl = _this$api48._impl) !== null && _this$api48$_impl !== void 0 && _this$api48$_impl.undefineOverlay)) {
14323
- _context6.next = 2;
14296
+ _context5.next = 2;
14324
14297
  break;
14325
14298
  }
14326
- return _context6.abrupt("return", this.api._impl.undefineOverlay(name));
14299
+ return _context5.abrupt("return", this.api._impl.undefineOverlay(name));
14327
14300
  case 2:
14328
- return _context6.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be deleted at this time"))));
14301
+ return _context5.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be deleted at this time"))));
14329
14302
  case 3:
14330
14303
  case "end":
14331
- return _context6.stop();
14304
+ return _context5.stop();
14332
14305
  }
14333
- }, _callee6, this);
14306
+ }, _callee5, this);
14334
14307
  }));
14335
- function deleteOverlay(_x8) {
14308
+ function deleteOverlay(_x5) {
14336
14309
  return _deleteOverlay.apply(this, arguments);
14337
14310
  }
14338
14311
  return deleteOverlay;
@@ -14340,25 +14313,25 @@ var init_wistia_player = __esm({
14340
14313
  }, {
14341
14314
  key: "disableControl",
14342
14315
  value: function() {
14343
- var _disableControl = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee7(name) {
14316
+ var _disableControl = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee6(name) {
14344
14317
  var _this$api49, _this$api49$_impl;
14345
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
14346
- while (1) switch (_context7.prev = _context7.next) {
14318
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
14319
+ while (1) switch (_context6.prev = _context6.next) {
14347
14320
  case 0:
14348
14321
  if (!((_this$api49 = this.api) !== null && _this$api49 !== void 0 && (_this$api49$_impl = _this$api49._impl) !== null && _this$api49$_impl !== void 0 && _this$api49$_impl.setControlEnabled)) {
14349
- _context7.next = 2;
14322
+ _context6.next = 2;
14350
14323
  break;
14351
14324
  }
14352
- return _context7.abrupt("return", this.api._impl.setControlEnabled(name, false));
14325
+ return _context6.abrupt("return", this.api._impl.setControlEnabled(name, false));
14353
14326
  case 2:
14354
- return _context7.abrupt("return", Promise.reject(new Error('control "'.concat(name, '" cannot be disabled at this time'))));
14327
+ return _context6.abrupt("return", Promise.reject(new Error('control "'.concat(name, '" cannot be disabled at this time'))));
14355
14328
  case 3:
14356
14329
  case "end":
14357
- return _context7.stop();
14330
+ return _context6.stop();
14358
14331
  }
14359
- }, _callee7, this);
14332
+ }, _callee6, this);
14360
14333
  }));
14361
- function disableControl(_x9) {
14334
+ function disableControl(_x6) {
14362
14335
  return _disableControl.apply(this, arguments);
14363
14336
  }
14364
14337
  return disableControl;
@@ -14366,25 +14339,25 @@ var init_wistia_player = __esm({
14366
14339
  }, {
14367
14340
  key: "enableControl",
14368
14341
  value: function() {
14369
- var _enableControl = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee8(name) {
14342
+ var _enableControl = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee7(name) {
14370
14343
  var _this$api50, _this$api50$_impl;
14371
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
14372
- while (1) switch (_context8.prev = _context8.next) {
14344
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
14345
+ while (1) switch (_context7.prev = _context7.next) {
14373
14346
  case 0:
14374
14347
  if (!((_this$api50 = this.api) !== null && _this$api50 !== void 0 && (_this$api50$_impl = _this$api50._impl) !== null && _this$api50$_impl !== void 0 && _this$api50$_impl.setControlEnabled)) {
14375
- _context8.next = 2;
14348
+ _context7.next = 2;
14376
14349
  break;
14377
14350
  }
14378
- return _context8.abrupt("return", this.api._impl.setControlEnabled(name, true));
14351
+ return _context7.abrupt("return", this.api._impl.setControlEnabled(name, true));
14379
14352
  case 2:
14380
- return _context8.abrupt("return", Promise.reject(new Error('control "'.concat(name, '" cannot be enabled at this time'))));
14353
+ return _context7.abrupt("return", Promise.reject(new Error('control "'.concat(name, '" cannot be enabled at this time'))));
14381
14354
  case 3:
14382
14355
  case "end":
14383
- return _context8.stop();
14356
+ return _context7.stop();
14384
14357
  }
14385
- }, _callee8, this);
14358
+ }, _callee7, this);
14386
14359
  }));
14387
- function enableControl(_x10) {
14360
+ function enableControl(_x7) {
14388
14361
  return _enableControl.apply(this, arguments);
14389
14362
  }
14390
14363
  return enableControl;
@@ -14392,24 +14365,24 @@ var init_wistia_player = __esm({
14392
14365
  }, {
14393
14366
  key: "getPlugin",
14394
14367
  value: function() {
14395
- var _getPlugin = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9(name) {
14396
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
14397
- while (1) switch (_context9.prev = _context9.next) {
14368
+ var _getPlugin = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee8(name) {
14369
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
14370
+ while (1) switch (_context8.prev = _context8.next) {
14398
14371
  case 0:
14399
14372
  if (!this.api) {
14400
- _context9.next = 2;
14373
+ _context8.next = 2;
14401
14374
  break;
14402
14375
  }
14403
- return _context9.abrupt("return", this.api.plugin(name));
14376
+ return _context8.abrupt("return", this.api.plugin(name));
14404
14377
  case 2:
14405
- return _context9.abrupt("return", Promise.reject(new Error("plugin ".concat(name, " is not yet defined"))));
14378
+ return _context8.abrupt("return", Promise.reject(new Error("plugin ".concat(name, " is not yet defined"))));
14406
14379
  case 3:
14407
14380
  case "end":
14408
- return _context9.stop();
14381
+ return _context8.stop();
14409
14382
  }
14410
- }, _callee9, this);
14383
+ }, _callee8, this);
14411
14384
  }));
14412
- function getPlugin(_x11) {
14385
+ function getPlugin(_x8) {
14413
14386
  return _getPlugin.apply(this, arguments);
14414
14387
  }
14415
14388
  return getPlugin;
@@ -14417,25 +14390,25 @@ var init_wistia_player = __esm({
14417
14390
  }, {
14418
14391
  key: "hideOverlay",
14419
14392
  value: function() {
14420
- var _hideOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee10(name) {
14393
+ var _hideOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9(name) {
14421
14394
  var _this$api51, _this$api51$_impl;
14422
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
14423
- while (1) switch (_context10.prev = _context10.next) {
14395
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
14396
+ while (1) switch (_context9.prev = _context9.next) {
14424
14397
  case 0:
14425
14398
  if (!((_this$api51 = this.api) !== null && _this$api51 !== void 0 && (_this$api51$_impl = _this$api51._impl) !== null && _this$api51$_impl !== void 0 && _this$api51$_impl.cancelOverlay)) {
14426
- _context10.next = 2;
14399
+ _context9.next = 2;
14427
14400
  break;
14428
14401
  }
14429
- return _context10.abrupt("return", this.api._impl.cancelOverlay(name));
14402
+ return _context9.abrupt("return", this.api._impl.cancelOverlay(name));
14430
14403
  case 2:
14431
- return _context10.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be cancelled at this time"))));
14404
+ return _context9.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be cancelled at this time"))));
14432
14405
  case 3:
14433
14406
  case "end":
14434
- return _context10.stop();
14407
+ return _context9.stop();
14435
14408
  }
14436
- }, _callee10, this);
14409
+ }, _callee9, this);
14437
14410
  }));
14438
- function hideOverlay(_x12) {
14411
+ function hideOverlay(_x9) {
14439
14412
  return _hideOverlay.apply(this, arguments);
14440
14413
  }
14441
14414
  return hideOverlay;
@@ -14443,12 +14416,12 @@ var init_wistia_player = __esm({
14443
14416
  }, {
14444
14417
  key: "hidePopover",
14445
14418
  value: function() {
14446
- var _hidePopover = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee11() {
14419
+ var _hidePopover = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee10() {
14447
14420
  var _this5 = this;
14448
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
14449
- while (1) switch (_context11.prev = _context11.next) {
14421
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
14422
+ while (1) switch (_context10.prev = _context10.next) {
14450
14423
  case 0:
14451
- return _context11.abrupt("return", new Promise(function(resolve, reject) {
14424
+ return _context10.abrupt("return", new Promise(function(resolve, reject) {
14452
14425
  var _this5$api;
14453
14426
  if ((_this5$api = _this5.api) !== null && _this5$api !== void 0 && _this5$api.popover) {
14454
14427
  _this5.api.popover.hide();
@@ -14458,9 +14431,9 @@ var init_wistia_player = __esm({
14458
14431
  }));
14459
14432
  case 1:
14460
14433
  case "end":
14461
- return _context11.stop();
14434
+ return _context10.stop();
14462
14435
  }
14463
- }, _callee11);
14436
+ }, _callee10);
14464
14437
  }));
14465
14438
  function hidePopover() {
14466
14439
  return _hidePopover.apply(this, arguments);
@@ -14470,17 +14443,17 @@ var init_wistia_player = __esm({
14470
14443
  }, {
14471
14444
  key: "pause",
14472
14445
  value: function() {
14473
- var _pause = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee12() {
14446
+ var _pause = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee11() {
14474
14447
  var _this$api52, _this$api52$_impl;
14475
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
14476
- while (1) switch (_context12.prev = _context12.next) {
14448
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
14449
+ while (1) switch (_context11.prev = _context11.next) {
14477
14450
  case 0:
14478
- return _context12.abrupt("return", (_this$api52 = this.api) === null || _this$api52 === void 0 ? void 0 : (_this$api52$_impl = _this$api52._impl) === null || _this$api52$_impl === void 0 ? void 0 : _this$api52$_impl.pause());
14451
+ return _context11.abrupt("return", (_this$api52 = this.api) === null || _this$api52 === void 0 ? void 0 : (_this$api52$_impl = _this$api52._impl) === null || _this$api52$_impl === void 0 ? void 0 : _this$api52$_impl.pause());
14479
14452
  case 1:
14480
14453
  case "end":
14481
- return _context12.stop();
14454
+ return _context11.stop();
14482
14455
  }
14483
- }, _callee12, this);
14456
+ }, _callee11, this);
14484
14457
  }));
14485
14458
  function pause() {
14486
14459
  return _pause.apply(this, arguments);
@@ -14490,17 +14463,17 @@ var init_wistia_player = __esm({
14490
14463
  }, {
14491
14464
  key: "play",
14492
14465
  value: function() {
14493
- var _play = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee13() {
14466
+ var _play = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee12() {
14494
14467
  var _this$api53, _this$api53$_impl;
14495
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
14496
- while (1) switch (_context13.prev = _context13.next) {
14468
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
14469
+ while (1) switch (_context12.prev = _context12.next) {
14497
14470
  case 0:
14498
- return _context13.abrupt("return", (_this$api53 = this.api) === null || _this$api53 === void 0 ? void 0 : (_this$api53$_impl = _this$api53._impl) === null || _this$api53$_impl === void 0 ? void 0 : _this$api53$_impl.play());
14471
+ return _context12.abrupt("return", (_this$api53 = this.api) === null || _this$api53 === void 0 ? void 0 : (_this$api53$_impl = _this$api53._impl) === null || _this$api53$_impl === void 0 ? void 0 : _this$api53$_impl.play());
14499
14472
  case 1:
14500
14473
  case "end":
14501
- return _context13.stop();
14474
+ return _context12.stop();
14502
14475
  }
14503
- }, _callee13, this);
14476
+ }, _callee12, this);
14504
14477
  }));
14505
14478
  function play() {
14506
14479
  return _play.apply(this, arguments);
@@ -14510,19 +14483,19 @@ var init_wistia_player = __esm({
14510
14483
  }, {
14511
14484
  key: "releaseControls",
14512
14485
  value: function() {
14513
- var _releaseControls = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee14(name) {
14486
+ var _releaseControls = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee13(name) {
14514
14487
  var _this$api54, _this$api54$_impl;
14515
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
14516
- while (1) switch (_context14.prev = _context14.next) {
14488
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
14489
+ while (1) switch (_context13.prev = _context13.next) {
14517
14490
  case 0:
14518
- return _context14.abrupt("return", (_this$api54 = this.api) === null || _this$api54 === void 0 ? void 0 : (_this$api54$_impl = _this$api54._impl) === null || _this$api54$_impl === void 0 ? void 0 : _this$api54$_impl.releaseControls(name));
14491
+ return _context13.abrupt("return", (_this$api54 = this.api) === null || _this$api54 === void 0 ? void 0 : (_this$api54$_impl = _this$api54._impl) === null || _this$api54$_impl === void 0 ? void 0 : _this$api54$_impl.releaseControls(name));
14519
14492
  case 1:
14520
14493
  case "end":
14521
- return _context14.stop();
14494
+ return _context13.stop();
14522
14495
  }
14523
- }, _callee14, this);
14496
+ }, _callee13, this);
14524
14497
  }));
14525
- function releaseControls(_x13) {
14498
+ function releaseControls(_x10) {
14526
14499
  return _releaseControls.apply(this, arguments);
14527
14500
  }
14528
14501
  return releaseControls;
@@ -14530,14 +14503,14 @@ var init_wistia_player = __esm({
14530
14503
  }, {
14531
14504
  key: "replaceWithMedia",
14532
14505
  value: function() {
14533
- var _replaceWithMedia = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee15(mediaId) {
14506
+ var _replaceWithMedia = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee14(mediaId) {
14534
14507
  var _this6 = this;
14535
- var options, _args15 = arguments;
14536
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
14537
- while (1) switch (_context15.prev = _context15.next) {
14508
+ var options, _args14 = arguments;
14509
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
14510
+ while (1) switch (_context14.prev = _context14.next) {
14538
14511
  case 0:
14539
- options = _args15.length > 1 && _args15[1] !== void 0 ? _args15[1] : {};
14540
- return _context15.abrupt("return", new Promise(function(resolve, reject) {
14512
+ options = _args14.length > 1 && _args14[1] !== void 0 ? _args14[1] : {};
14513
+ return _context14.abrupt("return", new Promise(function(resolve, reject) {
14541
14514
  var _this6$api;
14542
14515
  if (!_this6.api) {
14543
14516
  reject(new Error("api not ready to replace"));
@@ -14556,11 +14529,11 @@ var init_wistia_player = __esm({
14556
14529
  }));
14557
14530
  case 2:
14558
14531
  case "end":
14559
- return _context15.stop();
14532
+ return _context14.stop();
14560
14533
  }
14561
- }, _callee15);
14534
+ }, _callee14);
14562
14535
  }));
14563
- function replaceWithMedia(_x14) {
14536
+ function replaceWithMedia(_x11) {
14564
14537
  return _replaceWithMedia.apply(this, arguments);
14565
14538
  }
14566
14539
  return replaceWithMedia;
@@ -14568,19 +14541,19 @@ var init_wistia_player = __esm({
14568
14541
  }, {
14569
14542
  key: "requestControls",
14570
14543
  value: function() {
14571
- var _requestControls = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee16(name) {
14544
+ var _requestControls = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee15(name) {
14572
14545
  var _this$api55, _this$api55$_impl;
14573
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
14574
- while (1) switch (_context16.prev = _context16.next) {
14546
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
14547
+ while (1) switch (_context15.prev = _context15.next) {
14575
14548
  case 0:
14576
- return _context16.abrupt("return", (_this$api55 = this.api) === null || _this$api55 === void 0 ? void 0 : (_this$api55$_impl = _this$api55._impl) === null || _this$api55$_impl === void 0 ? void 0 : _this$api55$_impl.requestControls(name));
14549
+ return _context15.abrupt("return", (_this$api55 = this.api) === null || _this$api55 === void 0 ? void 0 : (_this$api55$_impl = _this$api55._impl) === null || _this$api55$_impl === void 0 ? void 0 : _this$api55$_impl.requestControls(name));
14577
14550
  case 1:
14578
14551
  case "end":
14579
- return _context16.stop();
14552
+ return _context15.stop();
14580
14553
  }
14581
- }, _callee16, this);
14554
+ }, _callee15, this);
14582
14555
  }));
14583
- function requestControls(_x15) {
14556
+ function requestControls(_x12) {
14584
14557
  return _requestControls.apply(this, arguments);
14585
14558
  }
14586
14559
  return requestControls;
@@ -14588,23 +14561,23 @@ var init_wistia_player = __esm({
14588
14561
  }, {
14589
14562
  key: "requestFullscreen",
14590
14563
  value: function() {
14591
- var _requestFullscreen = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee17() {
14564
+ var _requestFullscreen = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee16() {
14592
14565
  var _this$api56, _this$api56$_impl;
14593
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
14594
- while (1) switch (_context17.prev = _context17.next) {
14566
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
14567
+ while (1) switch (_context16.prev = _context16.next) {
14595
14568
  case 0:
14596
14569
  if (!((_this$api56 = this.api) !== null && _this$api56 !== void 0 && (_this$api56$_impl = _this$api56._impl) !== null && _this$api56$_impl !== void 0 && _this$api56$_impl.requestFullscreen)) {
14597
- _context17.next = 2;
14570
+ _context16.next = 2;
14598
14571
  break;
14599
14572
  }
14600
- return _context17.abrupt("return", this.api._impl.requestFullscreen());
14573
+ return _context16.abrupt("return", this.api._impl.requestFullscreen());
14601
14574
  case 2:
14602
- return _context17.abrupt("return", Promise.reject(new Error("Fullscreen cannot be accessed")));
14575
+ return _context16.abrupt("return", Promise.reject(new Error("Fullscreen cannot be accessed")));
14603
14576
  case 3:
14604
14577
  case "end":
14605
- return _context17.stop();
14578
+ return _context16.stop();
14606
14579
  }
14607
- }, _callee17, this);
14580
+ }, _callee16, this);
14608
14581
  }));
14609
14582
  function requestFullscreen() {
14610
14583
  return _requestFullscreen.apply(this, arguments);
@@ -14614,25 +14587,25 @@ var init_wistia_player = __esm({
14614
14587
  }, {
14615
14588
  key: "showOverlay",
14616
14589
  value: function() {
14617
- var _showOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee18(name) {
14590
+ var _showOverlay = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee17(name) {
14618
14591
  var _this$api57, _this$api57$_impl;
14619
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
14620
- while (1) switch (_context18.prev = _context18.next) {
14592
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
14593
+ while (1) switch (_context17.prev = _context17.next) {
14621
14594
  case 0:
14622
14595
  if (!((_this$api57 = this.api) !== null && _this$api57 !== void 0 && (_this$api57$_impl = _this$api57._impl) !== null && _this$api57$_impl !== void 0 && _this$api57$_impl.requestOverlay)) {
14623
- _context18.next = 2;
14596
+ _context17.next = 2;
14624
14597
  break;
14625
14598
  }
14626
- return _context18.abrupt("return", this.api._impl.requestOverlay(name));
14599
+ return _context17.abrupt("return", this.api._impl.requestOverlay(name));
14627
14600
  case 2:
14628
- return _context18.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be requested at this time"))));
14601
+ return _context17.abrupt("return", Promise.reject(new Error("overlay ".concat(name, " cannot be requested at this time"))));
14629
14602
  case 3:
14630
14603
  case "end":
14631
- return _context18.stop();
14604
+ return _context17.stop();
14632
14605
  }
14633
- }, _callee18, this);
14606
+ }, _callee17, this);
14634
14607
  }));
14635
- function showOverlay(_x16) {
14608
+ function showOverlay(_x13) {
14636
14609
  return _showOverlay.apply(this, arguments);
14637
14610
  }
14638
14611
  return showOverlay;
@@ -14640,12 +14613,12 @@ var init_wistia_player = __esm({
14640
14613
  }, {
14641
14614
  key: "showPopover",
14642
14615
  value: function() {
14643
- var _showPopover = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee19() {
14616
+ var _showPopover = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee18() {
14644
14617
  var _this7 = this;
14645
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
14646
- while (1) switch (_context19.prev = _context19.next) {
14618
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
14619
+ while (1) switch (_context18.prev = _context18.next) {
14647
14620
  case 0:
14648
- return _context19.abrupt("return", new Promise(function(resolve, reject) {
14621
+ return _context18.abrupt("return", new Promise(function(resolve, reject) {
14649
14622
  var _this7$api;
14650
14623
  if ((_this7$api = _this7.api) !== null && _this7$api !== void 0 && _this7$api.popover) {
14651
14624
  _this7.api.popover.show();
@@ -14655,9 +14628,9 @@ var init_wistia_player = __esm({
14655
14628
  }));
14656
14629
  case 1:
14657
14630
  case "end":
14658
- return _context19.stop();
14631
+ return _context18.stop();
14659
14632
  }
14660
- }, _callee19);
14633
+ }, _callee18);
14661
14634
  }));
14662
14635
  function showPopover() {
14663
14636
  return _showPopover.apply(this, arguments);
@@ -14773,50 +14746,50 @@ var init_wistia_player = __esm({
14773
14746
  }(/* @__PURE__ */ _wrapNativeSuper(HTMLElement));
14774
14747
  _WistiaPlayer = WistiaPlayer;
14775
14748
  getSwatchMetaData2 = /* @__PURE__ */ function() {
14776
- var _ref15 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee20(url) {
14749
+ var _ref15 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee19(url) {
14777
14750
  var swatch;
14778
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
14779
- while (1) switch (_context20.prev = _context20.next) {
14751
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
14752
+ while (1) switch (_context19.prev = _context19.next) {
14780
14753
  case 0:
14781
14754
  swatch = new Image();
14782
14755
  swatch.src = url;
14783
- _context20.next = 4;
14756
+ _context19.next = 4;
14784
14757
  return swatch.decode();
14785
14758
  case 4:
14786
- return _context20.abrupt("return", swatch);
14759
+ return _context19.abrupt("return", swatch);
14787
14760
  case 5:
14788
14761
  case "end":
14789
- return _context20.stop();
14762
+ return _context19.stop();
14790
14763
  }
14791
- }, _callee20);
14764
+ }, _callee19);
14792
14765
  }));
14793
- return function getSwatchMetaData3(_x17) {
14766
+ return function getSwatchMetaData3(_x14) {
14794
14767
  return _ref15.apply(this, arguments);
14795
14768
  };
14796
14769
  }();
14797
14770
  wistiaSwatchElement = /* @__PURE__ */ function() {
14798
- var _ref16 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee21(mediaId, embedHost) {
14771
+ var _ref16 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee20(mediaId, embedHost) {
14799
14772
  var swatchUrl2, swatchImg, naturalHeight, naturalWidth, ratio, style;
14800
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
14801
- while (1) switch (_context21.prev = _context21.next) {
14773
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
14774
+ while (1) switch (_context20.prev = _context20.next) {
14802
14775
  case 0:
14803
14776
  swatchUrl2 = getSwatchUrl(mediaId, embedHost);
14804
- _context21.next = 3;
14777
+ _context20.next = 3;
14805
14778
  return getSwatchMetaData2(swatchUrl2);
14806
14779
  case 3:
14807
- swatchImg = _context21.sent;
14780
+ swatchImg = _context20.sent;
14808
14781
  naturalHeight = swatchImg.naturalHeight, naturalWidth = swatchImg.naturalWidth;
14809
14782
  ratio = naturalHeight / naturalWidth * 100;
14810
14783
  style = document.createElement("style");
14811
14784
  style.innerHTML = "\n wistia-player[media-id='".concat(mediaId, "']:not(:defined) {\n padding: ").concat(ratio, "% 0 0 0;\n background: url(").concat(swatchUrl2, ");\n background-size: contain;\n filter: blur(5px);\n display: block;\n }\n ");
14812
- return _context21.abrupt("return", style);
14785
+ return _context20.abrupt("return", style);
14813
14786
  case 9:
14814
14787
  case "end":
14815
- return _context21.stop();
14788
+ return _context20.stop();
14816
14789
  }
14817
- }, _callee21);
14790
+ }, _callee20);
14818
14791
  }));
14819
- return function wistiaSwatchElement2(_x18, _x19) {
14792
+ return function wistiaSwatchElement2(_x15, _x16) {
14820
14793
  return _ref16.apply(this, arguments);
14821
14794
  };
14822
14795
  }();