@wistia/wistia-player-react 0.7.13 → 0.7.15

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.
@@ -232,6 +232,23 @@ function _deferMediaDataFetchingToCarouselEmbed() {
232
232
  }
233
233
  return !!document.querySelector(`wistia-channel-carousel[player-dom-id="${this.id}"]:not([is-inside-playlist-embed="true"][channel-id])`);
234
234
  }
235
+ function _destroyPreloadThumbnailForPopover() {
236
+ if (!_assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this)) {
237
+ return;
238
+ }
239
+ const {
240
+ shadowRoot
241
+ } = this;
242
+ const activeElement = shadowRoot?.activeElement ?? null;
243
+ const hadFocus = activeElement !== null && _classPrivateFieldGet(_preloadThumbnailRoot, this) !== null && _classPrivateFieldGet(_preloadThumbnailRoot, this).contains(activeElement);
244
+ _assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
245
+ this.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
246
+ if (hadFocus) {
247
+ shadowRoot?.querySelector('[tabindex="0"]')?.focus({
248
+ preventScroll: true
249
+ });
250
+ }
251
+ }
235
252
  function _destroyPreloadThumbnailRoot() {
236
253
  if (_classPrivateFieldGet(_preloadThumbnailRoot, this)) {
237
254
  (0, preact__WEBPACK_IMPORTED_MODULE_0__.render)(null, _classPrivateFieldGet(_preloadThumbnailRoot, this));
@@ -322,7 +339,7 @@ async function _initPublicApi(mediaId, options) {
322
339
  _classPrivateFieldGet(_resizeObserver, this)?.disconnect();
323
340
  _classPrivateFieldSet(_resizeObserver, this, null);
324
341
  _assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
325
- this.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this));
342
+ this.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
326
343
  this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.c5, {
327
344
  detail: {
328
345
  mediaId
@@ -576,16 +593,20 @@ function _setupEventListeners() {
576
593
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.rO, loadedMediaDataCallback);
577
594
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.dp, implCreatedCallback);
578
595
  this.addEventListener("popover-hide", _classPrivateFieldGet(_returnFocusToPopoverTrigger, this));
596
+ const popoverThumbnailReadyCallback = () => {
597
+ _assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailForPopover).call(this);
598
+ };
599
+ this.addEventListener("popover-thumbnail-ready", popoverThumbnailReadyCallback);
579
600
  _classPrivateFieldGet(_removeEventListeners, this).push(() => {
580
601
  this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.rO, loadedMediaDataCallback);
581
602
  }, () => {
582
603
  this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.dp, implCreatedCallback);
583
604
  }, () => {
584
605
  this.removeEventListener("popover-hide", _classPrivateFieldGet(_returnFocusToPopoverTrigger, this));
606
+ }, () => {
607
+ this.removeEventListener("popover-thumbnail-ready", popoverThumbnailReadyCallback);
585
608
  });
586
- this.addEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), {
587
- once: true
588
- });
609
+ this.addEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
589
610
  }
590
611
  function _shouldDisplaySwatch() {
591
612
  return this.swatch !== false && (!this.wistiaPopover || _assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this));
@@ -611,7 +632,7 @@ function _updateMediaData(mediaData) {
611
632
  _classPrivateFieldSet(_playerType, this, (0, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_19__.$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions));
612
633
  _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
613
634
  }
