@mux/mux-player 3.3.3-canary.0 → 3.3.3-canary.2

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.
@@ -106,7 +106,7 @@ var mediaThemeMicrovideo = (() => {
106
106
  {}
107
107
  );
108
108
  var AdditionalStateChangeEvents = {
109
- USER_INACTIVE: "userinactivechange",
109
+ USER_INACTIVE_CHANGE: "userinactivechange",
110
110
  BREAKPOINTS_CHANGE: "breakpointchange",
111
111
  BREAKPOINTS_COMPUTED: "breakpointscomputed"
112
112
  };
@@ -369,16 +369,17 @@ var mediaThemeMicrovideo = (() => {
369
369
  };
370
370
 
371
371
  // ../../node_modules/media-chrome/dist/utils/i18n.js
372
+ var _a;
372
373
  var translationsLanguages = {
373
374
  en: En
374
375
  };
375
- var getBrowserLanguage = () => {
376
- var _a3;
377
- return ((_a3 = globalThis.navigator) == null ? void 0 : _a3.language.split("-")[0]) || "en";
376
+ var currentLanguage = ((_a = globalThis.navigator) == null ? void 0 : _a.language.split("-")[0]) || "en";
377
+ var setLanguage = (langCode) => {
378
+ currentLanguage = langCode;
378
379
  };
379
380
  var t = (key, variables = {}) => {
380
- var _a3;
381
- const result = ((_a3 = translationsLanguages[getBrowserLanguage()]) == null ? void 0 : _a3[key]) || En[key];
381
+ var _a22;
382
+ const result = ((_a22 = translationsLanguages[currentLanguage]) == null ? void 0 : _a22[key]) || En[key];
382
383
  return result.replace(
383
384
  /\{(\w+)\}/g,
384
385
  (_, varName) => variables[varName] !== void 0 ? String(variables[varName]) : `{${varName}}`
@@ -519,15 +520,15 @@ var mediaThemeMicrovideo = (() => {
519
520
  return obj;
520
521
  }
521
522
  function getMediaController(host) {
522
- var _a3;
523
- return (_a3 = getAttributeMediaController(host)) != null ? _a3 : closestComposedNode(host, "media-controller");
523
+ var _a4;
524
+ return (_a4 = getAttributeMediaController(host)) != null ? _a4 : closestComposedNode(host, "media-controller");
524
525
  }
525
526
  function getAttributeMediaController(host) {
526
- var _a3;
527
+ var _a4;
527
528
  const { MEDIA_CONTROLLER } = MediaStateReceiverAttributes;
528
529
  const mediaControllerId = host.getAttribute(MEDIA_CONTROLLER);
529
530
  if (mediaControllerId) {
530
- return (_a3 = getDocumentOrShadowRoot(host)) == null ? void 0 : _a3.getElementById(
531
+ return (_a4 = getDocumentOrShadowRoot(host)) == null ? void 0 : _a4.getElementById(
531
532
  mediaControllerId
532
533
  );
533
534
  }
@@ -568,15 +569,15 @@ var mediaThemeMicrovideo = (() => {
568
569
  );
569
570
  };
570
571
  function getActiveElement(root = document) {
571
- var _a3;
572
+ var _a4;
572
573
  const activeEl = root == null ? void 0 : root.activeElement;
573
574
  if (!activeEl)
574
575
  return null;
575
- return (_a3 = getActiveElement(activeEl.shadowRoot)) != null ? _a3 : activeEl;
576
+ return (_a4 = getActiveElement(activeEl.shadowRoot)) != null ? _a4 : activeEl;
576
577
  }
577
578
  function getDocumentOrShadowRoot(node) {
578
- var _a3;
579
- const rootNode = (_a3 = node == null ? void 0 : node.getRootNode) == null ? void 0 : _a3.call(node);
579
+ var _a4;
580
+ const rootNode = (_a4 = node == null ? void 0 : node.getRootNode) == null ? void 0 : _a4.call(node);
580
581
  if (rootNode instanceof ShadowRoot || rootNode instanceof Document) {
581
582
  return rootNode;
582
583
  }
@@ -601,16 +602,13 @@ var mediaThemeMicrovideo = (() => {
601
602
  return true;
602
603
  }
603
604
  function getPointProgressOnLine(x, y, p1, p2) {
604
- const segment = distance(p1, p2);
605
- const toStart = distance(p1, { x, y });
606
- const toEnd = distance(p2, { x, y });
607
- if (toStart > segment || toEnd > segment) {
608
- return toStart > toEnd ? 1 : 0;
609
- }
610
- return toStart / segment;
611
- }
612
- function distance(p1, p2) {
613
- return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
605
+ const dx = p2.x - p1.x;
606
+ const dy = p2.y - p1.y;
607
+ const lengthSquared = dx * dx + dy * dy;
608
+ if (lengthSquared === 0)
609
+ return 0;
610
+ const projection = ((x - p1.x) * dx + (y - p1.y) * dy) / lengthSquared;
611
+ return Math.max(0, Math.min(1, projection));
614
612
  }
615
613
  function getOrInsertCSSRule(styleParent, selectorText) {
616
614
  const cssRule = getCSSRule(styleParent, (st) => st === selectorText);
@@ -619,9 +617,9 @@ var mediaThemeMicrovideo = (() => {
619
617
  return insertCSSRule(styleParent, selectorText);
620
618
  }
621
619
  function getCSSRule(styleParent, predicate) {
622
- var _a3, _b2;
620
+ var _a4, _b2;
623
621
  let style;
624
- for (style of (_a3 = styleParent.querySelectorAll("style:not([media])")) != null ? _a3 : []) {
622
+ for (style of (_a4 = styleParent.querySelectorAll("style:not([media])")) != null ? _a4 : []) {
625
623
  let cssRules;
626
624
  try {
627
625
  cssRules = (_b2 = style.sheet) == null ? void 0 : _b2.cssRules;
@@ -635,8 +633,8 @@ var mediaThemeMicrovideo = (() => {
635
633
  }
636
634
  }
637
635
  function insertCSSRule(styleParent, selectorText) {
638
- var _a3, _b2;
639
- const styles = (_a3 = styleParent.querySelectorAll("style:not([media])")) != null ? _a3 : [];
636
+ var _a4, _b2;
637
+ const styles = (_a4 = styleParent.querySelectorAll("style:not([media])")) != null ? _a4 : [];
640
638
  const style = styles == null ? void 0 : styles[styles.length - 1];
641
639
  if (!(style == null ? void 0 : style.sheet)) {
642
640
  console.warn(
@@ -690,8 +688,8 @@ var mediaThemeMicrovideo = (() => {
690
688
  el.toggleAttribute(attrName, value);
691
689
  }
692
690
  function getStringAttr(el, attrName, defaultValue = null) {
693
- var _a3;
694
- return (_a3 = el.getAttribute(attrName)) != null ? _a3 : defaultValue;
691
+ var _a4;
692
+ return (_a4 = el.getAttribute(attrName)) != null ? _a4 : defaultValue;
695
693
  }
696
694
  function setStringAttr(el, attrName, value) {
697
695
  if (value == null) {
@@ -762,10 +760,10 @@ var mediaThemeMicrovideo = (() => {
762
760
  ];
763
761
  }
764
762
  attributeChangedCallback(attrName, oldValue, newValue) {
765
- var _a3, _b2, _c, _d, _e;
763
+ var _a4, _b2, _c, _d, _e;
766
764
  if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
767
765
  if (oldValue) {
768
- (_b2 = (_a3 = __privateGet(this, _mediaController)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
766
+ (_b2 = (_a4 = __privateGet(this, _mediaController)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
769
767
  __privateSet(this, _mediaController, null);
770
768
  }
771
769
  if (newValue && this.isConnected) {
@@ -775,28 +773,28 @@ var mediaThemeMicrovideo = (() => {
775
773
  }
776
774
  }
777
775
  connectedCallback() {
778
- var _a3, _b2, _c, _d;
776
+ var _a4, _b2, _c, _d;
779
777
  this.tabIndex = -1;
780
778
  this.setAttribute("aria-hidden", "true");
781
779
  __privateSet(this, _mediaController, getMediaControllerEl(this));
782
780
  if (this.getAttribute(MediaStateReceiverAttributes.MEDIA_CONTROLLER)) {
783
- (_b2 = (_a3 = __privateGet(this, _mediaController)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
781
+ (_b2 = (_a4 = __privateGet(this, _mediaController)) == null ? void 0 : _a4.associateElement) == null ? void 0 : _b2.call(_a4, this);
784
782
  }
785
783
  (_c = __privateGet(this, _mediaController)) == null ? void 0 : _c.addEventListener("pointerdown", this);
786
784
  (_d = __privateGet(this, _mediaController)) == null ? void 0 : _d.addEventListener("click", this);
787
785
  }
788
786
  disconnectedCallback() {
789
- var _a3, _b2, _c, _d;
787
+ var _a4, _b2, _c, _d;
790
788
  if (this.getAttribute(MediaStateReceiverAttributes.MEDIA_CONTROLLER)) {
791
- (_b2 = (_a3 = __privateGet(this, _mediaController)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
789
+ (_b2 = (_a4 = __privateGet(this, _mediaController)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
792
790
  }
793
791
  (_c = __privateGet(this, _mediaController)) == null ? void 0 : _c.removeEventListener("pointerdown", this);
794
792
  (_d = __privateGet(this, _mediaController)) == null ? void 0 : _d.removeEventListener("click", this);
795
793
  __privateSet(this, _mediaController, null);
796
794
  }
797
795
  handleEvent(event) {
798
- var _a3;
799
- const composedTarget = (_a3 = event.composedPath()) == null ? void 0 : _a3[0];
796
+ var _a4;
797
+ const composedTarget = (_a4 = event.composedPath()) == null ? void 0 : _a4[0];
800
798
  const allowList = ["video", "media-controller"];
801
799
  if (!allowList.includes(composedTarget == null ? void 0 : composedTarget.localName))
802
800
  return;
@@ -850,12 +848,12 @@ var mediaThemeMicrovideo = (() => {
850
848
  };
851
849
  _mediaController = /* @__PURE__ */ new WeakMap();
852
850
  function getMediaControllerEl(controlEl) {
853
- var _a3;
851
+ var _a4;
854
852
  const mediaControllerId = controlEl.getAttribute(
855
853
  MediaStateReceiverAttributes.MEDIA_CONTROLLER
856
854
  );
857
855
  if (mediaControllerId) {
858
- return (_a3 = controlEl.getRootNode()) == null ? void 0 : _a3.getElementById(mediaControllerId);
856
+ return (_a4 = controlEl.getRootNode()) == null ? void 0 : _a4.getElementById(mediaControllerId);
859
857
  }
860
858
  return closestComposedNode(controlEl, "media-controller");
861
859
  }
@@ -915,7 +913,8 @@ var mediaThemeMicrovideo = (() => {
915
913
  GESTURES_DISABLED: "gesturesdisabled",
916
914
  KEYBOARD_CONTROL: "keyboardcontrol",
917
915
  NO_AUTOHIDE: "noautohide",
918
- USER_INACTIVE: "userinactive"
916
+ USER_INACTIVE: "userinactive",
917
+ AUTOHIDE_OVER_CONTROLS: "autohideovercontrols"
919
918
  };
920
919
  var template2 = Document2.createElement("template");
921
920
  template2.innerHTML = /*html*/
@@ -1046,10 +1045,16 @@ var mediaThemeMicrovideo = (() => {
1046
1045
  transition: var(--media-control-transition-out, opacity 1s);
1047
1046
  }
1048
1047
 
1049
- :host([${Attributes.USER_INACTIVE}]:not([${MediaUIAttributes.MEDIA_PAUSED}]):not([${MediaUIAttributes.MEDIA_IS_CASTING}]):not([${Attributes.AUDIO}])) ::slotted([slot=media]) {
1048
+ :host([${Attributes.USER_INACTIVE}]:not([${Attributes.NO_AUTOHIDE}]):not([${MediaUIAttributes.MEDIA_PAUSED}]):not([${MediaUIAttributes.MEDIA_IS_CASTING}]):not([${Attributes.AUDIO}])) ::slotted([slot=media]) {
1050
1049
  cursor: none;
1051
1050
  }
1052
1051
 
1052
+ :host([${Attributes.USER_INACTIVE}][${Attributes.AUTOHIDE_OVER_CONTROLS}]:not([${Attributes.NO_AUTOHIDE}]):not([${MediaUIAttributes.MEDIA_PAUSED}]):not([${MediaUIAttributes.MEDIA_IS_CASTING}]):not([${Attributes.AUDIO}])) * {
1053
+ --media-cursor: none;
1054
+ cursor: none;
1055
+ }
1056
+
1057
+
1053
1058
  ::slotted(media-control-bar) {
1054
1059
  align-self: stretch;
1055
1060
  }
@@ -1092,10 +1097,10 @@ var mediaThemeMicrovideo = (() => {
1092
1097
  setBreakpoints(entry.target, entry.contentRect.width);
1093
1098
  }
1094
1099
  function setBreakpoints(container, width) {
1095
- var _a3;
1100
+ var _a4;
1096
1101
  if (!container.isConnected)
1097
1102
  return;
1098
- const breakpoints = (_a3 = container.getAttribute(Attributes.BREAKPOINTS)) != null ? _a3 : defaultBreakpoints;
1103
+ const breakpoints = (_a4 = container.getAttribute(Attributes.BREAKPOINTS)) != null ? _a4 : defaultBreakpoints;
1099
1104
  const ranges = createBreakpointMap(breakpoints);
1100
1105
  const activeBreakpoints = getBreakpoints(ranges, width);
1101
1106
  let changed = false;
@@ -1218,7 +1223,7 @@ var mediaThemeMicrovideo = (() => {
1218
1223
  this.mediaSetCallback(media);
1219
1224
  }
1220
1225
  connectedCallback() {
1221
- var _a3;
1226
+ var _a4;
1222
1227
  __privateGet2(this, _mutationObserver).observe(this, { childList: true, subtree: true });
1223
1228
  observeResize(this, __privateGet2(this, _handleResize));
1224
1229
  const isAudioChrome = this.getAttribute(Attributes.AUDIO) != null;
@@ -1233,16 +1238,16 @@ var mediaThemeMicrovideo = (() => {
1233
1238
  this.addEventListener("pointerup", this);
1234
1239
  this.addEventListener("mouseleave", this);
1235
1240
  this.addEventListener("keyup", this);
1236
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("mouseup", this);
1241
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.addEventListener("mouseup", this);
1237
1242
  }
1238
1243
  disconnectedCallback() {
1239
- var _a3;
1244
+ var _a4;
1240
1245
  __privateGet2(this, _mutationObserver).disconnect();
1241
1246
  unobserveResize(this, __privateGet2(this, _handleResize));
1242
1247
  if (this.media) {
1243
1248
  this.mediaUnsetCallback(this.media);
1244
1249
  }
1245
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("mouseup", this);
1250
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.removeEventListener("mouseup", this);
1246
1251
  }
1247
1252
  /**
1248
1253
  * @abstract
@@ -1312,6 +1317,12 @@ var mediaThemeMicrovideo = (() => {
1312
1317
  set noAutohide(value) {
1313
1318
  setBooleanAttr(this, Attributes.NO_AUTOHIDE, value);
1314
1319
  }
1320
+ get autohideOverControls() {
1321
+ return getBooleanAttr(this, Attributes.AUTOHIDE_OVER_CONTROLS);
1322
+ }
1323
+ set autohideOverControls(value) {
1324
+ setBooleanAttr(this, Attributes.AUTOHIDE_OVER_CONTROLS, value);
1325
+ }
1315
1326
  get userInteractive() {
1316
1327
  return getBooleanAttr(this, Attributes.USER_INACTIVE);
1317
1328
  }
@@ -1366,7 +1377,10 @@ var mediaThemeMicrovideo = (() => {
1366
1377
  }
1367
1378
  __privateMethod(this, _setActive, setActive_fn).call(this);
1368
1379
  clearTimeout(__privateGet2(this, _inactiveTimeout));
1369
- if ([this, this.media].includes(event.target)) {
1380
+ const autohideOverControls = this.hasAttribute(
1381
+ Attributes.AUTOHIDE_OVER_CONTROLS
1382
+ );
1383
+ if ([this, this.media].includes(event.target) || autohideOverControls) {
1370
1384
  __privateMethod(this, _scheduleInactive, scheduleInactive_fn).call(this);
1371
1385
  }
1372
1386
  };
@@ -1395,7 +1409,7 @@ var mediaThemeMicrovideo = (() => {
1395
1409
  return;
1396
1410
  this.setAttribute(Attributes.USER_INACTIVE, "");
1397
1411
  const evt = new GlobalThis.CustomEvent(
1398
- MediaStateChangeEvents.USER_INACTIVE,
1412
+ MediaStateChangeEvents.USER_INACTIVE_CHANGE,
1399
1413
  { composed: true, bubbles: true, detail: true }
1400
1414
  );
1401
1415
  this.dispatchEvent(evt);
@@ -1406,7 +1420,7 @@ var mediaThemeMicrovideo = (() => {
1406
1420
  return;
1407
1421
  this.removeAttribute(Attributes.USER_INACTIVE);
1408
1422
  const evt = new GlobalThis.CustomEvent(
1409
- MediaStateChangeEvents.USER_INACTIVE,
1423
+ MediaStateChangeEvents.USER_INACTIVE_CHANGE,
1410
1424
  { composed: true, bubbles: true, detail: false }
1411
1425
  );
1412
1426
  this.dispatchEvent(evt);
@@ -1469,15 +1483,15 @@ var mediaThemeMicrovideo = (() => {
1469
1483
  return __privateGet3(this, _tokens, tokens_get).size;
1470
1484
  }
1471
1485
  get value() {
1472
- var _a3;
1473
- return (_a3 = [...__privateGet3(this, _tokens, tokens_get)].join(" ")) != null ? _a3 : "";
1486
+ var _a4;
1487
+ return (_a4 = [...__privateGet3(this, _tokens, tokens_get)].join(" ")) != null ? _a4 : "";
1474
1488
  }
1475
1489
  set value(val) {
1476
- var _a3;
1490
+ var _a4;
1477
1491
  if (val === this.value)
1478
1492
  return;
1479
1493
  __privateSet3(this, _tokenSet, /* @__PURE__ */ new Set());
1480
- this.add(...(_a3 = val == null ? void 0 : val.split(" ")) != null ? _a3 : []);
1494
+ this.add(...(_a4 = val == null ? void 0 : val.split(" ")) != null ? _a4 : []);
1481
1495
  }
1482
1496
  toString() {
1483
1497
  return this.value;
@@ -1492,17 +1506,17 @@ var mediaThemeMicrovideo = (() => {
1492
1506
  __privateGet3(this, _tokens, tokens_get).forEach(callback, thisArg);
1493
1507
  }
1494
1508
  add(...tokens) {
1495
- var _a3, _b2;
1509
+ var _a4, _b2;
1496
1510
  tokens.forEach((t2) => __privateGet3(this, _tokenSet).add(t2));
1497
- if (this.value === "" && !((_a3 = __privateGet3(this, _el)) == null ? void 0 : _a3.hasAttribute(`${__privateGet3(this, _attr)}`))) {
1511
+ if (this.value === "" && !((_a4 = __privateGet3(this, _el)) == null ? void 0 : _a4.hasAttribute(`${__privateGet3(this, _attr)}`))) {
1498
1512
  return;
1499
1513
  }
1500
1514
  (_b2 = __privateGet3(this, _el)) == null ? void 0 : _b2.setAttribute(`${__privateGet3(this, _attr)}`, `${this.value}`);
1501
1515
  }
1502
1516
  remove(...tokens) {
1503
- var _a3;
1517
+ var _a4;
1504
1518
  tokens.forEach((t2) => __privateGet3(this, _tokenSet).delete(t2));
1505
- (_a3 = __privateGet3(this, _el)) == null ? void 0 : _a3.setAttribute(`${__privateGet3(this, _attr)}`, `${this.value}`);
1519
+ (_a4 = __privateGet3(this, _el)) == null ? void 0 : _a4.setAttribute(`${__privateGet3(this, _attr)}`, `${this.value}`);
1506
1520
  }
1507
1521
  contains(token) {
1508
1522
  return __privateGet3(this, _tokens, tokens_get).has(token);
@@ -1608,18 +1622,18 @@ var mediaThemeMicrovideo = (() => {
1608
1622
  return Array.from(media.textTracks).filter(filterPred);
1609
1623
  };
1610
1624
  var areSubsOn = (el) => {
1611
- var _a3;
1612
- const showingSubtitles = !!((_a3 = el.mediaSubtitlesShowing) == null ? void 0 : _a3.length) || el.hasAttribute(MediaUIAttributes.MEDIA_SUBTITLES_SHOWING);
1625
+ var _a4;
1626
+ const showingSubtitles = !!((_a4 = el.mediaSubtitlesShowing) == null ? void 0 : _a4.length) || el.hasAttribute(MediaUIAttributes.MEDIA_SUBTITLES_SHOWING);
1613
1627
  return showingSubtitles;
1614
1628
  };
1615
1629
 
1616
1630
  // ../../node_modules/media-chrome/dist/utils/fullscreen-api.js
1617
1631
  var enterFullscreen = (stateOwners) => {
1618
- var _a3;
1632
+ var _a4;
1619
1633
  const { media, fullscreenElement } = stateOwners;
1620
1634
  const enterFullscreenKey = fullscreenElement && "requestFullscreen" in fullscreenElement ? "requestFullscreen" : fullscreenElement && "webkitRequestFullScreen" in fullscreenElement ? "webkitRequestFullScreen" : void 0;
1621
1635
  if (enterFullscreenKey) {
1622
- const maybePromise = (_a3 = fullscreenElement[enterFullscreenKey]) == null ? void 0 : _a3.call(fullscreenElement);
1636
+ const maybePromise = (_a4 = fullscreenElement[enterFullscreenKey]) == null ? void 0 : _a4.call(fullscreenElement);
1623
1637
  if (maybePromise instanceof Promise) {
1624
1638
  return maybePromise.catch(() => {
1625
1639
  });
@@ -1632,10 +1646,10 @@ var mediaThemeMicrovideo = (() => {
1632
1646
  };
1633
1647
  var exitFullscreenKey = "exitFullscreen" in Document2 ? "exitFullscreen" : "webkitExitFullscreen" in Document2 ? "webkitExitFullscreen" : "webkitCancelFullScreen" in Document2 ? "webkitCancelFullScreen" : void 0;
1634
1648
  var exitFullscreen = (stateOwners) => {
1635
- var _a3;
1649
+ var _a4;
1636
1650
  const { documentElement } = stateOwners;
1637
1651
  if (exitFullscreenKey) {
1638
- const maybePromise = (_a3 = documentElement == null ? void 0 : documentElement[exitFullscreenKey]) == null ? void 0 : _a3.call(documentElement);
1652
+ const maybePromise = (_a4 = documentElement == null ? void 0 : documentElement[exitFullscreenKey]) == null ? void 0 : _a4.call(documentElement);
1639
1653
  if (maybePromise instanceof Promise) {
1640
1654
  return maybePromise.catch(() => {
1641
1655
  });
@@ -1652,7 +1666,7 @@ var mediaThemeMicrovideo = (() => {
1652
1666
  return docFullscreenElement;
1653
1667
  };
1654
1668
  var isFullscreen = (stateOwners) => {
1655
- var _a3;
1669
+ var _a4;
1656
1670
  const { media, documentElement, fullscreenElement = media } = stateOwners;
1657
1671
  if (!media || !documentElement)
1658
1672
  return false;
@@ -1675,7 +1689,7 @@ var mediaThemeMicrovideo = (() => {
1675
1689
  while (currentRoot == null ? void 0 : currentRoot[fullscreenElementKey]) {
1676
1690
  if (currentRoot[fullscreenElementKey] === fullscreenElement)
1677
1691
  return true;
1678
- currentRoot = (_a3 = currentRoot[fullscreenElementKey]) == null ? void 0 : _a3.shadowRoot;
1692
+ currentRoot = (_a4 = currentRoot[fullscreenElementKey]) == null ? void 0 : _a4.shadowRoot;
1679
1693
  }
1680
1694
  }
1681
1695
  return false;
@@ -1689,10 +1703,10 @@ var mediaThemeMicrovideo = (() => {
1689
1703
  // ../../node_modules/media-chrome/dist/utils/platform-tests.js
1690
1704
  var testMediaEl;
1691
1705
  var getTestMediaEl = () => {
1692
- var _a3, _b2;
1706
+ var _a4, _b2;
1693
1707
  if (testMediaEl)
1694
1708
  return testMediaEl;
1695
- testMediaEl = (_b2 = (_a3 = Document2) == null ? void 0 : _a3.createElement) == null ? void 0 : _b2.call(_a3, "video");
1709
+ testMediaEl = (_b2 = (_a4 = Document2) == null ? void 0 : _a4.createElement) == null ? void 0 : _b2.call(_a4, "video");
1696
1710
  return testMediaEl;
1697
1711
  };
1698
1712
  var hasVolumeSupportAsync = async (mediaEl = getTestMediaEl()) => {
@@ -1858,55 +1872,55 @@ var mediaThemeMicrovideo = (() => {
1858
1872
  },
1859
1873
  mediaErrorCode: {
1860
1874
  get(stateOwners, event) {
1861
- var _a3;
1875
+ var _a4;
1862
1876
  const { media } = stateOwners;
1863
1877
  if ((event == null ? void 0 : event.type) === "playing")
1864
1878
  return;
1865
- return (_a3 = media == null ? void 0 : media.error) == null ? void 0 : _a3.code;
1879
+ return (_a4 = media == null ? void 0 : media.error) == null ? void 0 : _a4.code;
1866
1880
  },
1867
1881
  mediaEvents: ["emptied", "error", "playing"]
1868
1882
  },
1869
1883
  mediaErrorMessage: {
1870
1884
  get(stateOwners, event) {
1871
- var _a3, _b2;
1885
+ var _a4, _b2;
1872
1886
  const { media } = stateOwners;
1873
1887
  if ((event == null ? void 0 : event.type) === "playing")
1874
1888
  return;
1875
- return (_b2 = (_a3 = media == null ? void 0 : media.error) == null ? void 0 : _a3.message) != null ? _b2 : "";
1889
+ return (_b2 = (_a4 = media == null ? void 0 : media.error) == null ? void 0 : _a4.message) != null ? _b2 : "";
1876
1890
  },
1877
1891
  mediaEvents: ["emptied", "error", "playing"]
1878
1892
  },
1879
1893
  mediaWidth: {
1880
1894
  get(stateOwners) {
1881
- var _a3;
1895
+ var _a4;
1882
1896
  const { media } = stateOwners;
1883
- return (_a3 = media == null ? void 0 : media.videoWidth) != null ? _a3 : 0;
1897
+ return (_a4 = media == null ? void 0 : media.videoWidth) != null ? _a4 : 0;
1884
1898
  },
1885
1899
  mediaEvents: ["resize"]
1886
1900
  },
1887
1901
  mediaHeight: {
1888
1902
  get(stateOwners) {
1889
- var _a3;
1903
+ var _a4;
1890
1904
  const { media } = stateOwners;
1891
- return (_a3 = media == null ? void 0 : media.videoHeight) != null ? _a3 : 0;
1905
+ return (_a4 = media == null ? void 0 : media.videoHeight) != null ? _a4 : 0;
1892
1906
  },
1893
1907
  mediaEvents: ["resize"]
1894
1908
  },
1895
1909
  mediaPaused: {
1896
1910
  get(stateOwners) {
1897
- var _a3;
1911
+ var _a4;
1898
1912
  const { media } = stateOwners;
1899
- return (_a3 = media == null ? void 0 : media.paused) != null ? _a3 : true;
1913
+ return (_a4 = media == null ? void 0 : media.paused) != null ? _a4 : true;
1900
1914
  },
1901
1915
  set(value, stateOwners) {
1902
- var _a3;
1916
+ var _a4;
1903
1917
  const { media } = stateOwners;
1904
1918
  if (!media)
1905
1919
  return;
1906
1920
  if (value) {
1907
1921
  media.pause();
1908
1922
  } else {
1909
- (_a3 = media.play()) == null ? void 0 : _a3.catch(() => {
1923
+ (_a4 = media.play()) == null ? void 0 : _a4.catch(() => {
1910
1924
  });
1911
1925
  }
1912
1926
  },
@@ -1928,17 +1942,17 @@ var mediaThemeMicrovideo = (() => {
1928
1942
  },
1929
1943
  mediaEnded: {
1930
1944
  get(stateOwners) {
1931
- var _a3;
1945
+ var _a4;
1932
1946
  const { media } = stateOwners;
1933
- return (_a3 = media == null ? void 0 : media.ended) != null ? _a3 : false;
1947
+ return (_a4 = media == null ? void 0 : media.ended) != null ? _a4 : false;
1934
1948
  },
1935
1949
  mediaEvents: ["seeked", "ended", "emptied"]
1936
1950
  },
1937
1951
  mediaPlaybackRate: {
1938
1952
  get(stateOwners) {
1939
- var _a3;
1953
+ var _a4;
1940
1954
  const { media } = stateOwners;
1941
- return (_a3 = media == null ? void 0 : media.playbackRate) != null ? _a3 : 1;
1955
+ return (_a4 = media == null ? void 0 : media.playbackRate) != null ? _a4 : 1;
1942
1956
  },
1943
1957
  set(value, stateOwners) {
1944
1958
  const { media } = stateOwners;
@@ -1952,9 +1966,9 @@ var mediaThemeMicrovideo = (() => {
1952
1966
  },
1953
1967
  mediaMuted: {
1954
1968
  get(stateOwners) {
1955
- var _a3;
1969
+ var _a4;
1956
1970
  const { media } = stateOwners;
1957
- return (_a3 = media == null ? void 0 : media.muted) != null ? _a3 : false;
1971
+ return (_a4 = media == null ? void 0 : media.muted) != null ? _a4 : false;
1958
1972
  },
1959
1973
  set(value, stateOwners) {
1960
1974
  const { media } = stateOwners;
@@ -1991,9 +2005,9 @@ var mediaThemeMicrovideo = (() => {
1991
2005
  },
1992
2006
  mediaVolume: {
1993
2007
  get(stateOwners) {
1994
- var _a3;
2008
+ var _a4;
1995
2009
  const { media } = stateOwners;
1996
- return (_a3 = media == null ? void 0 : media.volume) != null ? _a3 : 1;
2010
+ return (_a4 = media == null ? void 0 : media.volume) != null ? _a4 : 1;
1997
2011
  },
1998
2012
  set(value, stateOwners) {
1999
2013
  const { media } = stateOwners;
@@ -2060,9 +2074,9 @@ var mediaThemeMicrovideo = (() => {
2060
2074
  },
2061
2075
  mediaCurrentTime: {
2062
2076
  get(stateOwners) {
2063
- var _a3;
2077
+ var _a4;
2064
2078
  const { media } = stateOwners;
2065
- return (_a3 = media == null ? void 0 : media.currentTime) != null ? _a3 : 0;
2079
+ return (_a4 = media == null ? void 0 : media.currentTime) != null ? _a4 : 0;
2066
2080
  },
2067
2081
  set(value, stateOwners) {
2068
2082
  const { media } = stateOwners;
@@ -2091,9 +2105,9 @@ var mediaThemeMicrovideo = (() => {
2091
2105
  },
2092
2106
  mediaSeekable: {
2093
2107
  get(stateOwners) {
2094
- var _a3;
2108
+ var _a4;
2095
2109
  const { media } = stateOwners;
2096
- if (!((_a3 = media == null ? void 0 : media.seekable) == null ? void 0 : _a3.length))
2110
+ if (!((_a4 = media == null ? void 0 : media.seekable) == null ? void 0 : _a4.length))
2097
2111
  return void 0;
2098
2112
  const start = media.seekable.start(0);
2099
2113
  const end = media.seekable.end(media.seekable.length - 1);
@@ -2105,9 +2119,9 @@ var mediaThemeMicrovideo = (() => {
2105
2119
  },
2106
2120
  mediaBuffered: {
2107
2121
  get(stateOwners) {
2108
- var _a3;
2122
+ var _a4;
2109
2123
  const { media } = stateOwners;
2110
- const timeRanges = (_a3 = media == null ? void 0 : media.buffered) != null ? _a3 : [];
2124
+ const timeRanges = (_a4 = media == null ? void 0 : media.buffered) != null ? _a4 : [];
2111
2125
  return Array.from(timeRanges).map((_, i) => [
2112
2126
  Number(timeRanges.start(i).toFixed(3)),
2113
2127
  Number(timeRanges.end(i).toFixed(3))
@@ -2213,7 +2227,7 @@ var mediaThemeMicrovideo = (() => {
2213
2227
  textTracksEvents: ["addtrack", "removetrack", "change"],
2214
2228
  stateOwnersUpdateHandlers: [
2215
2229
  (_handler, stateOwners) => {
2216
- var _a3, _b2;
2230
+ var _a4, _b2;
2217
2231
  const { media, options } = stateOwners;
2218
2232
  if (!media)
2219
2233
  return;
@@ -2229,7 +2243,11 @@ var mediaThemeMicrovideo = (() => {
2229
2243
  return;
2230
2244
  toggleSubtitleTracks(stateOwners, true);
2231
2245
  };
2232
- (_a3 = media.textTracks) == null ? void 0 : _a3.addEventListener(
2246
+ media.addEventListener(
2247
+ "loadstart",
2248
+ updateDefaultSubtitlesCallback
2249
+ );
2250
+ (_a4 = media.textTracks) == null ? void 0 : _a4.addEventListener(
2233
2251
  "addtrack",
2234
2252
  updateDefaultSubtitlesCallback
2235
2253
  );
@@ -2237,9 +2255,12 @@ var mediaThemeMicrovideo = (() => {
2237
2255
  "removetrack",
2238
2256
  updateDefaultSubtitlesCallback
2239
2257
  );
2240
- updateDefaultSubtitlesCallback();
2241
2258
  return () => {
2242
2259
  var _a22, _b22;
2260
+ media.removeEventListener(
2261
+ "loadstart",
2262
+ updateDefaultSubtitlesCallback
2263
+ );
2243
2264
  (_a22 = media.textTracks) == null ? void 0 : _a22.removeEventListener(
2244
2265
  "addtrack",
2245
2266
  updateDefaultSubtitlesCallback
@@ -2254,14 +2275,14 @@ var mediaThemeMicrovideo = (() => {
2254
2275
  },
2255
2276
  mediaChaptersCues: {
2256
2277
  get(stateOwners) {
2257
- var _a3;
2278
+ var _a4;
2258
2279
  const { media } = stateOwners;
2259
2280
  if (!media)
2260
2281
  return [];
2261
2282
  const [chaptersTrack] = getTextTracksList(media, {
2262
2283
  kind: TextTrackKinds.CHAPTERS
2263
2284
  });
2264
- return Array.from((_a3 = chaptersTrack == null ? void 0 : chaptersTrack.cues) != null ? _a3 : []).map(
2285
+ return Array.from((_a4 = chaptersTrack == null ? void 0 : chaptersTrack.cues) != null ? _a4 : []).map(
2265
2286
  ({ text, startTime, endTime }) => ({
2266
2287
  text,
2267
2288
  startTime,
@@ -2273,14 +2294,14 @@ var mediaThemeMicrovideo = (() => {
2273
2294
  textTracksEvents: ["addtrack", "removetrack", "change"],
2274
2295
  stateOwnersUpdateHandlers: [
2275
2296
  (handler, stateOwners) => {
2276
- var _a3;
2297
+ var _a4;
2277
2298
  const { media } = stateOwners;
2278
2299
  if (!media)
2279
2300
  return;
2280
2301
  const chaptersTrack = media.querySelector(
2281
2302
  'track[kind="chapters"][default][src]'
2282
2303
  );
2283
- const shadowChaptersTrack = (_a3 = media.shadowRoot) == null ? void 0 : _a3.querySelector(
2304
+ const shadowChaptersTrack = (_a4 = media.shadowRoot) == null ? void 0 : _a4.querySelector(
2284
2305
  ':is(video,audio) > track[kind="chapters"][default][src]'
2285
2306
  );
2286
2307
  chaptersTrack == null ? void 0 : chaptersTrack.addEventListener("load", handler);
@@ -2295,7 +2316,7 @@ var mediaThemeMicrovideo = (() => {
2295
2316
  // Modeling state tied to root node
2296
2317
  mediaIsPip: {
2297
2318
  get(stateOwners) {
2298
- var _a3, _b2;
2319
+ var _a4, _b2;
2299
2320
  const { media, documentElement } = stateOwners;
2300
2321
  if (!media || !documentElement)
2301
2322
  return false;
@@ -2304,7 +2325,7 @@ var mediaThemeMicrovideo = (() => {
2304
2325
  if (documentElement.pictureInPictureElement === media)
2305
2326
  return true;
2306
2327
  if (documentElement.pictureInPictureElement instanceof HTMLMediaElement) {
2307
- if (!((_a3 = media.localName) == null ? void 0 : _a3.includes("-")))
2328
+ if (!((_a4 = media.localName) == null ? void 0 : _a4.includes("-")))
2308
2329
  return false;
2309
2330
  return containsComposedNode(
2310
2331
  media,
@@ -2380,9 +2401,9 @@ var mediaThemeMicrovideo = (() => {
2380
2401
  },
2381
2402
  mediaRenditionList: {
2382
2403
  get(stateOwners) {
2383
- var _a3;
2404
+ var _a4;
2384
2405
  const { media } = stateOwners;
2385
- return [...(_a3 = media == null ? void 0 : media.videoRenditions) != null ? _a3 : []].map((videoRendition) => ({
2406
+ return [...(_a4 = media == null ? void 0 : media.videoRenditions) != null ? _a4 : []].map((videoRendition) => ({
2386
2407
  ...videoRendition
2387
2408
  }));
2388
2409
  },
@@ -2392,9 +2413,9 @@ var mediaThemeMicrovideo = (() => {
2392
2413
  /** @TODO Model this as a derived value? (CJP) */
2393
2414
  mediaRenditionSelected: {
2394
2415
  get(stateOwners) {
2395
- var _a3, _b2, _c;
2416
+ var _a4, _b2, _c;
2396
2417
  const { media } = stateOwners;
2397
- return (_c = (_b2 = media == null ? void 0 : media.videoRenditions) == null ? void 0 : _b2[(_a3 = media.videoRenditions) == null ? void 0 : _a3.selectedIndex]) == null ? void 0 : _c.id;
2418
+ return (_c = (_b2 = media == null ? void 0 : media.videoRenditions) == null ? void 0 : _b2[(_a4 = media.videoRenditions) == null ? void 0 : _a4.selectedIndex]) == null ? void 0 : _c.id;
2398
2419
  },
2399
2420
  set(value, stateOwners) {
2400
2421
  const { media } = stateOwners;
@@ -2418,18 +2439,18 @@ var mediaThemeMicrovideo = (() => {
2418
2439
  },
2419
2440
  mediaAudioTrackList: {
2420
2441
  get(stateOwners) {
2421
- var _a3;
2442
+ var _a4;
2422
2443
  const { media } = stateOwners;
2423
- return [...(_a3 = media == null ? void 0 : media.audioTracks) != null ? _a3 : []];
2444
+ return [...(_a4 = media == null ? void 0 : media.audioTracks) != null ? _a4 : []];
2424
2445
  },
2425
2446
  mediaEvents: ["emptied", "loadstart"],
2426
2447
  audioTracksEvents: ["addtrack", "removetrack"]
2427
2448
  },
2428
2449
  mediaAudioTrackEnabled: {
2429
2450
  get(stateOwners) {
2430
- var _a3, _b2;
2451
+ var _a4, _b2;
2431
2452
  const { media } = stateOwners;
2432
- return (_b2 = [...(_a3 = media == null ? void 0 : media.audioTracks) != null ? _a3 : []].find(
2453
+ return (_b2 = [...(_a4 = media == null ? void 0 : media.audioTracks) != null ? _a4 : []].find(
2433
2454
  (audioTrack) => audioTrack.enabled
2434
2455
  )) == null ? void 0 : _b2.id;
2435
2456
  },
@@ -2463,23 +2484,27 @@ var mediaThemeMicrovideo = (() => {
2463
2484
  // older Safari version may require webkit-specific events
2464
2485
  rootEvents: ["fullscreenchange", "webkitfullscreenchange"],
2465
2486
  // iOS requires webkit-specific events on the video.
2466
- mediaEvents: ["webkitbeginfullscreen", "webkitendfullscreen", "webkitpresentationmodechanged"]
2487
+ mediaEvents: [
2488
+ "webkitbeginfullscreen",
2489
+ "webkitendfullscreen",
2490
+ "webkitpresentationmodechanged"
2491
+ ]
2467
2492
  },
2468
2493
  mediaIsCasting: {
2469
2494
  // Note this relies on a customized castable-video element.
2470
2495
  get(stateOwners) {
2471
- var _a3;
2496
+ var _a4;
2472
2497
  const { media } = stateOwners;
2473
- if (!(media == null ? void 0 : media.remote) || ((_a3 = media.remote) == null ? void 0 : _a3.state) === "disconnected")
2498
+ if (!(media == null ? void 0 : media.remote) || ((_a4 = media.remote) == null ? void 0 : _a4.state) === "disconnected")
2474
2499
  return false;
2475
2500
  return !!media.remote.state;
2476
2501
  },
2477
2502
  set(value, stateOwners) {
2478
- var _a3, _b2;
2503
+ var _a4, _b2;
2479
2504
  const { media } = stateOwners;
2480
2505
  if (!media)
2481
2506
  return;
2482
- if (value && ((_a3 = media.remote) == null ? void 0 : _a3.state) !== "disconnected")
2507
+ if (value && ((_a4 = media.remote) == null ? void 0 : _a4.state) !== "disconnected")
2483
2508
  return;
2484
2509
  if (!value && ((_b2 = media.remote) == null ? void 0 : _b2.state) !== "connected")
2485
2510
  return;
@@ -2553,9 +2578,9 @@ var mediaThemeMicrovideo = (() => {
2553
2578
  mediaCastUnavailable: {
2554
2579
  // @ts-ignore
2555
2580
  get(stateOwners, { availability = "not-available" } = {}) {
2556
- var _a3;
2581
+ var _a4;
2557
2582
  const { media } = stateOwners;
2558
- if (!castSupported || !((_a3 = media == null ? void 0 : media.remote) == null ? void 0 : _a3.state)) {
2583
+ if (!castSupported || !((_a4 = media == null ? void 0 : media.remote) == null ? void 0 : _a4.state)) {
2559
2584
  return AvailabilityStates.UNSUPPORTED;
2560
2585
  }
2561
2586
  if (availability == null || availability === "available")
@@ -2564,13 +2589,13 @@ var mediaThemeMicrovideo = (() => {
2564
2589
  },
2565
2590
  stateOwnersUpdateHandlers: [
2566
2591
  (handler, stateOwners) => {
2567
- var _a3;
2592
+ var _a4;
2568
2593
  const { media } = stateOwners;
2569
2594
  if (!media)
2570
2595
  return;
2571
2596
  const remotePlaybackDisabled = media.disableRemotePlayback || media.hasAttribute("disableremoteplayback");
2572
2597
  if (!remotePlaybackDisabled) {
2573
- (_a3 = media == null ? void 0 : media.remote) == null ? void 0 : _a3.watchAvailability((availabilityBool) => {
2598
+ (_a4 = media == null ? void 0 : media.remote) == null ? void 0 : _a4.watchAvailability((availabilityBool) => {
2574
2599
  const availability = availabilityBool ? "available" : "not-available";
2575
2600
  handler({ availability });
2576
2601
  }).catch((error) => {
@@ -2604,13 +2629,13 @@ var mediaThemeMicrovideo = (() => {
2604
2629
  mediaEvents: ["webkitplaybacktargetavailabilitychanged"],
2605
2630
  stateOwnersUpdateHandlers: [
2606
2631
  (handler, stateOwners) => {
2607
- var _a3;
2632
+ var _a4;
2608
2633
  const { media } = stateOwners;
2609
2634
  if (!media)
2610
2635
  return;
2611
2636
  const remotePlaybackDisabled = media.disableRemotePlayback || media.hasAttribute("disableremoteplayback");
2612
2637
  if (!remotePlaybackDisabled) {
2613
- (_a3 = media == null ? void 0 : media.remote) == null ? void 0 : _a3.watchAvailability((availabilityBool) => {
2638
+ (_a4 = media == null ? void 0 : media.remote) == null ? void 0 : _a4.watchAvailability((availabilityBool) => {
2614
2639
  const availability = availabilityBool ? "available" : "not-available";
2615
2640
  handler({ availability });
2616
2641
  }).catch((error) => {
@@ -2631,12 +2656,12 @@ var mediaThemeMicrovideo = (() => {
2631
2656
  },
2632
2657
  mediaRenditionUnavailable: {
2633
2658
  get(stateOwners) {
2634
- var _a3;
2659
+ var _a4;
2635
2660
  const { media } = stateOwners;
2636
2661
  if (!(media == null ? void 0 : media.videoRenditions)) {
2637
2662
  return AvailabilityStates.UNSUPPORTED;
2638
2663
  }
2639
- if (!((_a3 = media.videoRenditions) == null ? void 0 : _a3.length)) {
2664
+ if (!((_a4 = media.videoRenditions) == null ? void 0 : _a4.length)) {
2640
2665
  return AvailabilityStates.UNAVAILABLE;
2641
2666
  }
2642
2667
  return void 0;
@@ -2646,12 +2671,12 @@ var mediaThemeMicrovideo = (() => {
2646
2671
  },
2647
2672
  mediaAudioTrackUnavailable: {
2648
2673
  get(stateOwners) {
2649
- var _a3, _b2;
2674
+ var _a4, _b2;
2650
2675
  const { media } = stateOwners;
2651
2676
  if (!(media == null ? void 0 : media.audioTracks)) {
2652
2677
  return AvailabilityStates.UNSUPPORTED;
2653
2678
  }
2654
- if (((_b2 = (_a3 = media.audioTracks) == null ? void 0 : _a3.length) != null ? _b2 : 0) <= 1) {
2679
+ if (((_b2 = (_a4 = media.audioTracks) == null ? void 0 : _a4.length) != null ? _b2 : 0) <= 1) {
2655
2680
  return AvailabilityStates.UNAVAILABLE;
2656
2681
  }
2657
2682
  return void 0;
@@ -2667,7 +2692,7 @@ var mediaThemeMicrovideo = (() => {
2667
2692
  * @TODO Consider adding state to `StateMediator` for e.g. `mediaThumbnailCues` and use that for derived state here (CJP)
2668
2693
  */
2669
2694
  [MediaUIEvents.MEDIA_PREVIEW_REQUEST](stateMediator2, stateOwners, { detail }) {
2670
- var _a3, _b2, _c;
2695
+ var _a4, _b2, _c;
2671
2696
  const { media } = stateOwners;
2672
2697
  const mediaPreviewTime = detail != null ? detail : void 0;
2673
2698
  let mediaPreviewImage = void 0;
@@ -2677,7 +2702,7 @@ var mediaThemeMicrovideo = (() => {
2677
2702
  kind: TextTrackKinds.METADATA,
2678
2703
  label: "thumbnails"
2679
2704
  });
2680
- const cue = Array.prototype.find.call((_a3 = track == null ? void 0 : track.cues) != null ? _a3 : [], (c, i, cs) => {
2705
+ const cue = Array.prototype.find.call((_a4 = track == null ? void 0 : track.cues) != null ? _a4 : [], (c, i, cs) => {
2681
2706
  if (i === 0)
2682
2707
  return c.endTime > mediaPreviewTime;
2683
2708
  if (i === cs.length - 1)
@@ -2718,14 +2743,17 @@ var mediaThemeMicrovideo = (() => {
2718
2743
  stateMediator2[key].set(value, stateOwners);
2719
2744
  },
2720
2745
  [MediaUIEvents.MEDIA_PLAY_REQUEST](stateMediator2, stateOwners) {
2721
- var _a3;
2746
+ var _a4, _b2, _c, _d;
2722
2747
  const key = "mediaPaused";
2723
2748
  const value = false;
2724
- const live = stateMediator2.mediaStreamType.get(stateOwners) === StreamTypes.LIVE;
2725
- if (live) {
2726
- const notDvr = !(stateMediator2.mediaTargetLiveWindow.get(stateOwners) > 0);
2727
- const liveEdgeTime = (_a3 = stateMediator2.mediaSeekable.get(stateOwners)) == null ? void 0 : _a3[1];
2728
- if (notDvr && liveEdgeTime) {
2749
+ const isLive = stateMediator2.mediaStreamType.get(stateOwners) === StreamTypes.LIVE;
2750
+ const canAutoSeekToLive = !((_a4 = stateOwners.options) == null ? void 0 : _a4.noAutoSeekToLive);
2751
+ const isDVR = stateMediator2.mediaTargetLiveWindow.get(stateOwners) > 0;
2752
+ if (isLive && canAutoSeekToLive && !isDVR) {
2753
+ const seekableEnd = (_b2 = stateMediator2.mediaSeekable.get(stateOwners)) == null ? void 0 : _b2[1];
2754
+ if (seekableEnd) {
2755
+ const seekToLiveOffset = (_d = (_c = stateOwners.options) == null ? void 0 : _c.seekToLiveOffset) != null ? _d : 0;
2756
+ const liveEdgeTime = seekableEnd - seekToLiveOffset;
2729
2757
  stateMediator2.mediaCurrentTime.set(liveEdgeTime, stateOwners);
2730
2758
  }
2731
2759
  }
@@ -2763,20 +2791,22 @@ var mediaThemeMicrovideo = (() => {
2763
2791
  stateMediator2[key].set(value, stateOwners);
2764
2792
  },
2765
2793
  [MediaUIEvents.MEDIA_SEEK_TO_LIVE_REQUEST](stateMediator2, stateOwners) {
2766
- var _a3;
2794
+ var _a4, _b2, _c;
2767
2795
  const key = "mediaCurrentTime";
2768
- const value = (_a3 = stateMediator2.mediaSeekable.get(stateOwners)) == null ? void 0 : _a3[1];
2769
- if (Number.isNaN(Number(value)))
2796
+ const seekableEnd = (_a4 = stateMediator2.mediaSeekable.get(stateOwners)) == null ? void 0 : _a4[1];
2797
+ if (Number.isNaN(Number(seekableEnd)))
2770
2798
  return;
2799
+ const seekToLiveOffset = (_c = (_b2 = stateOwners.options) == null ? void 0 : _b2.seekToLiveOffset) != null ? _c : 0;
2800
+ const value = seekableEnd - seekToLiveOffset;
2771
2801
  stateMediator2[key].set(value, stateOwners);
2772
2802
  },
2773
2803
  // Text Tracks state change requests
2774
2804
  [MediaUIEvents.MEDIA_SHOW_SUBTITLES_REQUEST](_stateMediator, stateOwners, { detail }) {
2775
- var _a3;
2805
+ var _a4;
2776
2806
  const { options } = stateOwners;
2777
2807
  const tracks = getSubtitleTracks(stateOwners);
2778
2808
  const tracksToUpdate = parseTracks(detail);
2779
- const preferredLanguage = (_a3 = tracksToUpdate[0]) == null ? void 0 : _a3.language;
2809
+ const preferredLanguage = (_a4 = tracksToUpdate[0]) == null ? void 0 : _a4.language;
2780
2810
  if (preferredLanguage && !options.noSubtitlesLangPref) {
2781
2811
  GlobalThis.localStorage.setItem(
2782
2812
  "media-chrome-pref-subtitles-lang",
@@ -2898,7 +2928,7 @@ var mediaThemeMicrovideo = (() => {
2898
2928
  const stateUpdateHandlers = {};
2899
2929
  let nextStateOwners = void 0;
2900
2930
  const updateStateOwners = async (nextStateOwnersDelta, nextSubscriberCount) => {
2901
- var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
2931
+ var _a4, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
2902
2932
  const pendingUpdate = !!nextStateOwners;
2903
2933
  nextStateOwners = {
2904
2934
  ...stateOwners,
@@ -2910,7 +2940,7 @@ var mediaThemeMicrovideo = (() => {
2910
2940
  await prepareStateOwners(...Object.values(nextStateOwnersDelta));
2911
2941
  const shouldTeardownFromSubscriberCount = callbacks.length > 0 && nextSubscriberCount === 0 && monitorStateOwnersOnlyWithSubscriptions;
2912
2942
  const mediaChanged = stateOwners.media !== nextStateOwners.media;
2913
- const textTracksChanged = ((_a3 = stateOwners.media) == null ? void 0 : _a3.textTracks) !== ((_b2 = nextStateOwners.media) == null ? void 0 : _b2.textTracks);
2943
+ const textTracksChanged = ((_a4 = stateOwners.media) == null ? void 0 : _a4.textTracks) !== ((_b2 = nextStateOwners.media) == null ? void 0 : _b2.textTracks);
2914
2944
  const videoRenditionsChanged = ((_c = stateOwners.media) == null ? void 0 : _c.videoRenditions) !== ((_d = nextStateOwners.media) == null ? void 0 : _d.videoRenditions);
2915
2945
  const audioTracksChanged = ((_e = stateOwners.media) == null ? void 0 : _e.audioTracks) !== ((_f = nextStateOwners.media) == null ? void 0 : _f.audioTracks);
2916
2946
  const remoteChanged = ((_g = stateOwners.media) == null ? void 0 : _g.remote) !== ((_h = nextStateOwners.media) == null ? void 0 : _h.remote);
@@ -3177,13 +3207,15 @@ var mediaThemeMicrovideo = (() => {
3177
3207
  HOTKEYS: "hotkeys",
3178
3208
  KEYS_USED: "keysused",
3179
3209
  LIVE_EDGE_OFFSET: "liveedgeoffset",
3210
+ SEEK_TO_LIVE_OFFSET: "seektoliveoffset",
3180
3211
  NO_AUTO_SEEK_TO_LIVE: "noautoseektolive",
3181
3212
  NO_HOTKEYS: "nohotkeys",
3182
3213
  NO_VOLUME_PREF: "novolumepref",
3183
3214
  NO_SUBTITLES_LANG_PREF: "nosubtitleslangpref",
3184
3215
  NO_DEFAULT_STORE: "nodefaultstore",
3185
3216
  KEYBOARD_FORWARD_SEEK_OFFSET: "keyboardforwardseekoffset",
3186
- KEYBOARD_BACKWARD_SEEK_OFFSET: "keyboardbackwardseekoffset"
3217
+ KEYBOARD_BACKWARD_SEEK_OFFSET: "keyboardbackwardseekoffset",
3218
+ LANG: "lang"
3187
3219
  };
3188
3220
  var MediaController = class extends MediaContainer {
3189
3221
  constructor() {
@@ -3199,8 +3231,8 @@ var mediaThemeMicrovideo = (() => {
3199
3231
  __privateAdd4(this, _mediaStateCallback, void 0);
3200
3232
  __privateAdd4(this, _mediaStoreUnsubscribe, void 0);
3201
3233
  __privateAdd4(this, _mediaStateEventHandler, (event) => {
3202
- var _a3;
3203
- (_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch(event);
3234
+ var _a4;
3235
+ (_a4 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a4.dispatch(event);
3204
3236
  });
3205
3237
  this.associateElement(this);
3206
3238
  let prevState = {};
@@ -3226,16 +3258,17 @@ var mediaThemeMicrovideo = (() => {
3226
3258
  Attributes2.HOTKEYS,
3227
3259
  Attributes2.DEFAULT_STREAM_TYPE,
3228
3260
  Attributes2.DEFAULT_SUBTITLES,
3229
- Attributes2.DEFAULT_DURATION
3261
+ Attributes2.DEFAULT_DURATION,
3262
+ Attributes2.LANG
3230
3263
  );
3231
3264
  }
3232
3265
  get mediaStore() {
3233
3266
  return __privateGet4(this, _mediaStore);
3234
3267
  }
3235
3268
  set mediaStore(value) {
3236
- var _a3, _b2;
3269
+ var _a4, _b2;
3237
3270
  if (__privateGet4(this, _mediaStore)) {
3238
- (_a3 = __privateGet4(this, _mediaStoreUnsubscribe)) == null ? void 0 : _a3.call(this);
3271
+ (_a4 = __privateGet4(this, _mediaStoreUnsubscribe)) == null ? void 0 : _a4.call(this);
3239
3272
  __privateSet4(this, _mediaStoreUnsubscribe, void 0);
3240
3273
  }
3241
3274
  __privateSet4(this, _mediaStore, value);
@@ -3248,16 +3281,16 @@ var mediaThemeMicrovideo = (() => {
3248
3281
  ));
3249
3282
  }
3250
3283
  get fullscreenElement() {
3251
- var _a3;
3252
- return (_a3 = __privateGet4(this, _fullscreenElement)) != null ? _a3 : this;
3284
+ var _a4;
3285
+ return (_a4 = __privateGet4(this, _fullscreenElement)) != null ? _a4 : this;
3253
3286
  }
3254
3287
  set fullscreenElement(element) {
3255
- var _a3;
3288
+ var _a4;
3256
3289
  if (this.hasAttribute(Attributes2.FULLSCREEN_ELEMENT)) {
3257
3290
  this.removeAttribute(Attributes2.FULLSCREEN_ELEMENT);
3258
3291
  }
3259
3292
  __privateSet4(this, _fullscreenElement, element);
3260
- (_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch({
3293
+ (_a4 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a4.dispatch({
3261
3294
  type: "fullscreenelementchangerequest",
3262
3295
  detail: this.fullscreenElement
3263
3296
  });
@@ -3323,7 +3356,7 @@ var mediaThemeMicrovideo = (() => {
3323
3356
  setBooleanAttr(this, Attributes2.NO_DEFAULT_STORE, value);
3324
3357
  }
3325
3358
  attributeChangedCallback(attrName, oldValue, newValue) {
3326
- var _a3, _b2, _c, _d, _e, _f;
3359
+ var _a4, _b2, _c, _d, _e, _f, _g, _h;
3327
3360
  super.attributeChangedCallback(attrName, oldValue, newValue);
3328
3361
  if (attrName === Attributes2.NO_HOTKEYS) {
3329
3362
  if (newValue !== oldValue && newValue === "") {
@@ -3339,7 +3372,7 @@ var mediaThemeMicrovideo = (() => {
3339
3372
  } else if (attrName === Attributes2.HOTKEYS) {
3340
3373
  __privateGet4(this, _hotKeys).value = newValue;
3341
3374
  } else if (attrName === Attributes2.DEFAULT_SUBTITLES && newValue !== oldValue) {
3342
- (_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch({
3375
+ (_a4 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a4.dispatch({
3343
3376
  type: "optionschangerequest",
3344
3377
  detail: {
3345
3378
  defaultSubtitles: this.hasAttribute(Attributes2.DEFAULT_SUBTITLES)
@@ -3356,24 +3389,41 @@ var mediaThemeMicrovideo = (() => {
3356
3389
  (_d = __privateGet4(this, _mediaStore)) == null ? void 0 : _d.dispatch({
3357
3390
  type: "optionschangerequest",
3358
3391
  detail: {
3359
- liveEdgeOffset: this.hasAttribute(Attributes2.LIVE_EDGE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0
3392
+ liveEdgeOffset: this.hasAttribute(Attributes2.LIVE_EDGE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0,
3393
+ seekToLiveOffset: !this.hasAttribute(Attributes2.SEEK_TO_LIVE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0
3394
+ }
3395
+ });
3396
+ } else if (attrName === Attributes2.SEEK_TO_LIVE_OFFSET) {
3397
+ (_e = __privateGet4(this, _mediaStore)) == null ? void 0 : _e.dispatch({
3398
+ type: "optionschangerequest",
3399
+ detail: {
3400
+ seekToLiveOffset: this.hasAttribute(Attributes2.SEEK_TO_LIVE_OFFSET) ? +this.getAttribute(Attributes2.SEEK_TO_LIVE_OFFSET) : void 0
3401
+ }
3402
+ });
3403
+ } else if (attrName === Attributes2.NO_AUTO_SEEK_TO_LIVE) {
3404
+ (_f = __privateGet4(this, _mediaStore)) == null ? void 0 : _f.dispatch({
3405
+ type: "optionschangerequest",
3406
+ detail: {
3407
+ noAutoSeekToLive: this.hasAttribute(Attributes2.NO_AUTO_SEEK_TO_LIVE)
3360
3408
  }
3361
3409
  });
3362
3410
  } else if (attrName === Attributes2.FULLSCREEN_ELEMENT) {
3363
- const el = newValue ? (_e = this.getRootNode()) == null ? void 0 : _e.getElementById(newValue) : void 0;
3411
+ const el = newValue ? (_g = this.getRootNode()) == null ? void 0 : _g.getElementById(newValue) : void 0;
3364
3412
  __privateSet4(this, _fullscreenElement, el);
3365
- (_f = __privateGet4(this, _mediaStore)) == null ? void 0 : _f.dispatch({
3413
+ (_h = __privateGet4(this, _mediaStore)) == null ? void 0 : _h.dispatch({
3366
3414
  type: "fullscreenelementchangerequest",
3367
3415
  detail: this.fullscreenElement
3368
3416
  });
3417
+ } else if (attrName === Attributes2.LANG && newValue !== oldValue) {
3418
+ setLanguage(newValue);
3369
3419
  }
3370
3420
  }
3371
3421
  connectedCallback() {
3372
- var _a3, _b2;
3422
+ var _a4, _b2;
3373
3423
  if (!__privateGet4(this, _mediaStore) && !this.hasAttribute(Attributes2.NO_DEFAULT_STORE)) {
3374
3424
  __privateMethod2(this, _setupDefaultStore, setupDefaultStore_fn).call(this);
3375
3425
  }
3376
- (_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch({
3426
+ (_a4 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a4.dispatch({
3377
3427
  type: "documentelementchangerequest",
3378
3428
  detail: Document2
3379
3429
  });
@@ -3386,8 +3436,8 @@ var mediaThemeMicrovideo = (() => {
3386
3436
  this.enableHotkeys();
3387
3437
  }
3388
3438
  disconnectedCallback() {
3389
- var _a3, _b2, _c, _d;
3390
- (_a3 = super.disconnectedCallback) == null ? void 0 : _a3.call(this);
3439
+ var _a4, _b2, _c, _d;
3440
+ (_a4 = super.disconnectedCallback) == null ? void 0 : _a4.call(this);
3391
3441
  if (__privateGet4(this, _mediaStore)) {
3392
3442
  (_b2 = __privateGet4(this, _mediaStore)) == null ? void 0 : _b2.dispatch({
3393
3443
  type: "documentelementchangerequest",
@@ -3408,9 +3458,9 @@ var mediaThemeMicrovideo = (() => {
3408
3458
  * @param {HTMLMediaElement} media
3409
3459
  */
3410
3460
  mediaSetCallback(media) {
3411
- var _a3;
3461
+ var _a4;
3412
3462
  super.mediaSetCallback(media);
3413
- (_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch({
3463
+ (_a4 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a4.dispatch({
3414
3464
  type: "mediaelementchangerequest",
3415
3465
  detail: media
3416
3466
  });
@@ -3423,9 +3473,9 @@ var mediaThemeMicrovideo = (() => {
3423
3473
  * @param {HTMLMediaElement} media
3424
3474
  */
3425
3475
  mediaUnsetCallback(media) {
3426
- var _a3;
3476
+ var _a4;
3427
3477
  super.mediaUnsetCallback(media);
3428
- (_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch({
3478
+ (_a4 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a4.dispatch({
3429
3479
  type: "mediaelementchangerequest",
3430
3480
  detail: void 0
3431
3481
  });
@@ -3501,9 +3551,9 @@ var mediaThemeMicrovideo = (() => {
3501
3551
  setStringAttr(this, Attributes2.HOTKEYS, value);
3502
3552
  }
3503
3553
  keyboardShortcutHandler(e) {
3504
- var _a3, _b2, _c, _d, _e;
3554
+ var _a4, _b2, _c, _d, _e;
3505
3555
  const target = e.target;
3506
- const keysUsed = ((_c = (_b2 = (_a3 = target.getAttribute(Attributes2.KEYS_USED)) == null ? void 0 : _a3.split(" ")) != null ? _b2 : target == null ? void 0 : target.keysUsed) != null ? _c : []).map((key) => key === "Space" ? " " : key).filter(Boolean);
3556
+ const keysUsed = ((_c = (_b2 = (_a4 = target.getAttribute(Attributes2.KEYS_USED)) == null ? void 0 : _a4.split(" ")) != null ? _b2 : target == null ? void 0 : target.keysUsed) != null ? _c : []).map((key) => key === "Space" ? " " : key).filter(Boolean);
3507
3557
  if (keysUsed.includes(e.key)) {
3508
3558
  return;
3509
3559
  }
@@ -3594,7 +3644,7 @@ var mediaThemeMicrovideo = (() => {
3594
3644
  _mediaStateEventHandler = /* @__PURE__ */ new WeakMap();
3595
3645
  _setupDefaultStore = /* @__PURE__ */ new WeakSet();
3596
3646
  setupDefaultStore_fn = function() {
3597
- var _a3;
3647
+ var _a4;
3598
3648
  this.mediaStore = createMediaStore({
3599
3649
  media: this.media,
3600
3650
  fullscreenElement: this.fullscreenElement,
@@ -3603,11 +3653,13 @@ var mediaThemeMicrovideo = (() => {
3603
3653
  defaultDuration: this.hasAttribute(Attributes2.DEFAULT_DURATION) ? +this.getAttribute(Attributes2.DEFAULT_DURATION) : void 0,
3604
3654
  defaultStreamType: (
3605
3655
  /** @type {import('./media-store/state-mediator.js').StreamTypeValue} */
3606
- (_a3 = this.getAttribute(
3656
+ (_a4 = this.getAttribute(
3607
3657
  Attributes2.DEFAULT_STREAM_TYPE
3608
- )) != null ? _a3 : void 0
3658
+ )) != null ? _a4 : void 0
3609
3659
  ),
3610
3660
  liveEdgeOffset: this.hasAttribute(Attributes2.LIVE_EDGE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0,
3661
+ seekToLiveOffset: this.hasAttribute(Attributes2.SEEK_TO_LIVE_OFFSET) ? +this.getAttribute(Attributes2.SEEK_TO_LIVE_OFFSET) : this.hasAttribute(Attributes2.LIVE_EDGE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0,
3662
+ noAutoSeekToLive: this.hasAttribute(Attributes2.NO_AUTO_SEEK_TO_LIVE),
3611
3663
  // NOTE: This wasn't updated if it was changed later. Should it be? (CJP)
3612
3664
  noVolumePref: this.hasAttribute(Attributes2.NO_VOLUME_PREF),
3613
3665
  noSubtitlesLangPref: this.hasAttribute(
@@ -3640,9 +3692,9 @@ var mediaThemeMicrovideo = (() => {
3640
3692
  var MEDIA_UI_ATTRIBUTE_NAMES2 = Object.values(MediaUIAttributes);
3641
3693
  var MEDIA_UI_PROP_NAMES = Object.values(MediaUIProps);
3642
3694
  var getMediaUIAttributesFrom = (child) => {
3643
- var _a3, _b2, _c, _d;
3695
+ var _a4, _b2, _c, _d;
3644
3696
  let { observedAttributes: observedAttributes2 } = child.constructor;
3645
- if (!observedAttributes2 && ((_a3 = child.nodeName) == null ? void 0 : _a3.includes("-"))) {
3697
+ if (!observedAttributes2 && ((_a4 = child.nodeName) == null ? void 0 : _a4.includes("-"))) {
3646
3698
  GlobalThis.customElements.upgrade(child);
3647
3699
  ({ observedAttributes: observedAttributes2 } = child.constructor);
3648
3700
  }
@@ -3654,8 +3706,8 @@ var mediaThemeMicrovideo = (() => {
3654
3706
  );
3655
3707
  };
3656
3708
  var hasMediaUIProps = (mediaStateReceiverCandidate) => {
3657
- var _a3, _b2;
3658
- if (((_a3 = mediaStateReceiverCandidate.nodeName) == null ? void 0 : _a3.includes("-")) && !!GlobalThis.customElements.get(
3709
+ var _a4, _b2;
3710
+ if (((_a4 = mediaStateReceiverCandidate.nodeName) == null ? void 0 : _a4.includes("-")) && !!GlobalThis.customElements.get(
3659
3711
  (_b2 = mediaStateReceiverCandidate.nodeName) == null ? void 0 : _b2.toLowerCase()
3660
3712
  ) && !(mediaStateReceiverCandidate instanceof GlobalThis.customElements.get(
3661
3713
  mediaStateReceiverCandidate.nodeName.toLowerCase()
@@ -3670,8 +3722,8 @@ var mediaThemeMicrovideo = (() => {
3670
3722
  return hasMediaUIProps(child) || !!getMediaUIAttributesFrom(child).length;
3671
3723
  };
3672
3724
  var serializeTuple = (tuple) => {
3673
- var _a3;
3674
- return (_a3 = tuple == null ? void 0 : tuple.join) == null ? void 0 : _a3.call(tuple, ":");
3725
+ var _a4;
3726
+ return (_a4 = tuple == null ? void 0 : tuple.join) == null ? void 0 : _a4.call(tuple, ":");
3675
3727
  };
3676
3728
  var CustomAttrSerializer = {
3677
3729
  [MediaUIAttributes.MEDIA_SUBTITLES_LIST]: stringifyTextTrackList,
@@ -3683,7 +3735,7 @@ var mediaThemeMicrovideo = (() => {
3683
3735
  [MediaUIAttributes.MEDIA_AUDIO_TRACK_LIST]: stringifyAudioTrackList
3684
3736
  };
3685
3737
  var setAttr = async (child, attrName, attrValue) => {
3686
- var _a3, _b2;
3738
+ var _a4, _b2;
3687
3739
  if (!child.isConnected) {
3688
3740
  await delay(0);
3689
3741
  }
@@ -3699,24 +3751,24 @@ var mediaThemeMicrovideo = (() => {
3699
3751
  if (Array.isArray(attrValue) && !attrValue.length) {
3700
3752
  return child.removeAttribute(attrName);
3701
3753
  }
3702
- const val = (_b2 = (_a3 = CustomAttrSerializer[attrName]) == null ? void 0 : _a3.call(CustomAttrSerializer, attrValue)) != null ? _b2 : attrValue;
3754
+ const val = (_b2 = (_a4 = CustomAttrSerializer[attrName]) == null ? void 0 : _a4.call(CustomAttrSerializer, attrValue)) != null ? _b2 : attrValue;
3703
3755
  return child.setAttribute(attrName, val);
3704
3756
  };
3705
3757
  var isMediaSlotElementDescendant = (el) => {
3706
- var _a3;
3707
- return !!((_a3 = el.closest) == null ? void 0 : _a3.call(el, '*[slot="media"]'));
3758
+ var _a4;
3759
+ return !!((_a4 = el.closest) == null ? void 0 : _a4.call(el, '*[slot="media"]'));
3708
3760
  };
3709
3761
  var traverseForMediaStateReceivers = (rootNode, mediaStateReceiverCallback) => {
3710
3762
  if (isMediaSlotElementDescendant(rootNode)) {
3711
3763
  return;
3712
3764
  }
3713
3765
  const traverseForMediaStateReceiversSync = (rootNode2, mediaStateReceiverCallback2) => {
3714
- var _a3, _b2;
3766
+ var _a4, _b2;
3715
3767
  if (isMediaStateReceiver(rootNode2)) {
3716
3768
  mediaStateReceiverCallback2(rootNode2);
3717
3769
  }
3718
3770
  const { children = [] } = rootNode2 != null ? rootNode2 : {};
3719
- const shadowChildren = (_b2 = (_a3 = rootNode2 == null ? void 0 : rootNode2.shadowRoot) == null ? void 0 : _a3.children) != null ? _b2 : [];
3771
+ const shadowChildren = (_b2 = (_a4 = rootNode2 == null ? void 0 : rootNode2.shadowRoot) == null ? void 0 : _a4.children) != null ? _b2 : [];
3720
3772
  const allChildren = [...children, ...shadowChildren];
3721
3773
  allChildren.forEach(
3722
3774
  (child) => traverseForMediaStateReceivers(
@@ -3750,13 +3802,13 @@ var mediaThemeMicrovideo = (() => {
3750
3802
  var monitorForMediaStateReceivers = (rootNode, registerMediaStateReceiver, unregisterMediaStateReceiver) => {
3751
3803
  traverseForMediaStateReceivers(rootNode, registerMediaStateReceiver);
3752
3804
  const registerMediaStateReceiverHandler = (evt) => {
3753
- var _a3;
3754
- const el = (_a3 = evt == null ? void 0 : evt.composedPath()[0]) != null ? _a3 : evt.target;
3805
+ var _a4;
3806
+ const el = (_a4 = evt == null ? void 0 : evt.composedPath()[0]) != null ? _a4 : evt.target;
3755
3807
  registerMediaStateReceiver(el);
3756
3808
  };
3757
3809
  const unregisterMediaStateReceiverHandler = (evt) => {
3758
- var _a3;
3759
- const el = (_a3 = evt == null ? void 0 : evt.composedPath()[0]) != null ? _a3 : evt.target;
3810
+ var _a4;
3811
+ const el = (_a4 = evt == null ? void 0 : evt.composedPath()[0]) != null ? _a4 : evt.target;
3760
3812
  unregisterMediaStateReceiver(el);
3761
3813
  };
3762
3814
  rootNode.addEventListener(
@@ -3897,7 +3949,7 @@ var mediaThemeMicrovideo = (() => {
3897
3949
  box-sizing: border-box;
3898
3950
  transition: background .15s linear;
3899
3951
  pointer-events: auto;
3900
- cursor: pointer;
3952
+ cursor: var(--media-cursor, pointer);
3901
3953
  -webkit-tap-highlight-color: transparent;
3902
3954
  }
3903
3955
 
@@ -3964,7 +4016,7 @@ var mediaThemeMicrovideo = (() => {
3964
4016
  `;
3965
4017
  var MediaChromeButton = class extends GlobalThis.HTMLElement {
3966
4018
  constructor(options = {}) {
3967
- var _a3;
4019
+ var _a4;
3968
4020
  super();
3969
4021
  __privateAdd5(this, _setupTooltip);
3970
4022
  __privateAdd5(this, _mediaController2, void 0);
@@ -3978,8 +4030,8 @@ var mediaThemeMicrovideo = (() => {
3978
4030
  setTimeout(__privateGet5(this, _positionTooltip), 0);
3979
4031
  });
3980
4032
  __privateAdd5(this, _positionTooltip, () => {
3981
- var _a4, _b2;
3982
- (_b2 = (_a4 = this.tooltipEl) == null ? void 0 : _a4.updateXOffset) == null ? void 0 : _b2.call(_a4);
4033
+ var _a5, _b2;
4034
+ (_b2 = (_a5 = this.tooltipEl) == null ? void 0 : _a5.updateXOffset) == null ? void 0 : _b2.call(_a5);
3983
4035
  });
3984
4036
  __privateAdd5(this, _keyupListener, (e) => {
3985
4037
  const { key } = e;
@@ -4009,7 +4061,7 @@ var mediaThemeMicrovideo = (() => {
4009
4061
  slotTemplate17.innerHTML = `<slot>${options.defaultContent || ""}</slot>`;
4010
4062
  }
4011
4063
  if (options.tooltipContent) {
4012
- buttonHTML.querySelector('slot[name="tooltip-content"]').innerHTML = (_a3 = options.tooltipContent) != null ? _a3 : "";
4064
+ buttonHTML.querySelector('slot[name="tooltip-content"]').innerHTML = (_a4 = options.tooltipContent) != null ? _a4 : "";
4013
4065
  this.tooltipContent = options.tooltipContent;
4014
4066
  }
4015
4067
  this.nativeEl.appendChild(slotTemplate17.content.cloneNode(true));
@@ -4036,10 +4088,10 @@ var mediaThemeMicrovideo = (() => {
4036
4088
  this.tabIndex = -1;
4037
4089
  }
4038
4090
  attributeChangedCallback(attrName, oldValue, newValue) {
4039
- var _a3, _b2, _c, _d, _e;
4091
+ var _a4, _b2, _c, _d, _e;
4040
4092
  if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
4041
4093
  if (oldValue) {
4042
- (_b2 = (_a3 = __privateGet5(this, _mediaController2)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
4094
+ (_b2 = (_a4 = __privateGet5(this, _mediaController2)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
4043
4095
  __privateSet5(this, _mediaController2, null);
4044
4096
  }
4045
4097
  if (newValue && this.isConnected) {
@@ -4058,7 +4110,7 @@ var mediaThemeMicrovideo = (() => {
4058
4110
  __privateGet5(this, _positionTooltip).call(this);
4059
4111
  }
4060
4112
  connectedCallback() {
4061
- var _a3, _b2, _c;
4113
+ var _a4, _b2, _c;
4062
4114
  const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
4063
4115
  style.setProperty(
4064
4116
  "display",
@@ -4078,16 +4130,16 @@ var mediaThemeMicrovideo = (() => {
4078
4130
  this,
4079
4131
  _mediaController2,
4080
4132
  // @ts-ignore
4081
- (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(mediaControllerId)
4133
+ (_a4 = this.getRootNode()) == null ? void 0 : _a4.getElementById(mediaControllerId)
4082
4134
  );
4083
4135
  (_c = (_b2 = __privateGet5(this, _mediaController2)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
4084
4136
  }
4085
4137
  GlobalThis.customElements.whenDefined("media-tooltip").then(() => __privateMethod3(this, _setupTooltip, setupTooltip_fn).call(this));
4086
4138
  }
4087
4139
  disconnectedCallback() {
4088
- var _a3, _b2;
4140
+ var _a4, _b2;
4089
4141
  this.disable();
4090
- (_b2 = (_a3 = __privateGet5(this, _mediaController2)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
4142
+ (_b2 = (_a4 = __privateGet5(this, _mediaController2)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
4091
4143
  __privateSet5(this, _mediaController2, null);
4092
4144
  this.removeEventListener("mouseenter", __privateGet5(this, _positionTooltip));
4093
4145
  this.removeEventListener("focus", __privateGet5(this, _positionTooltip));
@@ -4647,15 +4699,15 @@ var mediaThemeMicrovideo = (() => {
4647
4699
  };
4648
4700
  _handleOpen = /* @__PURE__ */ new WeakSet();
4649
4701
  handleOpen_fn = function() {
4650
- var _a3;
4651
- (_a3 = __privateGet6(this, _invokerElement)) == null ? void 0 : _a3.setAttribute("aria-expanded", "true");
4702
+ var _a4;
4703
+ (_a4 = __privateGet6(this, _invokerElement)) == null ? void 0 : _a4.setAttribute("aria-expanded", "true");
4652
4704
  this.dispatchEvent(new Event("open", { composed: true, bubbles: true }));
4653
4705
  this.addEventListener("transitionend", () => this.focus(), { once: true });
4654
4706
  };
4655
4707
  _handleClosed = /* @__PURE__ */ new WeakSet();
4656
4708
  handleClosed_fn = function() {
4657
- var _a3;
4658
- (_a3 = __privateGet6(this, _invokerElement)) == null ? void 0 : _a3.setAttribute("aria-expanded", "false");
4709
+ var _a4;
4710
+ (_a4 = __privateGet6(this, _invokerElement)) == null ? void 0 : _a4.setAttribute("aria-expanded", "false");
4659
4711
  this.dispatchEvent(new Event("close", { composed: true, bubbles: true }));
4660
4712
  };
4661
4713
  _handleInvoke = /* @__PURE__ */ new WeakSet();
@@ -4667,9 +4719,9 @@ var mediaThemeMicrovideo = (() => {
4667
4719
  };
4668
4720
  _handleFocusOut = /* @__PURE__ */ new WeakSet();
4669
4721
  handleFocusOut_fn = function(event) {
4670
- var _a3;
4722
+ var _a4;
4671
4723
  if (!containsComposedNode(this, event.relatedTarget)) {
4672
- (_a3 = __privateGet6(this, _previouslyFocused)) == null ? void 0 : _a3.focus();
4724
+ (_a4 = __privateGet6(this, _previouslyFocused)) == null ? void 0 : _a4.focus();
4673
4725
  if (__privateGet6(this, _invokerElement) && __privateGet6(this, _invokerElement) !== event.relatedTarget && this.open) {
4674
4726
  this.open = false;
4675
4727
  }
@@ -4677,7 +4729,7 @@ var mediaThemeMicrovideo = (() => {
4677
4729
  };
4678
4730
  _handleKeyDown = /* @__PURE__ */ new WeakSet();
4679
4731
  handleKeyDown_fn = function(event) {
4680
- var _a3, _b2, _c, _d, _e;
4732
+ var _a4, _b2, _c, _d, _e;
4681
4733
  const { key, ctrlKey, altKey, metaKey } = event;
4682
4734
  if (ctrlKey || altKey || metaKey) {
4683
4735
  return;
@@ -4689,7 +4741,7 @@ var mediaThemeMicrovideo = (() => {
4689
4741
  event.stopPropagation();
4690
4742
  if (key === "Tab") {
4691
4743
  if (event.shiftKey) {
4692
- (_b2 = (_a3 = this.previousElementSibling) == null ? void 0 : _a3.focus) == null ? void 0 : _b2.call(_a3);
4744
+ (_b2 = (_a4 = this.previousElementSibling) == null ? void 0 : _a4.focus) == null ? void 0 : _b2.call(_a4);
4693
4745
  } else {
4694
4746
  (_d = (_c = this.nextElementSibling) == null ? void 0 : _c.focus) == null ? void 0 : _d.call(_c);
4695
4747
  }
@@ -4773,7 +4825,7 @@ var mediaThemeMicrovideo = (() => {
4773
4825
  position: relative;
4774
4826
  width: 100px;
4775
4827
  transition: background .15s linear;
4776
- cursor: pointer;
4828
+ cursor: var(--media-cursor, pointer);
4777
4829
  pointer-events: auto;
4778
4830
  touch-action: none; ${/* Prevent scrolling when dragging on mobile. */
4779
4831
  ""}
@@ -4829,7 +4881,7 @@ var mediaThemeMicrovideo = (() => {
4829
4881
  height: var(--media-time-range-hover-height, max(100% + 7px, 25px));
4830
4882
  width: 100%;
4831
4883
  position: absolute;
4832
- cursor: pointer;
4884
+ cursor: var(--media-cursor, pointer);
4833
4885
 
4834
4886
  -webkit-appearance: none; ${/* Hides the slider so that custom slider can be made */
4835
4887
  ""}
@@ -4932,7 +4984,7 @@ var mediaThemeMicrovideo = (() => {
4932
4984
  translate: -50%;
4933
4985
  position: absolute;
4934
4986
  left: 0;
4935
- cursor: pointer;
4987
+ cursor: var(--media-cursor, pointer);
4936
4988
  }
4937
4989
 
4938
4990
  #thumb {
@@ -5048,10 +5100,10 @@ var mediaThemeMicrovideo = (() => {
5048
5100
  ];
5049
5101
  }
5050
5102
  attributeChangedCallback(attrName, oldValue, newValue) {
5051
- var _a3, _b2, _c, _d, _e;
5103
+ var _a4, _b2, _c, _d, _e;
5052
5104
  if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
5053
5105
  if (oldValue) {
5054
- (_b2 = (_a3 = __privateGet7(this, _mediaController3)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
5106
+ (_b2 = (_a4 = __privateGet7(this, _mediaController3)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
5055
5107
  __privateSet7(this, _mediaController3, null);
5056
5108
  }
5057
5109
  if (newValue && this.isConnected) {
@@ -5069,7 +5121,7 @@ var mediaThemeMicrovideo = (() => {
5069
5121
  }
5070
5122
  }
5071
5123
  connectedCallback() {
5072
- var _a3, _b2, _c;
5124
+ var _a4, _b2, _c;
5073
5125
  const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
5074
5126
  style.setProperty(
5075
5127
  "display",
@@ -5077,7 +5129,10 @@ var mediaThemeMicrovideo = (() => {
5077
5129
  );
5078
5130
  __privateGet7(this, _cssRules).pointer = getOrInsertCSSRule(this.shadowRoot, "#pointer");
5079
5131
  __privateGet7(this, _cssRules).progress = getOrInsertCSSRule(this.shadowRoot, "#progress");
5080
- __privateGet7(this, _cssRules).thumb = getOrInsertCSSRule(this.shadowRoot, '#thumb, ::slotted([slot="thumb"])');
5132
+ __privateGet7(this, _cssRules).thumb = getOrInsertCSSRule(
5133
+ this.shadowRoot,
5134
+ '#thumb, ::slotted([slot="thumb"])'
5135
+ );
5081
5136
  __privateGet7(this, _cssRules).activeSegment = getOrInsertCSSRule(
5082
5137
  this.shadowRoot,
5083
5138
  "#segments-clipping rect:nth-child(0)"
@@ -5086,7 +5141,7 @@ var mediaThemeMicrovideo = (() => {
5086
5141
  MediaStateReceiverAttributes.MEDIA_CONTROLLER
5087
5142
  );
5088
5143
  if (mediaControllerId) {
5089
- __privateSet7(this, _mediaController3, (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(
5144
+ __privateSet7(this, _mediaController3, (_a4 = this.getRootNode()) == null ? void 0 : _a4.getElementById(
5090
5145
  mediaControllerId
5091
5146
  ));
5092
5147
  (_c = (_b2 = __privateGet7(this, _mediaController3)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
@@ -5098,25 +5153,25 @@ var mediaThemeMicrovideo = (() => {
5098
5153
  observeResize(this.container, __privateGet7(this, _updateComputedStyles));
5099
5154
  }
5100
5155
  disconnectedCallback() {
5101
- var _a3, _b2;
5156
+ var _a4, _b2;
5102
5157
  __privateMethod5(this, _disableUserEvents, disableUserEvents_fn).call(this);
5103
- (_b2 = (_a3 = __privateGet7(this, _mediaController3)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
5158
+ (_b2 = (_a4 = __privateGet7(this, _mediaController3)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
5104
5159
  __privateSet7(this, _mediaController3, null);
5105
5160
  this.shadowRoot.removeEventListener("focusin", __privateGet7(this, _onFocusIn));
5106
5161
  this.shadowRoot.removeEventListener("focusout", __privateGet7(this, _onFocusOut));
5107
5162
  unobserveResize(this.container, __privateGet7(this, _updateComputedStyles));
5108
5163
  }
5109
5164
  updatePointerBar(evt) {
5110
- var _a3;
5111
- (_a3 = __privateGet7(this, _cssRules).pointer) == null ? void 0 : _a3.style.setProperty(
5165
+ var _a4;
5166
+ (_a4 = __privateGet7(this, _cssRules).pointer) == null ? void 0 : _a4.style.setProperty(
5112
5167
  "width",
5113
5168
  `${this.getPointerRatio(evt) * 100}%`
5114
5169
  );
5115
5170
  }
5116
5171
  updateBar() {
5117
- var _a3, _b2;
5172
+ var _a4, _b2;
5118
5173
  const rangePercent = this.range.valueAsNumber * 100;
5119
- (_a3 = __privateGet7(this, _cssRules).progress) == null ? void 0 : _a3.style.setProperty("width", `${rangePercent}%`);
5174
+ (_a4 = __privateGet7(this, _cssRules).progress) == null ? void 0 : _a4.style.setProperty("width", `${rangePercent}%`);
5120
5175
  (_b2 = __privateGet7(this, _cssRules).thumb) == null ? void 0 : _b2.style.setProperty("left", `${rangePercent}%`);
5121
5176
  }
5122
5177
  updateSegments(segments) {
@@ -5153,13 +5208,12 @@ var mediaThemeMicrovideo = (() => {
5153
5208
  }
5154
5209
  }
5155
5210
  getPointerRatio(evt) {
5156
- const pointerRatio = getPointProgressOnLine(
5211
+ return getPointProgressOnLine(
5157
5212
  evt.clientX,
5158
5213
  evt.clientY,
5159
5214
  __privateGet7(this, _startpoint).getBoundingClientRect(),
5160
5215
  __privateGet7(this, _endpoint).getBoundingClientRect()
5161
5216
  );
5162
- return Math.max(0, Math.min(1, pointerRatio));
5163
5217
  }
5164
5218
  get dragging() {
5165
5219
  return this.hasAttribute("dragging");
@@ -5228,39 +5282,39 @@ var mediaThemeMicrovideo = (() => {
5228
5282
  };
5229
5283
  _disableUserEvents = /* @__PURE__ */ new WeakSet();
5230
5284
  disableUserEvents_fn = function() {
5231
- var _a3, _b2;
5285
+ var _a4, _b2;
5232
5286
  this.removeEventListener("input", this);
5233
5287
  this.removeEventListener("pointerdown", this);
5234
5288
  this.removeEventListener("pointerenter", this);
5235
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("pointerup", this);
5289
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.removeEventListener("pointerup", this);
5236
5290
  (_b2 = GlobalThis.window) == null ? void 0 : _b2.removeEventListener("pointermove", this);
5237
5291
  };
5238
5292
  _handlePointerDown = /* @__PURE__ */ new WeakSet();
5239
5293
  handlePointerDown_fn = function(evt) {
5240
- var _a3;
5294
+ var _a4;
5241
5295
  __privateSet7(this, _isInputTarget, evt.composedPath().includes(this.range));
5242
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointerup", this);
5296
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.addEventListener("pointerup", this);
5243
5297
  };
5244
5298
  _handlePointerEnter = /* @__PURE__ */ new WeakSet();
5245
5299
  handlePointerEnter_fn = function(evt) {
5246
- var _a3;
5300
+ var _a4;
5247
5301
  if (evt.pointerType !== "mouse")
5248
5302
  __privateMethod5(this, _handlePointerDown, handlePointerDown_fn).call(this, evt);
5249
5303
  this.addEventListener("pointerleave", this);
5250
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointermove", this);
5304
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.addEventListener("pointermove", this);
5251
5305
  };
5252
5306
  _handlePointerUp2 = /* @__PURE__ */ new WeakSet();
5253
5307
  handlePointerUp_fn2 = function() {
5254
- var _a3;
5255
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("pointerup", this);
5308
+ var _a4;
5309
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.removeEventListener("pointerup", this);
5256
5310
  this.toggleAttribute("dragging", false);
5257
5311
  this.range.disabled = this.hasAttribute("disabled");
5258
5312
  };
5259
5313
  _handlePointerLeave = /* @__PURE__ */ new WeakSet();
5260
5314
  handlePointerLeave_fn = function() {
5261
- var _a3, _b2;
5315
+ var _a4, _b2;
5262
5316
  this.removeEventListener("pointerleave", this);
5263
- (_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("pointermove", this);
5317
+ (_a4 = GlobalThis.window) == null ? void 0 : _a4.removeEventListener("pointermove", this);
5264
5318
  this.toggleAttribute("dragging", false);
5265
5319
  this.range.disabled = this.hasAttribute("disabled");
5266
5320
  (_b2 = __privateGet7(this, _cssRules).activeSegment) == null ? void 0 : _b2.style.removeProperty("transform");
@@ -5348,10 +5402,10 @@ var mediaThemeMicrovideo = (() => {
5348
5402
  return [MediaStateReceiverAttributes.MEDIA_CONTROLLER];
5349
5403
  }
5350
5404
  attributeChangedCallback(attrName, oldValue, newValue) {
5351
- var _a3, _b2, _c, _d, _e;
5405
+ var _a4, _b2, _c, _d, _e;
5352
5406
  if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
5353
5407
  if (oldValue) {
5354
- (_b2 = (_a3 = __privateGet8(this, _mediaController4)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
5408
+ (_b2 = (_a4 = __privateGet8(this, _mediaController4)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
5355
5409
  __privateSet8(this, _mediaController4, null);
5356
5410
  }
5357
5411
  if (newValue && this.isConnected) {
@@ -5361,20 +5415,20 @@ var mediaThemeMicrovideo = (() => {
5361
5415
  }
5362
5416
  }
5363
5417
  connectedCallback() {
5364
- var _a3, _b2, _c;
5418
+ var _a4, _b2, _c;
5365
5419
  const mediaControllerId = this.getAttribute(
5366
5420
  MediaStateReceiverAttributes.MEDIA_CONTROLLER
5367
5421
  );
5368
5422
  if (mediaControllerId) {
5369
- __privateSet8(this, _mediaController4, (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(
5423
+ __privateSet8(this, _mediaController4, (_a4 = this.getRootNode()) == null ? void 0 : _a4.getElementById(
5370
5424
  mediaControllerId
5371
5425
  ));
5372
5426
  (_c = (_b2 = __privateGet8(this, _mediaController4)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
5373
5427
  }
5374
5428
  }
5375
5429
  disconnectedCallback() {
5376
- var _a3, _b2;
5377
- (_b2 = (_a3 = __privateGet8(this, _mediaController4)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
5430
+ var _a4, _b2;
5431
+ (_b2 = (_a4 = __privateGet8(this, _mediaController4)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
5378
5432
  __privateSet8(this, _mediaController4, null);
5379
5433
  }
5380
5434
  };
@@ -5459,10 +5513,10 @@ var mediaThemeMicrovideo = (() => {
5459
5513
  return [MediaStateReceiverAttributes.MEDIA_CONTROLLER];
5460
5514
  }
5461
5515
  attributeChangedCallback(attrName, oldValue, newValue) {
5462
- var _a3, _b2, _c, _d, _e;
5516
+ var _a4, _b2, _c, _d, _e;
5463
5517
  if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
5464
5518
  if (oldValue) {
5465
- (_b2 = (_a3 = __privateGet9(this, _mediaController5)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
5519
+ (_b2 = (_a4 = __privateGet9(this, _mediaController5)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
5466
5520
  __privateSet9(this, _mediaController5, null);
5467
5521
  }
5468
5522
  if (newValue && this.isConnected) {
@@ -5472,7 +5526,7 @@ var mediaThemeMicrovideo = (() => {
5472
5526
  }
5473
5527
  }
5474
5528
  connectedCallback() {
5475
- var _a3, _b2, _c;
5529
+ var _a4, _b2, _c;
5476
5530
  const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
5477
5531
  style.setProperty(
5478
5532
  "display",
@@ -5482,15 +5536,15 @@ var mediaThemeMicrovideo = (() => {
5482
5536
  MediaStateReceiverAttributes.MEDIA_CONTROLLER
5483
5537
  );
5484
5538
  if (mediaControllerId) {
5485
- __privateSet9(this, _mediaController5, (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(
5539
+ __privateSet9(this, _mediaController5, (_a4 = this.getRootNode()) == null ? void 0 : _a4.getElementById(
5486
5540
  mediaControllerId
5487
5541
  ));
5488
5542
  (_c = (_b2 = __privateGet9(this, _mediaController5)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
5489
5543
  }
5490
5544
  }
5491
5545
  disconnectedCallback() {
5492
- var _a3, _b2;
5493
- (_b2 = (_a3 = __privateGet9(this, _mediaController5)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
5546
+ var _a4, _b2;
5547
+ (_b2 = (_a4 = __privateGet9(this, _mediaController5)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
5494
5548
  __privateSet9(this, _mediaController5, null);
5495
5549
  }
5496
5550
  };
@@ -5571,11 +5625,11 @@ var mediaThemeMicrovideo = (() => {
5571
5625
  5: t("The media is encrypted and there are no keys to decrypt it.")
5572
5626
  };
5573
5627
  var formatError = (error) => {
5574
- var _a3, _b2;
5628
+ var _a4, _b2;
5575
5629
  if (error.code === 1)
5576
5630
  return null;
5577
5631
  return {
5578
- title: (_a3 = defaultErrorTitles[error.code]) != null ? _a3 : `Error ${error.code}`,
5632
+ title: (_a4 = defaultErrorTitles[error.code]) != null ? _a4 : `Error ${error.code}`,
5579
5633
  message: (_b2 = defaultErrorMessages[error.code]) != null ? _b2 : error.message
5580
5634
  };
5581
5635
  };
@@ -5629,8 +5683,8 @@ var mediaThemeMicrovideo = (() => {
5629
5683
  return error.code && formatError(error) !== null;
5630
5684
  }
5631
5685
  function formatErrorMessage(error) {
5632
- var _a3;
5633
- const { title, message } = (_a3 = formatError(error)) != null ? _a3 : {};
5686
+ var _a4;
5687
+ const { title, message } = (_a4 = formatError(error)) != null ? _a4 : {};
5634
5688
  let html = "";
5635
5689
  if (title)
5636
5690
  html += `<slot name="error-${error.code}-title"><h3>${title}</h3></slot>`;
@@ -5654,11 +5708,11 @@ var mediaThemeMicrovideo = (() => {
5654
5708
  return this.constructor.formatErrorMessage(error);
5655
5709
  }
5656
5710
  attributeChangedCallback(attrName, oldValue, newValue) {
5657
- var _a3;
5711
+ var _a4;
5658
5712
  super.attributeChangedCallback(attrName, oldValue, newValue);
5659
5713
  if (!observedAttributes.includes(attrName))
5660
5714
  return;
5661
- const mediaError = (_a3 = this.mediaError) != null ? _a3 : {
5715
+ const mediaError = (_a4 = this.mediaError) != null ? _a4 : {
5662
5716
  code: this.mediaErrorCode,
5663
5717
  message: this.mediaErrorMessage
5664
5718
  };
@@ -5816,7 +5870,7 @@ var mediaThemeMicrovideo = (() => {
5816
5870
  }
5817
5871
 
5818
5872
  :host([${MEDIA_TIME_IS_LIVE}]:not([${MEDIA_PAUSED}])) {
5819
- cursor: not-allowed;
5873
+ cursor: var(--media-cursor, not-allowed);
5820
5874
  }
5821
5875
 
5822
5876
  slot[name=text]{
@@ -6005,12 +6059,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
6005
6059
  ];
6006
6060
  }
6007
6061
  attributeChangedCallback(attrName, oldValue, newValue) {
6008
- var _a3, _b2, _c, _d, _e;
6062
+ var _a4, _b2, _c, _d, _e;
6009
6063
  if (attrName === Attributes5.LOADING_DELAY && oldValue !== newValue) {
6010
6064
  this.loadingDelay = Number(newValue);
6011
6065
  } else if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
6012
6066
  if (oldValue) {
6013
- (_b2 = (_a3 = __privateGet12(this, _mediaController6)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
6067
+ (_b2 = (_a4 = __privateGet12(this, _mediaController6)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
6014
6068
  __privateSet12(this, _mediaController6, null);
6015
6069
  }
6016
6070
  if (newValue && this.isConnected) {
@@ -6020,20 +6074,20 @@ svg, img, ::slotted(svg), ::slotted(img) {
6020
6074
  }
6021
6075
  }
6022
6076
  connectedCallback() {
6023
- var _a3, _b2, _c;
6077
+ var _a4, _b2, _c;
6024
6078
  const mediaControllerId = this.getAttribute(
6025
6079
  MediaStateReceiverAttributes.MEDIA_CONTROLLER
6026
6080
  );
6027
6081
  if (mediaControllerId) {
6028
- __privateSet12(this, _mediaController6, (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(
6082
+ __privateSet12(this, _mediaController6, (_a4 = this.getRootNode()) == null ? void 0 : _a4.getElementById(
6029
6083
  mediaControllerId
6030
6084
  ));
6031
6085
  (_c = (_b2 = __privateGet12(this, _mediaController6)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
6032
6086
  }
6033
6087
  }
6034
6088
  disconnectedCallback() {
6035
- var _a3, _b2;
6036
- (_b2 = (_a3 = __privateGet12(this, _mediaController6)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
6089
+ var _a4, _b2;
6090
+ (_b2 = (_a4 = __privateGet12(this, _mediaController6)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
6037
6091
  __privateSet12(this, _mediaController6, null);
6038
6092
  }
6039
6093
  /**
@@ -6370,11 +6424,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
6370
6424
  setNumericAttr(this, MediaUIAttributes.MEDIA_PLAYBACK_RATE, value);
6371
6425
  }
6372
6426
  handleClick() {
6373
- var _a3, _b2;
6427
+ var _a4, _b2;
6374
6428
  const availableRates = Array.from(this.rates.values(), (str) => +str).sort(
6375
6429
  (a, b) => a - b
6376
6430
  );
6377
- const detail = (_b2 = (_a3 = availableRates.find((r) => r > this.mediaPlaybackRate)) != null ? _a3 : availableRates[0]) != null ? _b2 : DEFAULT_RATE;
6431
+ const detail = (_b2 = (_a4 = availableRates.find((r) => r > this.mediaPlaybackRate)) != null ? _a4 : availableRates[0]) != null ? _b2 : DEFAULT_RATE;
6378
6432
  const evt = new GlobalThis.CustomEvent(
6379
6433
  MediaUIEvents.MEDIA_PLAYBACK_RATE_REQUEST,
6380
6434
  { composed: true, bubbles: true, detail }
@@ -6673,7 +6727,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
6673
6727
  ];
6674
6728
  }
6675
6729
  connectedCallback() {
6676
- var _a3, _b2, _c;
6730
+ var _a4, _b2, _c;
6677
6731
  const mediaControllerId = this.getAttribute(
6678
6732
  MediaStateReceiverAttributes.MEDIA_CONTROLLER
6679
6733
  );
@@ -6682,18 +6736,18 @@ svg, img, ::slotted(svg), ::slotted(img) {
6682
6736
  this,
6683
6737
  _mediaController7,
6684
6738
  // @ts-ignore
6685
- (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(mediaControllerId)
6739
+ (_a4 = this.getRootNode()) == null ? void 0 : _a4.getElementById(mediaControllerId)
6686
6740
  );
6687
6741
  (_c = (_b2 = __privateGet15(this, _mediaController7)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
6688
6742
  }
6689
6743
  }
6690
6744
  disconnectedCallback() {
6691
- var _a3, _b2;
6692
- (_b2 = (_a3 = __privateGet15(this, _mediaController7)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
6745
+ var _a4, _b2;
6746
+ (_b2 = (_a4 = __privateGet15(this, _mediaController7)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
6693
6747
  __privateSet14(this, _mediaController7, null);
6694
6748
  }
6695
6749
  attributeChangedCallback(attrName, oldValue, newValue) {
6696
- var _a3, _b2, _c, _d, _e;
6750
+ var _a4, _b2, _c, _d, _e;
6697
6751
  if ([
6698
6752
  MediaUIAttributes.MEDIA_PREVIEW_IMAGE,
6699
6753
  MediaUIAttributes.MEDIA_PREVIEW_COORDS
@@ -6702,7 +6756,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
6702
6756
  }
6703
6757
  if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
6704
6758
  if (oldValue) {
6705
- (_b2 = (_a3 = __privateGet15(this, _mediaController7)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
6759
+ (_b2 = (_a4 = __privateGet15(this, _mediaController7)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
6706
6760
  __privateSet14(this, _mediaController7, null);
6707
6761
  }
6708
6762
  if (newValue && this.isConnected) {
@@ -7051,10 +7105,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
7051
7105
  var ButtonPressedKeys2 = ["Enter", " "];
7052
7106
  var DEFAULT_TIMES_SEP = "&nbsp;/&nbsp;";
7053
7107
  var formatTimesLabel = (el, { timesSep = DEFAULT_TIMES_SEP } = {}) => {
7054
- var _a3, _b2;
7108
+ var _a4, _b2;
7055
7109
  const showRemaining = el.hasAttribute(Attributes10.REMAINING);
7056
7110
  const showDuration = el.hasAttribute(Attributes10.SHOW_DURATION);
7057
- const currentTime = (_a3 = el.mediaCurrentTime) != null ? _a3 : 0;
7111
+ const currentTime = (_a4 = el.mediaCurrentTime) != null ? _a4 : 0;
7058
7112
  const [, seekableEnd] = (_b2 = el.mediaSeekable) != null ? _b2 : [];
7059
7113
  let endTime = 0;
7060
7114
  if (Number.isFinite(el.mediaDuration)) {
@@ -7069,9 +7123,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
7069
7123
  };
7070
7124
  var DEFAULT_MISSING_TIME_PHRASE = "video not loaded, unknown time.";
7071
7125
  var updateAriaValueText = (el) => {
7072
- var _a3;
7126
+ var _a4;
7073
7127
  const currentTime = el.mediaCurrentTime;
7074
- const [, seekableEnd] = (_a3 = el.mediaSeekable) != null ? _a3 : [];
7128
+ const [, seekableEnd] = (_a4 = el.mediaSeekable) != null ? _a4 : [];
7075
7129
  let endTime = null;
7076
7130
  if (Number.isFinite(el.mediaDuration)) {
7077
7131
  endTime = el.mediaDuration;
@@ -7108,7 +7162,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
7108
7162
  this.shadowRoot,
7109
7163
  ":host(:hover:not([notoggle]))"
7110
7164
  );
7111
- style.setProperty("cursor", "pointer");
7165
+ style.setProperty("cursor", "var(--media-cursor, pointer)");
7112
7166
  style.setProperty(
7113
7167
  "background",
7114
7168
  "var(--media-control-hover-background, rgba(50 50 70 / .7))"
@@ -7715,18 +7769,18 @@ svg, img, ::slotted(svg), ::slotted(img) {
7715
7769
  ];
7716
7770
  }
7717
7771
  connectedCallback() {
7718
- var _a3;
7772
+ var _a4;
7719
7773
  super.connectedCallback();
7720
7774
  this.range.setAttribute("aria-label", t("seek"));
7721
7775
  __privateMethod6(this, _toggleRangeAnimation, toggleRangeAnimation_fn).call(this);
7722
7776
  __privateSet18(this, _rootNode, this.getRootNode());
7723
- (_a3 = __privateGet19(this, _rootNode)) == null ? void 0 : _a3.addEventListener("transitionstart", this);
7777
+ (_a4 = __privateGet19(this, _rootNode)) == null ? void 0 : _a4.addEventListener("transitionstart", this);
7724
7778
  }
7725
7779
  disconnectedCallback() {
7726
- var _a3;
7780
+ var _a4;
7727
7781
  super.disconnectedCallback();
7728
7782
  __privateMethod6(this, _toggleRangeAnimation, toggleRangeAnimation_fn).call(this);
7729
- (_a3 = __privateGet19(this, _rootNode)) == null ? void 0 : _a3.removeEventListener("transitionstart", this);
7783
+ (_a4 = __privateGet19(this, _rootNode)) == null ? void 0 : _a4.removeEventListener("transitionstart", this);
7730
7784
  __privateSet18(this, _rootNode, null);
7731
7785
  }
7732
7786
  attributeChangedCallback(attrName, oldValue, newValue) {
@@ -7753,10 +7807,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
7753
7807
  return __privateGet19(this, _mediaChaptersCues);
7754
7808
  }
7755
7809
  set mediaChaptersCues(value) {
7756
- var _a3;
7810
+ var _a4;
7757
7811
  __privateSet18(this, _mediaChaptersCues, value);
7758
7812
  this.updateSegments(
7759
- (_a3 = __privateGet19(this, _mediaChaptersCues)) == null ? void 0 : _a3.map((c) => ({
7813
+ (_a4 = __privateGet19(this, _mediaChaptersCues)) == null ? void 0 : _a4.map((c) => ({
7760
7814
  start: calcRangeValueFromTime(this, c.startTime),
7761
7815
  end: calcRangeValueFromTime(this, c.endTime)
7762
7816
  }))
@@ -7846,13 +7900,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
7846
7900
  *
7847
7901
  */
7848
7902
  get mediaSeekableEnd() {
7849
- var _a3;
7850
- const [, end = this.mediaDuration] = (_a3 = this.mediaSeekable) != null ? _a3 : [];
7903
+ var _a4;
7904
+ const [, end = this.mediaDuration] = (_a4 = this.mediaSeekable) != null ? _a4 : [];
7851
7905
  return end;
7852
7906
  }
7853
7907
  get mediaSeekableStart() {
7854
- var _a3;
7855
- const [start = 0] = (_a3 = this.mediaSeekable) != null ? _a3 : [];
7908
+ var _a4;
7909
+ const [start = 0] = (_a4 = this.mediaSeekable) != null ? _a4 : [];
7856
7910
  return start;
7857
7911
  }
7858
7912
  /**
@@ -7889,7 +7943,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
7889
7943
  this.updateCurrentBox();
7890
7944
  }
7891
7945
  updateBufferedBar() {
7892
- var _a3;
7946
+ var _a4;
7893
7947
  const buffered = this.mediaBuffered;
7894
7948
  if (!buffered.length) {
7895
7949
  return;
@@ -7897,9 +7951,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
7897
7951
  let relativeBufferedEnd;
7898
7952
  if (!this.mediaEnded) {
7899
7953
  const currentTime = this.mediaCurrentTime;
7900
- const [, bufferedEnd = this.mediaSeekableStart] = (_a3 = buffered.find(
7954
+ const [, bufferedEnd = this.mediaSeekableStart] = (_a4 = buffered.find(
7901
7955
  ([start, end]) => start <= currentTime && currentTime <= end
7902
- )) != null ? _a3 : [];
7956
+ )) != null ? _a4 : [];
7903
7957
  relativeBufferedEnd = calcRangeValueFromTime(this, bufferedEnd);
7904
7958
  } else {
7905
7959
  relativeBufferedEnd = 1;
@@ -7975,8 +8029,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
7975
8029
  _updateRange = /* @__PURE__ */ new WeakMap();
7976
8030
  _getElementRects = /* @__PURE__ */ new WeakSet();
7977
8031
  getElementRects_fn = function(box) {
7978
- var _a3;
7979
- const bounds = (_a3 = this.getAttribute("bounds") ? closestComposedNode(this, `#${this.getAttribute("bounds")}`) : this.parentElement) != null ? _a3 : this;
8032
+ var _a4;
8033
+ const bounds = (_a4 = this.getAttribute("bounds") ? closestComposedNode(this, `#${this.getAttribute("bounds")}`) : this.parentElement) != null ? _a4 : this;
7980
8034
  const boundsRect = bounds.getBoundingClientRect();
7981
8035
  const rangeRect = this.range.getBoundingClientRect();
7982
8036
  const width = box.offsetWidth;
@@ -8203,7 +8257,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
8203
8257
  constructor() {
8204
8258
  super();
8205
8259
  this.updateXOffset = () => {
8206
- var _a3;
8260
+ var _a4;
8207
8261
  if (!isElementVisible(this, { checkOpacity: false, checkVisibilityCSS: false }))
8208
8262
  return;
8209
8263
  const placement = this.placement;
@@ -8212,7 +8266,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
8212
8266
  return;
8213
8267
  }
8214
8268
  const tooltipStyle = getComputedStyle(this);
8215
- const containingEl = (_a3 = closestComposedNode(this, "#" + this.bounds)) != null ? _a3 : getMediaController(this);
8269
+ const containingEl = (_a4 = closestComposedNode(this, "#" + this.bounds)) != null ? _a4 : getMediaController(this);
8216
8270
  if (!containingEl)
8217
8271
  return;
8218
8272
  const { x: containerX, width: containerWidth } = containingEl.getBoundingClientRect();
@@ -8409,14 +8463,14 @@ svg, img, ::slotted(svg), ::slotted(img) {
8409
8463
  };
8410
8464
  var TemplateInstance = class extends GlobalThis.DocumentFragment {
8411
8465
  constructor(template18, state, processor2 = defaultProcessor) {
8412
- var _a3;
8466
+ var _a4;
8413
8467
  super();
8414
8468
  __privateAdd20(this, _parts, void 0);
8415
8469
  __privateAdd20(this, _processor, void 0);
8416
8470
  this.append(template18.content.cloneNode(true));
8417
8471
  __privateSet19(this, _parts, parse(this));
8418
8472
  __privateSet19(this, _processor, processor2);
8419
- (_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this, __privateGet20(this, _parts), state);
8473
+ (_a4 = processor2.createCallback) == null ? void 0 : _a4.call(processor2, this, __privateGet20(this, _parts), state);
8420
8474
  processor2.processCallback(this, __privateGet20(this, _parts), state);
8421
8475
  }
8422
8476
  update(state) {
@@ -8704,7 +8758,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
8704
8758
  state[part.expression] = new PartialTemplate(part.template);
8705
8759
  },
8706
8760
  if: (part, state) => {
8707
- var _a3;
8761
+ var _a4;
8708
8762
  if (evaluateExpression(part.expression, state)) {
8709
8763
  if (templates.get(part) !== part.template) {
8710
8764
  templates.set(part, part.template);
@@ -8712,7 +8766,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
8712
8766
  part.replace(tpl);
8713
8767
  templateInstances.set(part, tpl);
8714
8768
  } else {
8715
- (_a3 = templateInstances.get(part)) == null ? void 0 : _a3.update(state);
8769
+ (_a4 = templateInstances.get(part)) == null ? void 0 : _a4.update(state);
8716
8770
  }
8717
8771
  } else {
8718
8772
  part.replace("");
@@ -8724,7 +8778,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
8724
8778
  var DirectiveNames = Object.keys(Directives);
8725
8779
  var processor = {
8726
8780
  processCallback(instance, parts, state) {
8727
- var _a3, _b2;
8781
+ var _a4, _b2;
8728
8782
  if (!state)
8729
8783
  return;
8730
8784
  for (const [expression, part] of parts) {
@@ -8738,7 +8792,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
8738
8792
  part.expression = part.template.getAttribute(directive);
8739
8793
  }
8740
8794
  }
8741
- (_a3 = Directives[part.directive]) == null ? void 0 : _a3.call(Directives, part, state);
8795
+ (_a4 = Directives[part.directive]) == null ? void 0 : _a4.call(Directives, part, state);
8742
8796
  continue;
8743
8797
  }
8744
8798
  let value = evaluateExpression(expression, state);
@@ -8795,8 +8849,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
8795
8849
  "<=": (a, b) => a <= b,
8796
8850
  "??": (a, b) => a != null ? a : b,
8797
8851
  "|": (a, b) => {
8798
- var _a3;
8799
- return (_a3 = pipeModifiers[b]) == null ? void 0 : _a3.call(pipeModifiers, a);
8852
+ var _a4;
8853
+ return (_a4 = pipeModifiers[b]) == null ? void 0 : _a4.call(pipeModifiers, a);
8800
8854
  }
8801
8855
  };
8802
8856
  function tokenizeExpression(expr) {
@@ -8810,12 +8864,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
8810
8864
  }).filter(({ type }) => type !== "ws");
8811
8865
  }
8812
8866
  function evaluateExpression(expr, state = {}) {
8813
- var _a3, _b2, _c, _d, _e, _f, _g;
8867
+ var _a4, _b2, _c, _d, _e, _f, _g;
8814
8868
  const tokens = tokenizeExpression(expr);
8815
8869
  if (tokens.length === 0 || tokens.some(({ type }) => !type)) {
8816
8870
  return invalidExpression(expr);
8817
8871
  }
8818
- if (((_a3 = tokens[0]) == null ? void 0 : _a3.token) === ">") {
8872
+ if (((_a4 = tokens[0]) == null ? void 0 : _a4.token) === ">") {
8819
8873
  const partial = state[(_b2 = tokens[1]) == null ? void 0 : _b2.token];
8820
8874
  if (!partial) {
8821
8875
  return invalidExpression(expr);
@@ -8993,8 +9047,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
8993
9047
  this.createRenderer();
8994
9048
  }
8995
9049
  const observer2 = new MutationObserver((mutationList) => {
8996
- var _a3;
8997
- if (this.mediaController && !((_a3 = this.mediaController) == null ? void 0 : _a3.breakpointsComputed))
9050
+ var _a4;
9051
+ if (this.mediaController && !((_a4 = this.mediaController) == null ? void 0 : _a4.breakpointsComputed))
8998
9052
  return;
8999
9053
  if (mutationList.some((mutation) => {
9000
9054
  const target = mutation.target;
@@ -9027,8 +9081,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
9027
9081
  return this.renderRoot.querySelector("media-controller");
9028
9082
  }
9029
9083
  get template() {
9030
- var _a3;
9031
- return (_a3 = __privateGet21(this, _template)) != null ? _a3 : this.constructor.template;
9084
+ var _a4;
9085
+ return (_a4 = __privateGet21(this, _template)) != null ? _a4 : this.constructor.template;
9032
9086
  }
9033
9087
  set template(element) {
9034
9088
  __privateSet20(this, _prevTemplateId, null);
@@ -9036,9 +9090,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
9036
9090
  this.createRenderer();
9037
9091
  }
9038
9092
  get props() {
9039
- var _a3, _b2, _c;
9093
+ var _a4, _b2, _c;
9040
9094
  const observedAttributes2 = [
9041
- ...Array.from((_b2 = (_a3 = this.mediaController) == null ? void 0 : _a3.attributes) != null ? _b2 : []).filter(
9095
+ ...Array.from((_b2 = (_a4 = this.mediaController) == null ? void 0 : _a4.attributes) != null ? _b2 : []).filter(
9042
9096
  ({ name }) => {
9043
9097
  return observedMediaAttributes[name] || name.startsWith("breakpoint");
9044
9098
  }
@@ -9085,8 +9139,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
9085
9139
  }
9086
9140
  }
9087
9141
  render() {
9088
- var _a3;
9089
- (_a3 = this.renderer) == null ? void 0 : _a3.update(this.props);
9142
+ var _a4;
9143
+ (_a4 = this.renderer) == null ? void 0 : _a4.update(this.props);
9090
9144
  }
9091
9145
  };
9092
9146
  _template = /* @__PURE__ */ new WeakMap();
@@ -9102,12 +9156,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
9102
9156
  };
9103
9157
  _updateTemplate = /* @__PURE__ */ new WeakSet();
9104
9158
  updateTemplate_fn = function() {
9105
- var _a3;
9159
+ var _a4;
9106
9160
  const templateId = this.getAttribute("template");
9107
9161
  if (!templateId || templateId === __privateGet21(this, _prevTemplateId))
9108
9162
  return;
9109
9163
  const rootNode = this.getRootNode();
9110
- const template18 = (_a3 = rootNode == null ? void 0 : rootNode.getElementById) == null ? void 0 : _a3.call(rootNode, templateId);
9164
+ const template18 = (_a4 = rootNode == null ? void 0 : rootNode.getElementById) == null ? void 0 : _a4.call(rootNode, templateId);
9111
9165
  if (template18) {
9112
9166
  __privateSet20(this, _prevTemplateId, templateId);
9113
9167
  __privateSet20(this, _template, template18);
@@ -9175,9 +9229,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
9175
9229
  };
9176
9230
  }
9177
9231
  function getRectRelativeToOffsetParent(element, offsetParent) {
9178
- var _a3;
9232
+ var _a4;
9179
9233
  const rect = element.getBoundingClientRect();
9180
- const offsetRect = (_a3 = offsetParent == null ? void 0 : offsetParent.getBoundingClientRect()) != null ? _a3 : { x: 0, y: 0 };
9234
+ const offsetRect = (_a4 = offsetParent == null ? void 0 : offsetParent.getBoundingClientRect()) != null ? _a4 : { x: 0, y: 0 };
9181
9235
  return {
9182
9236
  x: rect.x - offsetRect.x,
9183
9237
  y: rect.y - offsetRect.y,
@@ -9451,12 +9505,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
9451
9505
  slot[name="header"]::slotted(*) {
9452
9506
  padding: .4em .7em;
9453
9507
  border-bottom: 1px solid rgb(255 255 255 / .25);
9454
- cursor: default;
9508
+ cursor: var(--media-cursor, default);
9455
9509
  }
9456
9510
 
9457
9511
  slot[name="header"] > button[part~="back"],
9458
9512
  slot[name="header"]::slotted(button[part~="back"]) {
9459
- cursor: pointer;
9513
+ cursor: var(--media-cursor, pointer);
9460
9514
  }
9461
9515
 
9462
9516
  svg[part~="back"] {
@@ -9648,7 +9702,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
9648
9702
  }
9649
9703
  }
9650
9704
  connectedCallback() {
9651
- var _a3, _b2;
9705
+ var _a4, _b2;
9652
9706
  __privateSet21(this, _cssRule, insertCSSRule(this.shadowRoot, ":host"));
9653
9707
  __privateMethod8(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
9654
9708
  if (!this.hasAttribute("disabled")) {
@@ -9658,22 +9712,22 @@ svg, img, ::slotted(svg), ::slotted(img) {
9658
9712
  this.role = "menu";
9659
9713
  }
9660
9714
  __privateSet21(this, _mediaController8, getAttributeMediaController(this));
9661
- (_b2 = (_a3 = __privateGet22(this, _mediaController8)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
9715
+ (_b2 = (_a4 = __privateGet22(this, _mediaController8)) == null ? void 0 : _a4.associateElement) == null ? void 0 : _b2.call(_a4, this);
9662
9716
  if (!this.hidden) {
9663
9717
  observeResize(getBoundsElement(this), __privateGet22(this, _handleBoundsResize));
9664
9718
  observeResize(this, __privateGet22(this, _handleMenuResize));
9665
9719
  }
9666
9720
  }
9667
9721
  disconnectedCallback() {
9668
- var _a3, _b2;
9722
+ var _a4, _b2;
9669
9723
  unobserveResize(getBoundsElement(this), __privateGet22(this, _handleBoundsResize));
9670
9724
  unobserveResize(this, __privateGet22(this, _handleMenuResize));
9671
9725
  this.disable();
9672
- (_b2 = (_a3 = __privateGet22(this, _mediaController8)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
9726
+ (_b2 = (_a4 = __privateGet22(this, _mediaController8)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
9673
9727
  __privateSet21(this, _mediaController8, null);
9674
9728
  }
9675
9729
  attributeChangedCallback(attrName, oldValue, newValue) {
9676
- var _a3, _b2, _c, _d;
9730
+ var _a4, _b2, _c, _d;
9677
9731
  if (attrName === Attributes12.HIDDEN && newValue !== oldValue) {
9678
9732
  if (!__privateGet22(this, _isPopover))
9679
9733
  __privateSet21(this, _isPopover, true);
@@ -9691,7 +9745,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
9691
9745
  );
9692
9746
  } else if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
9693
9747
  if (oldValue) {
9694
- (_b2 = (_a3 = __privateGet22(this, _mediaController8)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
9748
+ (_b2 = (_a4 = __privateGet22(this, _mediaController8)) == null ? void 0 : _a4.unassociateElement) == null ? void 0 : _b2.call(_a4, this);
9695
9749
  __privateSet21(this, _mediaController8, null);
9696
9750
  }
9697
9751
  if (newValue && this.isConnected) {
@@ -9724,9 +9778,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
9724
9778
  * Returns the anchor element when it is a floating menu.
9725
9779
  */
9726
9780
  get anchorElement() {
9727
- var _a3;
9781
+ var _a4;
9728
9782
  if (this.anchor) {
9729
- return (_a3 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a3.querySelector(
9783
+ return (_a4 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a4.querySelector(
9730
9784
  `#${this.anchor}`
9731
9785
  );
9732
9786
  }
@@ -9745,8 +9799,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
9745
9799
  return this.items.filter((item) => item.checked);
9746
9800
  }
9747
9801
  get value() {
9748
- var _a3, _b2;
9749
- return (_b2 = (_a3 = this.checkedItems[0]) == null ? void 0 : _a3.value) != null ? _b2 : "";
9802
+ var _a4, _b2;
9803
+ return (_b2 = (_a4 = this.checkedItems[0]) == null ? void 0 : _a4.value) != null ? _b2 : "";
9750
9804
  }
9751
9805
  set value(newValue) {
9752
9806
  const item = this.items.find((item2) => item2.value === newValue);
@@ -9767,13 +9821,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
9767
9821
  focusable == null ? void 0 : focusable.focus();
9768
9822
  }
9769
9823
  handleSelect(event) {
9770
- var _a3;
9824
+ var _a4;
9771
9825
  const item = __privateMethod8(this, _getItem, getItem_fn).call(this, event);
9772
9826
  if (!item)
9773
9827
  return;
9774
9828
  __privateMethod8(this, _selectItem, selectItem_fn).call(this, item, item.type === "checkbox");
9775
9829
  if (__privateGet22(this, _invokerElement2) && !this.hidden) {
9776
- (_a3 = __privateGet22(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
9830
+ (_a4 = __privateGet22(this, _previouslyFocused2)) == null ? void 0 : _a4.focus();
9777
9831
  this.hidden = true;
9778
9832
  }
9779
9833
  }
@@ -9790,10 +9844,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
9790
9844
  ];
9791
9845
  }
9792
9846
  handleMove(event) {
9793
- var _a3, _b2;
9847
+ var _a4, _b2;
9794
9848
  const { key } = event;
9795
9849
  const items = this.items;
9796
- const currentItem = (_b2 = (_a3 = __privateMethod8(this, _getItem, getItem_fn).call(this, event)) != null ? _a3 : __privateMethod8(this, _getTabItem, getTabItem_fn).call(this)) != null ? _b2 : items[0];
9850
+ const currentItem = (_b2 = (_a4 = __privateMethod8(this, _getItem, getItem_fn).call(this, event)) != null ? _a4 : __privateMethod8(this, _getTabItem, getTabItem_fn).call(this)) != null ? _b2 : items[0];
9797
9851
  const currentIndex = items.indexOf(currentItem);
9798
9852
  let index = Math.max(0, currentIndex);
9799
9853
  if (key === "ArrowDown") {
@@ -9843,9 +9897,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
9843
9897
  _handleMenuItems = /* @__PURE__ */ new WeakMap();
9844
9898
  _updateLayoutStyle = /* @__PURE__ */ new WeakSet();
9845
9899
  updateLayoutStyle_fn = function() {
9846
- var _a3;
9900
+ var _a4;
9847
9901
  const layoutRowStyle = this.shadowRoot.querySelector("#layout-row");
9848
- const menuLayout = (_a3 = getComputedStyle(this).getPropertyValue("--media-menu-layout")) == null ? void 0 : _a3.trim();
9902
+ const menuLayout = (_a4 = getComputedStyle(this).getPropertyValue("--media-menu-layout")) == null ? void 0 : _a4.trim();
9849
9903
  layoutRowStyle.setAttribute("media", menuLayout === "row" ? "" : "width:0");
9850
9904
  };
9851
9905
  _handleInvoke2 = /* @__PURE__ */ new WeakSet();
@@ -9857,16 +9911,16 @@ svg, img, ::slotted(svg), ::slotted(img) {
9857
9911
  };
9858
9912
  _handleOpen2 = /* @__PURE__ */ new WeakSet();
9859
9913
  handleOpen_fn2 = function() {
9860
- var _a3;
9861
- (_a3 = __privateGet22(this, _invokerElement2)) == null ? void 0 : _a3.setAttribute("aria-expanded", "true");
9914
+ var _a4;
9915
+ (_a4 = __privateGet22(this, _invokerElement2)) == null ? void 0 : _a4.setAttribute("aria-expanded", "true");
9862
9916
  this.addEventListener("transitionend", () => this.focus(), { once: true });
9863
9917
  observeResize(getBoundsElement(this), __privateGet22(this, _handleBoundsResize));
9864
9918
  observeResize(this, __privateGet22(this, _handleMenuResize));
9865
9919
  };
9866
9920
  _handleClosed2 = /* @__PURE__ */ new WeakSet();
9867
9921
  handleClosed_fn2 = function() {
9868
- var _a3;
9869
- (_a3 = __privateGet22(this, _invokerElement2)) == null ? void 0 : _a3.setAttribute("aria-expanded", "false");
9922
+ var _a4;
9923
+ (_a4 = __privateGet22(this, _invokerElement2)) == null ? void 0 : _a4.setAttribute("aria-expanded", "false");
9870
9924
  unobserveResize(getBoundsElement(this), __privateGet22(this, _handleBoundsResize));
9871
9925
  unobserveResize(this, __privateGet22(this, _handleMenuResize));
9872
9926
  };
@@ -9928,10 +9982,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
9928
9982
  };
9929
9983
  _handleClick = /* @__PURE__ */ new WeakSet();
9930
9984
  handleClick_fn = function(event) {
9931
- var _a3;
9985
+ var _a4;
9932
9986
  event.stopPropagation();
9933
9987
  if (event.composedPath().includes(__privateGet22(this, _backButtonElement, backButtonElement_get))) {
9934
- (_a3 = __privateGet22(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
9988
+ (_a4 = __privateGet22(this, _previouslyFocused2)) == null ? void 0 : _a4.focus();
9935
9989
  this.hidden = true;
9936
9990
  return;
9937
9991
  }
@@ -9943,11 +9997,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
9943
9997
  };
9944
9998
  _backButtonElement = /* @__PURE__ */ new WeakSet();
9945
9999
  backButtonElement_get = function() {
9946
- var _a3;
10000
+ var _a4;
9947
10001
  const headerSlot = this.shadowRoot.querySelector(
9948
10002
  'slot[name="header"]'
9949
10003
  );
9950
- return (_a3 = headerSlot.assignedElements({ flatten: true })) == null ? void 0 : _a3.find((el) => el.matches('button[part~="back"]'));
10004
+ return (_a4 = headerSlot.assignedElements({ flatten: true })) == null ? void 0 : _a4.find((el) => el.matches('button[part~="back"]'));
9951
10005
  };
9952
10006
  _handleToggle = /* @__PURE__ */ new WeakSet();
9953
10007
  handleToggle_fn = function(event) {
@@ -9979,10 +10033,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
9979
10033
  };
9980
10034
  _handleFocusOut2 = /* @__PURE__ */ new WeakSet();
9981
10035
  handleFocusOut_fn2 = function(event) {
9982
- var _a3;
10036
+ var _a4;
9983
10037
  if (!containsComposedNode(this, event.relatedTarget)) {
9984
10038
  if (__privateGet22(this, _isPopover)) {
9985
- (_a3 = __privateGet22(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
10039
+ (_a4 = __privateGet22(this, _previouslyFocused2)) == null ? void 0 : _a4.focus();
9986
10040
  }
9987
10041
  if (__privateGet22(this, _invokerElement2) && __privateGet22(this, _invokerElement2) !== event.relatedTarget && !this.hidden) {
9988
10042
  this.hidden = true;
@@ -9991,7 +10045,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
9991
10045
  };
9992
10046
  _handleKeyDown2 = /* @__PURE__ */ new WeakSet();
9993
10047
  handleKeyDown_fn2 = function(event) {
9994
- var _a3, _b2, _c, _d, _e;
10048
+ var _a4, _b2, _c, _d, _e;
9995
10049
  const { key, ctrlKey, altKey, metaKey } = event;
9996
10050
  if (ctrlKey || altKey || metaKey) {
9997
10051
  return;
@@ -10007,7 +10061,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
10007
10061
  return;
10008
10062
  }
10009
10063
  if (event.shiftKey) {
10010
- (_b2 = (_a3 = this.previousElementSibling) == null ? void 0 : _a3.focus) == null ? void 0 : _b2.call(_a3);
10064
+ (_b2 = (_a4 = this.previousElementSibling) == null ? void 0 : _a4.focus) == null ? void 0 : _b2.call(_a4);
10011
10065
  } else {
10012
10066
  (_d = (_c = this.nextElementSibling) == null ? void 0 : _c.focus) == null ? void 0 : _d.call(_c);
10013
10067
  }
@@ -10065,8 +10119,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
10065
10119
  );
10066
10120
  }
10067
10121
  function getBoundsElement(host) {
10068
- var _a3;
10069
- return (_a3 = host.getAttribute("bounds") ? closestComposedNode(host, `#${host.getAttribute("bounds")}`) : getMediaController(host) || host.parentElement) != null ? _a3 : host;
10122
+ var _a4;
10123
+ return (_a4 = host.getAttribute("bounds") ? closestComposedNode(host, `#${host.getAttribute("bounds")}`) : getMediaController(host) || host.parentElement) != null ? _a4 : host;
10070
10124
  }
10071
10125
  if (!GlobalThis.customElements.get("media-chrome-menu")) {
10072
10126
  GlobalThis.customElements.define("media-chrome-menu", MediaChromeMenu);
@@ -10121,7 +10175,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
10121
10175
  );
10122
10176
  outline: var(--media-menu-item-outline, 0);
10123
10177
  outline-offset: var(--media-menu-item-outline-offset, -1px);
10124
- cursor: pointer;
10178
+ cursor: var(--media-cursor, pointer);
10125
10179
  display: flex;
10126
10180
  align-items: center;
10127
10181
  align-self: stretch;
@@ -10139,7 +10193,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
10139
10193
  }
10140
10194
 
10141
10195
  :host(:hover) {
10142
- cursor: pointer;
10196
+ cursor: var(--media-cursor, pointer);
10143
10197
  background: var(--media-menu-item-hover-background, rgb(92 92 102 / .5));
10144
10198
  outline: var(--media-menu-item-hover-outline);
10145
10199
  outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));
@@ -10249,12 +10303,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
10249
10303
  __privateAdd23(this, _dirty, false);
10250
10304
  __privateAdd23(this, _ownerElement, void 0);
10251
10305
  __privateAdd23(this, _handleMenuItem, () => {
10252
- var _a3, _b2;
10306
+ var _a4, _b2;
10253
10307
  this.setAttribute("submenusize", `${this.submenuElement.items.length}`);
10254
10308
  const descriptionSlot = this.shadowRoot.querySelector(
10255
10309
  'slot[name="description"]'
10256
10310
  );
10257
- const checkedItem = (_a3 = this.submenuElement.checkedItems) == null ? void 0 : _a3[0];
10311
+ const checkedItem = (_a4 = this.submenuElement.checkedItems) == null ? void 0 : _a4[0];
10258
10312
  const description = (_b2 = checkedItem == null ? void 0 : checkedItem.dataset.description) != null ? _b2 : checkedItem == null ? void 0 : checkedItem.text;
10259
10313
  const span = Document2.createElement("span");
10260
10314
  span.textContent = description != null ? description : "";
@@ -10343,9 +10397,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
10343
10397
  * or the slotted submenu element.
10344
10398
  */
10345
10399
  get invokeTargetElement() {
10346
- var _a3;
10400
+ var _a4;
10347
10401
  if (this.invokeTarget) {
10348
- return (_a3 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a3.querySelector(
10402
+ return (_a4 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a4.querySelector(
10349
10403
  `#${this.invokeTarget}`
10350
10404
  );
10351
10405
  }
@@ -10363,22 +10417,22 @@ svg, img, ::slotted(svg), ::slotted(img) {
10363
10417
  })[0];
10364
10418
  }
10365
10419
  get type() {
10366
- var _a3;
10367
- return (_a3 = this.getAttribute(Attributes13.TYPE)) != null ? _a3 : "";
10420
+ var _a4;
10421
+ return (_a4 = this.getAttribute(Attributes13.TYPE)) != null ? _a4 : "";
10368
10422
  }
10369
10423
  set type(val) {
10370
10424
  this.setAttribute(Attributes13.TYPE, `${val}`);
10371
10425
  }
10372
10426
  get value() {
10373
- var _a3;
10374
- return (_a3 = this.getAttribute(Attributes13.VALUE)) != null ? _a3 : this.text;
10427
+ var _a4;
10428
+ return (_a4 = this.getAttribute(Attributes13.VALUE)) != null ? _a4 : this.text;
10375
10429
  }
10376
10430
  set value(val) {
10377
10431
  this.setAttribute(Attributes13.VALUE, val);
10378
10432
  }
10379
10433
  get text() {
10380
- var _a3;
10381
- return ((_a3 = this.textContent) != null ? _a3 : "").trim();
10434
+ var _a4;
10435
+ return ((_a4 = this.textContent) != null ? _a4 : "").trim();
10382
10436
  }
10383
10437
  get checked() {
10384
10438
  if (!isCheckable(this))
@@ -10478,8 +10532,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
10478
10532
  };
10479
10533
  _reset = /* @__PURE__ */ new WeakSet();
10480
10534
  reset_fn = function() {
10481
- var _a3;
10482
- const items = (_a3 = __privateGet23(this, _ownerElement)) == null ? void 0 : _a3.radioGroupItems;
10535
+ var _a4;
10536
+ const items = (_a4 = __privateGet23(this, _ownerElement)) == null ? void 0 : _a4.radioGroupItems;
10483
10537
  if (!items)
10484
10538
  return;
10485
10539
  let checkedItem = items.filter((item) => item.getAttribute("aria-checked") === "true").pop();
@@ -10568,7 +10622,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
10568
10622
  }
10569
10623
 
10570
10624
  // ../../node_modules/media-chrome/dist/menu/media-settings-menu-item.js
10571
- var _a;
10625
+ var _a2;
10572
10626
  var template15 = Document2.createElement("template");
10573
10627
  template15.innerHTML = MediaChromeMenuItem.template.innerHTML + /*html*/
10574
10628
  `
@@ -10582,7 +10636,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
10582
10636
  }
10583
10637
  </style>
10584
10638
  `;
10585
- if ((_a = template15.content) == null ? void 0 : _a.querySelector) {
10639
+ if ((_a2 = template15.content) == null ? void 0 : _a2.querySelector) {
10586
10640
  template15.content.querySelector('slot[name="suffix"]').innerHTML = /*html*/
10587
10641
  `
10588
10642
  <svg aria-hidden="true" viewBox="0 0 20 24">
@@ -10619,17 +10673,17 @@ svg, img, ::slotted(svg), ::slotted(img) {
10619
10673
  * @return {HTMLElement | null}
10620
10674
  */
10621
10675
  get invokeTargetElement() {
10622
- var _a3;
10676
+ var _a4;
10623
10677
  if (this.invokeTarget) {
10624
- return (_a3 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a3.querySelector(
10678
+ return (_a4 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a4.querySelector(
10625
10679
  `#${this.invokeTarget}`
10626
10680
  );
10627
10681
  }
10628
10682
  return null;
10629
10683
  }
10630
10684
  handleClick() {
10631
- var _a3;
10632
- (_a3 = this.invokeTargetElement) == null ? void 0 : _a3.dispatchEvent(
10685
+ var _a4;
10686
+ (_a4 = this.invokeTargetElement) == null ? void 0 : _a4.dispatchEvent(
10633
10687
  new InvokeEvent({ relatedTarget: this })
10634
10688
  );
10635
10689
  }
@@ -10750,10 +10804,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
10750
10804
  * Returns the anchor element when it is a floating menu.
10751
10805
  */
10752
10806
  get anchorElement() {
10753
- var _a3;
10807
+ var _a4;
10754
10808
  if (this.anchor !== "auto")
10755
10809
  return super.anchorElement;
10756
- return (_a3 = getMediaController(this)) == null ? void 0 : _a3.querySelector(
10810
+ return (_a4 = getMediaController(this)) == null ? void 0 : _a4.querySelector(
10757
10811
  "media-audio-track-menu-button"
10758
10812
  );
10759
10813
  }
@@ -10768,8 +10822,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
10768
10822
  * Get enabled audio track id.
10769
10823
  */
10770
10824
  get mediaAudioTrackEnabled() {
10771
- var _a3;
10772
- return (_a3 = getStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED)) != null ? _a3 : "";
10825
+ var _a4;
10826
+ return (_a4 = getStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED)) != null ? _a4 : "";
10773
10827
  }
10774
10828
  set mediaAudioTrackEnabled(id) {
10775
10829
  setStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED, id);
@@ -10858,18 +10912,18 @@ svg, img, ::slotted(svg), ::slotted(img) {
10858
10912
  * @return {HTMLElement | null}
10859
10913
  */
10860
10914
  get invokeTargetElement() {
10861
- var _a3;
10915
+ var _a4;
10862
10916
  if (this.invokeTarget != void 0)
10863
10917
  return super.invokeTargetElement;
10864
- return (_a3 = getMediaController(this)) == null ? void 0 : _a3.querySelector("media-audio-track-menu");
10918
+ return (_a4 = getMediaController(this)) == null ? void 0 : _a4.querySelector("media-audio-track-menu");
10865
10919
  }
10866
10920
  /**
10867
10921
  * Get enabled audio track id.
10868
10922
  * @return {string}
10869
10923
  */
10870
10924
  get mediaAudioTrackEnabled() {
10871
- var _a3;
10872
- return (_a3 = getStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED)) != null ? _a3 : "";
10925
+ var _a4;
10926
+ return (_a4 = getStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED)) != null ? _a4 : "";
10873
10927
  }
10874
10928
  set mediaAudioTrackEnabled(id) {
10875
10929
  setStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED, id);
@@ -10986,7 +11040,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
10986
11040
  _prevState2 = /* @__PURE__ */ new WeakMap();
10987
11041
  _render2 = /* @__PURE__ */ new WeakSet();
10988
11042
  render_fn2 = function() {
10989
- var _a3;
11043
+ var _a4;
10990
11044
  if (__privateGet25(this, _prevState2) === JSON.stringify(this.mediaSubtitlesList))
10991
11045
  return;
10992
11046
  __privateSet24(this, _prevState2, JSON.stringify(this.mediaSubtitlesList));
@@ -11009,7 +11063,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
11009
11063
  checked: this.value == formatTextTrackObj(subs)
11010
11064
  });
11011
11065
  item2.prepend(createIndicator(this, "checked-indicator"));
11012
- const type = (_a3 = subs.kind) != null ? _a3 : "subs";
11066
+ const type = (_a4 = subs.kind) != null ? _a4 : "subs";
11013
11067
  if (type === "captions") {
11014
11068
  item2.append(createIndicator(this, "captions-indicator"));
11015
11069
  }
@@ -11145,10 +11199,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
11145
11199
  * @return {HTMLElement | null}
11146
11200
  */
11147
11201
  get invokeTargetElement() {
11148
- var _a3;
11202
+ var _a4;
11149
11203
  if (this.invokeTarget != void 0)
11150
11204
  return super.invokeTargetElement;
11151
- return (_a3 = getMediaController(this)) == null ? void 0 : _a3.querySelector("media-captions-menu");
11205
+ return (_a4 = getMediaController(this)) == null ? void 0 : _a4.querySelector("media-captions-menu");
11152
11206
  }
11153
11207
  /**
11154
11208
  * An array of TextTrack-like objects.
@@ -11670,8 +11724,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
11670
11724
  }
11671
11725
 
11672
11726
  // ../../node_modules/player.style/themes/microvideo/dist/media-theme.js
11673
- var _a2, _b;
11674
- var template17 = (_b = (_a2 = GlobalThis.document) == null ? void 0 : _a2.createElement) == null ? void 0 : _b.call(_a2, "template");
11727
+ var _a3, _b;
11728
+ var template17 = (_b = (_a3 = GlobalThis.document) == null ? void 0 : _a3.createElement) == null ? void 0 : _b.call(_a3, "template");
11675
11729
  if (template17) {
11676
11730
  template17.innerHTML = /*html*/
11677
11731
  `