@mux/mux-player 3.11.9-canary.2 → 3.12.0
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.
- package/dist/base.cjs.js +74 -74
- package/dist/base.mjs +1 -1
- package/dist/mux-player.js +90 -90
- package/dist/mux-player.mjs +90 -90
- package/dist/themes/classic/index.cjs.js +76 -53
- package/dist/themes/classic/index.js +76 -53
- package/dist/themes/classic/index.mjs +76 -53
- package/dist/themes/gerwig/index.cjs.js +76 -53
- package/dist/themes/gerwig/index.js +76 -53
- package/dist/themes/gerwig/index.mjs +76 -53
- package/dist/themes/microvideo/index.cjs.js +895 -657
- package/dist/themes/microvideo/index.js +895 -657
- package/dist/themes/microvideo/index.mjs +895 -657
- package/dist/themes/minimal/index.cjs.js +889 -653
- package/dist/themes/minimal/index.js +889 -653
- package/dist/themes/minimal/index.mjs +889 -653
- package/dist/themes/news/index.cjs.js +76 -53
- package/dist/themes/news/index.js +76 -53
- package/dist/themes/news/index.mjs +76 -53
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -214,84 +214,6 @@ function isNumericString(str) {
|
|
|
214
214
|
}
|
|
215
215
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
216
216
|
|
|
217
|
-
// ../../node_modules/media-chrome/dist/utils/time.js
|
|
218
|
-
var UnitLabels = [
|
|
219
|
-
{
|
|
220
|
-
singular: "hour",
|
|
221
|
-
plural: "hours"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
singular: "minute",
|
|
225
|
-
plural: "minutes"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
singular: "second",
|
|
229
|
-
plural: "seconds"
|
|
230
|
-
}
|
|
231
|
-
];
|
|
232
|
-
var toTimeUnitPhrase = (timeUnitValue, unitIndex) => {
|
|
233
|
-
const unitLabel = timeUnitValue === 1 ? UnitLabels[unitIndex].singular : UnitLabels[unitIndex].plural;
|
|
234
|
-
return `${timeUnitValue} ${unitLabel}`;
|
|
235
|
-
};
|
|
236
|
-
var formatAsTimePhrase = (seconds) => {
|
|
237
|
-
if (!isValidNumber(seconds))
|
|
238
|
-
return "";
|
|
239
|
-
const positiveSeconds = Math.abs(seconds);
|
|
240
|
-
const negative = positiveSeconds !== seconds;
|
|
241
|
-
const secondsDateTime = new Date(0, 0, 0, 0, 0, positiveSeconds, 0);
|
|
242
|
-
const timeParts = [
|
|
243
|
-
secondsDateTime.getHours(),
|
|
244
|
-
secondsDateTime.getMinutes(),
|
|
245
|
-
secondsDateTime.getSeconds()
|
|
246
|
-
];
|
|
247
|
-
const timeString = timeParts.map(
|
|
248
|
-
(timeUnitValue, index) => timeUnitValue && toTimeUnitPhrase(timeUnitValue, index)
|
|
249
|
-
).filter((x) => x).join(", ");
|
|
250
|
-
const negativeSuffix = negative ? " remaining" : "";
|
|
251
|
-
return `${timeString}${negativeSuffix}`;
|
|
252
|
-
};
|
|
253
|
-
function formatTime(seconds, guide) {
|
|
254
|
-
let negative = false;
|
|
255
|
-
if (seconds < 0) {
|
|
256
|
-
negative = true;
|
|
257
|
-
seconds = 0 - seconds;
|
|
258
|
-
}
|
|
259
|
-
seconds = seconds < 0 ? 0 : seconds;
|
|
260
|
-
let s = Math.floor(seconds % 60);
|
|
261
|
-
let m = Math.floor(seconds / 60 % 60);
|
|
262
|
-
let h = Math.floor(seconds / 3600);
|
|
263
|
-
const gm = Math.floor(guide / 60 % 60);
|
|
264
|
-
const gh = Math.floor(guide / 3600);
|
|
265
|
-
if (isNaN(seconds) || seconds === Infinity) {
|
|
266
|
-
h = m = s = "0";
|
|
267
|
-
}
|
|
268
|
-
h = h > 0 || gh > 0 ? h + ":" : "";
|
|
269
|
-
m = ((h || gm >= 10) && m < 10 ? "0" + m : m) + ":";
|
|
270
|
-
s = s < 10 ? "0" + s : s;
|
|
271
|
-
return (negative ? "-" : "") + h + m + s;
|
|
272
|
-
}
|
|
273
|
-
var emptyTimeRanges = Object.freeze({
|
|
274
|
-
length: 0,
|
|
275
|
-
start(index) {
|
|
276
|
-
const unsignedIdx = index >>> 0;
|
|
277
|
-
if (unsignedIdx >= this.length) {
|
|
278
|
-
throw new DOMException(
|
|
279
|
-
`Failed to execute 'start' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
|
-
return 0;
|
|
283
|
-
},
|
|
284
|
-
end(index) {
|
|
285
|
-
const unsignedIdx = index >>> 0;
|
|
286
|
-
if (unsignedIdx >= this.length) {
|
|
287
|
-
throw new DOMException(
|
|
288
|
-
`Failed to execute 'end' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
return 0;
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
|
|
295
217
|
// ../../node_modules/media-chrome/dist/lang/en.js
|
|
296
218
|
var En = {
|
|
297
219
|
"Start airplay": "Start airplay",
|
|
@@ -355,7 +277,16 @@ var En = {
|
|
|
355
277
|
"A network error caused the media download to fail.": "A network error caused the media download to fail.",
|
|
356
278
|
"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.": "A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",
|
|
357
279
|
"An unsupported error occurred. The server or network failed, or your browser does not support this format.": "An unsupported error occurred. The server or network failed, or your browser does not support this format.",
|
|
358
|
-
"The media is encrypted and there are no keys to decrypt it.": "The media is encrypted and there are no keys to decrypt it."
|
|
280
|
+
"The media is encrypted and there are no keys to decrypt it.": "The media is encrypted and there are no keys to decrypt it.",
|
|
281
|
+
hour: "hour",
|
|
282
|
+
hours: "hours",
|
|
283
|
+
minute: "minute",
|
|
284
|
+
minutes: "minutes",
|
|
285
|
+
second: "second",
|
|
286
|
+
seconds: "seconds",
|
|
287
|
+
"{time} remaining": "{time} remaining",
|
|
288
|
+
"{currentTime} of {totalTime}": "{currentTime} of {totalTime}",
|
|
289
|
+
"video not loaded, unknown time.": "video not loaded, unknown time."
|
|
359
290
|
};
|
|
360
291
|
|
|
361
292
|
// ../../node_modules/media-chrome/dist/utils/i18n.js
|
|
@@ -377,6 +308,86 @@ var t = (key, vars = {}) => resolveTranslation(key).replace(
|
|
|
377
308
|
(_, v) => v in vars ? String(vars[v]) : `{${v}}`
|
|
378
309
|
);
|
|
379
310
|
|
|
311
|
+
// ../../node_modules/media-chrome/dist/utils/time.js
|
|
312
|
+
var UnitLabels = [
|
|
313
|
+
{
|
|
314
|
+
singular: "hour",
|
|
315
|
+
plural: "hours"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
singular: "minute",
|
|
319
|
+
plural: "minutes"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
singular: "second",
|
|
323
|
+
plural: "seconds"
|
|
324
|
+
}
|
|
325
|
+
];
|
|
326
|
+
var toTimeUnitPhrase = (timeUnitValue, unitIndex) => {
|
|
327
|
+
const unitLabel = timeUnitValue === 1 ? t(UnitLabels[unitIndex].singular) : t(UnitLabels[unitIndex].plural);
|
|
328
|
+
return `${timeUnitValue} ${unitLabel}`;
|
|
329
|
+
};
|
|
330
|
+
var formatAsTimePhrase = (seconds) => {
|
|
331
|
+
if (!isValidNumber(seconds))
|
|
332
|
+
return "";
|
|
333
|
+
const positiveSeconds = Math.abs(seconds);
|
|
334
|
+
const negative = positiveSeconds !== seconds;
|
|
335
|
+
const secondsDateTime = new Date(0, 0, 0, 0, 0, positiveSeconds, 0);
|
|
336
|
+
const timeParts = [
|
|
337
|
+
secondsDateTime.getHours(),
|
|
338
|
+
secondsDateTime.getMinutes(),
|
|
339
|
+
secondsDateTime.getSeconds()
|
|
340
|
+
];
|
|
341
|
+
const timeString = timeParts.map(
|
|
342
|
+
(timeUnitValue, index) => timeUnitValue && toTimeUnitPhrase(timeUnitValue, index)
|
|
343
|
+
).filter((x) => x).join(", ");
|
|
344
|
+
if (negative) {
|
|
345
|
+
return t("{time} remaining", { time: timeString });
|
|
346
|
+
}
|
|
347
|
+
return timeString;
|
|
348
|
+
};
|
|
349
|
+
function formatTime(seconds, guide) {
|
|
350
|
+
let negative = false;
|
|
351
|
+
if (seconds < 0) {
|
|
352
|
+
negative = true;
|
|
353
|
+
seconds = 0 - seconds;
|
|
354
|
+
}
|
|
355
|
+
seconds = seconds < 0 ? 0 : seconds;
|
|
356
|
+
let s = Math.floor(seconds % 60);
|
|
357
|
+
let m = Math.floor(seconds / 60 % 60);
|
|
358
|
+
let h = Math.floor(seconds / 3600);
|
|
359
|
+
const gm = Math.floor(guide / 60 % 60);
|
|
360
|
+
const gh = Math.floor(guide / 3600);
|
|
361
|
+
if (isNaN(seconds) || seconds === Infinity) {
|
|
362
|
+
h = m = s = "0";
|
|
363
|
+
}
|
|
364
|
+
h = h > 0 || gh > 0 ? h + ":" : "";
|
|
365
|
+
m = ((h || gm >= 10) && m < 10 ? "0" + m : m) + ":";
|
|
366
|
+
s = s < 10 ? "0" + s : s;
|
|
367
|
+
return (negative ? "-" : "") + h + m + s;
|
|
368
|
+
}
|
|
369
|
+
var emptyTimeRanges = Object.freeze({
|
|
370
|
+
length: 0,
|
|
371
|
+
start(index) {
|
|
372
|
+
const unsignedIdx = index >>> 0;
|
|
373
|
+
if (unsignedIdx >= this.length) {
|
|
374
|
+
throw new DOMException(
|
|
375
|
+
`Failed to execute 'start' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
return 0;
|
|
379
|
+
},
|
|
380
|
+
end(index) {
|
|
381
|
+
const unsignedIdx = index >>> 0;
|
|
382
|
+
if (unsignedIdx >= this.length) {
|
|
383
|
+
throw new DOMException(
|
|
384
|
+
`Failed to execute 'end' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
return 0;
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
|
|
380
391
|
// ../../node_modules/media-chrome/dist/utils/server-safe-globals.js
|
|
381
392
|
var EventTarget = class {
|
|
382
393
|
addEventListener() {
|
|
@@ -652,11 +663,8 @@ function insertCSSRule(styleParent, selectorText) {
|
|
|
652
663
|
}
|
|
653
664
|
};
|
|
654
665
|
}
|
|
655
|
-
style == null ? void 0 : style.sheet.insertRule(`${selectorText}{}`, style.sheet.cssRules.length);
|
|
656
|
-
return (
|
|
657
|
-
/** @type {CSSStyleRule} */
|
|
658
|
-
(_b2 = style.sheet.cssRules) == null ? void 0 : _b2[style.sheet.cssRules.length - 1]
|
|
659
|
-
);
|
|
666
|
+
const cssRuleId = style == null ? void 0 : style.sheet.insertRule(`${selectorText}{}`, style.sheet.cssRules.length);
|
|
667
|
+
return (_b2 = style.sheet.cssRules) == null ? void 0 : _b2[cssRuleId];
|
|
660
668
|
}
|
|
661
669
|
function getNumericAttr(el, attrName, defaultValue = Number.NaN) {
|
|
662
670
|
const attrVal = el.getAttribute(attrName);
|
|
@@ -770,15 +778,20 @@ var MediaGestureReceiver = class extends GlobalThis.HTMLElement {
|
|
|
770
778
|
}
|
|
771
779
|
}
|
|
772
780
|
connectedCallback() {
|
|
773
|
-
var _a3, _b2
|
|
781
|
+
var _a3, _b2;
|
|
774
782
|
this.tabIndex = -1;
|
|
775
783
|
this.setAttribute("aria-hidden", "true");
|
|
776
784
|
__privateSet(this, _mediaController, getMediaControllerEl(this));
|
|
777
785
|
if (this.getAttribute(MediaStateReceiverAttributes.MEDIA_CONTROLLER)) {
|
|
778
786
|
(_b2 = (_a3 = __privateGet(this, _mediaController)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
779
787
|
}
|
|
780
|
-
(
|
|
781
|
-
|
|
788
|
+
if (!__privateGet(this, _mediaController))
|
|
789
|
+
return;
|
|
790
|
+
__privateGet(this, _mediaController).addEventListener("pointerdown", this);
|
|
791
|
+
__privateGet(this, _mediaController).addEventListener("click", this);
|
|
792
|
+
if (!__privateGet(this, _mediaController).hasAttribute("tabindex")) {
|
|
793
|
+
__privateGet(this, _mediaController).tabIndex = 0;
|
|
794
|
+
}
|
|
782
795
|
}
|
|
783
796
|
disconnectedCallback() {
|
|
784
797
|
var _a3, _b2, _c, _d;
|
|
@@ -887,13 +900,12 @@ var __privateMethod = (obj, member, method) => {
|
|
|
887
900
|
__accessCheck2(obj, member, "access private method");
|
|
888
901
|
return method;
|
|
889
902
|
};
|
|
903
|
+
var _mutationObserver;
|
|
890
904
|
var _pointerDownTimeStamp;
|
|
891
905
|
var _currentMedia;
|
|
892
906
|
var _inactiveTimeout;
|
|
893
907
|
var _autohide;
|
|
894
|
-
var _mutationObserver;
|
|
895
908
|
var _handleMutation;
|
|
896
|
-
var handleMutation_fn;
|
|
897
909
|
var _isResizePending;
|
|
898
910
|
var _handleResize;
|
|
899
911
|
var _handlePointerMove;
|
|
@@ -906,6 +918,8 @@ var _setActive;
|
|
|
906
918
|
var setActive_fn;
|
|
907
919
|
var _scheduleInactive;
|
|
908
920
|
var scheduleInactive_fn;
|
|
921
|
+
var _chainedSlot;
|
|
922
|
+
var _handleSlotChange;
|
|
909
923
|
var Attributes = {
|
|
910
924
|
AUDIO: "audio",
|
|
911
925
|
AUTOHIDE: "autohide",
|
|
@@ -1153,18 +1167,47 @@ function getBreakpoints(breakpoints, width) {
|
|
|
1153
1167
|
var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
1154
1168
|
constructor() {
|
|
1155
1169
|
super();
|
|
1156
|
-
__privateAdd2(this, _handleMutation);
|
|
1157
1170
|
__privateAdd2(this, _handlePointerMove);
|
|
1158
1171
|
__privateAdd2(this, _handlePointerUp);
|
|
1159
1172
|
__privateAdd2(this, _setInactive);
|
|
1160
1173
|
__privateAdd2(this, _setActive);
|
|
1161
1174
|
__privateAdd2(this, _scheduleInactive);
|
|
1175
|
+
__privateAdd2(this, _mutationObserver, void 0);
|
|
1162
1176
|
__privateAdd2(this, _pointerDownTimeStamp, 0);
|
|
1163
1177
|
__privateAdd2(this, _currentMedia, null);
|
|
1164
1178
|
__privateAdd2(this, _inactiveTimeout, null);
|
|
1165
1179
|
__privateAdd2(this, _autohide, void 0);
|
|
1166
1180
|
this.breakpointsComputed = false;
|
|
1167
|
-
__privateAdd2(this,
|
|
1181
|
+
__privateAdd2(this, _handleMutation, (mutationsList) => {
|
|
1182
|
+
const media = this.media;
|
|
1183
|
+
for (const mutation of mutationsList) {
|
|
1184
|
+
if (mutation.type !== "childList")
|
|
1185
|
+
continue;
|
|
1186
|
+
const removedNodes = mutation.removedNodes;
|
|
1187
|
+
for (const node of removedNodes) {
|
|
1188
|
+
if (node.slot != "media" || mutation.target != this)
|
|
1189
|
+
continue;
|
|
1190
|
+
let previousSibling = mutation.previousSibling && mutation.previousSibling.previousElementSibling;
|
|
1191
|
+
if (!previousSibling || !media) {
|
|
1192
|
+
this.mediaUnsetCallback(node);
|
|
1193
|
+
} else {
|
|
1194
|
+
let wasFirst = previousSibling.slot !== "media";
|
|
1195
|
+
while ((previousSibling = previousSibling.previousSibling) !== null) {
|
|
1196
|
+
if (previousSibling.slot == "media")
|
|
1197
|
+
wasFirst = false;
|
|
1198
|
+
}
|
|
1199
|
+
if (wasFirst)
|
|
1200
|
+
this.mediaUnsetCallback(node);
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
if (media) {
|
|
1204
|
+
for (const node of mutation.addedNodes) {
|
|
1205
|
+
if (node === media)
|
|
1206
|
+
this.handleMediaUpdated(media);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1168
1211
|
__privateAdd2(this, _isResizePending, false);
|
|
1169
1212
|
__privateAdd2(this, _handleResize, (entry) => {
|
|
1170
1213
|
if (__privateGet2(this, _isResizePending))
|
|
@@ -1175,27 +1218,24 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1175
1218
|
}, 0);
|
|
1176
1219
|
__privateSet2(this, _isResizePending, true);
|
|
1177
1220
|
});
|
|
1221
|
+
__privateAdd2(this, _chainedSlot, void 0);
|
|
1222
|
+
__privateAdd2(this, _handleSlotChange, () => {
|
|
1223
|
+
const slotEls = __privateGet2(this, _chainedSlot).assignedElements({ flatten: true });
|
|
1224
|
+
if (!slotEls.length) {
|
|
1225
|
+
if (__privateGet2(this, _currentMedia)) {
|
|
1226
|
+
this.mediaUnsetCallback(__privateGet2(this, _currentMedia));
|
|
1227
|
+
}
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
this.handleMediaUpdated(this.media);
|
|
1231
|
+
});
|
|
1178
1232
|
if (!this.shadowRoot) {
|
|
1179
1233
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
1180
1234
|
const attrs = namedNodeMapToObject(this.attributes);
|
|
1181
1235
|
const html = this.constructor.getTemplateHTML(attrs);
|
|
1182
1236
|
this.shadowRoot.setHTMLUnsafe ? this.shadowRoot.setHTMLUnsafe(html) : this.shadowRoot.innerHTML = html;
|
|
1183
1237
|
}
|
|
1184
|
-
|
|
1185
|
-
":scope > slot[slot=media]"
|
|
1186
|
-
);
|
|
1187
|
-
if (chainedSlot) {
|
|
1188
|
-
chainedSlot.addEventListener("slotchange", () => {
|
|
1189
|
-
const slotEls = chainedSlot.assignedElements({ flatten: true });
|
|
1190
|
-
if (!slotEls.length) {
|
|
1191
|
-
if (__privateGet2(this, _currentMedia)) {
|
|
1192
|
-
this.mediaUnsetCallback(__privateGet2(this, _currentMedia));
|
|
1193
|
-
}
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
this.handleMediaUpdated(this.media);
|
|
1197
|
-
});
|
|
1198
|
-
}
|
|
1238
|
+
__privateSet2(this, _mutationObserver, new MutationObserver(__privateGet2(this, _handleMutation)));
|
|
1199
1239
|
}
|
|
1200
1240
|
static get observedAttributes() {
|
|
1201
1241
|
return [Attributes.AUTOHIDE, Attributes.GESTURES_DISABLED].concat(MEDIA_UI_ATTRIBUTE_NAMES).filter(
|
|
@@ -1243,6 +1283,13 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1243
1283
|
this.handleMediaUpdated(this.media);
|
|
1244
1284
|
this.setAttribute(Attributes.USER_INACTIVE, "");
|
|
1245
1285
|
setBreakpoints(this, this.getBoundingClientRect().width);
|
|
1286
|
+
const chainedSlot = this.querySelector(
|
|
1287
|
+
":scope > slot[slot=media]"
|
|
1288
|
+
);
|
|
1289
|
+
if (chainedSlot) {
|
|
1290
|
+
__privateSet2(this, _chainedSlot, chainedSlot);
|
|
1291
|
+
__privateGet2(this, _chainedSlot).addEventListener("slotchange", __privateGet2(this, _handleSlotChange));
|
|
1292
|
+
}
|
|
1246
1293
|
this.addEventListener("pointerdown", this);
|
|
1247
1294
|
this.addEventListener("pointermove", this);
|
|
1248
1295
|
this.addEventListener("pointerup", this);
|
|
@@ -1252,12 +1299,23 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1252
1299
|
}
|
|
1253
1300
|
disconnectedCallback() {
|
|
1254
1301
|
var _a3;
|
|
1255
|
-
__privateGet2(this, _mutationObserver).disconnect();
|
|
1256
1302
|
unobserveResize(this, __privateGet2(this, _handleResize));
|
|
1303
|
+
clearTimeout(__privateGet2(this, _inactiveTimeout));
|
|
1304
|
+
__privateGet2(this, _mutationObserver).disconnect();
|
|
1257
1305
|
if (this.media) {
|
|
1258
1306
|
this.mediaUnsetCallback(this.media);
|
|
1259
1307
|
}
|
|
1260
1308
|
(_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("mouseup", this);
|
|
1309
|
+
this.removeEventListener("pointerdown", this);
|
|
1310
|
+
this.removeEventListener("pointermove", this);
|
|
1311
|
+
this.removeEventListener("pointerup", this);
|
|
1312
|
+
this.removeEventListener("mouseleave", this);
|
|
1313
|
+
this.removeEventListener("keyup", this);
|
|
1314
|
+
if (__privateGet2(this, _chainedSlot)) {
|
|
1315
|
+
__privateGet2(this, _chainedSlot).removeEventListener("slotchange", __privateGet2(this, _handleSlotChange));
|
|
1316
|
+
__privateSet2(this, _chainedSlot, null);
|
|
1317
|
+
}
|
|
1318
|
+
__privateSet2(this, _isResizePending, false);
|
|
1261
1319
|
}
|
|
1262
1320
|
/**
|
|
1263
1321
|
* @abstract
|
|
@@ -1340,42 +1398,12 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1340
1398
|
setBooleanAttr(this, Attributes.USER_INACTIVE, value);
|
|
1341
1399
|
}
|
|
1342
1400
|
};
|
|
1401
|
+
_mutationObserver = /* @__PURE__ */ new WeakMap();
|
|
1343
1402
|
_pointerDownTimeStamp = /* @__PURE__ */ new WeakMap();
|
|
1344
1403
|
_currentMedia = /* @__PURE__ */ new WeakMap();
|
|
1345
1404
|
_inactiveTimeout = /* @__PURE__ */ new WeakMap();
|
|
1346
1405
|
_autohide = /* @__PURE__ */ new WeakMap();
|
|
1347
|
-
|
|
1348
|
-
_handleMutation = /* @__PURE__ */ new WeakSet();
|
|
1349
|
-
handleMutation_fn = function(mutationsList) {
|
|
1350
|
-
const media = this.media;
|
|
1351
|
-
for (const mutation of mutationsList) {
|
|
1352
|
-
if (mutation.type !== "childList")
|
|
1353
|
-
continue;
|
|
1354
|
-
const removedNodes = mutation.removedNodes;
|
|
1355
|
-
for (const node of removedNodes) {
|
|
1356
|
-
if (node.slot != "media" || mutation.target != this)
|
|
1357
|
-
continue;
|
|
1358
|
-
let previousSibling = mutation.previousSibling && mutation.previousSibling.previousElementSibling;
|
|
1359
|
-
if (!previousSibling || !media) {
|
|
1360
|
-
this.mediaUnsetCallback(node);
|
|
1361
|
-
} else {
|
|
1362
|
-
let wasFirst = previousSibling.slot !== "media";
|
|
1363
|
-
while ((previousSibling = previousSibling.previousSibling) !== null) {
|
|
1364
|
-
if (previousSibling.slot == "media")
|
|
1365
|
-
wasFirst = false;
|
|
1366
|
-
}
|
|
1367
|
-
if (wasFirst)
|
|
1368
|
-
this.mediaUnsetCallback(node);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
if (media) {
|
|
1372
|
-
for (const node of mutation.addedNodes) {
|
|
1373
|
-
if (node === media)
|
|
1374
|
-
this.handleMediaUpdated(media);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
};
|
|
1406
|
+
_handleMutation = /* @__PURE__ */ new WeakMap();
|
|
1379
1407
|
_isResizePending = /* @__PURE__ */ new WeakMap();
|
|
1380
1408
|
_handleResize = /* @__PURE__ */ new WeakMap();
|
|
1381
1409
|
_handlePointerMove = /* @__PURE__ */ new WeakSet();
|
|
@@ -1446,6 +1474,8 @@ scheduleInactive_fn = function() {
|
|
|
1446
1474
|
__privateMethod(this, _setInactive, setInactive_fn).call(this);
|
|
1447
1475
|
}, autohide * 1e3));
|
|
1448
1476
|
};
|
|
1477
|
+
_chainedSlot = /* @__PURE__ */ new WeakMap();
|
|
1478
|
+
_handleSlotChange = /* @__PURE__ */ new WeakMap();
|
|
1449
1479
|
MediaContainer.shadowRootOptions = { mode: "open" };
|
|
1450
1480
|
MediaContainer.getTemplateHTML = getTemplateHTML2;
|
|
1451
1481
|
if (!GlobalThis.customElements.get("media-container")) {
|
|
@@ -1794,10 +1824,10 @@ var toggleSubtitleTracks = (stateOwners, force) => {
|
|
|
1794
1824
|
let subTrack = tracks[0];
|
|
1795
1825
|
const { options } = stateOwners;
|
|
1796
1826
|
if (!(options == null ? void 0 : options.noSubtitlesLangPref)) {
|
|
1797
|
-
const subtitlesPref =
|
|
1827
|
+
const subtitlesPref = GlobalThis.localStorage.getItem(
|
|
1798
1828
|
"media-chrome-pref-subtitles-lang"
|
|
1799
1829
|
);
|
|
1800
|
-
const userLangPrefs = subtitlesPref ? [subtitlesPref, ...
|
|
1830
|
+
const userLangPrefs = subtitlesPref ? [subtitlesPref, ...GlobalThis.navigator.languages] : GlobalThis.navigator.languages;
|
|
1801
1831
|
const preferredAvailableSubs = tracks.filter((textTrack) => {
|
|
1802
1832
|
return userLangPrefs.some(
|
|
1803
1833
|
(lang) => textTrack.language.toLowerCase().startsWith(lang.split("-")[0])
|
|
@@ -2516,14 +2546,14 @@ var stateMediator = {
|
|
|
2516
2546
|
return isFullscreen(stateOwners);
|
|
2517
2547
|
},
|
|
2518
2548
|
set(value, stateOwners, event) {
|
|
2519
|
-
var _a3;
|
|
2549
|
+
var _a3, _b2;
|
|
2520
2550
|
if (!value) {
|
|
2521
2551
|
exitFullscreen(stateOwners);
|
|
2522
2552
|
} else {
|
|
2523
2553
|
enterFullscreen(stateOwners);
|
|
2524
2554
|
const isPointer = event.detail;
|
|
2525
|
-
if (isPointer)
|
|
2526
|
-
(
|
|
2555
|
+
if (isPointer && !((_a3 = stateOwners.media) == null ? void 0 : _a3.inert))
|
|
2556
|
+
(_b2 = stateOwners.media) == null ? void 0 : _b2.focus();
|
|
2527
2557
|
}
|
|
2528
2558
|
},
|
|
2529
2559
|
// older Safari version may require webkit-specific events
|
|
@@ -3247,10 +3277,10 @@ var _keyboardShortcutsDialog;
|
|
|
3247
3277
|
var _mediaStateCallback;
|
|
3248
3278
|
var _mediaStoreUnsubscribe;
|
|
3249
3279
|
var _mediaStateEventHandler;
|
|
3280
|
+
var _subtitlesState;
|
|
3250
3281
|
var _setupDefaultStore;
|
|
3251
3282
|
var setupDefaultStore_fn;
|
|
3252
3283
|
var _keyUpHandler;
|
|
3253
|
-
var keyUpHandler_fn;
|
|
3254
3284
|
var _keyDownHandler;
|
|
3255
3285
|
var keyDownHandler_fn;
|
|
3256
3286
|
var _showKeyboardShortcutsDialog;
|
|
@@ -3303,7 +3333,6 @@ var MediaController = class extends MediaContainer {
|
|
|
3303
3333
|
constructor() {
|
|
3304
3334
|
super();
|
|
3305
3335
|
__privateAdd4(this, _setupDefaultStore);
|
|
3306
|
-
__privateAdd4(this, _keyUpHandler);
|
|
3307
3336
|
__privateAdd4(this, _keyDownHandler);
|
|
3308
3337
|
__privateAdd4(this, _showKeyboardShortcutsDialog);
|
|
3309
3338
|
this.mediaStateReceivers = [];
|
|
@@ -3318,6 +3347,17 @@ var MediaController = class extends MediaContainer {
|
|
|
3318
3347
|
var _a3;
|
|
3319
3348
|
(_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch(event);
|
|
3320
3349
|
});
|
|
3350
|
+
__privateAdd4(this, _subtitlesState, void 0);
|
|
3351
|
+
__privateAdd4(this, _keyUpHandler, (e) => {
|
|
3352
|
+
const { key, shiftKey } = e;
|
|
3353
|
+
const isShiftSlash = shiftKey && (key === "/" || key === "?");
|
|
3354
|
+
const shouldHandle = isShiftSlash || ButtonPressedKeys.includes(key);
|
|
3355
|
+
if (!shouldHandle) {
|
|
3356
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3357
|
+
return;
|
|
3358
|
+
}
|
|
3359
|
+
this.keyboardShortcutHandler(e);
|
|
3360
|
+
});
|
|
3321
3361
|
this.associateElement(this);
|
|
3322
3362
|
let prevState = {};
|
|
3323
3363
|
__privateSet4(this, _mediaStateCallback, (nextState) => {
|
|
@@ -3334,7 +3374,6 @@ var MediaController = class extends MediaContainer {
|
|
|
3334
3374
|
});
|
|
3335
3375
|
prevState = nextState;
|
|
3336
3376
|
});
|
|
3337
|
-
this.hasAttribute(Attributes2.NO_HOTKEYS) ? this.disableHotkeys() : this.enableHotkeys();
|
|
3338
3377
|
}
|
|
3339
3378
|
static get observedAttributes() {
|
|
3340
3379
|
return super.observedAttributes.concat(
|
|
@@ -3346,7 +3385,10 @@ var MediaController = class extends MediaContainer {
|
|
|
3346
3385
|
Attributes2.NO_MUTED_PREF,
|
|
3347
3386
|
Attributes2.NO_VOLUME_PREF,
|
|
3348
3387
|
Attributes2.LANG,
|
|
3349
|
-
Attributes2.LOOP
|
|
3388
|
+
Attributes2.LOOP,
|
|
3389
|
+
Attributes2.LIVE_EDGE_OFFSET,
|
|
3390
|
+
Attributes2.SEEK_TO_LIVE_OFFSET,
|
|
3391
|
+
Attributes2.NO_AUTO_SEEK_TO_LIVE
|
|
3350
3392
|
);
|
|
3351
3393
|
}
|
|
3352
3394
|
get mediaStore() {
|
|
@@ -3478,19 +3520,21 @@ var MediaController = class extends MediaContainer {
|
|
|
3478
3520
|
defaultStreamType: (_b2 = this.getAttribute(Attributes2.DEFAULT_STREAM_TYPE)) != null ? _b2 : void 0
|
|
3479
3521
|
}
|
|
3480
3522
|
});
|
|
3481
|
-
} else if (attrName === Attributes2.LIVE_EDGE_OFFSET) {
|
|
3523
|
+
} else if (attrName === Attributes2.LIVE_EDGE_OFFSET && newValue !== oldValue) {
|
|
3482
3524
|
(_d = __privateGet4(this, _mediaStore)) == null ? void 0 : _d.dispatch({
|
|
3483
3525
|
type: "optionschangerequest",
|
|
3484
3526
|
detail: {
|
|
3485
3527
|
liveEdgeOffset: this.hasAttribute(Attributes2.LIVE_EDGE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0,
|
|
3486
|
-
seekToLiveOffset:
|
|
3528
|
+
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
|
|
3487
3529
|
}
|
|
3488
3530
|
});
|
|
3489
|
-
} else if (attrName === Attributes2.SEEK_TO_LIVE_OFFSET) {
|
|
3531
|
+
} else if (attrName === Attributes2.SEEK_TO_LIVE_OFFSET && newValue !== oldValue) {
|
|
3490
3532
|
(_e = __privateGet4(this, _mediaStore)) == null ? void 0 : _e.dispatch({
|
|
3491
3533
|
type: "optionschangerequest",
|
|
3492
3534
|
detail: {
|
|
3493
|
-
|
|
3535
|
+
// Mirror #setupDefaultStore: prefer seektoliveoffset, fall back to
|
|
3536
|
+
// liveedgeoffset, otherwise undefined.
|
|
3537
|
+
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
|
|
3494
3538
|
}
|
|
3495
3539
|
});
|
|
3496
3540
|
} else if (attrName === Attributes2.NO_AUTO_SEEK_TO_LIVE) {
|
|
@@ -3537,7 +3581,8 @@ var MediaController = class extends MediaContainer {
|
|
|
3537
3581
|
}
|
|
3538
3582
|
}
|
|
3539
3583
|
connectedCallback() {
|
|
3540
|
-
var _a3, _b2;
|
|
3584
|
+
var _a3, _b2, _c;
|
|
3585
|
+
this.associateElement(this);
|
|
3541
3586
|
if (!__privateGet4(this, _mediaStore) && !this.hasAttribute(Attributes2.NO_DEFAULT_STORE)) {
|
|
3542
3587
|
__privateMethod2(this, _setupDefaultStore, setupDefaultStore_fn).call(this);
|
|
3543
3588
|
}
|
|
@@ -3545,31 +3590,58 @@ var MediaController = class extends MediaContainer {
|
|
|
3545
3590
|
type: "documentelementchangerequest",
|
|
3546
3591
|
detail: Document2
|
|
3547
3592
|
});
|
|
3593
|
+
(_b2 = __privateGet4(this, _mediaStore)) == null ? void 0 : _b2.dispatch({
|
|
3594
|
+
type: "fullscreenelementchangerequest",
|
|
3595
|
+
detail: this.fullscreenElement
|
|
3596
|
+
});
|
|
3548
3597
|
super.connectedCallback();
|
|
3549
3598
|
if (__privateGet4(this, _mediaStore) && !__privateGet4(this, _mediaStoreUnsubscribe)) {
|
|
3550
|
-
__privateSet4(this, _mediaStoreUnsubscribe, (
|
|
3599
|
+
__privateSet4(this, _mediaStoreUnsubscribe, (_c = __privateGet4(this, _mediaStore)) == null ? void 0 : _c.subscribe(
|
|
3551
3600
|
__privateGet4(this, _mediaStateCallback)
|
|
3552
3601
|
));
|
|
3553
3602
|
}
|
|
3603
|
+
if (__privateGet4(this, _subtitlesState) !== void 0 && __privateGet4(this, _mediaStore) && this.media) {
|
|
3604
|
+
setTimeout(() => {
|
|
3605
|
+
var _a22, _b22, _c2;
|
|
3606
|
+
if ((_b22 = (_a22 = this.media) == null ? void 0 : _a22.textTracks) == null ? void 0 : _b22.length) {
|
|
3607
|
+
(_c2 = __privateGet4(this, _mediaStore)) == null ? void 0 : _c2.dispatch({
|
|
3608
|
+
type: MediaUIEvents.MEDIA_TOGGLE_SUBTITLES_REQUEST,
|
|
3609
|
+
detail: __privateGet4(this, _subtitlesState)
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3612
|
+
}, 0);
|
|
3613
|
+
}
|
|
3554
3614
|
this.hasAttribute(Attributes2.NO_HOTKEYS) ? this.disableHotkeys() : this.enableHotkeys();
|
|
3555
3615
|
}
|
|
3556
3616
|
disconnectedCallback() {
|
|
3557
|
-
var _a3, _b2, _c, _d;
|
|
3617
|
+
var _a3, _b2, _c, _d, _e, _f;
|
|
3558
3618
|
(_a3 = super.disconnectedCallback) == null ? void 0 : _a3.call(this);
|
|
3619
|
+
this.disableHotkeys();
|
|
3559
3620
|
if (__privateGet4(this, _mediaStore)) {
|
|
3560
|
-
|
|
3621
|
+
const currentState = __privateGet4(this, _mediaStore).getState();
|
|
3622
|
+
__privateSet4(this, _subtitlesState, !!((_b2 = currentState.mediaSubtitlesShowing) == null ? void 0 : _b2.length));
|
|
3623
|
+
(_c = __privateGet4(this, _mediaStore)) == null ? void 0 : _c.dispatch({
|
|
3624
|
+
type: "fullscreenelementchangerequest",
|
|
3625
|
+
detail: void 0
|
|
3626
|
+
});
|
|
3627
|
+
(_d = __privateGet4(this, _mediaStore)) == null ? void 0 : _d.dispatch({
|
|
3561
3628
|
type: "documentelementchangerequest",
|
|
3562
3629
|
detail: void 0
|
|
3563
3630
|
});
|
|
3564
|
-
(
|
|
3631
|
+
(_e = __privateGet4(this, _mediaStore)) == null ? void 0 : _e.dispatch({
|
|
3565
3632
|
type: MediaUIEvents.MEDIA_TOGGLE_SUBTITLES_REQUEST,
|
|
3566
3633
|
detail: false
|
|
3567
3634
|
});
|
|
3568
3635
|
}
|
|
3569
3636
|
if (__privateGet4(this, _mediaStoreUnsubscribe)) {
|
|
3570
|
-
(
|
|
3637
|
+
(_f = __privateGet4(this, _mediaStoreUnsubscribe)) == null ? void 0 : _f.call(this);
|
|
3571
3638
|
__privateSet4(this, _mediaStoreUnsubscribe, void 0);
|
|
3572
3639
|
}
|
|
3640
|
+
this.unassociateElement(this);
|
|
3641
|
+
if (__privateGet4(this, _keyboardShortcutsDialog)) {
|
|
3642
|
+
__privateGet4(this, _keyboardShortcutsDialog).remove();
|
|
3643
|
+
__privateSet4(this, _keyboardShortcutsDialog, null);
|
|
3644
|
+
}
|
|
3573
3645
|
}
|
|
3574
3646
|
/**
|
|
3575
3647
|
* @override
|
|
@@ -3660,10 +3732,11 @@ var MediaController = class extends MediaContainer {
|
|
|
3660
3732
|
}
|
|
3661
3733
|
disableHotkeys() {
|
|
3662
3734
|
this.removeEventListener("keydown", __privateMethod2(this, _keyDownHandler, keyDownHandler_fn));
|
|
3663
|
-
this.removeEventListener("keyup",
|
|
3735
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3664
3736
|
}
|
|
3737
|
+
// Added string to support JSX compatibility
|
|
3665
3738
|
get hotkeys() {
|
|
3666
|
-
return
|
|
3739
|
+
return __privateGet4(this, _hotKeys);
|
|
3667
3740
|
}
|
|
3668
3741
|
set hotkeys(value) {
|
|
3669
3742
|
setStringAttr(this, Attributes2.HOTKEYS, value);
|
|
@@ -3838,6 +3911,7 @@ _keyboardShortcutsDialog = /* @__PURE__ */ new WeakMap();
|
|
|
3838
3911
|
_mediaStateCallback = /* @__PURE__ */ new WeakMap();
|
|
3839
3912
|
_mediaStoreUnsubscribe = /* @__PURE__ */ new WeakMap();
|
|
3840
3913
|
_mediaStateEventHandler = /* @__PURE__ */ new WeakMap();
|
|
3914
|
+
_subtitlesState = /* @__PURE__ */ new WeakMap();
|
|
3841
3915
|
_setupDefaultStore = /* @__PURE__ */ new WeakSet();
|
|
3842
3916
|
setupDefaultStore_fn = function() {
|
|
3843
3917
|
var _a3;
|
|
@@ -3865,28 +3939,18 @@ setupDefaultStore_fn = function() {
|
|
|
3865
3939
|
}
|
|
3866
3940
|
});
|
|
3867
3941
|
};
|
|
3868
|
-
_keyUpHandler = /* @__PURE__ */ new
|
|
3869
|
-
keyUpHandler_fn = function(e) {
|
|
3870
|
-
const { key, shiftKey } = e;
|
|
3871
|
-
const isShiftSlash = shiftKey && (key === "/" || key === "?");
|
|
3872
|
-
const shouldHandle = isShiftSlash || ButtonPressedKeys.includes(key);
|
|
3873
|
-
if (!shouldHandle) {
|
|
3874
|
-
this.removeEventListener("keyup", __privateMethod2(this, _keyUpHandler, keyUpHandler_fn));
|
|
3875
|
-
return;
|
|
3876
|
-
}
|
|
3877
|
-
this.keyboardShortcutHandler(e);
|
|
3878
|
-
};
|
|
3942
|
+
_keyUpHandler = /* @__PURE__ */ new WeakMap();
|
|
3879
3943
|
_keyDownHandler = /* @__PURE__ */ new WeakSet();
|
|
3880
3944
|
keyDownHandler_fn = function(e) {
|
|
3881
3945
|
var _a3;
|
|
3882
3946
|
const { metaKey, altKey, key, shiftKey } = e;
|
|
3883
3947
|
const isShiftSlash = shiftKey && (key === "/" || key === "?");
|
|
3884
3948
|
if (isShiftSlash && ((_a3 = __privateGet4(this, _keyboardShortcutsDialog)) == null ? void 0 : _a3.open)) {
|
|
3885
|
-
this.removeEventListener("keyup",
|
|
3949
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3886
3950
|
return;
|
|
3887
3951
|
}
|
|
3888
3952
|
if (metaKey || altKey || !isShiftSlash && !ButtonPressedKeys.includes(key)) {
|
|
3889
|
-
this.removeEventListener("keyup",
|
|
3953
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3890
3954
|
return;
|
|
3891
3955
|
}
|
|
3892
3956
|
const target = e.target;
|
|
@@ -3894,7 +3958,7 @@ keyDownHandler_fn = function(e) {
|
|
|
3894
3958
|
if ([" ", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(key) && !(__privateGet4(this, _hotKeys).contains(`no${key.toLowerCase()}`) || key === " " && __privateGet4(this, _hotKeys).contains("nospace")) && !isRangeInput) {
|
|
3895
3959
|
e.preventDefault();
|
|
3896
3960
|
}
|
|
3897
|
-
this.addEventListener("keyup",
|
|
3961
|
+
this.addEventListener("keyup", __privateGet4(this, _keyUpHandler), { once: true });
|
|
3898
3962
|
};
|
|
3899
3963
|
_showKeyboardShortcutsDialog = /* @__PURE__ */ new WeakSet();
|
|
3900
3964
|
showKeyboardShortcutsDialog_fn = function() {
|
|
@@ -4608,11 +4672,9 @@ var MediaChromeButton = class extends GlobalThis.HTMLElement {
|
|
|
4608
4672
|
}
|
|
4609
4673
|
/**
|
|
4610
4674
|
* @abstract
|
|
4611
|
-
* @argument {Event} e
|
|
4612
4675
|
*/
|
|
4613
|
-
handleClick(
|
|
4676
|
+
handleClick(_e) {
|
|
4614
4677
|
}
|
|
4615
|
-
// eslint-disable-line
|
|
4616
4678
|
};
|
|
4617
4679
|
_mediaController2 = /* @__PURE__ */ new WeakMap();
|
|
4618
4680
|
_clickListener = /* @__PURE__ */ new WeakMap();
|
|
@@ -4793,7 +4855,7 @@ var MediaCaptionsButton = class extends MediaChromeButton {
|
|
|
4793
4855
|
}
|
|
4794
4856
|
connectedCallback() {
|
|
4795
4857
|
super.connectedCallback();
|
|
4796
|
-
this.setAttribute("role", "
|
|
4858
|
+
this.setAttribute("role", "button");
|
|
4797
4859
|
this.setAttribute("aria-label", t("closed captions"));
|
|
4798
4860
|
updateAriaChecked(this);
|
|
4799
4861
|
}
|
|
@@ -5062,9 +5124,6 @@ var MediaChromeDialog = class extends GlobalThis.HTMLElement {
|
|
|
5062
5124
|
__privateAdd6(this, _isInit, false);
|
|
5063
5125
|
__privateAdd6(this, _previouslyFocused, null);
|
|
5064
5126
|
__privateAdd6(this, _invokerElement, null);
|
|
5065
|
-
this.addEventListener("invoke", this);
|
|
5066
|
-
this.addEventListener("focusout", this);
|
|
5067
|
-
this.addEventListener("keydown", this);
|
|
5068
5127
|
}
|
|
5069
5128
|
static get observedAttributes() {
|
|
5070
5129
|
return [Attributes5.OPEN, Attributes5.ANCHOR];
|
|
@@ -5093,6 +5152,14 @@ var MediaChromeDialog = class extends GlobalThis.HTMLElement {
|
|
|
5093
5152
|
if (!this.role) {
|
|
5094
5153
|
this.role = "dialog";
|
|
5095
5154
|
}
|
|
5155
|
+
this.addEventListener("invoke", this);
|
|
5156
|
+
this.addEventListener("focusout", this);
|
|
5157
|
+
this.addEventListener("keydown", this);
|
|
5158
|
+
}
|
|
5159
|
+
disconnectedCallback() {
|
|
5160
|
+
this.removeEventListener("invoke", this);
|
|
5161
|
+
this.removeEventListener("focusout", this);
|
|
5162
|
+
this.removeEventListener("keydown", this);
|
|
5096
5163
|
}
|
|
5097
5164
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
5098
5165
|
__privateMethod4(this, _init, init_fn).call(this);
|
|
@@ -5473,6 +5540,14 @@ function getTemplateHTML6(_attrs) {
|
|
|
5473
5540
|
transform: var(--media-range-segment-transform, scaleY(1));
|
|
5474
5541
|
transform-origin: center;
|
|
5475
5542
|
}
|
|
5543
|
+
|
|
5544
|
+
/* Visible label for accessibility - positioned off-screen but technically visible (Firefox requires visible labels) */
|
|
5545
|
+
#range-label {
|
|
5546
|
+
position: absolute;
|
|
5547
|
+
left: -10000px;
|
|
5548
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
5549
|
+
pointer-events: none;
|
|
5550
|
+
}
|
|
5476
5551
|
</style>
|
|
5477
5552
|
<div id="leftgap"></div>
|
|
5478
5553
|
<div id="container">
|
|
@@ -5486,14 +5561,20 @@ function getTemplateHTML6(_attrs) {
|
|
|
5486
5561
|
<slot name="thumb">
|
|
5487
5562
|
<div id="thumb" part="thumb"></div>
|
|
5488
5563
|
</slot>
|
|
5489
|
-
<svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>
|
|
5564
|
+
<svg id="segments" aria-hidden="true"><clipPath id="segments-clipping"></clipPath></svg>
|
|
5490
5565
|
</div>
|
|
5491
|
-
|
|
5566
|
+
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
5567
|
+
<label for="range" id="range-label"></label>
|
|
5568
|
+
|
|
5569
|
+
${this.getContainerTemplateHTML(_attrs)}
|
|
5492
5570
|
</div>
|
|
5493
5571
|
<div id="rightgap"></div>
|
|
5494
5572
|
`
|
|
5495
5573
|
);
|
|
5496
5574
|
}
|
|
5575
|
+
function getContainerTemplateHTML(_attrs) {
|
|
5576
|
+
return "";
|
|
5577
|
+
}
|
|
5497
5578
|
var MediaChromeRange = class extends GlobalThis.HTMLElement {
|
|
5498
5579
|
constructor() {
|
|
5499
5580
|
super();
|
|
@@ -5723,7 +5804,7 @@ updateActiveSegment_fn = function(evt) {
|
|
|
5723
5804
|
};
|
|
5724
5805
|
_enableUserEvents = /* @__PURE__ */ new WeakSet();
|
|
5725
5806
|
enableUserEvents_fn = function() {
|
|
5726
|
-
if (this.hasAttribute("disabled"))
|
|
5807
|
+
if (this.hasAttribute("disabled") || !this.isConnected)
|
|
5727
5808
|
return;
|
|
5728
5809
|
this.addEventListener("input", this);
|
|
5729
5810
|
this.addEventListener("pointerdown", this);
|
|
@@ -5735,6 +5816,7 @@ disableUserEvents_fn = function() {
|
|
|
5735
5816
|
this.removeEventListener("input", this);
|
|
5736
5817
|
this.removeEventListener("pointerdown", this);
|
|
5737
5818
|
this.removeEventListener("pointerenter", this);
|
|
5819
|
+
this.removeEventListener("pointerleave", this);
|
|
5738
5820
|
(_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("pointerup", this);
|
|
5739
5821
|
(_b2 = GlobalThis.window) == null ? void 0 : _b2.removeEventListener("pointermove", this);
|
|
5740
5822
|
};
|
|
@@ -5742,14 +5824,14 @@ _handlePointerDown = /* @__PURE__ */ new WeakSet();
|
|
|
5742
5824
|
handlePointerDown_fn = function(evt) {
|
|
5743
5825
|
var _a3;
|
|
5744
5826
|
__privateSet7(this, _isInputTarget, evt.composedPath().includes(this.range));
|
|
5745
|
-
(_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointerup", this);
|
|
5827
|
+
(_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointerup", this, { once: true });
|
|
5746
5828
|
};
|
|
5747
5829
|
_handlePointerEnter = /* @__PURE__ */ new WeakSet();
|
|
5748
5830
|
handlePointerEnter_fn = function(evt) {
|
|
5749
5831
|
var _a3;
|
|
5750
5832
|
if (evt.pointerType !== "mouse")
|
|
5751
5833
|
__privateMethod5(this, _handlePointerDown, handlePointerDown_fn).call(this, evt);
|
|
5752
|
-
this.addEventListener("pointerleave", this);
|
|
5834
|
+
this.addEventListener("pointerleave", this, { once: true });
|
|
5753
5835
|
(_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointermove", this);
|
|
5754
5836
|
};
|
|
5755
5837
|
_handlePointerUp2 = /* @__PURE__ */ new WeakSet();
|
|
@@ -5789,6 +5871,7 @@ handlePointerMove_fn2 = function(evt) {
|
|
|
5789
5871
|
};
|
|
5790
5872
|
MediaChromeRange.shadowRootOptions = { mode: "open" };
|
|
5791
5873
|
MediaChromeRange.getTemplateHTML = getTemplateHTML6;
|
|
5874
|
+
MediaChromeRange.getContainerTemplateHTML = getContainerTemplateHTML;
|
|
5792
5875
|
if (!GlobalThis.customElements.get("media-chrome-range")) {
|
|
5793
5876
|
GlobalThis.customElements.define("media-chrome-range", MediaChromeRange);
|
|
5794
5877
|
}
|
|
@@ -5946,7 +6029,7 @@ function getTemplateHTML8(_attrs, _props = {}) {
|
|
|
5946
6029
|
*/
|
|
5947
6030
|
""}
|
|
5948
6031
|
:host(:focus-visible) {
|
|
5949
|
-
box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
|
|
6032
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
5950
6033
|
outline: 0;
|
|
5951
6034
|
}
|
|
5952
6035
|
|
|
@@ -6206,6 +6289,11 @@ var MediaErrorDialog = class extends MediaChromeDialog {
|
|
|
6206
6289
|
if (this.open) {
|
|
6207
6290
|
this.shadowRoot.querySelector("slot").name = `error-${this.mediaErrorCode}`;
|
|
6208
6291
|
this.shadowRoot.querySelector("#content").innerHTML = this.formatErrorMessage(mediaError);
|
|
6292
|
+
if (!this.hasAttribute("aria-label")) {
|
|
6293
|
+
const { title } = formatError(mediaError);
|
|
6294
|
+
if (title)
|
|
6295
|
+
this.setAttribute("aria-label", title);
|
|
6296
|
+
}
|
|
6209
6297
|
}
|
|
6210
6298
|
}
|
|
6211
6299
|
get mediaError() {
|
|
@@ -6567,7 +6655,7 @@ if (!GlobalThis.customElements.get("media-fullscreen-button")) {
|
|
|
6567
6655
|
// ../../node_modules/media-chrome/dist/media-live-button.js
|
|
6568
6656
|
var { MEDIA_TIME_IS_LIVE, MEDIA_PAUSED } = MediaUIAttributes;
|
|
6569
6657
|
var { MEDIA_SEEK_TO_LIVE_REQUEST, MEDIA_PLAY_REQUEST } = MediaUIEvents;
|
|
6570
|
-
var indicatorSVG = '<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';
|
|
6658
|
+
var indicatorSVG = '<svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg>';
|
|
6571
6659
|
function getSlotTemplateHTML11(_attrs) {
|
|
6572
6660
|
return (
|
|
6573
6661
|
/*html*/
|
|
@@ -7564,21 +7652,36 @@ var MediaPreviewThumbnail = class extends GlobalThis.HTMLElement {
|
|
|
7564
7652
|
const src = previewImage.split("#")[0];
|
|
7565
7653
|
const computedStyle = getComputedStyle(this);
|
|
7566
7654
|
const { maxWidth, maxHeight, minWidth, minHeight } = computedStyle;
|
|
7567
|
-
const
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7655
|
+
const objectFit = computedStyle.getPropertyValue("--media-preview-thumbnail-object-fit").trim() || "contain";
|
|
7656
|
+
let scaleX;
|
|
7657
|
+
let scaleY;
|
|
7658
|
+
if (objectFit === "fill") {
|
|
7659
|
+
const maxRatioX = parseInt(maxWidth) / w;
|
|
7660
|
+
const maxRatioY = parseInt(maxHeight) / h;
|
|
7661
|
+
const minRatioX = parseInt(minWidth) / w;
|
|
7662
|
+
const minRatioY = parseInt(minHeight) / h;
|
|
7663
|
+
scaleX = maxRatioX < 1 ? maxRatioX : Math.max(maxRatioX, minRatioX);
|
|
7664
|
+
scaleY = maxRatioY < 1 ? maxRatioY : Math.max(maxRatioY, minRatioY);
|
|
7665
|
+
} else {
|
|
7666
|
+
const maxRatio = Math.min(parseInt(maxWidth) / w, parseInt(maxHeight) / h);
|
|
7667
|
+
const minRatio = Math.max(parseInt(minWidth) / w, parseInt(minHeight) / h);
|
|
7668
|
+
const isScalingDown2 = maxRatio < 1;
|
|
7669
|
+
const scale = isScalingDown2 ? maxRatio : minRatio > 1 ? minRatio : 1;
|
|
7670
|
+
scaleX = scale;
|
|
7671
|
+
scaleY = scale;
|
|
7672
|
+
}
|
|
7571
7673
|
const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
|
|
7572
7674
|
const imgStyle = getOrInsertCSSRule(this.shadowRoot, "img").style;
|
|
7573
7675
|
const img = this.shadowRoot.querySelector("img");
|
|
7676
|
+
const isScalingDown = Math.min(scaleX, scaleY) < 1;
|
|
7574
7677
|
const extremum = isScalingDown ? "min" : "max";
|
|
7575
7678
|
style.setProperty(`${extremum}-width`, "initial", "important");
|
|
7576
7679
|
style.setProperty(`${extremum}-height`, "initial", "important");
|
|
7577
|
-
style.width = `${w *
|
|
7578
|
-
style.height = `${h *
|
|
7680
|
+
style.width = `${w * scaleX}px`;
|
|
7681
|
+
style.height = `${h * scaleY}px`;
|
|
7579
7682
|
const resize = () => {
|
|
7580
|
-
imgStyle.width = `${this.imgWidth *
|
|
7581
|
-
imgStyle.height = `${this.imgHeight *
|
|
7683
|
+
imgStyle.width = `${this.imgWidth * scaleX}px`;
|
|
7684
|
+
imgStyle.height = `${this.imgHeight * scaleY}px`;
|
|
7582
7685
|
imgStyle.display = "block";
|
|
7583
7686
|
};
|
|
7584
7687
|
if (img.src !== src) {
|
|
@@ -7586,12 +7689,13 @@ var MediaPreviewThumbnail = class extends GlobalThis.HTMLElement {
|
|
|
7586
7689
|
this.imgWidth = img.naturalWidth;
|
|
7587
7690
|
this.imgHeight = img.naturalHeight;
|
|
7588
7691
|
resize();
|
|
7692
|
+
img.onload = null;
|
|
7589
7693
|
};
|
|
7590
7694
|
img.src = src;
|
|
7591
7695
|
resize();
|
|
7592
7696
|
}
|
|
7593
7697
|
resize();
|
|
7594
|
-
imgStyle.transform = `translate(-${x *
|
|
7698
|
+
imgStyle.transform = `translate(-${x * scaleX}px, -${y * scaleY}px)`;
|
|
7595
7699
|
}
|
|
7596
7700
|
};
|
|
7597
7701
|
_mediaController7 = /* @__PURE__ */ new WeakMap();
|
|
@@ -7680,6 +7784,9 @@ function getSlotTemplateHTML16(_attrs, props) {
|
|
|
7680
7784
|
`
|
|
7681
7785
|
);
|
|
7682
7786
|
}
|
|
7787
|
+
var updateAriaLabel7 = (el, seekOffset) => {
|
|
7788
|
+
el.setAttribute("aria-label", t("seek back {seekOffset} seconds", { seekOffset }));
|
|
7789
|
+
};
|
|
7683
7790
|
function getTooltipContentHTML10() {
|
|
7684
7791
|
return t("Seek backward");
|
|
7685
7792
|
}
|
|
@@ -7702,6 +7809,7 @@ var MediaSeekBackwardButton = class extends MediaChromeButton {
|
|
|
7702
7809
|
}
|
|
7703
7810
|
attributeChangedCallback(attrName, _oldValue, newValue) {
|
|
7704
7811
|
super.attributeChangedCallback(attrName, _oldValue, newValue);
|
|
7812
|
+
updateAriaLabel7(this, this.seekOffset);
|
|
7705
7813
|
if (attrName === Attributes9.SEEK_OFFSET) {
|
|
7706
7814
|
this.seekOffset = getNumericAttr(
|
|
7707
7815
|
this,
|
|
@@ -7779,6 +7887,9 @@ function getSlotTemplateHTML17(_attrs, props) {
|
|
|
7779
7887
|
`
|
|
7780
7888
|
);
|
|
7781
7889
|
}
|
|
7890
|
+
var updateAriaLabel8 = (el, seekOffset) => {
|
|
7891
|
+
el.setAttribute("aria-label", t("seek forward {seekOffset} seconds", { seekOffset }));
|
|
7892
|
+
};
|
|
7782
7893
|
function getTooltipContentHTML11() {
|
|
7783
7894
|
return t("Seek forward");
|
|
7784
7895
|
}
|
|
@@ -7801,6 +7912,7 @@ var MediaSeekForwardButton = class extends MediaChromeButton {
|
|
|
7801
7912
|
}
|
|
7802
7913
|
attributeChangedCallback(attrName, _oldValue, newValue) {
|
|
7803
7914
|
super.attributeChangedCallback(attrName, _oldValue, newValue);
|
|
7915
|
+
updateAriaLabel8(this, this.seekOffset);
|
|
7804
7916
|
if (attrName === Attributes10.SEEK_OFFSET) {
|
|
7805
7917
|
this.seekOffset = getNumericAttr(
|
|
7806
7918
|
this,
|
|
@@ -7876,7 +7988,21 @@ var __privateSet17 = (obj, member, value, setter) => {
|
|
|
7876
7988
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
7877
7989
|
return value;
|
|
7878
7990
|
};
|
|
7991
|
+
var __privateMethod6 = (obj, member, method) => {
|
|
7992
|
+
__accessCheck19(obj, member, "access private method");
|
|
7993
|
+
return method;
|
|
7994
|
+
};
|
|
7879
7995
|
var _slot4;
|
|
7996
|
+
var _keyUpHandler2;
|
|
7997
|
+
var _keyDownHandler3;
|
|
7998
|
+
var _setupEventListeners;
|
|
7999
|
+
var setupEventListeners_fn;
|
|
8000
|
+
var _removeEventListeners;
|
|
8001
|
+
var removeEventListeners_fn;
|
|
8002
|
+
var _makeInteractive;
|
|
8003
|
+
var makeInteractive_fn;
|
|
8004
|
+
var _makeNonInteractive;
|
|
8005
|
+
var makeNonInteractive_fn;
|
|
7880
8006
|
var Attributes11 = {
|
|
7881
8007
|
REMAINING: "remaining",
|
|
7882
8008
|
SHOW_DURATION: "showduration",
|
|
@@ -7905,8 +8031,7 @@ var formatTimesLabel = (el, { timesSep = DEFAULT_TIMES_SEP } = {}) => {
|
|
|
7905
8031
|
return timeLabel;
|
|
7906
8032
|
return `${timeLabel}${timesSep}${formatTime(endTime)}`;
|
|
7907
8033
|
};
|
|
7908
|
-
var
|
|
7909
|
-
var updateAriaValueText = (el) => {
|
|
8034
|
+
var updateAriaDescription = (el) => {
|
|
7910
8035
|
var _a3;
|
|
7911
8036
|
const currentTime = el.mediaCurrentTime;
|
|
7912
8037
|
const [, seekableEnd] = (_a3 = el.mediaSeekable) != null ? _a3 : [];
|
|
@@ -7917,17 +8042,20 @@ var updateAriaValueText = (el) => {
|
|
|
7917
8042
|
endTime = seekableEnd;
|
|
7918
8043
|
}
|
|
7919
8044
|
if (currentTime == null || endTime === null) {
|
|
7920
|
-
el.setAttribute("aria-
|
|
8045
|
+
el.setAttribute("aria-description", t("video not loaded, unknown time."));
|
|
7921
8046
|
return;
|
|
7922
8047
|
}
|
|
7923
8048
|
const currentTimePhrase = el.remaining ? formatAsTimePhrase(0 - (endTime - currentTime)) : formatAsTimePhrase(currentTime);
|
|
7924
8049
|
if (!el.showDuration) {
|
|
7925
|
-
el.setAttribute("aria-
|
|
8050
|
+
el.setAttribute("aria-description", currentTimePhrase);
|
|
7926
8051
|
return;
|
|
7927
8052
|
}
|
|
7928
8053
|
const totalTimePhrase = formatAsTimePhrase(endTime);
|
|
7929
|
-
const fullPhrase =
|
|
7930
|
-
|
|
8054
|
+
const fullPhrase = t("{currentTime} of {totalTime}", {
|
|
8055
|
+
currentTime: currentTimePhrase,
|
|
8056
|
+
totalTime: totalTimePhrase
|
|
8057
|
+
});
|
|
8058
|
+
el.setAttribute("aria-description", fullPhrase);
|
|
7931
8059
|
};
|
|
7932
8060
|
function getSlotTemplateHTML18(_attrs, props) {
|
|
7933
8061
|
return (
|
|
@@ -7937,10 +8065,26 @@ function getSlotTemplateHTML18(_attrs, props) {
|
|
|
7937
8065
|
`
|
|
7938
8066
|
);
|
|
7939
8067
|
}
|
|
8068
|
+
var updateAriaLabel9 = (el) => {
|
|
8069
|
+
el.setAttribute("aria-label", t("playback time"));
|
|
8070
|
+
};
|
|
7940
8071
|
var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
7941
8072
|
constructor() {
|
|
7942
8073
|
super();
|
|
8074
|
+
__privateAdd19(this, _setupEventListeners);
|
|
8075
|
+
__privateAdd19(this, _removeEventListeners);
|
|
8076
|
+
__privateAdd19(this, _makeInteractive);
|
|
8077
|
+
__privateAdd19(this, _makeNonInteractive);
|
|
7943
8078
|
__privateAdd19(this, _slot4, void 0);
|
|
8079
|
+
__privateAdd19(this, _keyUpHandler2, null);
|
|
8080
|
+
__privateAdd19(this, _keyDownHandler3, (evt) => {
|
|
8081
|
+
const { metaKey, altKey, key } = evt;
|
|
8082
|
+
if (metaKey || altKey || !ButtonPressedKeys2.includes(key)) {
|
|
8083
|
+
this.removeEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8084
|
+
return;
|
|
8085
|
+
}
|
|
8086
|
+
this.addEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8087
|
+
});
|
|
7944
8088
|
__privateSet17(this, _slot4, this.shadowRoot.querySelector("slot"));
|
|
7945
8089
|
__privateGet19(this, _slot4).innerHTML = `${formatTimesLabel(this)}`;
|
|
7946
8090
|
}
|
|
@@ -7957,28 +8101,8 @@ var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
|
7957
8101
|
"background",
|
|
7958
8102
|
"var(--media-control-hover-background, rgba(50 50 70 / .7))"
|
|
7959
8103
|
);
|
|
7960
|
-
if (!this.hasAttribute("disabled")) {
|
|
7961
|
-
this.enable();
|
|
7962
|
-
}
|
|
7963
|
-
this.setAttribute("role", "progressbar");
|
|
7964
8104
|
this.setAttribute("aria-label", t("playback time"));
|
|
7965
|
-
|
|
7966
|
-
const { key } = evt;
|
|
7967
|
-
if (!ButtonPressedKeys2.includes(key)) {
|
|
7968
|
-
this.removeEventListener("keyup", keyUpHandler);
|
|
7969
|
-
return;
|
|
7970
|
-
}
|
|
7971
|
-
this.toggleTimeDisplay();
|
|
7972
|
-
};
|
|
7973
|
-
this.addEventListener("keydown", (evt) => {
|
|
7974
|
-
const { metaKey, altKey, key } = evt;
|
|
7975
|
-
if (metaKey || altKey || !ButtonPressedKeys2.includes(key)) {
|
|
7976
|
-
this.removeEventListener("keyup", keyUpHandler);
|
|
7977
|
-
return;
|
|
7978
|
-
}
|
|
7979
|
-
this.addEventListener("keyup", keyUpHandler);
|
|
7980
|
-
});
|
|
7981
|
-
this.addEventListener("click", this.toggleTimeDisplay);
|
|
8105
|
+
__privateMethod6(this, _makeInteractive, makeInteractive_fn).call(this);
|
|
7982
8106
|
super.connectedCallback();
|
|
7983
8107
|
}
|
|
7984
8108
|
toggleTimeDisplay() {
|
|
@@ -7993,22 +8117,32 @@ var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
|
7993
8117
|
}
|
|
7994
8118
|
disconnectedCallback() {
|
|
7995
8119
|
this.disable();
|
|
8120
|
+
__privateMethod6(this, _removeEventListeners, removeEventListeners_fn).call(this);
|
|
7996
8121
|
super.disconnectedCallback();
|
|
7997
8122
|
}
|
|
7998
8123
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
8124
|
+
updateAriaLabel9(this);
|
|
7999
8125
|
if (CombinedAttributes.includes(attrName)) {
|
|
8000
8126
|
this.update();
|
|
8001
8127
|
} else if (attrName === "disabled" && newValue !== oldValue) {
|
|
8002
8128
|
if (newValue == null) {
|
|
8003
|
-
this.
|
|
8129
|
+
__privateMethod6(this, _makeInteractive, makeInteractive_fn).call(this);
|
|
8004
8130
|
} else {
|
|
8005
|
-
this.
|
|
8131
|
+
__privateMethod6(this, _makeNonInteractive, makeNonInteractive_fn).call(this);
|
|
8132
|
+
}
|
|
8133
|
+
} else if (attrName === Attributes11.NO_TOGGLE && newValue !== oldValue) {
|
|
8134
|
+
if (this.noToggle) {
|
|
8135
|
+
__privateMethod6(this, _makeNonInteractive, makeNonInteractive_fn).call(this);
|
|
8136
|
+
} else {
|
|
8137
|
+
__privateMethod6(this, _makeInteractive, makeInteractive_fn).call(this);
|
|
8006
8138
|
}
|
|
8007
8139
|
}
|
|
8008
8140
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
8009
8141
|
}
|
|
8010
8142
|
enable() {
|
|
8011
|
-
this.
|
|
8143
|
+
if (!this.noToggle) {
|
|
8144
|
+
this.tabIndex = 0;
|
|
8145
|
+
}
|
|
8012
8146
|
}
|
|
8013
8147
|
disable() {
|
|
8014
8148
|
this.tabIndex = -1;
|
|
@@ -8079,13 +8213,54 @@ var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
|
8079
8213
|
}
|
|
8080
8214
|
update() {
|
|
8081
8215
|
const timesLabel = formatTimesLabel(this);
|
|
8082
|
-
|
|
8216
|
+
updateAriaDescription(this);
|
|
8083
8217
|
if (timesLabel !== __privateGet19(this, _slot4).innerHTML) {
|
|
8084
8218
|
__privateGet19(this, _slot4).innerHTML = timesLabel;
|
|
8085
8219
|
}
|
|
8086
8220
|
}
|
|
8087
8221
|
};
|
|
8088
8222
|
_slot4 = /* @__PURE__ */ new WeakMap();
|
|
8223
|
+
_keyUpHandler2 = /* @__PURE__ */ new WeakMap();
|
|
8224
|
+
_keyDownHandler3 = /* @__PURE__ */ new WeakMap();
|
|
8225
|
+
_setupEventListeners = /* @__PURE__ */ new WeakSet();
|
|
8226
|
+
setupEventListeners_fn = function() {
|
|
8227
|
+
if (__privateGet19(this, _keyUpHandler2)) {
|
|
8228
|
+
return;
|
|
8229
|
+
}
|
|
8230
|
+
__privateSet17(this, _keyUpHandler2, (evt) => {
|
|
8231
|
+
const { key } = evt;
|
|
8232
|
+
if (!ButtonPressedKeys2.includes(key)) {
|
|
8233
|
+
this.removeEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8234
|
+
return;
|
|
8235
|
+
}
|
|
8236
|
+
this.toggleTimeDisplay();
|
|
8237
|
+
});
|
|
8238
|
+
this.addEventListener("keydown", __privateGet19(this, _keyDownHandler3));
|
|
8239
|
+
this.addEventListener("click", this.toggleTimeDisplay);
|
|
8240
|
+
};
|
|
8241
|
+
_removeEventListeners = /* @__PURE__ */ new WeakSet();
|
|
8242
|
+
removeEventListeners_fn = function() {
|
|
8243
|
+
if (__privateGet19(this, _keyUpHandler2)) {
|
|
8244
|
+
this.removeEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8245
|
+
this.removeEventListener("keydown", __privateGet19(this, _keyDownHandler3));
|
|
8246
|
+
this.removeEventListener("click", this.toggleTimeDisplay);
|
|
8247
|
+
__privateSet17(this, _keyUpHandler2, null);
|
|
8248
|
+
}
|
|
8249
|
+
};
|
|
8250
|
+
_makeInteractive = /* @__PURE__ */ new WeakSet();
|
|
8251
|
+
makeInteractive_fn = function() {
|
|
8252
|
+
if (!this.noToggle && !this.hasAttribute("disabled")) {
|
|
8253
|
+
this.setAttribute("role", "button");
|
|
8254
|
+
this.enable();
|
|
8255
|
+
__privateMethod6(this, _setupEventListeners, setupEventListeners_fn).call(this);
|
|
8256
|
+
}
|
|
8257
|
+
};
|
|
8258
|
+
_makeNonInteractive = /* @__PURE__ */ new WeakSet();
|
|
8259
|
+
makeNonInteractive_fn = function() {
|
|
8260
|
+
this.removeAttribute("role");
|
|
8261
|
+
this.disable();
|
|
8262
|
+
__privateMethod6(this, _removeEventListeners, removeEventListeners_fn).call(this);
|
|
8263
|
+
};
|
|
8089
8264
|
MediaTimeDisplay.getSlotTemplateHTML = getSlotTemplateHTML18;
|
|
8090
8265
|
if (!GlobalThis.customElements.get("media-time-display")) {
|
|
8091
8266
|
GlobalThis.customElements.define("media-time-display", MediaTimeDisplay);
|
|
@@ -8218,7 +8393,7 @@ var __privateSet19 = (obj, member, value, setter) => {
|
|
|
8218
8393
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
8219
8394
|
return value;
|
|
8220
8395
|
};
|
|
8221
|
-
var
|
|
8396
|
+
var __privateMethod7 = (obj, member, method) => {
|
|
8222
8397
|
__accessCheck21(obj, member, "access private method");
|
|
8223
8398
|
return method;
|
|
8224
8399
|
};
|
|
@@ -8233,7 +8408,6 @@ var _boxPaddingRight;
|
|
|
8233
8408
|
var _mediaChaptersCues;
|
|
8234
8409
|
var _isPointerDown;
|
|
8235
8410
|
var _toggleRangeAnimation;
|
|
8236
|
-
var toggleRangeAnimation_fn;
|
|
8237
8411
|
var _shouldRangeAnimate;
|
|
8238
8412
|
var shouldRangeAnimate_fn;
|
|
8239
8413
|
var _updateRange;
|
|
@@ -8249,19 +8423,20 @@ var _previewRequest;
|
|
|
8249
8423
|
var previewRequest_fn;
|
|
8250
8424
|
var _seekRequest;
|
|
8251
8425
|
var seekRequest_fn;
|
|
8252
|
-
var
|
|
8253
|
-
var updateAriaValueText2 = (el) => {
|
|
8426
|
+
var updateAriaValueText = (el) => {
|
|
8254
8427
|
const range = el.range;
|
|
8255
8428
|
const currentTimePhrase = formatAsTimePhrase(+calcTimeFromRangeValue(el));
|
|
8256
8429
|
const totalTimePhrase = formatAsTimePhrase(+el.mediaSeekableEnd);
|
|
8257
|
-
const fullPhrase = !(currentTimePhrase && totalTimePhrase) ?
|
|
8430
|
+
const fullPhrase = !(currentTimePhrase && totalTimePhrase) ? t("video not loaded, unknown time.") : t("{currentTime} of {totalTime}", {
|
|
8431
|
+
currentTime: currentTimePhrase,
|
|
8432
|
+
totalTime: totalTimePhrase
|
|
8433
|
+
});
|
|
8258
8434
|
range.setAttribute("aria-valuetext", fullPhrase);
|
|
8259
8435
|
};
|
|
8260
|
-
function
|
|
8436
|
+
function getContainerTemplateHTML2(_attrs) {
|
|
8261
8437
|
return (
|
|
8262
8438
|
/*html*/
|
|
8263
8439
|
`
|
|
8264
|
-
${MediaChromeRange.getTemplateHTML(_attrs)}
|
|
8265
8440
|
<style>
|
|
8266
8441
|
:host {
|
|
8267
8442
|
--media-box-border-radius: 4px;
|
|
@@ -8509,7 +8684,6 @@ var calcTimeFromRangeValue = (el, value = el.range.valueAsNumber) => {
|
|
|
8509
8684
|
var MediaTimeRange = class extends MediaChromeRange {
|
|
8510
8685
|
constructor() {
|
|
8511
8686
|
super();
|
|
8512
|
-
__privateAdd21(this, _toggleRangeAnimation);
|
|
8513
8687
|
__privateAdd21(this, _shouldRangeAnimate);
|
|
8514
8688
|
__privateAdd21(this, _getElementRects);
|
|
8515
8689
|
__privateAdd21(this, _getBoxPosition);
|
|
@@ -8517,7 +8691,7 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8517
8691
|
__privateAdd21(this, _handlePointerMove3);
|
|
8518
8692
|
__privateAdd21(this, _previewRequest);
|
|
8519
8693
|
__privateAdd21(this, _seekRequest);
|
|
8520
|
-
__privateAdd21(this, _rootNode,
|
|
8694
|
+
__privateAdd21(this, _rootNode, null);
|
|
8521
8695
|
__privateAdd21(this, _animation, void 0);
|
|
8522
8696
|
__privateAdd21(this, _boxes, void 0);
|
|
8523
8697
|
__privateAdd21(this, _previewTime, void 0);
|
|
@@ -8527,6 +8701,13 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8527
8701
|
__privateAdd21(this, _boxPaddingRight, void 0);
|
|
8528
8702
|
__privateAdd21(this, _mediaChaptersCues, void 0);
|
|
8529
8703
|
__privateAdd21(this, _isPointerDown, void 0);
|
|
8704
|
+
__privateAdd21(this, _toggleRangeAnimation, () => {
|
|
8705
|
+
if (__privateMethod7(this, _shouldRangeAnimate, shouldRangeAnimate_fn).call(this)) {
|
|
8706
|
+
__privateGet21(this, _animation).start();
|
|
8707
|
+
} else {
|
|
8708
|
+
__privateGet21(this, _animation).stop();
|
|
8709
|
+
}
|
|
8710
|
+
});
|
|
8530
8711
|
__privateAdd21(this, _updateRange, (value) => {
|
|
8531
8712
|
if (this.dragging)
|
|
8532
8713
|
return;
|
|
@@ -8574,14 +8755,14 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8574
8755
|
var _a3;
|
|
8575
8756
|
super.connectedCallback();
|
|
8576
8757
|
this.range.setAttribute("aria-label", t("seek"));
|
|
8577
|
-
|
|
8758
|
+
__privateGet21(this, _toggleRangeAnimation).call(this);
|
|
8578
8759
|
__privateSet19(this, _rootNode, this.getRootNode());
|
|
8579
8760
|
(_a3 = __privateGet21(this, _rootNode)) == null ? void 0 : _a3.addEventListener("transitionstart", this);
|
|
8580
8761
|
}
|
|
8581
8762
|
disconnectedCallback() {
|
|
8582
8763
|
var _a3;
|
|
8583
8764
|
super.disconnectedCallback();
|
|
8584
|
-
|
|
8765
|
+
__privateGet21(this, _animation).stop();
|
|
8585
8766
|
(_a3 = __privateGet21(this, _rootNode)) == null ? void 0 : _a3.removeEventListener("transitionstart", this);
|
|
8586
8767
|
__privateSet19(this, _rootNode, null);
|
|
8587
8768
|
}
|
|
@@ -8595,8 +8776,8 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8595
8776
|
duration: this.mediaSeekableEnd - this.mediaSeekableStart,
|
|
8596
8777
|
playbackRate: this.mediaPlaybackRate
|
|
8597
8778
|
});
|
|
8598
|
-
|
|
8599
|
-
|
|
8779
|
+
__privateGet21(this, _toggleRangeAnimation).call(this);
|
|
8780
|
+
updateAriaValueText(this);
|
|
8600
8781
|
} else if (attrName === MediaUIAttributes.MEDIA_BUFFERED) {
|
|
8601
8782
|
this.updateBufferedBar();
|
|
8602
8783
|
}
|
|
@@ -8777,9 +8958,9 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8777
8958
|
this.shadowRoot,
|
|
8778
8959
|
'[part~="current-box"]'
|
|
8779
8960
|
);
|
|
8780
|
-
const rects =
|
|
8781
|
-
const boxPos =
|
|
8782
|
-
const boxShift =
|
|
8961
|
+
const rects = __privateMethod7(this, _getElementRects, getElementRects_fn).call(this, __privateGet21(this, _currentBox));
|
|
8962
|
+
const boxPos = __privateMethod7(this, _getBoxPosition, getBoxPosition_fn).call(this, rects, this.range.valueAsNumber);
|
|
8963
|
+
const boxShift = __privateMethod7(this, _getBoxShiftPosition, getBoxShiftPosition_fn).call(this, rects, this.range.valueAsNumber);
|
|
8783
8964
|
currentRailRule.style.transform = `translateX(${boxPos})`;
|
|
8784
8965
|
currentRailRule.style.setProperty("--_range-width", `${rects.range.width}`);
|
|
8785
8966
|
currentBoxRule.style.setProperty("--_box-shift", `${boxShift}`);
|
|
@@ -8790,10 +8971,10 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8790
8971
|
super.handleEvent(evt);
|
|
8791
8972
|
switch (evt.type) {
|
|
8792
8973
|
case "input":
|
|
8793
|
-
|
|
8974
|
+
__privateMethod7(this, _seekRequest, seekRequest_fn).call(this);
|
|
8794
8975
|
break;
|
|
8795
8976
|
case "pointermove":
|
|
8796
|
-
|
|
8977
|
+
__privateMethod7(this, _handlePointerMove3, handlePointerMove_fn3).call(this, evt);
|
|
8797
8978
|
break;
|
|
8798
8979
|
case "pointerup":
|
|
8799
8980
|
if (__privateGet21(this, _isPointerDown))
|
|
@@ -8803,11 +8984,11 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8803
8984
|
__privateSet19(this, _isPointerDown, true);
|
|
8804
8985
|
break;
|
|
8805
8986
|
case "pointerleave":
|
|
8806
|
-
|
|
8987
|
+
__privateMethod7(this, _previewRequest, previewRequest_fn).call(this, null);
|
|
8807
8988
|
break;
|
|
8808
8989
|
case "transitionstart":
|
|
8809
8990
|
if (containsComposedNode(evt.target, this)) {
|
|
8810
|
-
setTimeout(() =>
|
|
8991
|
+
setTimeout(() => __privateGet21(this, _toggleRangeAnimation).call(this), 0);
|
|
8811
8992
|
}
|
|
8812
8993
|
break;
|
|
8813
8994
|
}
|
|
@@ -8823,14 +9004,7 @@ _boxPaddingLeft = /* @__PURE__ */ new WeakMap();
|
|
|
8823
9004
|
_boxPaddingRight = /* @__PURE__ */ new WeakMap();
|
|
8824
9005
|
_mediaChaptersCues = /* @__PURE__ */ new WeakMap();
|
|
8825
9006
|
_isPointerDown = /* @__PURE__ */ new WeakMap();
|
|
8826
|
-
_toggleRangeAnimation = /* @__PURE__ */ new
|
|
8827
|
-
toggleRangeAnimation_fn = function() {
|
|
8828
|
-
if (__privateMethod6(this, _shouldRangeAnimate, shouldRangeAnimate_fn).call(this)) {
|
|
8829
|
-
__privateGet21(this, _animation).start();
|
|
8830
|
-
} else {
|
|
8831
|
-
__privateGet21(this, _animation).stop();
|
|
8832
|
-
}
|
|
8833
|
-
};
|
|
9007
|
+
_toggleRangeAnimation = /* @__PURE__ */ new WeakMap();
|
|
8834
9008
|
_shouldRangeAnimate = /* @__PURE__ */ new WeakSet();
|
|
8835
9009
|
shouldRangeAnimate_fn = function() {
|
|
8836
9010
|
return this.isConnected && !this.mediaPaused && !this.mediaLoading && !this.mediaEnded && this.mediaSeekableEnd > 0 && isElementVisible(this);
|
|
@@ -8889,7 +9063,7 @@ handlePointerMove_fn3 = function(evt) {
|
|
|
8889
9063
|
(b) => evt.composedPath().includes(b)
|
|
8890
9064
|
);
|
|
8891
9065
|
if (!this.dragging && (isOverBoxes || !evt.composedPath().includes(this))) {
|
|
8892
|
-
|
|
9066
|
+
__privateMethod7(this, _previewRequest, previewRequest_fn).call(this, null);
|
|
8893
9067
|
return;
|
|
8894
9068
|
}
|
|
8895
9069
|
const duration = this.mediaSeekableEnd;
|
|
@@ -8903,11 +9077,11 @@ handlePointerMove_fn3 = function(evt) {
|
|
|
8903
9077
|
this.shadowRoot,
|
|
8904
9078
|
'[part~="preview-box"]'
|
|
8905
9079
|
);
|
|
8906
|
-
const rects =
|
|
9080
|
+
const rects = __privateMethod7(this, _getElementRects, getElementRects_fn).call(this, __privateGet21(this, _previewBox));
|
|
8907
9081
|
let pointerRatio = (evt.clientX - rects.range.left) / rects.range.width;
|
|
8908
9082
|
pointerRatio = Math.max(0, Math.min(1, pointerRatio));
|
|
8909
|
-
const boxPos =
|
|
8910
|
-
const boxShift =
|
|
9083
|
+
const boxPos = __privateMethod7(this, _getBoxPosition, getBoxPosition_fn).call(this, rects, pointerRatio);
|
|
9084
|
+
const boxShift = __privateMethod7(this, _getBoxShiftPosition, getBoxShiftPosition_fn).call(this, rects, pointerRatio);
|
|
8911
9085
|
previewRailRule.style.transform = `translateX(${boxPos})`;
|
|
8912
9086
|
previewRailRule.style.setProperty("--_range-width", `${rects.range.width}`);
|
|
8913
9087
|
previewBoxRule.style.setProperty("--_box-shift", `${boxShift}`);
|
|
@@ -8916,7 +9090,7 @@ handlePointerMove_fn3 = function(evt) {
|
|
|
8916
9090
|
if (Math.abs(diff) < 1 && pointerRatio > 0.01 && pointerRatio < 0.99)
|
|
8917
9091
|
return;
|
|
8918
9092
|
__privateSet19(this, _previewTime, pointerRatio * duration);
|
|
8919
|
-
|
|
9093
|
+
__privateMethod7(this, _previewRequest, previewRequest_fn).call(this, __privateGet21(this, _previewTime));
|
|
8920
9094
|
};
|
|
8921
9095
|
_previewRequest = /* @__PURE__ */ new WeakSet();
|
|
8922
9096
|
previewRequest_fn = function(detail) {
|
|
@@ -8941,12 +9115,26 @@ seekRequest_fn = function() {
|
|
|
8941
9115
|
);
|
|
8942
9116
|
};
|
|
8943
9117
|
MediaTimeRange.shadowRootOptions = { mode: "open" };
|
|
8944
|
-
MediaTimeRange.
|
|
9118
|
+
MediaTimeRange.getContainerTemplateHTML = getContainerTemplateHTML2;
|
|
8945
9119
|
if (!GlobalThis.customElements.get("media-time-range")) {
|
|
8946
9120
|
GlobalThis.customElements.define("media-time-range", MediaTimeRange);
|
|
8947
9121
|
}
|
|
8948
9122
|
|
|
8949
9123
|
// ../../node_modules/media-chrome/dist/media-volume-range.js
|
|
9124
|
+
var __accessCheck22 = (obj, member, msg) => {
|
|
9125
|
+
if (!member.has(obj))
|
|
9126
|
+
throw TypeError("Cannot " + msg);
|
|
9127
|
+
};
|
|
9128
|
+
var __privateGet22 = (obj, member, getter) => {
|
|
9129
|
+
__accessCheck22(obj, member, "read from private field");
|
|
9130
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
9131
|
+
};
|
|
9132
|
+
var __privateAdd22 = (obj, member, value) => {
|
|
9133
|
+
if (member.has(obj))
|
|
9134
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
9135
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9136
|
+
};
|
|
9137
|
+
var _handleRangeInput;
|
|
8950
9138
|
var DEFAULT_VOLUME = 1;
|
|
8951
9139
|
var toVolume = (el) => {
|
|
8952
9140
|
if (el.mediaMuted)
|
|
@@ -8955,17 +9143,9 @@ var toVolume = (el) => {
|
|
|
8955
9143
|
};
|
|
8956
9144
|
var formatAsPercentString = (value) => `${Math.round(value * 100)}%`;
|
|
8957
9145
|
var MediaVolumeRange = class extends MediaChromeRange {
|
|
8958
|
-
static get observedAttributes() {
|
|
8959
|
-
return [
|
|
8960
|
-
...super.observedAttributes,
|
|
8961
|
-
MediaUIAttributes.MEDIA_VOLUME,
|
|
8962
|
-
MediaUIAttributes.MEDIA_MUTED,
|
|
8963
|
-
MediaUIAttributes.MEDIA_VOLUME_UNAVAILABLE
|
|
8964
|
-
];
|
|
8965
|
-
}
|
|
8966
9146
|
constructor() {
|
|
8967
|
-
super();
|
|
8968
|
-
this
|
|
9147
|
+
super(...arguments);
|
|
9148
|
+
__privateAdd22(this, _handleRangeInput, () => {
|
|
8969
9149
|
const detail = this.range.value;
|
|
8970
9150
|
const evt = new GlobalThis.CustomEvent(
|
|
8971
9151
|
MediaUIEvents.MEDIA_VOLUME_REQUEST,
|
|
@@ -8978,9 +9158,22 @@ var MediaVolumeRange = class extends MediaChromeRange {
|
|
|
8978
9158
|
this.dispatchEvent(evt);
|
|
8979
9159
|
});
|
|
8980
9160
|
}
|
|
9161
|
+
static get observedAttributes() {
|
|
9162
|
+
return [
|
|
9163
|
+
...super.observedAttributes,
|
|
9164
|
+
MediaUIAttributes.MEDIA_VOLUME,
|
|
9165
|
+
MediaUIAttributes.MEDIA_MUTED,
|
|
9166
|
+
MediaUIAttributes.MEDIA_VOLUME_UNAVAILABLE
|
|
9167
|
+
];
|
|
9168
|
+
}
|
|
8981
9169
|
connectedCallback() {
|
|
8982
9170
|
super.connectedCallback();
|
|
8983
9171
|
this.range.setAttribute("aria-label", t("volume"));
|
|
9172
|
+
this.range.addEventListener("input", __privateGet22(this, _handleRangeInput));
|
|
9173
|
+
}
|
|
9174
|
+
disconnectedCallback() {
|
|
9175
|
+
this.range.removeEventListener("input", __privateGet22(this, _handleRangeInput));
|
|
9176
|
+
super.disconnectedCallback();
|
|
8984
9177
|
}
|
|
8985
9178
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
8986
9179
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
@@ -9021,6 +9214,7 @@ var MediaVolumeRange = class extends MediaChromeRange {
|
|
|
9021
9214
|
setStringAttr(this, MediaUIAttributes.MEDIA_VOLUME_UNAVAILABLE, value);
|
|
9022
9215
|
}
|
|
9023
9216
|
};
|
|
9217
|
+
_handleRangeInput = /* @__PURE__ */ new WeakMap();
|
|
9024
9218
|
if (!GlobalThis.customElements.get("media-volume-range")) {
|
|
9025
9219
|
GlobalThis.customElements.define("media-volume-range", MediaVolumeRange);
|
|
9026
9220
|
}
|
|
@@ -9112,21 +9306,21 @@ if (!GlobalThis.customElements.get("media-loop-button")) {
|
|
|
9112
9306
|
}
|
|
9113
9307
|
|
|
9114
9308
|
// ../../node_modules/media-chrome/dist/utils/template-parts.js
|
|
9115
|
-
var
|
|
9309
|
+
var __accessCheck23 = (obj, member, msg) => {
|
|
9116
9310
|
if (!member.has(obj))
|
|
9117
9311
|
throw TypeError("Cannot " + msg);
|
|
9118
9312
|
};
|
|
9119
|
-
var
|
|
9120
|
-
|
|
9313
|
+
var __privateGet23 = (obj, member, getter) => {
|
|
9314
|
+
__accessCheck23(obj, member, "read from private field");
|
|
9121
9315
|
return getter ? getter.call(obj) : member.get(obj);
|
|
9122
9316
|
};
|
|
9123
|
-
var
|
|
9317
|
+
var __privateAdd23 = (obj, member, value) => {
|
|
9124
9318
|
if (member.has(obj))
|
|
9125
9319
|
throw TypeError("Cannot add the same private member more than once");
|
|
9126
9320
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9127
9321
|
};
|
|
9128
9322
|
var __privateSet20 = (obj, member, value, setter) => {
|
|
9129
|
-
|
|
9323
|
+
__accessCheck23(obj, member, "write to private field");
|
|
9130
9324
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
9131
9325
|
return value;
|
|
9132
9326
|
};
|
|
@@ -9166,16 +9360,16 @@ var TemplateInstance = class extends GlobalThis.DocumentFragment {
|
|
|
9166
9360
|
constructor(template2, state, processor2 = defaultProcessor) {
|
|
9167
9361
|
var _a3;
|
|
9168
9362
|
super();
|
|
9169
|
-
|
|
9170
|
-
|
|
9363
|
+
__privateAdd23(this, _parts, void 0);
|
|
9364
|
+
__privateAdd23(this, _processor, void 0);
|
|
9171
9365
|
this.append(template2.content.cloneNode(true));
|
|
9172
9366
|
__privateSet20(this, _parts, parse(this));
|
|
9173
9367
|
__privateSet20(this, _processor, processor2);
|
|
9174
|
-
(_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this,
|
|
9175
|
-
processor2.processCallback(this,
|
|
9368
|
+
(_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this, __privateGet23(this, _parts), state);
|
|
9369
|
+
processor2.processCallback(this, __privateGet23(this, _parts), state);
|
|
9176
9370
|
}
|
|
9177
9371
|
update(state) {
|
|
9178
|
-
|
|
9372
|
+
__privateGet23(this, _processor).processCallback(this, __privateGet23(this, _parts), state);
|
|
9179
9373
|
}
|
|
9180
9374
|
};
|
|
9181
9375
|
_parts = /* @__PURE__ */ new WeakMap();
|
|
@@ -9264,87 +9458,87 @@ var Part = class {
|
|
|
9264
9458
|
var attrPartToList = /* @__PURE__ */ new WeakMap();
|
|
9265
9459
|
var AttrPartList = class {
|
|
9266
9460
|
constructor() {
|
|
9267
|
-
|
|
9461
|
+
__privateAdd23(this, _items, []);
|
|
9268
9462
|
}
|
|
9269
9463
|
[Symbol.iterator]() {
|
|
9270
|
-
return
|
|
9464
|
+
return __privateGet23(this, _items).values();
|
|
9271
9465
|
}
|
|
9272
9466
|
get length() {
|
|
9273
|
-
return
|
|
9467
|
+
return __privateGet23(this, _items).length;
|
|
9274
9468
|
}
|
|
9275
9469
|
item(index) {
|
|
9276
|
-
return
|
|
9470
|
+
return __privateGet23(this, _items)[index];
|
|
9277
9471
|
}
|
|
9278
9472
|
append(...items) {
|
|
9279
9473
|
for (const item of items) {
|
|
9280
9474
|
if (item instanceof AttrPart) {
|
|
9281
9475
|
attrPartToList.set(item, this);
|
|
9282
9476
|
}
|
|
9283
|
-
|
|
9477
|
+
__privateGet23(this, _items).push(item);
|
|
9284
9478
|
}
|
|
9285
9479
|
}
|
|
9286
9480
|
toString() {
|
|
9287
|
-
return
|
|
9481
|
+
return __privateGet23(this, _items).join("");
|
|
9288
9482
|
}
|
|
9289
9483
|
};
|
|
9290
9484
|
_items = /* @__PURE__ */ new WeakMap();
|
|
9291
9485
|
var AttrPart = class extends Part {
|
|
9292
9486
|
constructor(element, attributeName, namespaceURI) {
|
|
9293
9487
|
super();
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9488
|
+
__privateAdd23(this, _list);
|
|
9489
|
+
__privateAdd23(this, _value, "");
|
|
9490
|
+
__privateAdd23(this, _element, void 0);
|
|
9491
|
+
__privateAdd23(this, _attributeName, void 0);
|
|
9492
|
+
__privateAdd23(this, _namespaceURI, void 0);
|
|
9299
9493
|
__privateSet20(this, _element, element);
|
|
9300
9494
|
__privateSet20(this, _attributeName, attributeName);
|
|
9301
9495
|
__privateSet20(this, _namespaceURI, namespaceURI);
|
|
9302
9496
|
}
|
|
9303
9497
|
get attributeName() {
|
|
9304
|
-
return
|
|
9498
|
+
return __privateGet23(this, _attributeName);
|
|
9305
9499
|
}
|
|
9306
9500
|
get attributeNamespace() {
|
|
9307
|
-
return
|
|
9501
|
+
return __privateGet23(this, _namespaceURI);
|
|
9308
9502
|
}
|
|
9309
9503
|
get element() {
|
|
9310
|
-
return
|
|
9504
|
+
return __privateGet23(this, _element);
|
|
9311
9505
|
}
|
|
9312
9506
|
get value() {
|
|
9313
|
-
return
|
|
9507
|
+
return __privateGet23(this, _value);
|
|
9314
9508
|
}
|
|
9315
9509
|
set value(newValue) {
|
|
9316
|
-
if (
|
|
9510
|
+
if (__privateGet23(this, _value) === newValue)
|
|
9317
9511
|
return;
|
|
9318
9512
|
__privateSet20(this, _value, newValue);
|
|
9319
|
-
if (!
|
|
9513
|
+
if (!__privateGet23(this, _list, list_get) || __privateGet23(this, _list, list_get).length === 1) {
|
|
9320
9514
|
if (newValue == null) {
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9515
|
+
__privateGet23(this, _element).removeAttributeNS(
|
|
9516
|
+
__privateGet23(this, _namespaceURI),
|
|
9517
|
+
__privateGet23(this, _attributeName)
|
|
9324
9518
|
);
|
|
9325
9519
|
} else {
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9520
|
+
__privateGet23(this, _element).setAttributeNS(
|
|
9521
|
+
__privateGet23(this, _namespaceURI),
|
|
9522
|
+
__privateGet23(this, _attributeName),
|
|
9329
9523
|
newValue
|
|
9330
9524
|
);
|
|
9331
9525
|
}
|
|
9332
9526
|
} else {
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9527
|
+
__privateGet23(this, _element).setAttributeNS(
|
|
9528
|
+
__privateGet23(this, _namespaceURI),
|
|
9529
|
+
__privateGet23(this, _attributeName),
|
|
9530
|
+
__privateGet23(this, _list, list_get).toString()
|
|
9337
9531
|
);
|
|
9338
9532
|
}
|
|
9339
9533
|
}
|
|
9340
9534
|
get booleanValue() {
|
|
9341
|
-
return
|
|
9342
|
-
|
|
9343
|
-
|
|
9535
|
+
return __privateGet23(this, _element).hasAttributeNS(
|
|
9536
|
+
__privateGet23(this, _namespaceURI),
|
|
9537
|
+
__privateGet23(this, _attributeName)
|
|
9344
9538
|
);
|
|
9345
9539
|
}
|
|
9346
9540
|
set booleanValue(value) {
|
|
9347
|
-
if (!
|
|
9541
|
+
if (!__privateGet23(this, _list, list_get) || __privateGet23(this, _list, list_get).length === 1)
|
|
9348
9542
|
this.value = value ? "" : null;
|
|
9349
9543
|
else
|
|
9350
9544
|
throw new DOMException("Value is not fully templatized");
|
|
@@ -9361,26 +9555,26 @@ list_get = function() {
|
|
|
9361
9555
|
var ChildNodePart = class extends Part {
|
|
9362
9556
|
constructor(parentNode, nodes) {
|
|
9363
9557
|
super();
|
|
9364
|
-
|
|
9365
|
-
|
|
9558
|
+
__privateAdd23(this, _parentNode, void 0);
|
|
9559
|
+
__privateAdd23(this, _nodes, void 0);
|
|
9366
9560
|
__privateSet20(this, _parentNode, parentNode);
|
|
9367
9561
|
__privateSet20(this, _nodes, nodes ? [...nodes] : [new Text()]);
|
|
9368
9562
|
}
|
|
9369
9563
|
get replacementNodes() {
|
|
9370
|
-
return
|
|
9564
|
+
return __privateGet23(this, _nodes);
|
|
9371
9565
|
}
|
|
9372
9566
|
get parentNode() {
|
|
9373
|
-
return
|
|
9567
|
+
return __privateGet23(this, _parentNode);
|
|
9374
9568
|
}
|
|
9375
9569
|
get nextSibling() {
|
|
9376
|
-
return
|
|
9570
|
+
return __privateGet23(this, _nodes)[__privateGet23(this, _nodes).length - 1].nextSibling;
|
|
9377
9571
|
}
|
|
9378
9572
|
get previousSibling() {
|
|
9379
|
-
return
|
|
9573
|
+
return __privateGet23(this, _nodes)[0].previousSibling;
|
|
9380
9574
|
}
|
|
9381
9575
|
// FIXME: not sure why do we need string serialization here? Just because parent class has type DOMString?
|
|
9382
9576
|
get value() {
|
|
9383
|
-
return
|
|
9577
|
+
return __privateGet23(this, _nodes).map((node) => node.textContent).join("");
|
|
9384
9578
|
}
|
|
9385
9579
|
set value(newValue) {
|
|
9386
9580
|
this.replace(newValue);
|
|
@@ -9392,8 +9586,8 @@ var ChildNodePart = class extends Part {
|
|
|
9392
9586
|
if (!normalisedNodes.length)
|
|
9393
9587
|
normalisedNodes.push(new Text());
|
|
9394
9588
|
__privateSet20(this, _nodes, swapdom(
|
|
9395
|
-
|
|
9396
|
-
|
|
9589
|
+
__privateGet23(this, _nodes)[0].parentNode,
|
|
9590
|
+
__privateGet23(this, _nodes),
|
|
9397
9591
|
normalisedNodes,
|
|
9398
9592
|
this.nextSibling
|
|
9399
9593
|
));
|
|
@@ -9670,35 +9864,37 @@ function tokenize2(str, parsers) {
|
|
|
9670
9864
|
}
|
|
9671
9865
|
|
|
9672
9866
|
// ../../node_modules/media-chrome/dist/media-theme-element.js
|
|
9673
|
-
var
|
|
9867
|
+
var __accessCheck24 = (obj, member, msg) => {
|
|
9674
9868
|
if (!member.has(obj))
|
|
9675
9869
|
throw TypeError("Cannot " + msg);
|
|
9676
9870
|
};
|
|
9677
|
-
var
|
|
9678
|
-
|
|
9871
|
+
var __privateGet24 = (obj, member, getter) => {
|
|
9872
|
+
__accessCheck24(obj, member, "read from private field");
|
|
9679
9873
|
return getter ? getter.call(obj) : member.get(obj);
|
|
9680
9874
|
};
|
|
9681
|
-
var
|
|
9875
|
+
var __privateAdd24 = (obj, member, value) => {
|
|
9682
9876
|
if (member.has(obj))
|
|
9683
9877
|
throw TypeError("Cannot add the same private member more than once");
|
|
9684
9878
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9685
9879
|
};
|
|
9686
9880
|
var __privateSet21 = (obj, member, value, setter) => {
|
|
9687
|
-
|
|
9881
|
+
__accessCheck24(obj, member, "write to private field");
|
|
9688
9882
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
9689
9883
|
return value;
|
|
9690
9884
|
};
|
|
9691
|
-
var
|
|
9692
|
-
|
|
9885
|
+
var __privateMethod8 = (obj, member, method) => {
|
|
9886
|
+
__accessCheck24(obj, member, "access private method");
|
|
9693
9887
|
return method;
|
|
9694
9888
|
};
|
|
9695
9889
|
var _template;
|
|
9696
9890
|
var _prevTemplate;
|
|
9697
9891
|
var _prevTemplateId;
|
|
9892
|
+
var _observer;
|
|
9698
9893
|
var _upgradeProperty;
|
|
9699
9894
|
var upgradeProperty_fn;
|
|
9700
9895
|
var _updateTemplate;
|
|
9701
9896
|
var updateTemplate_fn;
|
|
9897
|
+
var _renderBind;
|
|
9702
9898
|
var observedMediaAttributes = {
|
|
9703
9899
|
mediatargetlivewindow: "targetlivewindow",
|
|
9704
9900
|
mediastreamtype: "streamtype"
|
|
@@ -9736,18 +9932,20 @@ prependTemplate.innerHTML = /*html*/
|
|
|
9736
9932
|
var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
9737
9933
|
constructor() {
|
|
9738
9934
|
super();
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9935
|
+
__privateAdd24(this, _upgradeProperty);
|
|
9936
|
+
__privateAdd24(this, _updateTemplate);
|
|
9937
|
+
__privateAdd24(this, _template, void 0);
|
|
9938
|
+
__privateAdd24(this, _prevTemplate, void 0);
|
|
9939
|
+
__privateAdd24(this, _prevTemplateId, void 0);
|
|
9940
|
+
__privateAdd24(this, _observer, void 0);
|
|
9941
|
+
__privateAdd24(this, _renderBind, void 0);
|
|
9744
9942
|
if (this.shadowRoot) {
|
|
9745
9943
|
this.renderRoot = this.shadowRoot;
|
|
9746
9944
|
} else {
|
|
9747
9945
|
this.renderRoot = this.attachShadow({ mode: "open" });
|
|
9748
9946
|
this.createRenderer();
|
|
9749
9947
|
}
|
|
9750
|
-
|
|
9948
|
+
__privateSet21(this, _observer, new MutationObserver((mutationList) => {
|
|
9751
9949
|
var _a3;
|
|
9752
9950
|
if (this.mediaController && !((_a3 = this.mediaController) == null ? void 0 : _a3.breakpointsComputed))
|
|
9753
9951
|
return;
|
|
@@ -9765,17 +9963,9 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9765
9963
|
})) {
|
|
9766
9964
|
this.render();
|
|
9767
9965
|
}
|
|
9768
|
-
});
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
attributes: true,
|
|
9772
|
-
subtree: true
|
|
9773
|
-
});
|
|
9774
|
-
this.addEventListener(
|
|
9775
|
-
MediaStateChangeEvents.BREAKPOINTS_COMPUTED,
|
|
9776
|
-
this.render
|
|
9777
|
-
);
|
|
9778
|
-
__privateMethod7(this, _upgradeProperty, upgradeProperty_fn).call(this, "template");
|
|
9966
|
+
}));
|
|
9967
|
+
__privateSet21(this, _renderBind, this.render.bind(this));
|
|
9968
|
+
__privateMethod8(this, _upgradeProperty, upgradeProperty_fn).call(this, "template");
|
|
9779
9969
|
}
|
|
9780
9970
|
/** @type {HTMLElement & { breakpointsComputed?: boolean }} */
|
|
9781
9971
|
get mediaController() {
|
|
@@ -9783,7 +9973,7 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9783
9973
|
}
|
|
9784
9974
|
get template() {
|
|
9785
9975
|
var _a3;
|
|
9786
|
-
return (_a3 =
|
|
9976
|
+
return (_a3 = __privateGet24(this, _template)) != null ? _a3 : this.constructor.template;
|
|
9787
9977
|
}
|
|
9788
9978
|
set template(value) {
|
|
9789
9979
|
if (value === null) {
|
|
@@ -9825,14 +10015,30 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9825
10015
|
}
|
|
9826
10016
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
9827
10017
|
if (attrName === "template" && oldValue != newValue) {
|
|
9828
|
-
|
|
10018
|
+
__privateMethod8(this, _updateTemplate, updateTemplate_fn).call(this);
|
|
9829
10019
|
}
|
|
9830
10020
|
}
|
|
9831
10021
|
connectedCallback() {
|
|
9832
|
-
|
|
10022
|
+
this.addEventListener(
|
|
10023
|
+
MediaStateChangeEvents.BREAKPOINTS_COMPUTED,
|
|
10024
|
+
__privateGet24(this, _renderBind)
|
|
10025
|
+
);
|
|
10026
|
+
__privateGet24(this, _observer).observe(this, { attributes: true });
|
|
10027
|
+
__privateGet24(this, _observer).observe(this.renderRoot, {
|
|
10028
|
+
attributes: true,
|
|
10029
|
+
subtree: true
|
|
10030
|
+
});
|
|
10031
|
+
__privateMethod8(this, _updateTemplate, updateTemplate_fn).call(this);
|
|
10032
|
+
}
|
|
10033
|
+
disconnectedCallback() {
|
|
10034
|
+
this.removeEventListener(
|
|
10035
|
+
MediaStateChangeEvents.BREAKPOINTS_COMPUTED,
|
|
10036
|
+
__privateGet24(this, _renderBind)
|
|
10037
|
+
);
|
|
10038
|
+
__privateGet24(this, _observer).disconnect();
|
|
9833
10039
|
}
|
|
9834
10040
|
createRenderer() {
|
|
9835
|
-
if (this.template instanceof HTMLTemplateElement && this.template !==
|
|
10041
|
+
if (this.template instanceof HTMLTemplateElement && this.template !== __privateGet24(this, _prevTemplate)) {
|
|
9836
10042
|
__privateSet21(this, _prevTemplate, this.template);
|
|
9837
10043
|
this.renderer = new TemplateInstance(
|
|
9838
10044
|
this.template,
|
|
@@ -9855,6 +10061,7 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9855
10061
|
_template = /* @__PURE__ */ new WeakMap();
|
|
9856
10062
|
_prevTemplate = /* @__PURE__ */ new WeakMap();
|
|
9857
10063
|
_prevTemplateId = /* @__PURE__ */ new WeakMap();
|
|
10064
|
+
_observer = /* @__PURE__ */ new WeakMap();
|
|
9858
10065
|
_upgradeProperty = /* @__PURE__ */ new WeakSet();
|
|
9859
10066
|
upgradeProperty_fn = function(prop) {
|
|
9860
10067
|
if (Object.prototype.hasOwnProperty.call(this, prop)) {
|
|
@@ -9867,7 +10074,7 @@ _updateTemplate = /* @__PURE__ */ new WeakSet();
|
|
|
9867
10074
|
updateTemplate_fn = function() {
|
|
9868
10075
|
var _a3;
|
|
9869
10076
|
const templateId = this.getAttribute("template");
|
|
9870
|
-
if (!templateId || templateId ===
|
|
10077
|
+
if (!templateId || templateId === __privateGet24(this, _prevTemplateId))
|
|
9871
10078
|
return;
|
|
9872
10079
|
const rootNode = this.getRootNode();
|
|
9873
10080
|
const template2 = (_a3 = rootNode == null ? void 0 : rootNode.getElementById) == null ? void 0 : _a3.call(
|
|
@@ -9890,6 +10097,7 @@ updateTemplate_fn = function() {
|
|
|
9890
10097
|
}).catch(console.error);
|
|
9891
10098
|
}
|
|
9892
10099
|
};
|
|
10100
|
+
_renderBind = /* @__PURE__ */ new WeakMap();
|
|
9893
10101
|
MediaThemeElement.observedAttributes = ["template"];
|
|
9894
10102
|
MediaThemeElement.processor = processor;
|
|
9895
10103
|
function isValidUrl(url) {
|
|
@@ -10015,26 +10223,26 @@ var ToggleEvent = class extends Event {
|
|
|
10015
10223
|
};
|
|
10016
10224
|
|
|
10017
10225
|
// ../../node_modules/media-chrome/dist/menu/media-chrome-menu.js
|
|
10018
|
-
var
|
|
10226
|
+
var __accessCheck25 = (obj, member, msg) => {
|
|
10019
10227
|
if (!member.has(obj))
|
|
10020
10228
|
throw TypeError("Cannot " + msg);
|
|
10021
10229
|
};
|
|
10022
|
-
var
|
|
10023
|
-
|
|
10230
|
+
var __privateGet25 = (obj, member, getter) => {
|
|
10231
|
+
__accessCheck25(obj, member, "read from private field");
|
|
10024
10232
|
return getter ? getter.call(obj) : member.get(obj);
|
|
10025
10233
|
};
|
|
10026
|
-
var
|
|
10234
|
+
var __privateAdd25 = (obj, member, value) => {
|
|
10027
10235
|
if (member.has(obj))
|
|
10028
10236
|
throw TypeError("Cannot add the same private member more than once");
|
|
10029
10237
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10030
10238
|
};
|
|
10031
10239
|
var __privateSet22 = (obj, member, value, setter) => {
|
|
10032
|
-
|
|
10240
|
+
__accessCheck25(obj, member, "write to private field");
|
|
10033
10241
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
10034
10242
|
return value;
|
|
10035
10243
|
};
|
|
10036
|
-
var
|
|
10037
|
-
|
|
10244
|
+
var __privateMethod9 = (obj, member, method) => {
|
|
10245
|
+
__accessCheck25(obj, member, "access private method");
|
|
10038
10246
|
return method;
|
|
10039
10247
|
};
|
|
10040
10248
|
var _mediaController8;
|
|
@@ -10044,7 +10252,7 @@ var _previousItems;
|
|
|
10044
10252
|
var _mutationObserver2;
|
|
10045
10253
|
var _isPopover;
|
|
10046
10254
|
var _cssRule;
|
|
10047
|
-
var
|
|
10255
|
+
var _handleSlotChange2;
|
|
10048
10256
|
var handleSlotChange_fn;
|
|
10049
10257
|
var _toggleHeader;
|
|
10050
10258
|
var toggleHeader_fn;
|
|
@@ -10119,7 +10327,7 @@ function createIndicator(el, name) {
|
|
|
10119
10327
|
}
|
|
10120
10328
|
return "";
|
|
10121
10329
|
}
|
|
10122
|
-
function
|
|
10330
|
+
function getTemplateHTML12(_attrs) {
|
|
10123
10331
|
return (
|
|
10124
10332
|
/*html*/
|
|
10125
10333
|
`
|
|
@@ -10313,33 +10521,33 @@ var Attributes12 = {
|
|
|
10313
10521
|
var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
10314
10522
|
constructor() {
|
|
10315
10523
|
super();
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
const previousItems =
|
|
10524
|
+
__privateAdd25(this, _handleSlotChange2);
|
|
10525
|
+
__privateAdd25(this, _toggleHeader);
|
|
10526
|
+
__privateAdd25(this, _updateLayoutStyle);
|
|
10527
|
+
__privateAdd25(this, _handleInvoke2);
|
|
10528
|
+
__privateAdd25(this, _handleOpen2);
|
|
10529
|
+
__privateAdd25(this, _handleClosed2);
|
|
10530
|
+
__privateAdd25(this, _positionMenu);
|
|
10531
|
+
__privateAdd25(this, _resizeMenu);
|
|
10532
|
+
__privateAdd25(this, _handleClick);
|
|
10533
|
+
__privateAdd25(this, _backButtonElement);
|
|
10534
|
+
__privateAdd25(this, _handleToggle);
|
|
10535
|
+
__privateAdd25(this, _checkSubmenuHasExpanded);
|
|
10536
|
+
__privateAdd25(this, _handleFocusOut2);
|
|
10537
|
+
__privateAdd25(this, _handleKeyDown2);
|
|
10538
|
+
__privateAdd25(this, _getItem);
|
|
10539
|
+
__privateAdd25(this, _getTabItem);
|
|
10540
|
+
__privateAdd25(this, _setTabItem);
|
|
10541
|
+
__privateAdd25(this, _selectItem);
|
|
10542
|
+
__privateAdd25(this, _mediaController8, null);
|
|
10543
|
+
__privateAdd25(this, _previouslyFocused2, null);
|
|
10544
|
+
__privateAdd25(this, _invokerElement2, null);
|
|
10545
|
+
__privateAdd25(this, _previousItems, /* @__PURE__ */ new Set());
|
|
10546
|
+
__privateAdd25(this, _mutationObserver2, void 0);
|
|
10547
|
+
__privateAdd25(this, _isPopover, false);
|
|
10548
|
+
__privateAdd25(this, _cssRule, null);
|
|
10549
|
+
__privateAdd25(this, _handleMenuItems, () => {
|
|
10550
|
+
const previousItems = __privateGet25(this, _previousItems);
|
|
10343
10551
|
const currentItems = new Set(this.items);
|
|
10344
10552
|
for (const item of previousItems) {
|
|
10345
10553
|
if (!currentItems.has(item)) {
|
|
@@ -10353,12 +10561,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10353
10561
|
}
|
|
10354
10562
|
__privateSet22(this, _previousItems, currentItems);
|
|
10355
10563
|
});
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10564
|
+
__privateAdd25(this, _handleBoundsResize, () => {
|
|
10565
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this);
|
|
10566
|
+
__privateMethod9(this, _resizeMenu, resizeMenu_fn).call(this, false);
|
|
10359
10567
|
});
|
|
10360
|
-
|
|
10361
|
-
|
|
10568
|
+
__privateAdd25(this, _handleMenuResize, () => {
|
|
10569
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this);
|
|
10362
10570
|
});
|
|
10363
10571
|
if (!this.shadowRoot) {
|
|
10364
10572
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
@@ -10369,9 +10577,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10369
10577
|
this.defaultSlot = this.shadowRoot.querySelector(
|
|
10370
10578
|
"slot:not([name])"
|
|
10371
10579
|
);
|
|
10372
|
-
this
|
|
10373
|
-
__privateSet22(this, _mutationObserver2, new MutationObserver(__privateGet24(this, _handleMenuItems)));
|
|
10374
|
-
__privateGet24(this, _mutationObserver2).observe(this.defaultSlot, { childList: true });
|
|
10580
|
+
__privateSet22(this, _mutationObserver2, new MutationObserver(__privateGet25(this, _handleMenuItems)));
|
|
10375
10581
|
}
|
|
10376
10582
|
static get observedAttributes() {
|
|
10377
10583
|
return [
|
|
@@ -10402,29 +10608,30 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10402
10608
|
handleEvent(event) {
|
|
10403
10609
|
switch (event.type) {
|
|
10404
10610
|
case "slotchange":
|
|
10405
|
-
|
|
10611
|
+
__privateMethod9(this, _handleSlotChange2, handleSlotChange_fn).call(this, event);
|
|
10406
10612
|
break;
|
|
10407
10613
|
case "invoke":
|
|
10408
|
-
|
|
10614
|
+
__privateMethod9(this, _handleInvoke2, handleInvoke_fn2).call(this, event);
|
|
10409
10615
|
break;
|
|
10410
10616
|
case "click":
|
|
10411
|
-
|
|
10617
|
+
__privateMethod9(this, _handleClick, handleClick_fn).call(this, event);
|
|
10412
10618
|
break;
|
|
10413
10619
|
case "toggle":
|
|
10414
|
-
|
|
10620
|
+
__privateMethod9(this, _handleToggle, handleToggle_fn).call(this, event);
|
|
10415
10621
|
break;
|
|
10416
10622
|
case "focusout":
|
|
10417
|
-
|
|
10623
|
+
__privateMethod9(this, _handleFocusOut2, handleFocusOut_fn2).call(this, event);
|
|
10418
10624
|
break;
|
|
10419
10625
|
case "keydown":
|
|
10420
|
-
|
|
10626
|
+
__privateMethod9(this, _handleKeyDown2, handleKeyDown_fn2).call(this, event);
|
|
10421
10627
|
break;
|
|
10422
10628
|
}
|
|
10423
10629
|
}
|
|
10424
10630
|
connectedCallback() {
|
|
10425
10631
|
var _a3, _b2;
|
|
10632
|
+
__privateGet25(this, _mutationObserver2).observe(this.defaultSlot, { childList: true });
|
|
10426
10633
|
__privateSet22(this, _cssRule, insertCSSRule(this.shadowRoot, ":host"));
|
|
10427
|
-
|
|
10634
|
+
__privateMethod9(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
|
|
10428
10635
|
if (!this.hasAttribute("disabled")) {
|
|
10429
10636
|
this.enable();
|
|
10430
10637
|
}
|
|
@@ -10432,30 +10639,35 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10432
10639
|
this.role = "menu";
|
|
10433
10640
|
}
|
|
10434
10641
|
__privateSet22(this, _mediaController8, getAttributeMediaController(this));
|
|
10435
|
-
(_b2 = (_a3 =
|
|
10642
|
+
(_b2 = (_a3 = __privateGet25(this, _mediaController8)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
10436
10643
|
if (!this.hidden) {
|
|
10437
|
-
observeResize(getBoundsElement(this),
|
|
10438
|
-
observeResize(this,
|
|
10644
|
+
observeResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10645
|
+
observeResize(this, __privateGet25(this, _handleMenuResize));
|
|
10439
10646
|
}
|
|
10440
|
-
|
|
10647
|
+
__privateMethod9(this, _toggleHeader, toggleHeader_fn).call(this);
|
|
10648
|
+
this.shadowRoot.addEventListener("slotchange", this);
|
|
10441
10649
|
}
|
|
10442
10650
|
disconnectedCallback() {
|
|
10443
10651
|
var _a3, _b2;
|
|
10444
|
-
|
|
10445
|
-
unobserveResize(this,
|
|
10652
|
+
__privateGet25(this, _mutationObserver2).disconnect();
|
|
10653
|
+
unobserveResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10654
|
+
unobserveResize(this, __privateGet25(this, _handleMenuResize));
|
|
10446
10655
|
this.disable();
|
|
10447
|
-
(_b2 = (_a3 =
|
|
10656
|
+
(_b2 = (_a3 = __privateGet25(this, _mediaController8)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
10448
10657
|
__privateSet22(this, _mediaController8, null);
|
|
10658
|
+
__privateSet22(this, _previouslyFocused2, null);
|
|
10659
|
+
__privateSet22(this, _invokerElement2, null);
|
|
10660
|
+
this.shadowRoot.removeEventListener("slotchange", this);
|
|
10449
10661
|
}
|
|
10450
10662
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
10451
10663
|
var _a3, _b2, _c, _d;
|
|
10452
10664
|
if (attrName === Attributes12.HIDDEN && newValue !== oldValue) {
|
|
10453
|
-
if (!
|
|
10665
|
+
if (!__privateGet25(this, _isPopover))
|
|
10454
10666
|
__privateSet22(this, _isPopover, true);
|
|
10455
10667
|
if (this.hidden) {
|
|
10456
|
-
|
|
10668
|
+
__privateMethod9(this, _handleClosed2, handleClosed_fn2).call(this);
|
|
10457
10669
|
} else {
|
|
10458
|
-
|
|
10670
|
+
__privateMethod9(this, _handleOpen2, handleOpen_fn2).call(this);
|
|
10459
10671
|
}
|
|
10460
10672
|
this.dispatchEvent(
|
|
10461
10673
|
new ToggleEvent({
|
|
@@ -10466,12 +10678,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10466
10678
|
);
|
|
10467
10679
|
} else if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
|
|
10468
10680
|
if (oldValue) {
|
|
10469
|
-
(_b2 = (_a3 =
|
|
10681
|
+
(_b2 = (_a3 = __privateGet25(this, _mediaController8)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
10470
10682
|
__privateSet22(this, _mediaController8, null);
|
|
10471
10683
|
}
|
|
10472
10684
|
if (newValue && this.isConnected) {
|
|
10473
10685
|
__privateSet22(this, _mediaController8, getAttributeMediaController(this));
|
|
10474
|
-
(_d = (_c =
|
|
10686
|
+
(_d = (_c = __privateGet25(this, _mediaController8)) == null ? void 0 : _c.associateElement) == null ? void 0 : _d.call(_c, this);
|
|
10475
10687
|
}
|
|
10476
10688
|
} else if (attrName === Attributes12.DISABLED && newValue !== oldValue) {
|
|
10477
10689
|
if (newValue == null) {
|
|
@@ -10480,7 +10692,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10480
10692
|
this.disable();
|
|
10481
10693
|
}
|
|
10482
10694
|
} else if (attrName === Attributes12.STYLE && newValue !== oldValue) {
|
|
10483
|
-
|
|
10695
|
+
__privateMethod9(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
|
|
10484
10696
|
}
|
|
10485
10697
|
}
|
|
10486
10698
|
formatMenuItemText(text, data) {
|
|
@@ -10527,12 +10739,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10527
10739
|
const item = this.items.find((item2) => item2.value === newValue);
|
|
10528
10740
|
if (!item)
|
|
10529
10741
|
return;
|
|
10530
|
-
|
|
10742
|
+
__privateMethod9(this, _selectItem, selectItem_fn).call(this, item);
|
|
10531
10743
|
}
|
|
10532
10744
|
focus() {
|
|
10533
10745
|
__privateSet22(this, _previouslyFocused2, getActiveElement());
|
|
10534
10746
|
if (this.items.length) {
|
|
10535
|
-
|
|
10747
|
+
__privateMethod9(this, _setTabItem, setTabItem_fn).call(this, this.items[0]);
|
|
10536
10748
|
this.items[0].focus();
|
|
10537
10749
|
return;
|
|
10538
10750
|
}
|
|
@@ -10543,12 +10755,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10543
10755
|
}
|
|
10544
10756
|
handleSelect(event) {
|
|
10545
10757
|
var _a3;
|
|
10546
|
-
const item =
|
|
10758
|
+
const item = __privateMethod9(this, _getItem, getItem_fn).call(this, event);
|
|
10547
10759
|
if (!item)
|
|
10548
10760
|
return;
|
|
10549
|
-
|
|
10550
|
-
if (
|
|
10551
|
-
(_a3 =
|
|
10761
|
+
__privateMethod9(this, _selectItem, selectItem_fn).call(this, item, item.type === "checkbox");
|
|
10762
|
+
if (__privateGet25(this, _invokerElement2) && !this.hidden) {
|
|
10763
|
+
(_a3 = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
|
|
10552
10764
|
this.hidden = true;
|
|
10553
10765
|
}
|
|
10554
10766
|
}
|
|
@@ -10568,7 +10780,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10568
10780
|
var _a3, _b2;
|
|
10569
10781
|
const { key } = event;
|
|
10570
10782
|
const items = this.items;
|
|
10571
|
-
const currentItem = (_b2 = (_a3 =
|
|
10783
|
+
const currentItem = (_b2 = (_a3 = __privateMethod9(this, _getItem, getItem_fn).call(this, event)) != null ? _a3 : __privateMethod9(this, _getTabItem, getTabItem_fn).call(this)) != null ? _b2 : items[0];
|
|
10572
10784
|
const currentIndex = items.indexOf(currentItem);
|
|
10573
10785
|
let index = Math.max(0, currentIndex);
|
|
10574
10786
|
if (key === "ArrowDown") {
|
|
@@ -10586,7 +10798,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10586
10798
|
if (index > items.length - 1) {
|
|
10587
10799
|
index = 0;
|
|
10588
10800
|
}
|
|
10589
|
-
|
|
10801
|
+
__privateMethod9(this, _setTabItem, setTabItem_fn).call(this, items[index]);
|
|
10590
10802
|
items[index].focus();
|
|
10591
10803
|
}
|
|
10592
10804
|
};
|
|
@@ -10597,7 +10809,7 @@ _previousItems = /* @__PURE__ */ new WeakMap();
|
|
|
10597
10809
|
_mutationObserver2 = /* @__PURE__ */ new WeakMap();
|
|
10598
10810
|
_isPopover = /* @__PURE__ */ new WeakMap();
|
|
10599
10811
|
_cssRule = /* @__PURE__ */ new WeakMap();
|
|
10600
|
-
|
|
10812
|
+
_handleSlotChange2 = /* @__PURE__ */ new WeakSet();
|
|
10601
10813
|
handleSlotChange_fn = function(event) {
|
|
10602
10814
|
const slot = event.target;
|
|
10603
10815
|
for (const node of slot.assignedNodes({ flatten: true })) {
|
|
@@ -10606,10 +10818,10 @@ handleSlotChange_fn = function(event) {
|
|
|
10606
10818
|
}
|
|
10607
10819
|
}
|
|
10608
10820
|
if (["header", "title"].includes(slot.name)) {
|
|
10609
|
-
|
|
10821
|
+
__privateMethod9(this, _toggleHeader, toggleHeader_fn).call(this);
|
|
10610
10822
|
}
|
|
10611
10823
|
if (!slot.name) {
|
|
10612
|
-
|
|
10824
|
+
__privateGet25(this, _handleMenuItems).call(this);
|
|
10613
10825
|
}
|
|
10614
10826
|
};
|
|
10615
10827
|
_toggleHeader = /* @__PURE__ */ new WeakSet();
|
|
@@ -10640,17 +10852,17 @@ handleInvoke_fn2 = function(event) {
|
|
|
10640
10852
|
_handleOpen2 = /* @__PURE__ */ new WeakSet();
|
|
10641
10853
|
handleOpen_fn2 = function() {
|
|
10642
10854
|
var _a3;
|
|
10643
|
-
(_a3 =
|
|
10855
|
+
(_a3 = __privateGet25(this, _invokerElement2)) == null ? void 0 : _a3.setAttribute("aria-expanded", "true");
|
|
10644
10856
|
this.addEventListener("transitionend", () => this.focus(), { once: true });
|
|
10645
|
-
observeResize(getBoundsElement(this),
|
|
10646
|
-
observeResize(this,
|
|
10857
|
+
observeResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10858
|
+
observeResize(this, __privateGet25(this, _handleMenuResize));
|
|
10647
10859
|
};
|
|
10648
10860
|
_handleClosed2 = /* @__PURE__ */ new WeakSet();
|
|
10649
10861
|
handleClosed_fn2 = function() {
|
|
10650
10862
|
var _a3;
|
|
10651
|
-
(_a3 =
|
|
10652
|
-
unobserveResize(getBoundsElement(this),
|
|
10653
|
-
unobserveResize(this,
|
|
10863
|
+
(_a3 = __privateGet25(this, _invokerElement2)) == null ? void 0 : _a3.setAttribute("aria-expanded", "false");
|
|
10864
|
+
unobserveResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10865
|
+
unobserveResize(this, __privateGet25(this, _handleMenuResize));
|
|
10654
10866
|
};
|
|
10655
10867
|
_handleBoundsResize = /* @__PURE__ */ new WeakMap();
|
|
10656
10868
|
_handleMenuResize = /* @__PURE__ */ new WeakMap();
|
|
@@ -10670,7 +10882,7 @@ positionMenu_fn = function(menuWidth) {
|
|
|
10670
10882
|
const boundsRect = bounds.getBoundingClientRect();
|
|
10671
10883
|
const right = boundsRect.width - x - menuWidth;
|
|
10672
10884
|
const bottom = boundsRect.height - y - this.offsetHeight;
|
|
10673
|
-
const { style } =
|
|
10885
|
+
const { style } = __privateGet25(this, _cssRule);
|
|
10674
10886
|
style.setProperty("position", "absolute");
|
|
10675
10887
|
style.setProperty("right", `${Math.max(0, right)}px`);
|
|
10676
10888
|
style.setProperty("--_menu-bottom", `${bottom}px`);
|
|
@@ -10688,7 +10900,7 @@ resizeMenu_fn = function(animate) {
|
|
|
10688
10900
|
const expandedSubmenu = expandedMenuItem == null ? void 0 : expandedMenuItem.querySelector(
|
|
10689
10901
|
'[role="menu"]'
|
|
10690
10902
|
);
|
|
10691
|
-
const { style } =
|
|
10903
|
+
const { style } = __privateGet25(this, _cssRule);
|
|
10692
10904
|
if (!animate) {
|
|
10693
10905
|
style.setProperty("--media-menu-transition-in", "none");
|
|
10694
10906
|
}
|
|
@@ -10700,11 +10912,11 @@ resizeMenu_fn = function(animate) {
|
|
|
10700
10912
|
);
|
|
10701
10913
|
this.style.setProperty("min-width", `${width}px`);
|
|
10702
10914
|
this.style.setProperty("min-height", `${height}px`);
|
|
10703
|
-
|
|
10915
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this, width);
|
|
10704
10916
|
} else {
|
|
10705
10917
|
this.style.removeProperty("min-width");
|
|
10706
10918
|
this.style.removeProperty("min-height");
|
|
10707
|
-
|
|
10919
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this);
|
|
10708
10920
|
}
|
|
10709
10921
|
style.removeProperty("--media-menu-transition-in");
|
|
10710
10922
|
};
|
|
@@ -10712,15 +10924,15 @@ _handleClick = /* @__PURE__ */ new WeakSet();
|
|
|
10712
10924
|
handleClick_fn = function(event) {
|
|
10713
10925
|
var _a3;
|
|
10714
10926
|
event.stopPropagation();
|
|
10715
|
-
if (event.composedPath().includes(
|
|
10716
|
-
(_a3 =
|
|
10927
|
+
if (event.composedPath().includes(__privateGet25(this, _backButtonElement, backButtonElement_get))) {
|
|
10928
|
+
(_a3 = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
|
|
10717
10929
|
this.hidden = true;
|
|
10718
10930
|
return;
|
|
10719
10931
|
}
|
|
10720
|
-
const item =
|
|
10932
|
+
const item = __privateMethod9(this, _getItem, getItem_fn).call(this, event);
|
|
10721
10933
|
if (!item || item.hasAttribute("disabled"))
|
|
10722
10934
|
return;
|
|
10723
|
-
|
|
10935
|
+
__privateMethod9(this, _setTabItem, setTabItem_fn).call(this, item);
|
|
10724
10936
|
this.handleSelect(event);
|
|
10725
10937
|
};
|
|
10726
10938
|
_backButtonElement = /* @__PURE__ */ new WeakSet();
|
|
@@ -10735,7 +10947,7 @@ _handleToggle = /* @__PURE__ */ new WeakSet();
|
|
|
10735
10947
|
handleToggle_fn = function(event) {
|
|
10736
10948
|
if (event.target === this)
|
|
10737
10949
|
return;
|
|
10738
|
-
|
|
10950
|
+
__privateMethod9(this, _checkSubmenuHasExpanded, checkSubmenuHasExpanded_fn).call(this);
|
|
10739
10951
|
const menuItemsWithSubmenu = Array.from(
|
|
10740
10952
|
this.querySelectorAll('[role="menuitem"][aria-haspopup]')
|
|
10741
10953
|
);
|
|
@@ -10751,7 +10963,7 @@ handleToggle_fn = function(event) {
|
|
|
10751
10963
|
for (const item of menuItemsWithSubmenu) {
|
|
10752
10964
|
item.setAttribute("aria-expanded", `${!item.submenuElement.hidden}`);
|
|
10753
10965
|
}
|
|
10754
|
-
|
|
10966
|
+
__privateMethod9(this, _resizeMenu, resizeMenu_fn).call(this, true);
|
|
10755
10967
|
};
|
|
10756
10968
|
_checkSubmenuHasExpanded = /* @__PURE__ */ new WeakSet();
|
|
10757
10969
|
checkSubmenuHasExpanded_fn = function() {
|
|
@@ -10763,10 +10975,10 @@ _handleFocusOut2 = /* @__PURE__ */ new WeakSet();
|
|
|
10763
10975
|
handleFocusOut_fn2 = function(event) {
|
|
10764
10976
|
var _a3;
|
|
10765
10977
|
if (!containsComposedNode(this, event.relatedTarget)) {
|
|
10766
|
-
if (
|
|
10767
|
-
(_a3 =
|
|
10978
|
+
if (__privateGet25(this, _isPopover)) {
|
|
10979
|
+
(_a3 = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
|
|
10768
10980
|
}
|
|
10769
|
-
if (
|
|
10981
|
+
if (__privateGet25(this, _invokerElement2) && __privateGet25(this, _invokerElement2) !== event.relatedTarget && !this.hidden) {
|
|
10770
10982
|
this.hidden = true;
|
|
10771
10983
|
}
|
|
10772
10984
|
}
|
|
@@ -10784,7 +10996,7 @@ handleKeyDown_fn2 = function(event) {
|
|
|
10784
10996
|
event.preventDefault();
|
|
10785
10997
|
event.stopPropagation();
|
|
10786
10998
|
if (key === "Tab") {
|
|
10787
|
-
if (
|
|
10999
|
+
if (__privateGet25(this, _isPopover)) {
|
|
10788
11000
|
this.hidden = true;
|
|
10789
11001
|
return;
|
|
10790
11002
|
}
|
|
@@ -10795,8 +11007,8 @@ handleKeyDown_fn2 = function(event) {
|
|
|
10795
11007
|
}
|
|
10796
11008
|
this.blur();
|
|
10797
11009
|
} else if (key === "Escape") {
|
|
10798
|
-
(_e =
|
|
10799
|
-
if (
|
|
11010
|
+
(_e = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _e.focus();
|
|
11011
|
+
if (__privateGet25(this, _isPopover)) {
|
|
10800
11012
|
this.hidden = true;
|
|
10801
11013
|
}
|
|
10802
11014
|
} else if (key === "Enter" || key === " ") {
|
|
@@ -10841,7 +11053,7 @@ selectItem_fn = function(item, toggle) {
|
|
|
10841
11053
|
}
|
|
10842
11054
|
};
|
|
10843
11055
|
MediaChromeMenu.shadowRootOptions = { mode: "open" };
|
|
10844
|
-
MediaChromeMenu.getTemplateHTML =
|
|
11056
|
+
MediaChromeMenu.getTemplateHTML = getTemplateHTML12;
|
|
10845
11057
|
function isMenuItem(element) {
|
|
10846
11058
|
return ["menuitem", "menuitemradio", "menuitemcheckbox"].includes(
|
|
10847
11059
|
element == null ? void 0 : element.role
|
|
@@ -10856,31 +11068,31 @@ if (!GlobalThis.customElements.get("media-chrome-menu")) {
|
|
|
10856
11068
|
}
|
|
10857
11069
|
|
|
10858
11070
|
// ../../node_modules/media-chrome/dist/menu/media-chrome-menu-item.js
|
|
10859
|
-
var
|
|
11071
|
+
var __accessCheck26 = (obj, member, msg) => {
|
|
10860
11072
|
if (!member.has(obj))
|
|
10861
11073
|
throw TypeError("Cannot " + msg);
|
|
10862
11074
|
};
|
|
10863
|
-
var
|
|
10864
|
-
|
|
11075
|
+
var __privateGet26 = (obj, member, getter) => {
|
|
11076
|
+
__accessCheck26(obj, member, "read from private field");
|
|
10865
11077
|
return getter ? getter.call(obj) : member.get(obj);
|
|
10866
11078
|
};
|
|
10867
|
-
var
|
|
11079
|
+
var __privateAdd26 = (obj, member, value) => {
|
|
10868
11080
|
if (member.has(obj))
|
|
10869
11081
|
throw TypeError("Cannot add the same private member more than once");
|
|
10870
11082
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10871
11083
|
};
|
|
10872
11084
|
var __privateSet23 = (obj, member, value, setter) => {
|
|
10873
|
-
|
|
11085
|
+
__accessCheck26(obj, member, "write to private field");
|
|
10874
11086
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
10875
11087
|
return value;
|
|
10876
11088
|
};
|
|
10877
|
-
var
|
|
10878
|
-
|
|
11089
|
+
var __privateMethod10 = (obj, member, method) => {
|
|
11090
|
+
__accessCheck26(obj, member, "access private method");
|
|
10879
11091
|
return method;
|
|
10880
11092
|
};
|
|
10881
11093
|
var _dirty;
|
|
10882
11094
|
var _ownerElement;
|
|
10883
|
-
var
|
|
11095
|
+
var _handleSlotChange3;
|
|
10884
11096
|
var handleSlotChange_fn2;
|
|
10885
11097
|
var _submenuConnected;
|
|
10886
11098
|
var submenuConnected_fn;
|
|
@@ -10888,12 +11100,10 @@ var _submenuDisconnected;
|
|
|
10888
11100
|
var submenuDisconnected_fn;
|
|
10889
11101
|
var _handleMenuItem;
|
|
10890
11102
|
var _handleKeyUp;
|
|
10891
|
-
var handleKeyUp_fn;
|
|
10892
11103
|
var _handleKeyDown3;
|
|
10893
|
-
var handleKeyDown_fn3;
|
|
10894
11104
|
var _reset;
|
|
10895
11105
|
var reset_fn;
|
|
10896
|
-
function
|
|
11106
|
+
function getTemplateHTML13(_attrs) {
|
|
10897
11107
|
return (
|
|
10898
11108
|
/*html*/
|
|
10899
11109
|
`
|
|
@@ -11031,15 +11241,13 @@ var Attributes13 = {
|
|
|
11031
11241
|
var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
11032
11242
|
constructor() {
|
|
11033
11243
|
super();
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
__privateAdd25(this, _ownerElement, void 0);
|
|
11042
|
-
__privateAdd25(this, _handleMenuItem, () => {
|
|
11244
|
+
__privateAdd26(this, _handleSlotChange3);
|
|
11245
|
+
__privateAdd26(this, _submenuConnected);
|
|
11246
|
+
__privateAdd26(this, _submenuDisconnected);
|
|
11247
|
+
__privateAdd26(this, _reset);
|
|
11248
|
+
__privateAdd26(this, _dirty, false);
|
|
11249
|
+
__privateAdd26(this, _ownerElement, void 0);
|
|
11250
|
+
__privateAdd26(this, _handleMenuItem, () => {
|
|
11043
11251
|
var _a3, _b2;
|
|
11044
11252
|
if (this.submenuElement.items) {
|
|
11045
11253
|
this.setAttribute("submenusize", `${this.submenuElement.items.length}`);
|
|
@@ -11053,12 +11261,27 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11053
11261
|
span.textContent = description != null ? description : "";
|
|
11054
11262
|
descriptionSlot.replaceChildren(span);
|
|
11055
11263
|
});
|
|
11264
|
+
__privateAdd26(this, _handleKeyUp, (event) => {
|
|
11265
|
+
const { key } = event;
|
|
11266
|
+
if (!this.keysUsed.includes(key)) {
|
|
11267
|
+
this.removeEventListener("keyup", __privateGet26(this, _handleKeyUp));
|
|
11268
|
+
return;
|
|
11269
|
+
}
|
|
11270
|
+
this.handleClick(event);
|
|
11271
|
+
});
|
|
11272
|
+
__privateAdd26(this, _handleKeyDown3, (event) => {
|
|
11273
|
+
const { metaKey, altKey, key } = event;
|
|
11274
|
+
if (metaKey || altKey || !this.keysUsed.includes(key)) {
|
|
11275
|
+
this.removeEventListener("keyup", __privateGet26(this, _handleKeyUp));
|
|
11276
|
+
return;
|
|
11277
|
+
}
|
|
11278
|
+
this.addEventListener("keyup", __privateGet26(this, _handleKeyUp), { once: true });
|
|
11279
|
+
});
|
|
11056
11280
|
if (!this.shadowRoot) {
|
|
11057
11281
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
11058
11282
|
const attrs = namedNodeMapToObject(this.attributes);
|
|
11059
11283
|
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(attrs);
|
|
11060
11284
|
}
|
|
11061
|
-
this.shadowRoot.addEventListener("slotchange", this);
|
|
11062
11285
|
}
|
|
11063
11286
|
static get observedAttributes() {
|
|
11064
11287
|
return [
|
|
@@ -11087,21 +11310,21 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11087
11310
|
handleEvent(event) {
|
|
11088
11311
|
switch (event.type) {
|
|
11089
11312
|
case "slotchange":
|
|
11090
|
-
|
|
11313
|
+
__privateMethod10(this, _handleSlotChange3, handleSlotChange_fn2).call(this, event);
|
|
11091
11314
|
break;
|
|
11092
11315
|
case "click":
|
|
11093
11316
|
this.handleClick(event);
|
|
11094
11317
|
break;
|
|
11095
11318
|
case "keydown":
|
|
11096
|
-
|
|
11319
|
+
__privateGet26(this, _handleKeyDown3).call(this, event);
|
|
11097
11320
|
break;
|
|
11098
11321
|
case "keyup":
|
|
11099
|
-
|
|
11322
|
+
__privateGet26(this, _handleKeyUp).call(this, event);
|
|
11100
11323
|
break;
|
|
11101
11324
|
}
|
|
11102
11325
|
}
|
|
11103
11326
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
11104
|
-
if (attrName === Attributes13.CHECKED && isCheckable(this) && !
|
|
11327
|
+
if (attrName === Attributes13.CHECKED && isCheckable(this) && !__privateGet26(this, _dirty)) {
|
|
11105
11328
|
this.setAttribute("aria-checked", newValue != null ? "true" : "false");
|
|
11106
11329
|
} else if (attrName === Attributes13.TYPE && newValue !== oldValue) {
|
|
11107
11330
|
this.role = "menuitem" + newValue;
|
|
@@ -11119,15 +11342,17 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11119
11342
|
}
|
|
11120
11343
|
this.role = "menuitem" + this.type;
|
|
11121
11344
|
__privateSet23(this, _ownerElement, closestMenuItemsContainer(this, this.parentNode));
|
|
11122
|
-
|
|
11345
|
+
__privateMethod10(this, _reset, reset_fn).call(this);
|
|
11123
11346
|
if (this.submenuElement) {
|
|
11124
|
-
|
|
11347
|
+
__privateMethod10(this, _submenuConnected, submenuConnected_fn).call(this);
|
|
11125
11348
|
}
|
|
11349
|
+
this.shadowRoot.addEventListener("slotchange", this);
|
|
11126
11350
|
}
|
|
11127
11351
|
disconnectedCallback() {
|
|
11128
11352
|
this.disable();
|
|
11129
|
-
|
|
11353
|
+
__privateMethod10(this, _reset, reset_fn).call(this);
|
|
11130
11354
|
__privateSet23(this, _ownerElement, null);
|
|
11355
|
+
this.shadowRoot.removeEventListener("slotchange", this);
|
|
11131
11356
|
}
|
|
11132
11357
|
get invokeTarget() {
|
|
11133
11358
|
return this.getAttribute("invoketarget");
|
|
@@ -11208,7 +11433,7 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11208
11433
|
};
|
|
11209
11434
|
_dirty = /* @__PURE__ */ new WeakMap();
|
|
11210
11435
|
_ownerElement = /* @__PURE__ */ new WeakMap();
|
|
11211
|
-
|
|
11436
|
+
_handleSlotChange3 = /* @__PURE__ */ new WeakSet();
|
|
11212
11437
|
handleSlotChange_fn2 = function(event) {
|
|
11213
11438
|
const slot = event.target;
|
|
11214
11439
|
const isDefaultSlot = !(slot == null ? void 0 : slot.name);
|
|
@@ -11221,9 +11446,9 @@ handleSlotChange_fn2 = function(event) {
|
|
|
11221
11446
|
}
|
|
11222
11447
|
if (slot.name === "submenu") {
|
|
11223
11448
|
if (this.submenuElement) {
|
|
11224
|
-
|
|
11449
|
+
__privateMethod10(this, _submenuConnected, submenuConnected_fn).call(this);
|
|
11225
11450
|
} else {
|
|
11226
|
-
|
|
11451
|
+
__privateMethod10(this, _submenuDisconnected, submenuDisconnected_fn).call(this);
|
|
11227
11452
|
}
|
|
11228
11453
|
}
|
|
11229
11454
|
};
|
|
@@ -11231,52 +11456,36 @@ _submenuConnected = /* @__PURE__ */ new WeakSet();
|
|
|
11231
11456
|
submenuConnected_fn = async function() {
|
|
11232
11457
|
this.setAttribute("aria-haspopup", "menu");
|
|
11233
11458
|
this.setAttribute("aria-expanded", `${!this.submenuElement.hidden}`);
|
|
11234
|
-
this.submenuElement.addEventListener("change",
|
|
11235
|
-
this.submenuElement.addEventListener("addmenuitem",
|
|
11459
|
+
this.submenuElement.addEventListener("change", __privateGet26(this, _handleMenuItem));
|
|
11460
|
+
this.submenuElement.addEventListener("addmenuitem", __privateGet26(this, _handleMenuItem));
|
|
11236
11461
|
this.submenuElement.addEventListener(
|
|
11237
11462
|
"removemenuitem",
|
|
11238
|
-
|
|
11463
|
+
__privateGet26(this, _handleMenuItem)
|
|
11239
11464
|
);
|
|
11240
|
-
|
|
11465
|
+
__privateGet26(this, _handleMenuItem).call(this);
|
|
11241
11466
|
};
|
|
11242
11467
|
_submenuDisconnected = /* @__PURE__ */ new WeakSet();
|
|
11243
11468
|
submenuDisconnected_fn = function() {
|
|
11244
11469
|
this.removeAttribute("aria-haspopup");
|
|
11245
11470
|
this.removeAttribute("aria-expanded");
|
|
11246
|
-
this.submenuElement.removeEventListener("change",
|
|
11471
|
+
this.submenuElement.removeEventListener("change", __privateGet26(this, _handleMenuItem));
|
|
11247
11472
|
this.submenuElement.removeEventListener(
|
|
11248
11473
|
"addmenuitem",
|
|
11249
|
-
|
|
11474
|
+
__privateGet26(this, _handleMenuItem)
|
|
11250
11475
|
);
|
|
11251
11476
|
this.submenuElement.removeEventListener(
|
|
11252
11477
|
"removemenuitem",
|
|
11253
|
-
|
|
11478
|
+
__privateGet26(this, _handleMenuItem)
|
|
11254
11479
|
);
|
|
11255
|
-
|
|
11480
|
+
__privateGet26(this, _handleMenuItem).call(this);
|
|
11256
11481
|
};
|
|
11257
11482
|
_handleMenuItem = /* @__PURE__ */ new WeakMap();
|
|
11258
|
-
_handleKeyUp = /* @__PURE__ */ new
|
|
11259
|
-
|
|
11260
|
-
const { key } = event;
|
|
11261
|
-
if (!this.keysUsed.includes(key)) {
|
|
11262
|
-
this.removeEventListener("keyup", __privateMethod9(this, _handleKeyUp, handleKeyUp_fn));
|
|
11263
|
-
return;
|
|
11264
|
-
}
|
|
11265
|
-
this.handleClick(event);
|
|
11266
|
-
};
|
|
11267
|
-
_handleKeyDown3 = /* @__PURE__ */ new WeakSet();
|
|
11268
|
-
handleKeyDown_fn3 = function(event) {
|
|
11269
|
-
const { metaKey, altKey, key } = event;
|
|
11270
|
-
if (metaKey || altKey || !this.keysUsed.includes(key)) {
|
|
11271
|
-
this.removeEventListener("keyup", __privateMethod9(this, _handleKeyUp, handleKeyUp_fn));
|
|
11272
|
-
return;
|
|
11273
|
-
}
|
|
11274
|
-
this.addEventListener("keyup", __privateMethod9(this, _handleKeyUp, handleKeyUp_fn), { once: true });
|
|
11275
|
-
};
|
|
11483
|
+
_handleKeyUp = /* @__PURE__ */ new WeakMap();
|
|
11484
|
+
_handleKeyDown3 = /* @__PURE__ */ new WeakMap();
|
|
11276
11485
|
_reset = /* @__PURE__ */ new WeakSet();
|
|
11277
11486
|
reset_fn = function() {
|
|
11278
11487
|
var _a3;
|
|
11279
|
-
const items = (_a3 =
|
|
11488
|
+
const items = (_a3 = __privateGet26(this, _ownerElement)) == null ? void 0 : _a3.radioGroupItems;
|
|
11280
11489
|
if (!items)
|
|
11281
11490
|
return;
|
|
11282
11491
|
let checkedItem = items.filter((item) => item.getAttribute("aria-checked") === "true").pop();
|
|
@@ -11288,7 +11497,7 @@ reset_fn = function() {
|
|
|
11288
11497
|
checkedItem == null ? void 0 : checkedItem.setAttribute("aria-checked", "true");
|
|
11289
11498
|
};
|
|
11290
11499
|
MediaChromeMenuItem.shadowRootOptions = { mode: "open" };
|
|
11291
|
-
MediaChromeMenuItem.getTemplateHTML =
|
|
11500
|
+
MediaChromeMenuItem.getTemplateHTML = getTemplateHTML13;
|
|
11292
11501
|
MediaChromeMenuItem.getSuffixSlotInnerHTML = getSuffixSlotInnerHTML;
|
|
11293
11502
|
function isCheckable(item) {
|
|
11294
11503
|
return item.type === "radio" || item.type === "checkbox";
|
|
@@ -11311,7 +11520,7 @@ if (!GlobalThis.customElements.get("media-chrome-menu-item")) {
|
|
|
11311
11520
|
}
|
|
11312
11521
|
|
|
11313
11522
|
// ../../node_modules/media-chrome/dist/menu/media-settings-menu.js
|
|
11314
|
-
function
|
|
11523
|
+
function getTemplateHTML14(_attrs) {
|
|
11315
11524
|
return (
|
|
11316
11525
|
/*html*/
|
|
11317
11526
|
`
|
|
@@ -11365,13 +11574,13 @@ var MediaSettingsMenu = class extends MediaChromeMenu {
|
|
|
11365
11574
|
);
|
|
11366
11575
|
}
|
|
11367
11576
|
};
|
|
11368
|
-
MediaSettingsMenu.getTemplateHTML =
|
|
11577
|
+
MediaSettingsMenu.getTemplateHTML = getTemplateHTML14;
|
|
11369
11578
|
if (!GlobalThis.customElements.get("media-settings-menu")) {
|
|
11370
11579
|
GlobalThis.customElements.define("media-settings-menu", MediaSettingsMenu);
|
|
11371
11580
|
}
|
|
11372
11581
|
|
|
11373
11582
|
// ../../node_modules/media-chrome/dist/menu/media-settings-menu-item.js
|
|
11374
|
-
function
|
|
11583
|
+
function getTemplateHTML15(_attrs) {
|
|
11375
11584
|
return (
|
|
11376
11585
|
/*html*/
|
|
11377
11586
|
`
|
|
@@ -11401,7 +11610,7 @@ function getSuffixSlotInnerHTML2(_attrs) {
|
|
|
11401
11610
|
var MediaSettingsMenuItem = class extends MediaChromeMenuItem {
|
|
11402
11611
|
};
|
|
11403
11612
|
MediaSettingsMenuItem.shadowRootOptions = { mode: "open" };
|
|
11404
|
-
MediaSettingsMenuItem.getTemplateHTML =
|
|
11613
|
+
MediaSettingsMenuItem.getTemplateHTML = getTemplateHTML15;
|
|
11405
11614
|
MediaSettingsMenuItem.getSuffixSlotInnerHTML = getSuffixSlotInnerHTML2;
|
|
11406
11615
|
if (!GlobalThis.customElements.get("media-settings-menu-item")) {
|
|
11407
11616
|
GlobalThis.customElements.define(
|
|
@@ -11500,26 +11709,26 @@ if (!GlobalThis.customElements.get("media-settings-menu-button")) {
|
|
|
11500
11709
|
}
|
|
11501
11710
|
|
|
11502
11711
|
// ../../node_modules/media-chrome/dist/menu/media-audio-track-menu.js
|
|
11503
|
-
var
|
|
11712
|
+
var __accessCheck27 = (obj, member, msg) => {
|
|
11504
11713
|
if (!member.has(obj))
|
|
11505
11714
|
throw TypeError("Cannot " + msg);
|
|
11506
11715
|
};
|
|
11507
|
-
var
|
|
11508
|
-
|
|
11716
|
+
var __privateGet27 = (obj, member, getter) => {
|
|
11717
|
+
__accessCheck27(obj, member, "read from private field");
|
|
11509
11718
|
return getter ? getter.call(obj) : member.get(obj);
|
|
11510
11719
|
};
|
|
11511
|
-
var
|
|
11720
|
+
var __privateAdd27 = (obj, member, value) => {
|
|
11512
11721
|
if (member.has(obj))
|
|
11513
11722
|
throw TypeError("Cannot add the same private member more than once");
|
|
11514
11723
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
11515
11724
|
};
|
|
11516
11725
|
var __privateSet24 = (obj, member, value, setter) => {
|
|
11517
|
-
|
|
11726
|
+
__accessCheck27(obj, member, "write to private field");
|
|
11518
11727
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
11519
11728
|
return value;
|
|
11520
11729
|
};
|
|
11521
|
-
var
|
|
11522
|
-
|
|
11730
|
+
var __privateMethod11 = (obj, member, method) => {
|
|
11731
|
+
__accessCheck27(obj, member, "access private method");
|
|
11523
11732
|
return method;
|
|
11524
11733
|
};
|
|
11525
11734
|
var _audioTrackList;
|
|
@@ -11531,10 +11740,10 @@ var onChange_fn;
|
|
|
11531
11740
|
var MediaAudioTrackMenu = class extends MediaChromeMenu {
|
|
11532
11741
|
constructor() {
|
|
11533
11742
|
super(...arguments);
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11743
|
+
__privateAdd27(this, _render);
|
|
11744
|
+
__privateAdd27(this, _onChange);
|
|
11745
|
+
__privateAdd27(this, _audioTrackList, []);
|
|
11746
|
+
__privateAdd27(this, _prevState, void 0);
|
|
11538
11747
|
}
|
|
11539
11748
|
static get observedAttributes() {
|
|
11540
11749
|
return [
|
|
@@ -11550,16 +11759,16 @@ var MediaAudioTrackMenu = class extends MediaChromeMenu {
|
|
|
11550
11759
|
this.value = newValue;
|
|
11551
11760
|
} else if (attrName === MediaUIAttributes.MEDIA_AUDIO_TRACK_LIST && oldValue !== newValue) {
|
|
11552
11761
|
__privateSet24(this, _audioTrackList, parseAudioTrackList(newValue != null ? newValue : ""));
|
|
11553
|
-
|
|
11762
|
+
__privateMethod11(this, _render, render_fn).call(this);
|
|
11554
11763
|
}
|
|
11555
11764
|
}
|
|
11556
11765
|
connectedCallback() {
|
|
11557
11766
|
super.connectedCallback();
|
|
11558
|
-
this.addEventListener("change",
|
|
11767
|
+
this.addEventListener("change", __privateMethod11(this, _onChange, onChange_fn));
|
|
11559
11768
|
}
|
|
11560
11769
|
disconnectedCallback() {
|
|
11561
11770
|
super.disconnectedCallback();
|
|
11562
|
-
this.removeEventListener("change",
|
|
11771
|
+
this.removeEventListener("change", __privateMethod11(this, _onChange, onChange_fn));
|
|
11563
11772
|
}
|
|
11564
11773
|
/**
|
|
11565
11774
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -11573,11 +11782,11 @@ var MediaAudioTrackMenu = class extends MediaChromeMenu {
|
|
|
11573
11782
|
);
|
|
11574
11783
|
}
|
|
11575
11784
|
get mediaAudioTrackList() {
|
|
11576
|
-
return
|
|
11785
|
+
return __privateGet27(this, _audioTrackList);
|
|
11577
11786
|
}
|
|
11578
11787
|
set mediaAudioTrackList(list) {
|
|
11579
11788
|
__privateSet24(this, _audioTrackList, list);
|
|
11580
|
-
|
|
11789
|
+
__privateMethod11(this, _render, render_fn).call(this);
|
|
11581
11790
|
}
|
|
11582
11791
|
/**
|
|
11583
11792
|
* Get enabled audio track id.
|
|
@@ -11594,7 +11803,7 @@ _audioTrackList = /* @__PURE__ */ new WeakMap();
|
|
|
11594
11803
|
_prevState = /* @__PURE__ */ new WeakMap();
|
|
11595
11804
|
_render = /* @__PURE__ */ new WeakSet();
|
|
11596
11805
|
render_fn = function() {
|
|
11597
|
-
if (
|
|
11806
|
+
if (__privateGet27(this, _prevState) === JSON.stringify(this.mediaAudioTrackList))
|
|
11598
11807
|
return;
|
|
11599
11808
|
__privateSet24(this, _prevState, JSON.stringify(this.mediaAudioTrackList));
|
|
11600
11809
|
const audioTrackList = this.mediaAudioTrackList;
|
|
@@ -11657,7 +11866,7 @@ function getSlotTemplateHTML21() {
|
|
|
11657
11866
|
function getTooltipContentHTML14() {
|
|
11658
11867
|
return t("Audio");
|
|
11659
11868
|
}
|
|
11660
|
-
var
|
|
11869
|
+
var updateAriaLabel10 = (el) => {
|
|
11661
11870
|
const label = t("Audio");
|
|
11662
11871
|
el.setAttribute("aria-label", label);
|
|
11663
11872
|
};
|
|
@@ -11671,12 +11880,12 @@ var MediaAudioTrackMenuButton = class extends MediaChromeMenuButton {
|
|
|
11671
11880
|
}
|
|
11672
11881
|
connectedCallback() {
|
|
11673
11882
|
super.connectedCallback();
|
|
11674
|
-
|
|
11883
|
+
updateAriaLabel10(this);
|
|
11675
11884
|
}
|
|
11676
11885
|
attributeChangedCallback(attrName, _oldValue, newValue) {
|
|
11677
11886
|
super.attributeChangedCallback(attrName, _oldValue, newValue);
|
|
11678
11887
|
if (attrName === MediaUIAttributes.MEDIA_LANG) {
|
|
11679
|
-
|
|
11888
|
+
updateAriaLabel10(this);
|
|
11680
11889
|
}
|
|
11681
11890
|
}
|
|
11682
11891
|
/**
|
|
@@ -11711,26 +11920,26 @@ if (!GlobalThis.customElements.get("media-audio-track-menu-button")) {
|
|
|
11711
11920
|
}
|
|
11712
11921
|
|
|
11713
11922
|
// ../../node_modules/media-chrome/dist/menu/media-captions-menu.js
|
|
11714
|
-
var
|
|
11923
|
+
var __accessCheck28 = (obj, member, msg) => {
|
|
11715
11924
|
if (!member.has(obj))
|
|
11716
11925
|
throw TypeError("Cannot " + msg);
|
|
11717
11926
|
};
|
|
11718
|
-
var
|
|
11719
|
-
|
|
11927
|
+
var __privateGet28 = (obj, member, getter) => {
|
|
11928
|
+
__accessCheck28(obj, member, "read from private field");
|
|
11720
11929
|
return getter ? getter.call(obj) : member.get(obj);
|
|
11721
11930
|
};
|
|
11722
|
-
var
|
|
11931
|
+
var __privateAdd28 = (obj, member, value) => {
|
|
11723
11932
|
if (member.has(obj))
|
|
11724
11933
|
throw TypeError("Cannot add the same private member more than once");
|
|
11725
11934
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
11726
11935
|
};
|
|
11727
11936
|
var __privateSet25 = (obj, member, value, setter) => {
|
|
11728
|
-
|
|
11937
|
+
__accessCheck28(obj, member, "write to private field");
|
|
11729
11938
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
11730
11939
|
return value;
|
|
11731
11940
|
};
|
|
11732
|
-
var
|
|
11733
|
-
|
|
11941
|
+
var __privateMethod12 = (obj, member, method) => {
|
|
11942
|
+
__accessCheck28(obj, member, "access private method");
|
|
11734
11943
|
return method;
|
|
11735
11944
|
};
|
|
11736
11945
|
var _prevState2;
|
|
@@ -11745,7 +11954,7 @@ var ccIcon = (
|
|
|
11745
11954
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
11746
11955
|
</svg>`
|
|
11747
11956
|
);
|
|
11748
|
-
function
|
|
11957
|
+
function getTemplateHTML16(_attrs) {
|
|
11749
11958
|
return (
|
|
11750
11959
|
/*html*/
|
|
11751
11960
|
`
|
|
@@ -11757,9 +11966,9 @@ function getTemplateHTML17(_attrs) {
|
|
|
11757
11966
|
var MediaCaptionsMenu = class extends MediaChromeMenu {
|
|
11758
11967
|
constructor() {
|
|
11759
11968
|
super(...arguments);
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11969
|
+
__privateAdd28(this, _render2);
|
|
11970
|
+
__privateAdd28(this, _onChange2);
|
|
11971
|
+
__privateAdd28(this, _prevState2, void 0);
|
|
11763
11972
|
}
|
|
11764
11973
|
static get observedAttributes() {
|
|
11765
11974
|
return [
|
|
@@ -11771,19 +11980,19 @@ var MediaCaptionsMenu = class extends MediaChromeMenu {
|
|
|
11771
11980
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
11772
11981
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
11773
11982
|
if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_LIST && oldValue !== newValue) {
|
|
11774
|
-
|
|
11983
|
+
__privateMethod12(this, _render2, render_fn2).call(this);
|
|
11775
11984
|
} else if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_SHOWING && oldValue !== newValue) {
|
|
11776
11985
|
this.value = newValue || "";
|
|
11777
|
-
|
|
11986
|
+
__privateMethod12(this, _render2, render_fn2).call(this);
|
|
11778
11987
|
}
|
|
11779
11988
|
}
|
|
11780
11989
|
connectedCallback() {
|
|
11781
11990
|
super.connectedCallback();
|
|
11782
|
-
this.addEventListener("change",
|
|
11991
|
+
this.addEventListener("change", __privateMethod12(this, _onChange2, onChange_fn2));
|
|
11783
11992
|
}
|
|
11784
11993
|
disconnectedCallback() {
|
|
11785
11994
|
super.disconnectedCallback();
|
|
11786
|
-
this.removeEventListener("change",
|
|
11995
|
+
this.removeEventListener("change", __privateMethod12(this, _onChange2, onChange_fn2));
|
|
11787
11996
|
}
|
|
11788
11997
|
/**
|
|
11789
11998
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -11821,7 +12030,7 @@ _prevState2 = /* @__PURE__ */ new WeakMap();
|
|
|
11821
12030
|
_render2 = /* @__PURE__ */ new WeakSet();
|
|
11822
12031
|
render_fn2 = function() {
|
|
11823
12032
|
var _a3;
|
|
11824
|
-
const hasListChanged =
|
|
12033
|
+
const hasListChanged = __privateGet28(this, _prevState2) !== JSON.stringify(this.mediaSubtitlesList);
|
|
11825
12034
|
const hasShowingChanged = this.value !== this.getAttribute(MediaUIAttributes.MEDIA_SUBTITLES_SHOWING);
|
|
11826
12035
|
if (!hasListChanged && !hasShowingChanged)
|
|
11827
12036
|
return;
|
|
@@ -11883,7 +12092,7 @@ onChange_fn2 = function() {
|
|
|
11883
12092
|
);
|
|
11884
12093
|
this.dispatchEvent(event);
|
|
11885
12094
|
};
|
|
11886
|
-
MediaCaptionsMenu.getTemplateHTML =
|
|
12095
|
+
MediaCaptionsMenu.getTemplateHTML = getTemplateHTML16;
|
|
11887
12096
|
var getSubtitlesListAttr2 = (el, attrName) => {
|
|
11888
12097
|
const attrVal = el.getAttribute(attrName);
|
|
11889
12098
|
return attrVal ? parseTextTracksStr(attrVal) : [];
|
|
@@ -11943,7 +12152,7 @@ function getTooltipContentHTML15() {
|
|
|
11943
12152
|
var updateAriaChecked2 = (el) => {
|
|
11944
12153
|
el.setAttribute("data-captions-enabled", areSubsOn(el).toString());
|
|
11945
12154
|
};
|
|
11946
|
-
var
|
|
12155
|
+
var updateAriaLabel11 = (el) => {
|
|
11947
12156
|
el.setAttribute("aria-label", t("closed captions"));
|
|
11948
12157
|
};
|
|
11949
12158
|
var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
|
|
@@ -11957,7 +12166,7 @@ var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
|
|
|
11957
12166
|
}
|
|
11958
12167
|
connectedCallback() {
|
|
11959
12168
|
super.connectedCallback();
|
|
11960
|
-
|
|
12169
|
+
updateAriaLabel11(this);
|
|
11961
12170
|
updateAriaChecked2(this);
|
|
11962
12171
|
}
|
|
11963
12172
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
@@ -11965,7 +12174,7 @@ var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
|
|
|
11965
12174
|
if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_SHOWING) {
|
|
11966
12175
|
updateAriaChecked2(this);
|
|
11967
12176
|
} else if (attrName === MediaUIAttributes.MEDIA_LANG) {
|
|
11968
|
-
|
|
12177
|
+
updateAriaLabel11(this);
|
|
11969
12178
|
}
|
|
11970
12179
|
}
|
|
11971
12180
|
/**
|
|
@@ -12027,21 +12236,21 @@ if (!GlobalThis.customElements.get("media-captions-menu-button")) {
|
|
|
12027
12236
|
}
|
|
12028
12237
|
|
|
12029
12238
|
// ../../node_modules/media-chrome/dist/menu/media-playback-rate-menu.js
|
|
12030
|
-
var
|
|
12239
|
+
var __accessCheck29 = (obj, member, msg) => {
|
|
12031
12240
|
if (!member.has(obj))
|
|
12032
12241
|
throw TypeError("Cannot " + msg);
|
|
12033
12242
|
};
|
|
12034
|
-
var
|
|
12035
|
-
|
|
12243
|
+
var __privateGet29 = (obj, member, getter) => {
|
|
12244
|
+
__accessCheck29(obj, member, "read from private field");
|
|
12036
12245
|
return getter ? getter.call(obj) : member.get(obj);
|
|
12037
12246
|
};
|
|
12038
|
-
var
|
|
12247
|
+
var __privateAdd29 = (obj, member, value) => {
|
|
12039
12248
|
if (member.has(obj))
|
|
12040
12249
|
throw TypeError("Cannot add the same private member more than once");
|
|
12041
12250
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12042
12251
|
};
|
|
12043
|
-
var
|
|
12044
|
-
|
|
12252
|
+
var __privateMethod13 = (obj, member, method) => {
|
|
12253
|
+
__accessCheck29(obj, member, "access private method");
|
|
12045
12254
|
return method;
|
|
12046
12255
|
};
|
|
12047
12256
|
var _rates2;
|
|
@@ -12055,12 +12264,12 @@ var Attributes14 = {
|
|
|
12055
12264
|
var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
12056
12265
|
constructor() {
|
|
12057
12266
|
super();
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
12267
|
+
__privateAdd29(this, _render3);
|
|
12268
|
+
__privateAdd29(this, _onChange3);
|
|
12269
|
+
__privateAdd29(this, _rates2, new AttributeTokenList(this, Attributes14.RATES, {
|
|
12061
12270
|
defaultValue: DEFAULT_RATES
|
|
12062
12271
|
}));
|
|
12063
|
-
|
|
12272
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12064
12273
|
}
|
|
12065
12274
|
static get observedAttributes() {
|
|
12066
12275
|
return [
|
|
@@ -12073,19 +12282,19 @@ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
|
12073
12282
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
12074
12283
|
if (attrName === MediaUIAttributes.MEDIA_PLAYBACK_RATE && oldValue != newValue) {
|
|
12075
12284
|
this.value = newValue;
|
|
12076
|
-
|
|
12285
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12077
12286
|
} else if (attrName === Attributes14.RATES && oldValue != newValue) {
|
|
12078
|
-
|
|
12079
|
-
|
|
12287
|
+
__privateGet29(this, _rates2).value = newValue;
|
|
12288
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12080
12289
|
}
|
|
12081
12290
|
}
|
|
12082
12291
|
connectedCallback() {
|
|
12083
12292
|
super.connectedCallback();
|
|
12084
|
-
this.addEventListener("change",
|
|
12293
|
+
this.addEventListener("change", __privateMethod13(this, _onChange3, onChange_fn3));
|
|
12085
12294
|
}
|
|
12086
12295
|
disconnectedCallback() {
|
|
12087
12296
|
super.disconnectedCallback();
|
|
12088
|
-
this.removeEventListener("change",
|
|
12297
|
+
this.removeEventListener("change", __privateMethod13(this, _onChange3, onChange_fn3));
|
|
12089
12298
|
}
|
|
12090
12299
|
/**
|
|
12091
12300
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -12101,7 +12310,7 @@ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
|
12101
12310
|
* Get the playback rates for the button.
|
|
12102
12311
|
*/
|
|
12103
12312
|
get rates() {
|
|
12104
|
-
return
|
|
12313
|
+
return __privateGet29(this, _rates2);
|
|
12105
12314
|
}
|
|
12106
12315
|
/**
|
|
12107
12316
|
* Set the playback rates for the button.
|
|
@@ -12109,13 +12318,13 @@ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
|
12109
12318
|
*/
|
|
12110
12319
|
set rates(value) {
|
|
12111
12320
|
if (!value) {
|
|
12112
|
-
|
|
12321
|
+
__privateGet29(this, _rates2).value = "";
|
|
12113
12322
|
} else if (Array.isArray(value)) {
|
|
12114
|
-
|
|
12323
|
+
__privateGet29(this, _rates2).value = value.join(" ");
|
|
12115
12324
|
} else if (typeof value === "string") {
|
|
12116
|
-
|
|
12325
|
+
__privateGet29(this, _rates2).value = value;
|
|
12117
12326
|
}
|
|
12118
|
-
|
|
12327
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12119
12328
|
}
|
|
12120
12329
|
/**
|
|
12121
12330
|
* The current playback rate
|
|
@@ -12136,7 +12345,7 @@ _render3 = /* @__PURE__ */ new WeakSet();
|
|
|
12136
12345
|
render_fn3 = function() {
|
|
12137
12346
|
this.defaultSlot.textContent = "";
|
|
12138
12347
|
const currentRate = this.mediaPlaybackRate;
|
|
12139
|
-
const ratesSet = new Set(Array.from(
|
|
12348
|
+
const ratesSet = new Set(Array.from(__privateGet29(this, _rates2)).map((rate) => Number(rate)));
|
|
12140
12349
|
if (currentRate > 0 && !ratesSet.has(currentRate)) {
|
|
12141
12350
|
ratesSet.add(currentRate);
|
|
12142
12351
|
}
|
|
@@ -12185,6 +12394,10 @@ function getSlotTemplateHTML23(attrs) {
|
|
|
12185
12394
|
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
12186
12395
|
}
|
|
12187
12396
|
|
|
12397
|
+
:host([aria-expanded="true"]) slot {
|
|
12398
|
+
display: block;
|
|
12399
|
+
}
|
|
12400
|
+
|
|
12188
12401
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
12189
12402
|
display: none;
|
|
12190
12403
|
}
|
|
@@ -12253,26 +12466,26 @@ if (!GlobalThis.customElements.get("media-playback-rate-menu-button")) {
|
|
|
12253
12466
|
}
|
|
12254
12467
|
|
|
12255
12468
|
// ../../node_modules/media-chrome/dist/menu/media-rendition-menu.js
|
|
12256
|
-
var
|
|
12469
|
+
var __accessCheck30 = (obj, member, msg) => {
|
|
12257
12470
|
if (!member.has(obj))
|
|
12258
12471
|
throw TypeError("Cannot " + msg);
|
|
12259
12472
|
};
|
|
12260
|
-
var
|
|
12261
|
-
|
|
12473
|
+
var __privateGet30 = (obj, member, getter) => {
|
|
12474
|
+
__accessCheck30(obj, member, "read from private field");
|
|
12262
12475
|
return getter ? getter.call(obj) : member.get(obj);
|
|
12263
12476
|
};
|
|
12264
|
-
var
|
|
12477
|
+
var __privateAdd30 = (obj, member, value) => {
|
|
12265
12478
|
if (member.has(obj))
|
|
12266
12479
|
throw TypeError("Cannot add the same private member more than once");
|
|
12267
12480
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12268
12481
|
};
|
|
12269
12482
|
var __privateSet26 = (obj, member, value, setter) => {
|
|
12270
|
-
|
|
12483
|
+
__accessCheck30(obj, member, "write to private field");
|
|
12271
12484
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
12272
12485
|
return value;
|
|
12273
12486
|
};
|
|
12274
|
-
var
|
|
12275
|
-
|
|
12487
|
+
var __privateMethod14 = (obj, member, method) => {
|
|
12488
|
+
__accessCheck30(obj, member, "access private method");
|
|
12276
12489
|
return method;
|
|
12277
12490
|
};
|
|
12278
12491
|
var _renditionList;
|
|
@@ -12284,10 +12497,10 @@ var onChange_fn4;
|
|
|
12284
12497
|
var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
12285
12498
|
constructor() {
|
|
12286
12499
|
super(...arguments);
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12500
|
+
__privateAdd30(this, _render4);
|
|
12501
|
+
__privateAdd30(this, _onChange4);
|
|
12502
|
+
__privateAdd30(this, _renditionList, []);
|
|
12503
|
+
__privateAdd30(this, _prevState3, {});
|
|
12291
12504
|
}
|
|
12292
12505
|
static get observedAttributes() {
|
|
12293
12506
|
return [
|
|
@@ -12295,7 +12508,8 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12295
12508
|
MediaUIAttributes.MEDIA_RENDITION_LIST,
|
|
12296
12509
|
MediaUIAttributes.MEDIA_RENDITION_SELECTED,
|
|
12297
12510
|
MediaUIAttributes.MEDIA_RENDITION_UNAVAILABLE,
|
|
12298
|
-
MediaUIAttributes.MEDIA_HEIGHT
|
|
12511
|
+
MediaUIAttributes.MEDIA_HEIGHT,
|
|
12512
|
+
MediaUIAttributes.MEDIA_WIDTH
|
|
12299
12513
|
];
|
|
12300
12514
|
}
|
|
12301
12515
|
static formatMenuItemText(text, rendition) {
|
|
@@ -12319,23 +12533,30 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12319
12533
|
}
|
|
12320
12534
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
12321
12535
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
12322
|
-
if (
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12536
|
+
if (oldValue !== newValue) {
|
|
12537
|
+
switch (attrName) {
|
|
12538
|
+
case MediaUIAttributes.MEDIA_RENDITION_SELECTED:
|
|
12539
|
+
this.value = newValue != null ? newValue : "auto";
|
|
12540
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12541
|
+
break;
|
|
12542
|
+
case MediaUIAttributes.MEDIA_RENDITION_LIST:
|
|
12543
|
+
__privateSet26(this, _renditionList, parseRenditionList(newValue));
|
|
12544
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12545
|
+
break;
|
|
12546
|
+
case MediaUIAttributes.MEDIA_HEIGHT:
|
|
12547
|
+
case MediaUIAttributes.MEDIA_WIDTH:
|
|
12548
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12549
|
+
break;
|
|
12550
|
+
}
|
|
12330
12551
|
}
|
|
12331
12552
|
}
|
|
12332
12553
|
connectedCallback() {
|
|
12333
12554
|
super.connectedCallback();
|
|
12334
|
-
this.addEventListener("change",
|
|
12555
|
+
this.addEventListener("change", __privateMethod14(this, _onChange4, onChange_fn4));
|
|
12335
12556
|
}
|
|
12336
12557
|
disconnectedCallback() {
|
|
12337
12558
|
super.disconnectedCallback();
|
|
12338
|
-
this.removeEventListener("change",
|
|
12559
|
+
this.removeEventListener("change", __privateMethod14(this, _onChange4, onChange_fn4));
|
|
12339
12560
|
}
|
|
12340
12561
|
/**
|
|
12341
12562
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -12348,11 +12569,11 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12348
12569
|
);
|
|
12349
12570
|
}
|
|
12350
12571
|
get mediaRenditionList() {
|
|
12351
|
-
return
|
|
12572
|
+
return __privateGet30(this, _renditionList);
|
|
12352
12573
|
}
|
|
12353
12574
|
set mediaRenditionList(list) {
|
|
12354
12575
|
__privateSet26(this, _renditionList, list);
|
|
12355
|
-
|
|
12576
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12356
12577
|
}
|
|
12357
12578
|
/**
|
|
12358
12579
|
* Get selected rendition id.
|
|
@@ -12369,6 +12590,12 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12369
12590
|
set mediaHeight(height) {
|
|
12370
12591
|
setNumericAttr(this, MediaUIAttributes.MEDIA_HEIGHT, height);
|
|
12371
12592
|
}
|
|
12593
|
+
get mediaWidth() {
|
|
12594
|
+
return getNumericAttr(this, MediaUIAttributes.MEDIA_WIDTH);
|
|
12595
|
+
}
|
|
12596
|
+
set mediaWidth(width) {
|
|
12597
|
+
setNumericAttr(this, MediaUIAttributes.MEDIA_WIDTH, width);
|
|
12598
|
+
}
|
|
12372
12599
|
compareRendition(a, b) {
|
|
12373
12600
|
const ctor = this.constructor;
|
|
12374
12601
|
return ctor.compareRendition(a, b);
|
|
@@ -12391,12 +12618,15 @@ _renditionList = /* @__PURE__ */ new WeakMap();
|
|
|
12391
12618
|
_prevState3 = /* @__PURE__ */ new WeakMap();
|
|
12392
12619
|
_render4 = /* @__PURE__ */ new WeakSet();
|
|
12393
12620
|
render_fn4 = function() {
|
|
12394
|
-
|
|
12621
|
+
const isAuto = !this.mediaRenditionSelected;
|
|
12622
|
+
if (__privateGet30(this, _prevState3).mediaRenditionList === JSON.stringify(this.mediaRenditionList) && __privateGet30(this, _prevState3).mediaHeight === this.mediaHeight && __privateGet30(this, _prevState3).mediaWidth === this.mediaWidth && __privateGet30(this, _prevState3).isAuto === isAuto)
|
|
12395
12623
|
return;
|
|
12396
|
-
|
|
12624
|
+
__privateGet30(this, _prevState3).mediaRenditionList = JSON.stringify(
|
|
12397
12625
|
this.mediaRenditionList
|
|
12398
12626
|
);
|
|
12399
|
-
|
|
12627
|
+
__privateGet30(this, _prevState3).mediaHeight = this.mediaHeight;
|
|
12628
|
+
__privateGet30(this, _prevState3).mediaWidth = this.mediaWidth;
|
|
12629
|
+
__privateGet30(this, _prevState3).isAuto = isAuto;
|
|
12400
12630
|
const renditionList = this.mediaRenditionList.sort(
|
|
12401
12631
|
this.compareRendition.bind(this)
|
|
12402
12632
|
);
|
|
@@ -12407,7 +12637,6 @@ render_fn4 = function() {
|
|
|
12407
12637
|
rendition.selected = rendition === selectedRendition;
|
|
12408
12638
|
}
|
|
12409
12639
|
this.defaultSlot.textContent = "";
|
|
12410
|
-
const isAuto = !this.mediaRenditionSelected;
|
|
12411
12640
|
for (const rendition of renditionList) {
|
|
12412
12641
|
const text = this.formatRendition(rendition, {
|
|
12413
12642
|
showBitrate: this.showRenditionBitrate(rendition)
|
|
@@ -12422,15 +12651,22 @@ render_fn4 = function() {
|
|
|
12422
12651
|
this.defaultSlot.append(item2);
|
|
12423
12652
|
}
|
|
12424
12653
|
const showSelectedBitrate = selectedRendition && this.showRenditionBitrate(selectedRendition);
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
selectedRendition
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12654
|
+
let autoText = void 0;
|
|
12655
|
+
if (isAuto) {
|
|
12656
|
+
if (selectedRendition) {
|
|
12657
|
+
autoText = this.formatMenuItemText(
|
|
12658
|
+
`${t("Auto")} \u2022 ${this.formatRendition(selectedRendition, {
|
|
12659
|
+
showBitrate: showSelectedBitrate
|
|
12660
|
+
})}`,
|
|
12661
|
+
selectedRendition
|
|
12662
|
+
);
|
|
12663
|
+
} else if (this.mediaHeight > 0 && this.mediaWidth > 0) {
|
|
12664
|
+
autoText = this.formatMenuItemText(`${t("Auto")} (${Math.min(this.mediaWidth, this.mediaHeight)}p)`);
|
|
12665
|
+
}
|
|
12666
|
+
}
|
|
12667
|
+
if (!autoText) {
|
|
12668
|
+
autoText = this.formatMenuItemText(t("Auto"));
|
|
12669
|
+
}
|
|
12434
12670
|
const item = createMenuItem({
|
|
12435
12671
|
type: "radio",
|
|
12436
12672
|
text: autoText,
|
|
@@ -12529,26 +12765,26 @@ if (!GlobalThis.customElements.get("media-rendition-menu-button")) {
|
|
|
12529
12765
|
}
|
|
12530
12766
|
|
|
12531
12767
|
// ../../node_modules/media-chrome/dist/menu/media-context-menu.js
|
|
12532
|
-
var
|
|
12768
|
+
var __accessCheck31 = (obj, member, msg) => {
|
|
12533
12769
|
if (!member.has(obj))
|
|
12534
12770
|
throw TypeError("Cannot " + msg);
|
|
12535
12771
|
};
|
|
12536
|
-
var
|
|
12537
|
-
|
|
12772
|
+
var __privateGet31 = (obj, member, getter) => {
|
|
12773
|
+
__accessCheck31(obj, member, "read from private field");
|
|
12538
12774
|
return getter ? getter.call(obj) : member.get(obj);
|
|
12539
12775
|
};
|
|
12540
|
-
var
|
|
12776
|
+
var __privateAdd31 = (obj, member, value) => {
|
|
12541
12777
|
if (member.has(obj))
|
|
12542
12778
|
throw TypeError("Cannot add the same private member more than once");
|
|
12543
12779
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12544
12780
|
};
|
|
12545
12781
|
var __privateSet27 = (obj, member, value, setter) => {
|
|
12546
|
-
|
|
12782
|
+
__accessCheck31(obj, member, "write to private field");
|
|
12547
12783
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
12548
12784
|
return value;
|
|
12549
12785
|
};
|
|
12550
|
-
var
|
|
12551
|
-
|
|
12786
|
+
var __privateMethod15 = (obj, member, method) => {
|
|
12787
|
+
__accessCheck31(obj, member, "access private method");
|
|
12552
12788
|
return method;
|
|
12553
12789
|
};
|
|
12554
12790
|
var _isContextMenuOpen;
|
|
@@ -12566,7 +12802,7 @@ var onContextMenu_fn;
|
|
|
12566
12802
|
var _onDocumentClick;
|
|
12567
12803
|
var _onKeyDown;
|
|
12568
12804
|
var _onMenuClick;
|
|
12569
|
-
function
|
|
12805
|
+
function getTemplateHTML17(_attrs) {
|
|
12570
12806
|
return (
|
|
12571
12807
|
/*html*/
|
|
12572
12808
|
`
|
|
@@ -12589,30 +12825,30 @@ function getTemplateHTML18(_attrs) {
|
|
|
12589
12825
|
var MediaContextMenu = class extends MediaChromeMenu {
|
|
12590
12826
|
constructor() {
|
|
12591
12827
|
super();
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12828
|
+
__privateAdd31(this, _updateVisibility);
|
|
12829
|
+
__privateAdd31(this, _closeContextMenu);
|
|
12830
|
+
__privateAdd31(this, _closeOtherContextMenus);
|
|
12831
|
+
__privateAdd31(this, _isVideoContainer);
|
|
12832
|
+
__privateAdd31(this, _onContextMenu);
|
|
12833
|
+
__privateAdd31(this, _isContextMenuOpen, false);
|
|
12834
|
+
__privateAdd31(this, _onControllerContextMenu, (event) => {
|
|
12599
12835
|
const target = event.target;
|
|
12600
12836
|
const isVideoElement = (target == null ? void 0 : target.nodeName) === "VIDEO";
|
|
12601
|
-
const isVideoContainer =
|
|
12837
|
+
const isVideoContainer = __privateMethod15(this, _isVideoContainer, isVideoContainer_fn).call(this, target);
|
|
12602
12838
|
if (isVideoElement || isVideoContainer) {
|
|
12603
|
-
if (!
|
|
12604
|
-
|
|
12839
|
+
if (!__privateGet31(this, _isContextMenuOpen)) {
|
|
12840
|
+
__privateMethod15(this, _onContextMenu, onContextMenu_fn).call(this, event);
|
|
12605
12841
|
} else {
|
|
12606
|
-
|
|
12842
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12607
12843
|
}
|
|
12608
12844
|
}
|
|
12609
12845
|
});
|
|
12610
|
-
|
|
12846
|
+
__privateAdd31(this, _onDocumentClick, (event) => {
|
|
12611
12847
|
const target = event.target;
|
|
12612
12848
|
const isInsideMenu = this.contains(target);
|
|
12613
12849
|
const isRightClick = event.button === 2;
|
|
12614
12850
|
const isVideo = (target == null ? void 0 : target.nodeName) === "VIDEO";
|
|
12615
|
-
const isVideoContainer =
|
|
12851
|
+
const isVideoContainer = __privateMethod15(this, _isVideoContainer, isVideoContainer_fn).call(this, target);
|
|
12616
12852
|
if (isInsideMenu) {
|
|
12617
12853
|
return;
|
|
12618
12854
|
}
|
|
@@ -12620,53 +12856,53 @@ var MediaContextMenu = class extends MediaChromeMenu {
|
|
|
12620
12856
|
if (isRightClickOnVideo) {
|
|
12621
12857
|
return;
|
|
12622
12858
|
}
|
|
12623
|
-
|
|
12859
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12624
12860
|
});
|
|
12625
|
-
|
|
12861
|
+
__privateAdd31(this, _onKeyDown, (event) => {
|
|
12626
12862
|
if (event.key === "Escape") {
|
|
12627
|
-
|
|
12863
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12628
12864
|
}
|
|
12629
12865
|
});
|
|
12630
|
-
|
|
12866
|
+
__privateAdd31(this, _onMenuClick, (event) => {
|
|
12631
12867
|
var _a3, _b2;
|
|
12632
12868
|
const target = event.target;
|
|
12633
12869
|
if ((_a3 = target.matches) == null ? void 0 : _a3.call(target, 'button[invoke="copy"]')) {
|
|
12634
12870
|
const input = (_b2 = target.closest("media-context-menu-item")) == null ? void 0 : _b2.querySelector('input[slot="copy"]');
|
|
12635
12871
|
input && navigator.clipboard.writeText(input.value);
|
|
12636
12872
|
}
|
|
12637
|
-
|
|
12873
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12638
12874
|
});
|
|
12639
12875
|
this.setAttribute("noautohide", "");
|
|
12640
|
-
|
|
12876
|
+
__privateMethod15(this, _updateVisibility, updateVisibility_fn).call(this);
|
|
12641
12877
|
}
|
|
12642
12878
|
connectedCallback() {
|
|
12643
12879
|
super.connectedCallback();
|
|
12644
12880
|
getMediaController(this).addEventListener(
|
|
12645
12881
|
"contextmenu",
|
|
12646
|
-
|
|
12882
|
+
__privateGet31(this, _onControllerContextMenu)
|
|
12647
12883
|
);
|
|
12648
|
-
this.addEventListener("click",
|
|
12884
|
+
this.addEventListener("click", __privateGet31(this, _onMenuClick));
|
|
12649
12885
|
}
|
|
12650
12886
|
disconnectedCallback() {
|
|
12651
12887
|
super.disconnectedCallback();
|
|
12652
12888
|
getMediaController(this).removeEventListener(
|
|
12653
12889
|
"contextmenu",
|
|
12654
|
-
|
|
12890
|
+
__privateGet31(this, _onControllerContextMenu)
|
|
12655
12891
|
);
|
|
12656
|
-
this.removeEventListener("click",
|
|
12657
|
-
document.removeEventListener("mousedown",
|
|
12658
|
-
document.removeEventListener("keydown",
|
|
12892
|
+
this.removeEventListener("click", __privateGet31(this, _onMenuClick));
|
|
12893
|
+
document.removeEventListener("mousedown", __privateGet31(this, _onDocumentClick));
|
|
12894
|
+
document.removeEventListener("keydown", __privateGet31(this, _onKeyDown));
|
|
12659
12895
|
}
|
|
12660
12896
|
};
|
|
12661
12897
|
_isContextMenuOpen = /* @__PURE__ */ new WeakMap();
|
|
12662
12898
|
_updateVisibility = /* @__PURE__ */ new WeakSet();
|
|
12663
12899
|
updateVisibility_fn = function() {
|
|
12664
|
-
this.hidden = !
|
|
12900
|
+
this.hidden = !__privateGet31(this, _isContextMenuOpen);
|
|
12665
12901
|
};
|
|
12666
12902
|
_closeContextMenu = /* @__PURE__ */ new WeakSet();
|
|
12667
12903
|
closeContextMenu_fn = function() {
|
|
12668
12904
|
__privateSet27(this, _isContextMenuOpen, false);
|
|
12669
|
-
|
|
12905
|
+
__privateMethod15(this, _updateVisibility, updateVisibility_fn).call(this);
|
|
12670
12906
|
};
|
|
12671
12907
|
_closeOtherContextMenus = /* @__PURE__ */ new WeakSet();
|
|
12672
12908
|
closeOtherContextMenus_fn = function() {
|
|
@@ -12674,7 +12910,7 @@ closeOtherContextMenus_fn = function() {
|
|
|
12674
12910
|
allContextMenus.forEach((menu) => {
|
|
12675
12911
|
var _a3;
|
|
12676
12912
|
if (menu !== this) {
|
|
12677
|
-
|
|
12913
|
+
__privateMethod15(_a3 = menu, _closeContextMenu, closeContextMenu_fn).call(_a3);
|
|
12678
12914
|
}
|
|
12679
12915
|
});
|
|
12680
12916
|
};
|
|
@@ -12695,27 +12931,27 @@ _onControllerContextMenu = /* @__PURE__ */ new WeakMap();
|
|
|
12695
12931
|
_onContextMenu = /* @__PURE__ */ new WeakSet();
|
|
12696
12932
|
onContextMenu_fn = function(event) {
|
|
12697
12933
|
event.preventDefault();
|
|
12698
|
-
|
|
12934
|
+
__privateMethod15(this, _closeOtherContextMenus, closeOtherContextMenus_fn).call(this);
|
|
12699
12935
|
__privateSet27(this, _isContextMenuOpen, true);
|
|
12700
12936
|
this.style.position = "fixed";
|
|
12701
12937
|
this.style.left = `${event.clientX}px`;
|
|
12702
12938
|
this.style.top = `${event.clientY}px`;
|
|
12703
|
-
|
|
12704
|
-
document.addEventListener("mousedown",
|
|
12939
|
+
__privateMethod15(this, _updateVisibility, updateVisibility_fn).call(this);
|
|
12940
|
+
document.addEventListener("mousedown", __privateGet31(this, _onDocumentClick), {
|
|
12705
12941
|
once: true
|
|
12706
12942
|
});
|
|
12707
|
-
document.addEventListener("keydown",
|
|
12943
|
+
document.addEventListener("keydown", __privateGet31(this, _onKeyDown), { once: true });
|
|
12708
12944
|
};
|
|
12709
12945
|
_onDocumentClick = /* @__PURE__ */ new WeakMap();
|
|
12710
12946
|
_onKeyDown = /* @__PURE__ */ new WeakMap();
|
|
12711
12947
|
_onMenuClick = /* @__PURE__ */ new WeakMap();
|
|
12712
|
-
MediaContextMenu.getTemplateHTML =
|
|
12948
|
+
MediaContextMenu.getTemplateHTML = getTemplateHTML17;
|
|
12713
12949
|
if (!GlobalThis.customElements.get("media-context-menu")) {
|
|
12714
12950
|
GlobalThis.customElements.define("media-context-menu", MediaContextMenu);
|
|
12715
12951
|
}
|
|
12716
12952
|
|
|
12717
12953
|
// ../../node_modules/media-chrome/dist/menu/media-context-menu-item.js
|
|
12718
|
-
function
|
|
12954
|
+
function getTemplateHTML18(_attrs) {
|
|
12719
12955
|
return (
|
|
12720
12956
|
/*html*/
|
|
12721
12957
|
`
|
|
@@ -12737,7 +12973,7 @@ function getTemplateHTML19(_attrs) {
|
|
|
12737
12973
|
var MediaContextMenuItem = class extends MediaChromeMenuItem {
|
|
12738
12974
|
};
|
|
12739
12975
|
MediaContextMenuItem.shadowRootOptions = { mode: "open" };
|
|
12740
|
-
MediaContextMenuItem.getTemplateHTML =
|
|
12976
|
+
MediaContextMenuItem.getTemplateHTML = getTemplateHTML18;
|
|
12741
12977
|
if (!GlobalThis.customElements.get("media-context-menu-item")) {
|
|
12742
12978
|
GlobalThis.customElements.define(
|
|
12743
12979
|
"media-context-menu-item",
|
|
@@ -12752,7 +12988,7 @@ if (template) {
|
|
|
12752
12988
|
template.innerHTML = String.raw`
|
|
12753
12989
|
<style>
|
|
12754
12990
|
:host {
|
|
12755
|
-
--_primary-color: var(--media-primary-color, rgb(255 255 255 / .9));
|
|
12991
|
+
--_primary-color: var(--media-primary-color, rgb(255 255 255 / 0.9));
|
|
12756
12992
|
--_secondary-color: var(--media-secondary-color, rgb(0 0 0 / .75));
|
|
12757
12993
|
--_volume-range-expand-width: 70px;
|
|
12758
12994
|
--_volume-range-expand-height: 42px;
|
|
@@ -12836,6 +13072,7 @@ if (template) {
|
|
|
12836
13072
|
|
|
12837
13073
|
:host([controlbarvertical]) :is(media-control-bar, .control-group) {
|
|
12838
13074
|
flex-direction: column;
|
|
13075
|
+
width: 40px;
|
|
12839
13076
|
}
|
|
12840
13077
|
|
|
12841
13078
|
.volume-group {
|
|
@@ -12845,7 +13082,7 @@ if (template) {
|
|
|
12845
13082
|
}
|
|
12846
13083
|
|
|
12847
13084
|
:host([controlbarplace$="end"]) .volume-group {
|
|
12848
|
-
flex-direction: row
|
|
13085
|
+
flex-direction: row;
|
|
12849
13086
|
}
|
|
12850
13087
|
|
|
12851
13088
|
:host([controlbarplace$="end"]) .volume-group:first-child .volume-range-span {
|
|
@@ -12869,6 +13106,7 @@ if (template) {
|
|
|
12869
13106
|
position: relative;
|
|
12870
13107
|
overflow: hidden;
|
|
12871
13108
|
width: 0;
|
|
13109
|
+
transition: width .2s ease-in-out , height .2s ease-in-out;
|
|
12872
13110
|
}
|
|
12873
13111
|
|
|
12874
13112
|
.volume-group:hover .volume-range-span,
|
|
@@ -12908,7 +13146,7 @@ if (template) {
|
|
|
12908
13146
|
media-control-bar:has(.volume-group:hover),
|
|
12909
13147
|
[keyboardcontrol] media-control-bar:has(.volume-group:focus-within) {
|
|
12910
13148
|
top: var(--_control-bar-offset-top, 0);
|
|
12911
|
-
left: var(--_control-bar-offset-left,
|
|
13149
|
+
left: var(--_control-bar-offset-left, - var(--_volume-range-expand-width));
|
|
12912
13150
|
}
|
|
12913
13151
|
|
|
12914
13152
|
:host([controlbarplace$="start"]),
|
|
@@ -12921,7 +13159,7 @@ if (template) {
|
|
|
12921
13159
|
}
|
|
12922
13160
|
|
|
12923
13161
|
:host([controlbarvertical][controlbarplace^="center"]) {
|
|
12924
|
-
--_control-bar-offset-top:
|
|
13162
|
+
--_control-bar-offset-top: - var(--_volume-range-expand-height);
|
|
12925
13163
|
}
|
|
12926
13164
|
|
|
12927
13165
|
media-time-range {
|