614
- var __webpack_modules__, __webpack_module_cache__, __webpack_exports__2, preact__WEBPACK_IMPORTED_MODULE_0__, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_1__, _utilities_gradients_ts__WEBPACK_IMPORTED_MODULE_2__, _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__, _components_PreloadThumbnail_tsx__WEBPACK_IMPORTED_MODULE_4__, _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_5__, _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_6__, _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_7__, _appHostname_js__WEBPACK_IMPORTED_MODULE_8__, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_9__, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_10__, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_11__, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_12__, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_13__, _utilities_elem_js__WEBPACK_IMPORTED_MODULE_14__, _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__, _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_16__, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_17__, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_18__, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_19__, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_20__, _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_21__, _utilities_seqid_js__WEBPACK_IMPORTED_MODULE_22__, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_23__, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_24__, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_25__, _utilities_url_js__WEBPACK_IMPORTED_MODULE_26__, _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_27__, _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_28__, _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_29__, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_30__, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_31__, _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_32__, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_33__, _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_34__, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_35__, _types_gradient_ts__WEBPACK_IMPORTED_MODULE_36__, _WistiaPlayer, requiredAttributes, optionalPublicAttributes, optionalPrivateAttributes, defaultEmbedOptions, getSwatchUrl, _api, _eventListeners, _fullscreenState, _impl, _internals, _jsonLdId, _judyContext, _logger, _oldEngine, _playerData, _playerType, _removeEventListeners, _cachedRemapTime, _hasElementConnectedToDOM, _paddingTop, _playPending, _preactRoot, _preloadThumbnailRoot, _publicApiScript, _resizeObserver, _WistiaPlayer_brand, _handleAfterReplace, _handleBeforeReplace, _handlePreloadThumbnailClick, _returnFocusToPopoverTrigger, WistiaPlayer, getSwatchMetaData2, wistiaSwatchElement, __webpack_exports__WistiaPlayer, __webpack_exports__wistiaSwatchElement;
635
+ var __webpack_modules__, __webpack_module_cache__, __webpack_exports__2, preact__WEBPACK_IMPORTED_MODULE_0__, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_1__, _utilities_gradients_ts__WEBPACK_IMPORTED_MODULE_2__, _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__, _components_PreloadThumbnail_tsx__WEBPACK_IMPORTED_MODULE_4__, _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_5__, _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_6__, _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_7__, _appHostname_js__WEBPACK_IMPORTED_MODULE_8__, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_9__, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_10__, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_11__, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_12__, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_13__, _utilities_elem_js__WEBPACK_IMPORTED_MODULE_14__, _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__, _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_16__, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_17__, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_18__, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_19__, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_20__, _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_21__, _utilities_seqid_js__WEBPACK_IMPORTED_MODULE_22__, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_23__, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_24__, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_25__, _utilities_url_js__WEBPACK_IMPORTED_MODULE_26__, _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_27__, _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_28__, _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_29__, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_30__, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_31__, _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_32__, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_33__, _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_34__, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_35__, _types_gradient_ts__WEBPACK_IMPORTED_MODULE_36__, _WistiaPlayer, requiredAttributes, optionalPublicAttributes, optionalPrivateAttributes, defaultEmbedOptions, getSwatchUrl, PRELOAD_CLICK_OPTIONS, _api, _eventListeners, _fullscreenState, _impl, _internals, _jsonLdId, _judyContext, _logger, _oldEngine, _playerData, _playerType, _removeEventListeners, _cachedRemapTime, _hasElementConnectedToDOM, _paddingTop, _playPending, _preactRoot, _preloadThumbnailRoot, _publicApiScript, _resizeObserver, _WistiaPlayer_brand, _handleAfterReplace, _handleBeforeReplace, _handlePreloadThumbnailClick, _returnFocusToPopoverTrigger, WistiaPlayer, getSwatchMetaData2, wistiaSwatchElement, __webpack_exports__WistiaPlayer, __webpack_exports__wistiaSwatchElement;
615
636
  var init_wistia_player = __esm({
616
637
  "../wistia-player/dist/wistia-player.js"() {
617
638
  __webpack_modules__ = {
@@ -2047,6 +2068,20 @@ var init_wistia_player = __esm({
2047
2068
  const REGEX_WIZARD_DEV_BOX = /([a-z0-9-]+)-cde-([a-z0-9-]+)\.([a-z0-9-]+)\.wiz\.wistia\.io/i;
2048
2069
  const REGEX_CDB_STAGING_DEV_BOX = /([a-z0-9-]+)-cde-([a-z0-9-]+)\.([a-z0-9-]+)\.cdb-staging\.wistia\.io/i;
2049
2070
  const REGEX_DEV_METAL_TUNNEL = /([a-z0-9-]+)-txl-([a-z0-9-]+)\.([a-z0-9-]+)\.mtl\.wistia\.io/i;
2071
+ const HOST_MODE_META_NAME = "wistia-host-mode";
2072
+ const HOST_MODE_PRODUCTION = "production";
2073
+ const isProductionHostMode = () => {
2074
+ if (typeof document === "undefined" || typeof document.querySelector !== "function") {
2075
+ return false;
2076
+ }
2077
+ try {
2078
+ const meta = document.querySelector(`meta[name="${HOST_MODE_META_NAME}"]`);
2079
+ const content = meta?.getAttribute("content");
2080
+ return typeof content === "string" && content.trim().toLowerCase() === HOST_MODE_PRODUCTION;
2081
+ } catch {
2082
+ return false;
2083
+ }
2084
+ };
2050
2085
  const appHostname = (subdomain = "app") => {
2051
2086
  const hostname = "wistia.com";
2052
2087
  const subdomainSuffixHostname = getSubdomainSuffixHostname(subdomain);
@@ -2056,6 +2091,9 @@ var init_wistia_player = __esm({
2056
2091
  return `${subdomain}.${hostname}`;
2057
2092
  };
2058
2093
  const getSubdomainSuffixHostname = (subdomain = "app") => {
2094
+ if (isProductionHostMode()) {
2095
+ return null;
2096
+ }
2059
2097
  if (typeof window !== "undefined" && window.location) {
2060
2098
  const currentHost = window.location.hostname;
2061
2099
  const cdbStagingDevBoxMatches = REGEX_CDB_STAGING_DEV_BOX.exec(currentHost);
@@ -4590,6 +4628,7 @@ var init_wistia_player = __esm({
4590
4628
  this._hasRenderedVisible = true;
4591
4629
  }
4592
4630
  const sharedProps = {
4631
+ ariaHidden: this.props.ariaHidden,
4593
4632
  backgroundColor: this.props.backgroundColor,
4594
4633
  fitStrategy: this.props.fitStrategy,
4595
4634
  isVisible: this.props.isVisible,
@@ -6087,6 +6126,9 @@ var init_wistia_player = __esm({
6087
6126
  };
6088
6127
  defineLanguage("en-US", "English");
6089
6128
  defineTranslations("en-US", {
6129
+ BACKGROUND_FOCUS_MORE_OPTIONS_HINT: "Press O for more options",
6130
+ ELLIPSIS_LESS: "Show fewer buttons",
6131
+ ELLIPSIS_MORE: "Show more buttons",
6090
6132
  PAUSE: "Pause",
6091
6133
  PLAY: "Play",
6092
6134
  PLAY_BUTTON_LIVE_NOT_STARTED: "Livestream has not started",
@@ -6189,9 +6231,19 @@ var init_wistia_player = __esm({
6189
6231
  const isPrivacyModeEnabled = apis.some((api) => {
6190
6232
  const data = api._mediaData || api._galleryData || {};
6191
6233
  return data.privacyMode === true;
6192
- });
6234
+ }) || hasRegisteredPrivacyModeSource();
6193
6235
  return !isPrivacyModeEnabled;
6194
6236
  };
6237
+ const registerPrivacyModeSource = (key, privacyMode) => {
6238
+ Wistia._privacyModeSources ??= {};
6239
+ Wistia._privacyModeSources[key] = privacyMode === true;
6240
+ };
6241
+ const unregisterPrivacyModeSource = (key) => {
6242
+ if (Wistia._privacyModeSources) {
6243
+ delete Wistia._privacyModeSources[key];
6244
+ }
6245
+ };
6246
+ const hasRegisteredPrivacyModeSource = () => Object.values(_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__2.s._privacyModeSources || {}).some(Boolean);
6195
6247
  },
6196
6248
  /***/
6197
6249
  4989(__unused_webpack_module, __webpack_exports__3, __webpack_require__3) {
@@ -7601,8 +7653,8 @@ var init_wistia_player = __esm({
7601
7653
  const PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
7602
7654
  const PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
7603
7655
  const SSL_EMBED_HOST = "embed-ssl.wistia.com";
7604
- const TAGGED_VERSION = "0.7.13";
7605
- const CURRENT_SHA = "7a72da90e6251423490a96cd1da5bb1a47651431";
7656
+ const TAGGED_VERSION = "0.7.15";
7657
+ const CURRENT_SHA = "e0025c338cd1e425139e24b3fe9129d51c193690";
7606
7658
  const DEFAULT_PROTOCOL = (() => {
7607
7659
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
7608
7660
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -12602,6 +12654,9 @@ var init_wistia_player = __esm({
12602
12654
  const fastHost = (0, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_17__.CX)(embedHost);
12603
12655
  return `https://${fastHost}/embed/medias/${mediaId}/swatch`;
12604
12656
  };
12657
+ PRELOAD_CLICK_OPTIONS = {
12658
+ once: true
12659
+ };
12605
12660
  _api = /* @__PURE__ */ new WeakMap();
12606
12661
  _eventListeners = /* @__PURE__ */ new WeakMap();
12607
12662
  _fullscreenState = /* @__PURE__ */ new WeakMap();
@@ -8,7 +8,7 @@ import {
8
8
  import { forwardRef, Suspense, lazy, Fragment } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var WistiaPlayerWrapper = lazy(
11
- async () => import("./WistiaPlayerWrapper-SEY6FKGD.mjs").then((module) => ({
11
+ async () => import("./WistiaPlayerWrapper-ZBHZK3BC.mjs").then((module) => ({
12
12
  default: module.WistiaPlayerWrapper
13
13
  }))
14
14
  );
@@ -37,7 +37,7 @@ var WistiaPlayerWrapper = forwardRef(
37
37
  setSwatchAspectRatio(ratio);
38
38
  });
39
39
  }
40
- void import("./wistia-player-YVDMFZVS.mjs");
40
+ void import("./wistia-player-K36WAKA7.mjs");
41
41
  void customElements.whenDefined("wistia-player").then(() => {
42
42
  setIsWistiaPlayerDefined(true);
43
43
  });
@@ -1432,6 +1432,20 @@ var __webpack_modules__ = {
1432
1432
  const REGEX_WIZARD_DEV_BOX = /([a-z0-9-]+)-cde-([a-z0-9-]+)\.([a-z0-9-]+)\.wiz\.wistia\.io/i;
1433
1433
  const REGEX_CDB_STAGING_DEV_BOX = /([a-z0-9-]+)-cde-([a-z0-9-]+)\.([a-z0-9-]+)\.cdb-staging\.wistia\.io/i;
1434
1434
  const REGEX_DEV_METAL_TUNNEL = /([a-z0-9-]+)-txl-([a-z0-9-]+)\.([a-z0-9-]+)\.mtl\.wistia\.io/i;
1435
+ const HOST_MODE_META_NAME = "wistia-host-mode";
1436
+ const HOST_MODE_PRODUCTION = "production";
1437
+ const isProductionHostMode = () => {
1438
+ if (typeof document === "undefined" || typeof document.querySelector !== "function") {
1439
+ return false;
1440
+ }
1441
+ try {
1442
+ const meta = document.querySelector(`meta[name="${HOST_MODE_META_NAME}"]`);
1443
+ const content = meta?.getAttribute("content");
1444
+ return typeof content === "string" && content.trim().toLowerCase() === HOST_MODE_PRODUCTION;
1445
+ } catch {
1446
+ return false;
1447
+ }
1448
+ };
1435
1449
  const appHostname = (subdomain = "app") => {
1436
1450
  const hostname = "wistia.com";
1437
1451
  const subdomainSuffixHostname = getSubdomainSuffixHostname(subdomain);
@@ -1441,6 +1455,9 @@ var __webpack_modules__ = {
1441
1455
  return `${subdomain}.${hostname}`;
1442
1456
  };
1443
1457
  const getSubdomainSuffixHostname = (subdomain = "app") => {
1458
+ if (isProductionHostMode()) {
1459
+ return null;
1460
+ }
1444
1461
  if (typeof window !== "undefined" && window.location) {
1445
1462
  const currentHost = window.location.hostname;
1446
1463
  const cdbStagingDevBoxMatches = REGEX_CDB_STAGING_DEV_BOX.exec(currentHost);
@@ -3975,6 +3992,7 @@ var __webpack_modules__ = {
3975
3992
  this._hasRenderedVisible = true;
3976
3993
  }
3977
3994
  const sharedProps = {
3995
+ ariaHidden: this.props.ariaHidden,
3978
3996
  backgroundColor: this.props.backgroundColor,
3979
3997
  fitStrategy: this.props.fitStrategy,
3980
3998
  isVisible: this.props.isVisible,
@@ -5472,6 +5490,9 @@ var __webpack_modules__ = {
5472
5490
  };
5473
5491
  defineLanguage("en-US", "English");
5474
5492
  defineTranslations("en-US", {
5493
+ BACKGROUND_FOCUS_MORE_OPTIONS_HINT: "Press O for more options",
5494
+ ELLIPSIS_LESS: "Show fewer buttons",
5495
+ ELLIPSIS_MORE: "Show more buttons",
5475
5496
  PAUSE: "Pause",
5476
5497
  PLAY: "Play",
5477
5498
  PLAY_BUTTON_LIVE_NOT_STARTED: "Livestream has not started",
@@ -5574,9 +5595,19 @@ var __webpack_modules__ = {
5574
5595
  const isPrivacyModeEnabled = apis.some((api) => {
5575
5596
  const data = api._mediaData || api._galleryData || {};
5576
5597
  return data.privacyMode === true;
5577
- });
5598
+ }) || hasRegisteredPrivacyModeSource();
5578
5599
  return !isPrivacyModeEnabled;
5579
5600
  };
5601
+ const registerPrivacyModeSource = (key, privacyMode) => {
5602
+ Wistia._privacyModeSources ??= {};
5603
+ Wistia._privacyModeSources[key] = privacyMode === true;
5604
+ };
5605
+ const unregisterPrivacyModeSource = (key) => {
5606
+ if (Wistia._privacyModeSources) {
5607
+ delete Wistia._privacyModeSources[key];
5608
+ }
5609
+ };
5610
+ const hasRegisteredPrivacyModeSource = () => Object.values(_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__2.s._privacyModeSources || {}).some(Boolean);
5580
5611
  },
5581
5612
  /***/
5582
5613
  4989(__unused_webpack_module, __webpack_exports__3, __webpack_require__3) {
@@ -6986,8 +7017,8 @@ var __webpack_modules__ = {
6986
7017
  const PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
6987
7018
  const PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
6988
7019
  const SSL_EMBED_HOST = "embed-ssl.wistia.com";
6989
- const TAGGED_VERSION = "0.7.13";
6990
- const CURRENT_SHA = "7a72da90e6251423490a96cd1da5bb1a47651431";
7020
+ const TAGGED_VERSION = "0.7.15";
7021
+ const CURRENT_SHA = "e0025c338cd1e425139e24b3fe9129d51c193690";
6991
7022
  const DEFAULT_PROTOCOL = (() => {
6992
7023
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
6993
7024
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -12045,6 +12076,9 @@ var getSwatchUrl = (mediaId, embedHost = "") => {
12045
12076
  const fastHost = (0, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_17__.CX)(embedHost);
12046
12077
  return `https://${fastHost}/embed/medias/${mediaId}/swatch`;
12047
12078
  };
12079
+ var PRELOAD_CLICK_OPTIONS = {
12080
+ once: true
12081
+ };
12048
12082
  var _api = /* @__PURE__ */ new WeakMap();
12049
12083
  var _eventListeners = /* @__PURE__ */ new WeakMap();
12050
12084
  var _fullscreenState = /* @__PURE__ */ new WeakMap();
@@ -14132,6 +14166,23 @@ function _deferMediaDataFetchingToCarouselEmbed() {
14132
14166
  }
14133
14167
  return !!document.querySelector(`wistia-channel-carousel[player-dom-id="${this.id}"]:not([is-inside-playlist-embed="true"][channel-id])`);
14134
14168
  }
14169
+ function _destroyPreloadThumbnailForPopover() {
14170
+ if (!_assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this)) {
14171
+ return;
14172
+ }
14173
+ const {
14174
+ shadowRoot
14175
+ } = this;
14176
+ const activeElement = shadowRoot?.activeElement ?? null;
14177
+ const hadFocus = activeElement !== null && _classPrivateFieldGet(_preloadThumbnailRoot, this) !== null && _classPrivateFieldGet(_preloadThumbnailRoot, this).contains(activeElement);
14178
+ _assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
14179
+ this.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
14180
+ if (hadFocus) {
14181
+ shadowRoot?.querySelector('[tabindex="0"]')?.focus({
14182
+ preventScroll: true
14183
+ });
14184
+ }
14185
+ }
14135
14186
  function _destroyPreloadThumbnailRoot() {
14136
14187
  if (_classPrivateFieldGet(_preloadThumbnailRoot, this)) {
14137
14188
  (0, preact__WEBPACK_IMPORTED_MODULE_0__.render)(null, _classPrivateFieldGet(_preloadThumbnailRoot, this));
@@ -14222,7 +14273,7 @@ async function _initPublicApi(mediaId, options) {
14222
14273
  _classPrivateFieldGet(_resizeObserver, this)?.disconnect();
14223
14274
  _classPrivateFieldSet(_resizeObserver, this, null);
14224
14275
  _assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
14225
- this.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this));
14276
+ this.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
14226
14277
  this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.c5, {
14227
14278
  detail: {
14228
14279
  mediaId
@@ -14476,16 +14527,20 @@ function _setupEventListeners() {
14476
14527
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.rO, loadedMediaDataCallback);
14477
14528
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.dp, implCreatedCallback);
14478
14529
  this.addEventListener("popover-hide", _classPrivateFieldGet(_returnFocusToPopoverTrigger, this));
14530
+ const popoverThumbnailReadyCallback = () => {
14531
+ _assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailForPopover).call(this);
14532
+ };
14533
+ this.addEventListener("popover-thumbnail-ready", popoverThumbnailReadyCallback);
14479
14534
  _classPrivateFieldGet(_removeEventListeners, this).push(() => {
14480
14535
  this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.rO, loadedMediaDataCallback);
14481
14536
  }, () => {
14482
14537
  this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_15__.dp, implCreatedCallback);
14483
14538
  }, () => {
14484
14539
  this.removeEventListener("popover-hide", _classPrivateFieldGet(_returnFocusToPopoverTrigger, this));
14540
+ }, () => {
14541
+ this.removeEventListener("popover-thumbnail-ready", popoverThumbnailReadyCallback);
14485
14542
  });
14486
- this.addEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), {
14487
- once: true
14488
- });
14543
+ this.addEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
14489
14544
  }
14490
14545
  function _shouldDisplaySwatch() {
14491
14546
  return this.swatch !== false && (!this.wistiaPopover || _assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/wistia-player-react",
3
- "version": "0.7.13",
3
+ "version": "0.7.15",
4
4
  "packageManager": "yarn@4.18.0",
5
5
  "description": "An embeddable wistia-player web component and React wrapper to add responsive, lightweight, and SEO-friendly videos to your site.",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@wistia/type-guards": "^0.9.3",
49
- "@wistia/wistia-player": "0.7.13"
49
+ "@wistia/wistia-player": "0.7.15"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=18.0.0 <20.0.0",