@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
|
@@ -231,84 +231,6 @@ function isNumericString(str) {
|
|
|
231
231
|
}
|
|
232
232
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
233
233
|
|
|
234
|
-
// ../../node_modules/media-chrome/dist/utils/time.js
|
|
235
|
-
var UnitLabels = [
|
|
236
|
-
{
|
|
237
|
-
singular: "hour",
|
|
238
|
-
plural: "hours"
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
singular: "minute",
|
|
242
|
-
plural: "minutes"
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
singular: "second",
|
|
246
|
-
plural: "seconds"
|
|
247
|
-
}
|
|
248
|
-
];
|
|
249
|
-
var toTimeUnitPhrase = (timeUnitValue, unitIndex) => {
|
|
250
|
-
const unitLabel = timeUnitValue === 1 ? UnitLabels[unitIndex].singular : UnitLabels[unitIndex].plural;
|
|
251
|
-
return `${timeUnitValue} ${unitLabel}`;
|
|
252
|
-
};
|
|
253
|
-
var formatAsTimePhrase = (seconds) => {
|
|
254
|
-
if (!isValidNumber(seconds))
|
|
255
|
-
return "";
|
|
256
|
-
const positiveSeconds = Math.abs(seconds);
|
|
257
|
-
const negative = positiveSeconds !== seconds;
|
|
258
|
-
const secondsDateTime = new Date(0, 0, 0, 0, 0, positiveSeconds, 0);
|
|
259
|
-
const timeParts = [
|
|
260
|
-
secondsDateTime.getHours(),
|
|
261
|
-
secondsDateTime.getMinutes(),
|
|
262
|
-
secondsDateTime.getSeconds()
|
|
263
|
-
];
|
|
264
|
-
const timeString = timeParts.map(
|
|
265
|
-
(timeUnitValue, index) => timeUnitValue && toTimeUnitPhrase(timeUnitValue, index)
|
|
266
|
-
).filter((x) => x).join(", ");
|
|
267
|
-
const negativeSuffix = negative ? " remaining" : "";
|
|
268
|
-
return `${timeString}${negativeSuffix}`;
|
|
269
|
-
};
|
|
270
|
-
function formatTime(seconds, guide) {
|
|
271
|
-
let negative = false;
|
|
272
|
-
if (seconds < 0) {
|
|
273
|
-
negative = true;
|
|
274
|
-
seconds = 0 - seconds;
|
|
275
|
-
}
|
|
276
|
-
seconds = seconds < 0 ? 0 : seconds;
|
|
277
|
-
let s = Math.floor(seconds % 60);
|
|
278
|
-
let m = Math.floor(seconds / 60 % 60);
|
|
279
|
-
let h = Math.floor(seconds / 3600);
|
|
280
|
-
const gm = Math.floor(guide / 60 % 60);
|
|
281
|
-
const gh = Math.floor(guide / 3600);
|
|
282
|
-
if (isNaN(seconds) || seconds === Infinity) {
|
|
283
|
-
h = m = s = "0";
|
|
284
|
-
}
|
|
285
|
-
h = h > 0 || gh > 0 ? h + ":" : "";
|
|
286
|
-
m = ((h || gm >= 10) && m < 10 ? "0" + m : m) + ":";
|
|
287
|
-
s = s < 10 ? "0" + s : s;
|
|
288
|
-
return (negative ? "-" : "") + h + m + s;
|
|
289
|
-
}
|
|
290
|
-
var emptyTimeRanges = Object.freeze({
|
|
291
|
-
length: 0,
|
|
292
|
-
start(index) {
|
|
293
|
-
const unsignedIdx = index >>> 0;
|
|
294
|
-
if (unsignedIdx >= this.length) {
|
|
295
|
-
throw new DOMException(
|
|
296
|
-
`Failed to execute 'start' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
return 0;
|
|
300
|
-
},
|
|
301
|
-
end(index) {
|
|
302
|
-
const unsignedIdx = index >>> 0;
|
|
303
|
-
if (unsignedIdx >= this.length) {
|
|
304
|
-
throw new DOMException(
|
|
305
|
-
`Failed to execute 'end' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
return 0;
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
|
|
312
234
|
// ../../node_modules/media-chrome/dist/lang/en.js
|
|
313
235
|
var En = {
|
|
314
236
|
"Start airplay": "Start airplay",
|
|
@@ -372,7 +294,16 @@ var En = {
|
|
|
372
294
|
"A network error caused the media download to fail.": "A network error caused the media download to fail.",
|
|
373
295
|
"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.",
|
|
374
296
|
"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.",
|
|
375
|
-
"The media is encrypted and there are no keys to decrypt it.": "The media is encrypted and there are no keys to decrypt it."
|
|
297
|
+
"The media is encrypted and there are no keys to decrypt it.": "The media is encrypted and there are no keys to decrypt it.",
|
|
298
|
+
hour: "hour",
|
|
299
|
+
hours: "hours",
|
|
300
|
+
minute: "minute",
|
|
301
|
+
minutes: "minutes",
|
|
302
|
+
second: "second",
|
|
303
|
+
seconds: "seconds",
|
|
304
|
+
"{time} remaining": "{time} remaining",
|
|
305
|
+
"{currentTime} of {totalTime}": "{currentTime} of {totalTime}",
|
|
306
|
+
"video not loaded, unknown time.": "video not loaded, unknown time."
|
|
376
307
|
};
|
|
377
308
|
|
|
378
309
|
// ../../node_modules/media-chrome/dist/utils/i18n.js
|
|
@@ -394,6 +325,86 @@ var t = (key, vars = {}) => resolveTranslation(key).replace(
|
|
|
394
325
|
(_, v) => v in vars ? String(vars[v]) : `{${v}}`
|
|
395
326
|
);
|
|
396
327
|
|
|
328
|
+
// ../../node_modules/media-chrome/dist/utils/time.js
|
|
329
|
+
var UnitLabels = [
|
|
330
|
+
{
|
|
331
|
+
singular: "hour",
|
|
332
|
+
plural: "hours"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
singular: "minute",
|
|
336
|
+
plural: "minutes"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
singular: "second",
|
|
340
|
+
plural: "seconds"
|
|
341
|
+
}
|
|
342
|
+
];
|
|
343
|
+
var toTimeUnitPhrase = (timeUnitValue, unitIndex) => {
|
|
344
|
+
const unitLabel = timeUnitValue === 1 ? t(UnitLabels[unitIndex].singular) : t(UnitLabels[unitIndex].plural);
|
|
345
|
+
return `${timeUnitValue} ${unitLabel}`;
|
|
346
|
+
};
|
|
347
|
+
var formatAsTimePhrase = (seconds) => {
|
|
348
|
+
if (!isValidNumber(seconds))
|
|
349
|
+
return "";
|
|
350
|
+
const positiveSeconds = Math.abs(seconds);
|
|
351
|
+
const negative = positiveSeconds !== seconds;
|
|
352
|
+
const secondsDateTime = new Date(0, 0, 0, 0, 0, positiveSeconds, 0);
|
|
353
|
+
const timeParts = [
|
|
354
|
+
secondsDateTime.getHours(),
|
|
355
|
+
secondsDateTime.getMinutes(),
|
|
356
|
+
secondsDateTime.getSeconds()
|
|
357
|
+
];
|
|
358
|
+
const timeString = timeParts.map(
|
|
359
|
+
(timeUnitValue, index) => timeUnitValue && toTimeUnitPhrase(timeUnitValue, index)
|
|
360
|
+
).filter((x) => x).join(", ");
|
|
361
|
+
if (negative) {
|
|
362
|
+
return t("{time} remaining", { time: timeString });
|
|
363
|
+
}
|
|
364
|
+
return timeString;
|
|
365
|
+
};
|
|
366
|
+
function formatTime(seconds, guide) {
|
|
367
|
+
let negative = false;
|
|
368
|
+
if (seconds < 0) {
|
|
369
|
+
negative = true;
|
|
370
|
+
seconds = 0 - seconds;
|
|
371
|
+
}
|
|
372
|
+
seconds = seconds < 0 ? 0 : seconds;
|
|
373
|
+
let s = Math.floor(seconds % 60);
|
|
374
|
+
let m = Math.floor(seconds / 60 % 60);
|
|
375
|
+
let h = Math.floor(seconds / 3600);
|
|
376
|
+
const gm = Math.floor(guide / 60 % 60);
|
|
377
|
+
const gh = Math.floor(guide / 3600);
|
|
378
|
+
if (isNaN(seconds) || seconds === Infinity) {
|
|
379
|
+
h = m = s = "0";
|
|
380
|
+
}
|
|
381
|
+
h = h > 0 || gh > 0 ? h + ":" : "";
|
|
382
|
+
m = ((h || gm >= 10) && m < 10 ? "0" + m : m) + ":";
|
|
383
|
+
s = s < 10 ? "0" + s : s;
|
|
384
|
+
return (negative ? "-" : "") + h + m + s;
|
|
385
|
+
}
|
|
386
|
+
var emptyTimeRanges = Object.freeze({
|
|
387
|
+
length: 0,
|
|
388
|
+
start(index) {
|
|
389
|
+
const unsignedIdx = index >>> 0;
|
|
390
|
+
if (unsignedIdx >= this.length) {
|
|
391
|
+
throw new DOMException(
|
|
392
|
+
`Failed to execute 'start' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
return 0;
|
|
396
|
+
},
|
|
397
|
+
end(index) {
|
|
398
|
+
const unsignedIdx = index >>> 0;
|
|
399
|
+
if (unsignedIdx >= this.length) {
|
|
400
|
+
throw new DOMException(
|
|
401
|
+
`Failed to execute 'end' on 'TimeRanges': The index provided (${unsignedIdx}) is greater than or equal to the maximum bound (${this.length}).`
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
return 0;
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
|
|
397
408
|
// ../../node_modules/media-chrome/dist/utils/server-safe-globals.js
|
|
398
409
|
var EventTarget = class {
|
|
399
410
|
addEventListener() {
|
|
@@ -669,11 +680,8 @@ function insertCSSRule(styleParent, selectorText) {
|
|
|
669
680
|
}
|
|
670
681
|
};
|
|
671
682
|
}
|
|
672
|
-
style == null ? void 0 : style.sheet.insertRule(`${selectorText}{}`, style.sheet.cssRules.length);
|
|
673
|
-
return (
|
|
674
|
-
/** @type {CSSStyleRule} */
|
|
675
|
-
(_b2 = style.sheet.cssRules) == null ? void 0 : _b2[style.sheet.cssRules.length - 1]
|
|
676
|
-
);
|
|
683
|
+
const cssRuleId = style == null ? void 0 : style.sheet.insertRule(`${selectorText}{}`, style.sheet.cssRules.length);
|
|
684
|
+
return (_b2 = style.sheet.cssRules) == null ? void 0 : _b2[cssRuleId];
|
|
677
685
|
}
|
|
678
686
|
function getNumericAttr(el, attrName, defaultValue = Number.NaN) {
|
|
679
687
|
const attrVal = el.getAttribute(attrName);
|
|
@@ -787,15 +795,20 @@ var MediaGestureReceiver = class extends GlobalThis.HTMLElement {
|
|
|
787
795
|
}
|
|
788
796
|
}
|
|
789
797
|
connectedCallback() {
|
|
790
|
-
var _a3, _b2
|
|
798
|
+
var _a3, _b2;
|
|
791
799
|
this.tabIndex = -1;
|
|
792
800
|
this.setAttribute("aria-hidden", "true");
|
|
793
801
|
__privateSet(this, _mediaController, getMediaControllerEl(this));
|
|
794
802
|
if (this.getAttribute(MediaStateReceiverAttributes.MEDIA_CONTROLLER)) {
|
|
795
803
|
(_b2 = (_a3 = __privateGet(this, _mediaController)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
796
804
|
}
|
|
797
|
-
(
|
|
798
|
-
|
|
805
|
+
if (!__privateGet(this, _mediaController))
|
|
806
|
+
return;
|
|
807
|
+
__privateGet(this, _mediaController).addEventListener("pointerdown", this);
|
|
808
|
+
__privateGet(this, _mediaController).addEventListener("click", this);
|
|
809
|
+
if (!__privateGet(this, _mediaController).hasAttribute("tabindex")) {
|
|
810
|
+
__privateGet(this, _mediaController).tabIndex = 0;
|
|
811
|
+
}
|
|
799
812
|
}
|
|
800
813
|
disconnectedCallback() {
|
|
801
814
|
var _a3, _b2, _c, _d;
|
|
@@ -904,13 +917,12 @@ var __privateMethod = (obj, member, method) => {
|
|
|
904
917
|
__accessCheck2(obj, member, "access private method");
|
|
905
918
|
return method;
|
|
906
919
|
};
|
|
920
|
+
var _mutationObserver;
|
|
907
921
|
var _pointerDownTimeStamp;
|
|
908
922
|
var _currentMedia;
|
|
909
923
|
var _inactiveTimeout;
|
|
910
924
|
var _autohide;
|
|
911
|
-
var _mutationObserver;
|
|
912
925
|
var _handleMutation;
|
|
913
|
-
var handleMutation_fn;
|
|
914
926
|
var _isResizePending;
|
|
915
927
|
var _handleResize;
|
|
916
928
|
var _handlePointerMove;
|
|
@@ -923,6 +935,8 @@ var _setActive;
|
|
|
923
935
|
var setActive_fn;
|
|
924
936
|
var _scheduleInactive;
|
|
925
937
|
var scheduleInactive_fn;
|
|
938
|
+
var _chainedSlot;
|
|
939
|
+
var _handleSlotChange;
|
|
926
940
|
var Attributes = {
|
|
927
941
|
AUDIO: "audio",
|
|
928
942
|
AUTOHIDE: "autohide",
|
|
@@ -1170,18 +1184,47 @@ function getBreakpoints(breakpoints, width) {
|
|
|
1170
1184
|
var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
1171
1185
|
constructor() {
|
|
1172
1186
|
super();
|
|
1173
|
-
__privateAdd2(this, _handleMutation);
|
|
1174
1187
|
__privateAdd2(this, _handlePointerMove);
|
|
1175
1188
|
__privateAdd2(this, _handlePointerUp);
|
|
1176
1189
|
__privateAdd2(this, _setInactive);
|
|
1177
1190
|
__privateAdd2(this, _setActive);
|
|
1178
1191
|
__privateAdd2(this, _scheduleInactive);
|
|
1192
|
+
__privateAdd2(this, _mutationObserver, void 0);
|
|
1179
1193
|
__privateAdd2(this, _pointerDownTimeStamp, 0);
|
|
1180
1194
|
__privateAdd2(this, _currentMedia, null);
|
|
1181
1195
|
__privateAdd2(this, _inactiveTimeout, null);
|
|
1182
1196
|
__privateAdd2(this, _autohide, void 0);
|
|
1183
1197
|
this.breakpointsComputed = false;
|
|
1184
|
-
__privateAdd2(this,
|
|
1198
|
+
__privateAdd2(this, _handleMutation, (mutationsList) => {
|
|
1199
|
+
const media = this.media;
|
|
1200
|
+
for (const mutation of mutationsList) {
|
|
1201
|
+
if (mutation.type !== "childList")
|
|
1202
|
+
continue;
|
|
1203
|
+
const removedNodes = mutation.removedNodes;
|
|
1204
|
+
for (const node of removedNodes) {
|
|
1205
|
+
if (node.slot != "media" || mutation.target != this)
|
|
1206
|
+
continue;
|
|
1207
|
+
let previousSibling = mutation.previousSibling && mutation.previousSibling.previousElementSibling;
|
|
1208
|
+
if (!previousSibling || !media) {
|
|
1209
|
+
this.mediaUnsetCallback(node);
|
|
1210
|
+
} else {
|
|
1211
|
+
let wasFirst = previousSibling.slot !== "media";
|
|
1212
|
+
while ((previousSibling = previousSibling.previousSibling) !== null) {
|
|
1213
|
+
if (previousSibling.slot == "media")
|
|
1214
|
+
wasFirst = false;
|
|
1215
|
+
}
|
|
1216
|
+
if (wasFirst)
|
|
1217
|
+
this.mediaUnsetCallback(node);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
if (media) {
|
|
1221
|
+
for (const node of mutation.addedNodes) {
|
|
1222
|
+
if (node === media)
|
|
1223
|
+
this.handleMediaUpdated(media);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1185
1228
|
__privateAdd2(this, _isResizePending, false);
|
|
1186
1229
|
__privateAdd2(this, _handleResize, (entry) => {
|
|
1187
1230
|
if (__privateGet2(this, _isResizePending))
|
|
@@ -1192,27 +1235,24 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1192
1235
|
}, 0);
|
|
1193
1236
|
__privateSet2(this, _isResizePending, true);
|
|
1194
1237
|
});
|
|
1238
|
+
__privateAdd2(this, _chainedSlot, void 0);
|
|
1239
|
+
__privateAdd2(this, _handleSlotChange, () => {
|
|
1240
|
+
const slotEls = __privateGet2(this, _chainedSlot).assignedElements({ flatten: true });
|
|
1241
|
+
if (!slotEls.length) {
|
|
1242
|
+
if (__privateGet2(this, _currentMedia)) {
|
|
1243
|
+
this.mediaUnsetCallback(__privateGet2(this, _currentMedia));
|
|
1244
|
+
}
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1247
|
+
this.handleMediaUpdated(this.media);
|
|
1248
|
+
});
|
|
1195
1249
|
if (!this.shadowRoot) {
|
|
1196
1250
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
1197
1251
|
const attrs = namedNodeMapToObject(this.attributes);
|
|
1198
1252
|
const html = this.constructor.getTemplateHTML(attrs);
|
|
1199
1253
|
this.shadowRoot.setHTMLUnsafe ? this.shadowRoot.setHTMLUnsafe(html) : this.shadowRoot.innerHTML = html;
|
|
1200
1254
|
}
|
|
1201
|
-
|
|
1202
|
-
":scope > slot[slot=media]"
|
|
1203
|
-
);
|
|
1204
|
-
if (chainedSlot) {
|
|
1205
|
-
chainedSlot.addEventListener("slotchange", () => {
|
|
1206
|
-
const slotEls = chainedSlot.assignedElements({ flatten: true });
|
|
1207
|
-
if (!slotEls.length) {
|
|
1208
|
-
if (__privateGet2(this, _currentMedia)) {
|
|
1209
|
-
this.mediaUnsetCallback(__privateGet2(this, _currentMedia));
|
|
1210
|
-
}
|
|
1211
|
-
return;
|
|
1212
|
-
}
|
|
1213
|
-
this.handleMediaUpdated(this.media);
|
|
1214
|
-
});
|
|
1215
|
-
}
|
|
1255
|
+
__privateSet2(this, _mutationObserver, new MutationObserver(__privateGet2(this, _handleMutation)));
|
|
1216
1256
|
}
|
|
1217
1257
|
static get observedAttributes() {
|
|
1218
1258
|
return [Attributes.AUTOHIDE, Attributes.GESTURES_DISABLED].concat(MEDIA_UI_ATTRIBUTE_NAMES).filter(
|
|
@@ -1260,6 +1300,13 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1260
1300
|
this.handleMediaUpdated(this.media);
|
|
1261
1301
|
this.setAttribute(Attributes.USER_INACTIVE, "");
|
|
1262
1302
|
setBreakpoints(this, this.getBoundingClientRect().width);
|
|
1303
|
+
const chainedSlot = this.querySelector(
|
|
1304
|
+
":scope > slot[slot=media]"
|
|
1305
|
+
);
|
|
1306
|
+
if (chainedSlot) {
|
|
1307
|
+
__privateSet2(this, _chainedSlot, chainedSlot);
|
|
1308
|
+
__privateGet2(this, _chainedSlot).addEventListener("slotchange", __privateGet2(this, _handleSlotChange));
|
|
1309
|
+
}
|
|
1263
1310
|
this.addEventListener("pointerdown", this);
|
|
1264
1311
|
this.addEventListener("pointermove", this);
|
|
1265
1312
|
this.addEventListener("pointerup", this);
|
|
@@ -1269,12 +1316,23 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1269
1316
|
}
|
|
1270
1317
|
disconnectedCallback() {
|
|
1271
1318
|
var _a3;
|
|
1272
|
-
__privateGet2(this, _mutationObserver).disconnect();
|
|
1273
1319
|
unobserveResize(this, __privateGet2(this, _handleResize));
|
|
1320
|
+
clearTimeout(__privateGet2(this, _inactiveTimeout));
|
|
1321
|
+
__privateGet2(this, _mutationObserver).disconnect();
|
|
1274
1322
|
if (this.media) {
|
|
1275
1323
|
this.mediaUnsetCallback(this.media);
|
|
1276
1324
|
}
|
|
1277
1325
|
(_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("mouseup", this);
|
|
1326
|
+
this.removeEventListener("pointerdown", this);
|
|
1327
|
+
this.removeEventListener("pointermove", this);
|
|
1328
|
+
this.removeEventListener("pointerup", this);
|
|
1329
|
+
this.removeEventListener("mouseleave", this);
|
|
1330
|
+
this.removeEventListener("keyup", this);
|
|
1331
|
+
if (__privateGet2(this, _chainedSlot)) {
|
|
1332
|
+
__privateGet2(this, _chainedSlot).removeEventListener("slotchange", __privateGet2(this, _handleSlotChange));
|
|
1333
|
+
__privateSet2(this, _chainedSlot, null);
|
|
1334
|
+
}
|
|
1335
|
+
__privateSet2(this, _isResizePending, false);
|
|
1278
1336
|
}
|
|
1279
1337
|
/**
|
|
1280
1338
|
* @abstract
|
|
@@ -1357,42 +1415,12 @@ var MediaContainer = class extends GlobalThis.HTMLElement {
|
|
|
1357
1415
|
setBooleanAttr(this, Attributes.USER_INACTIVE, value);
|
|
1358
1416
|
}
|
|
1359
1417
|
};
|
|
1418
|
+
_mutationObserver = /* @__PURE__ */ new WeakMap();
|
|
1360
1419
|
_pointerDownTimeStamp = /* @__PURE__ */ new WeakMap();
|
|
1361
1420
|
_currentMedia = /* @__PURE__ */ new WeakMap();
|
|
1362
1421
|
_inactiveTimeout = /* @__PURE__ */ new WeakMap();
|
|
1363
1422
|
_autohide = /* @__PURE__ */ new WeakMap();
|
|
1364
|
-
|
|
1365
|
-
_handleMutation = /* @__PURE__ */ new WeakSet();
|
|
1366
|
-
handleMutation_fn = function(mutationsList) {
|
|
1367
|
-
const media = this.media;
|
|
1368
|
-
for (const mutation of mutationsList) {
|
|
1369
|
-
if (mutation.type !== "childList")
|
|
1370
|
-
continue;
|
|
1371
|
-
const removedNodes = mutation.removedNodes;
|
|
1372
|
-
for (const node of removedNodes) {
|
|
1373
|
-
if (node.slot != "media" || mutation.target != this)
|
|
1374
|
-
continue;
|
|
1375
|
-
let previousSibling = mutation.previousSibling && mutation.previousSibling.previousElementSibling;
|
|
1376
|
-
if (!previousSibling || !media) {
|
|
1377
|
-
this.mediaUnsetCallback(node);
|
|
1378
|
-
} else {
|
|
1379
|
-
let wasFirst = previousSibling.slot !== "media";
|
|
1380
|
-
while ((previousSibling = previousSibling.previousSibling) !== null) {
|
|
1381
|
-
if (previousSibling.slot == "media")
|
|
1382
|
-
wasFirst = false;
|
|
1383
|
-
}
|
|
1384
|
-
if (wasFirst)
|
|
1385
|
-
this.mediaUnsetCallback(node);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
if (media) {
|
|
1389
|
-
for (const node of mutation.addedNodes) {
|
|
1390
|
-
if (node === media)
|
|
1391
|
-
this.handleMediaUpdated(media);
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
};
|
|
1423
|
+
_handleMutation = /* @__PURE__ */ new WeakMap();
|
|
1396
1424
|
_isResizePending = /* @__PURE__ */ new WeakMap();
|
|
1397
1425
|
_handleResize = /* @__PURE__ */ new WeakMap();
|
|
1398
1426
|
_handlePointerMove = /* @__PURE__ */ new WeakSet();
|
|
@@ -1463,6 +1491,8 @@ scheduleInactive_fn = function() {
|
|
|
1463
1491
|
__privateMethod(this, _setInactive, setInactive_fn).call(this);
|
|
1464
1492
|
}, autohide * 1e3));
|
|
1465
1493
|
};
|
|
1494
|
+
_chainedSlot = /* @__PURE__ */ new WeakMap();
|
|
1495
|
+
_handleSlotChange = /* @__PURE__ */ new WeakMap();
|
|
1466
1496
|
MediaContainer.shadowRootOptions = { mode: "open" };
|
|
1467
1497
|
MediaContainer.getTemplateHTML = getTemplateHTML2;
|
|
1468
1498
|
if (!GlobalThis.customElements.get("media-container")) {
|
|
@@ -1811,10 +1841,10 @@ var toggleSubtitleTracks = (stateOwners, force) => {
|
|
|
1811
1841
|
let subTrack = tracks[0];
|
|
1812
1842
|
const { options } = stateOwners;
|
|
1813
1843
|
if (!(options == null ? void 0 : options.noSubtitlesLangPref)) {
|
|
1814
|
-
const subtitlesPref =
|
|
1844
|
+
const subtitlesPref = GlobalThis.localStorage.getItem(
|
|
1815
1845
|
"media-chrome-pref-subtitles-lang"
|
|
1816
1846
|
);
|
|
1817
|
-
const userLangPrefs = subtitlesPref ? [subtitlesPref, ...
|
|
1847
|
+
const userLangPrefs = subtitlesPref ? [subtitlesPref, ...GlobalThis.navigator.languages] : GlobalThis.navigator.languages;
|
|
1818
1848
|
const preferredAvailableSubs = tracks.filter((textTrack) => {
|
|
1819
1849
|
return userLangPrefs.some(
|
|
1820
1850
|
(lang) => textTrack.language.toLowerCase().startsWith(lang.split("-")[0])
|
|
@@ -2533,14 +2563,14 @@ var stateMediator = {
|
|
|
2533
2563
|
return isFullscreen(stateOwners);
|
|
2534
2564
|
},
|
|
2535
2565
|
set(value, stateOwners, event) {
|
|
2536
|
-
var _a3;
|
|
2566
|
+
var _a3, _b2;
|
|
2537
2567
|
if (!value) {
|
|
2538
2568
|
exitFullscreen(stateOwners);
|
|
2539
2569
|
} else {
|
|
2540
2570
|
enterFullscreen(stateOwners);
|
|
2541
2571
|
const isPointer = event.detail;
|
|
2542
|
-
if (isPointer)
|
|
2543
|
-
(
|
|
2572
|
+
if (isPointer && !((_a3 = stateOwners.media) == null ? void 0 : _a3.inert))
|
|
2573
|
+
(_b2 = stateOwners.media) == null ? void 0 : _b2.focus();
|
|
2544
2574
|
}
|
|
2545
2575
|
},
|
|
2546
2576
|
// older Safari version may require webkit-specific events
|
|
@@ -3264,10 +3294,10 @@ var _keyboardShortcutsDialog;
|
|
|
3264
3294
|
var _mediaStateCallback;
|
|
3265
3295
|
var _mediaStoreUnsubscribe;
|
|
3266
3296
|
var _mediaStateEventHandler;
|
|
3297
|
+
var _subtitlesState;
|
|
3267
3298
|
var _setupDefaultStore;
|
|
3268
3299
|
var setupDefaultStore_fn;
|
|
3269
3300
|
var _keyUpHandler;
|
|
3270
|
-
var keyUpHandler_fn;
|
|
3271
3301
|
var _keyDownHandler;
|
|
3272
3302
|
var keyDownHandler_fn;
|
|
3273
3303
|
var _showKeyboardShortcutsDialog;
|
|
@@ -3320,7 +3350,6 @@ var MediaController = class extends MediaContainer {
|
|
|
3320
3350
|
constructor() {
|
|
3321
3351
|
super();
|
|
3322
3352
|
__privateAdd4(this, _setupDefaultStore);
|
|
3323
|
-
__privateAdd4(this, _keyUpHandler);
|
|
3324
3353
|
__privateAdd4(this, _keyDownHandler);
|
|
3325
3354
|
__privateAdd4(this, _showKeyboardShortcutsDialog);
|
|
3326
3355
|
this.mediaStateReceivers = [];
|
|
@@ -3335,6 +3364,17 @@ var MediaController = class extends MediaContainer {
|
|
|
3335
3364
|
var _a3;
|
|
3336
3365
|
(_a3 = __privateGet4(this, _mediaStore)) == null ? void 0 : _a3.dispatch(event);
|
|
3337
3366
|
});
|
|
3367
|
+
__privateAdd4(this, _subtitlesState, void 0);
|
|
3368
|
+
__privateAdd4(this, _keyUpHandler, (e) => {
|
|
3369
|
+
const { key, shiftKey } = e;
|
|
3370
|
+
const isShiftSlash = shiftKey && (key === "/" || key === "?");
|
|
3371
|
+
const shouldHandle = isShiftSlash || ButtonPressedKeys.includes(key);
|
|
3372
|
+
if (!shouldHandle) {
|
|
3373
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3374
|
+
return;
|
|
3375
|
+
}
|
|
3376
|
+
this.keyboardShortcutHandler(e);
|
|
3377
|
+
});
|
|
3338
3378
|
this.associateElement(this);
|
|
3339
3379
|
let prevState = {};
|
|
3340
3380
|
__privateSet4(this, _mediaStateCallback, (nextState) => {
|
|
@@ -3351,7 +3391,6 @@ var MediaController = class extends MediaContainer {
|
|
|
3351
3391
|
});
|
|
3352
3392
|
prevState = nextState;
|
|
3353
3393
|
});
|
|
3354
|
-
this.hasAttribute(Attributes2.NO_HOTKEYS) ? this.disableHotkeys() : this.enableHotkeys();
|
|
3355
3394
|
}
|
|
3356
3395
|
static get observedAttributes() {
|
|
3357
3396
|
return super.observedAttributes.concat(
|
|
@@ -3363,7 +3402,10 @@ var MediaController = class extends MediaContainer {
|
|
|
3363
3402
|
Attributes2.NO_MUTED_PREF,
|
|
3364
3403
|
Attributes2.NO_VOLUME_PREF,
|
|
3365
3404
|
Attributes2.LANG,
|
|
3366
|
-
Attributes2.LOOP
|
|
3405
|
+
Attributes2.LOOP,
|
|
3406
|
+
Attributes2.LIVE_EDGE_OFFSET,
|
|
3407
|
+
Attributes2.SEEK_TO_LIVE_OFFSET,
|
|
3408
|
+
Attributes2.NO_AUTO_SEEK_TO_LIVE
|
|
3367
3409
|
);
|
|
3368
3410
|
}
|
|
3369
3411
|
get mediaStore() {
|
|
@@ -3495,19 +3537,21 @@ var MediaController = class extends MediaContainer {
|
|
|
3495
3537
|
defaultStreamType: (_b2 = this.getAttribute(Attributes2.DEFAULT_STREAM_TYPE)) != null ? _b2 : void 0
|
|
3496
3538
|
}
|
|
3497
3539
|
});
|
|
3498
|
-
} else if (attrName === Attributes2.LIVE_EDGE_OFFSET) {
|
|
3540
|
+
} else if (attrName === Attributes2.LIVE_EDGE_OFFSET && newValue !== oldValue) {
|
|
3499
3541
|
(_d = __privateGet4(this, _mediaStore)) == null ? void 0 : _d.dispatch({
|
|
3500
3542
|
type: "optionschangerequest",
|
|
3501
3543
|
detail: {
|
|
3502
3544
|
liveEdgeOffset: this.hasAttribute(Attributes2.LIVE_EDGE_OFFSET) ? +this.getAttribute(Attributes2.LIVE_EDGE_OFFSET) : void 0,
|
|
3503
|
-
seekToLiveOffset:
|
|
3545
|
+
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
|
|
3504
3546
|
}
|
|
3505
3547
|
});
|
|
3506
|
-
} else if (attrName === Attributes2.SEEK_TO_LIVE_OFFSET) {
|
|
3548
|
+
} else if (attrName === Attributes2.SEEK_TO_LIVE_OFFSET && newValue !== oldValue) {
|
|
3507
3549
|
(_e = __privateGet4(this, _mediaStore)) == null ? void 0 : _e.dispatch({
|
|
3508
3550
|
type: "optionschangerequest",
|
|
3509
3551
|
detail: {
|
|
3510
|
-
|
|
3552
|
+
// Mirror #setupDefaultStore: prefer seektoliveoffset, fall back to
|
|
3553
|
+
// liveedgeoffset, otherwise undefined.
|
|
3554
|
+
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
|
|
3511
3555
|
}
|
|
3512
3556
|
});
|
|
3513
3557
|
} else if (attrName === Attributes2.NO_AUTO_SEEK_TO_LIVE) {
|
|
@@ -3554,7 +3598,8 @@ var MediaController = class extends MediaContainer {
|
|
|
3554
3598
|
}
|
|
3555
3599
|
}
|
|
3556
3600
|
connectedCallback() {
|
|
3557
|
-
var _a3, _b2;
|
|
3601
|
+
var _a3, _b2, _c;
|
|
3602
|
+
this.associateElement(this);
|
|
3558
3603
|
if (!__privateGet4(this, _mediaStore) && !this.hasAttribute(Attributes2.NO_DEFAULT_STORE)) {
|
|
3559
3604
|
__privateMethod2(this, _setupDefaultStore, setupDefaultStore_fn).call(this);
|
|
3560
3605
|
}
|
|
@@ -3562,31 +3607,58 @@ var MediaController = class extends MediaContainer {
|
|
|
3562
3607
|
type: "documentelementchangerequest",
|
|
3563
3608
|
detail: Document2
|
|
3564
3609
|
});
|
|
3610
|
+
(_b2 = __privateGet4(this, _mediaStore)) == null ? void 0 : _b2.dispatch({
|
|
3611
|
+
type: "fullscreenelementchangerequest",
|
|
3612
|
+
detail: this.fullscreenElement
|
|
3613
|
+
});
|
|
3565
3614
|
super.connectedCallback();
|
|
3566
3615
|
if (__privateGet4(this, _mediaStore) && !__privateGet4(this, _mediaStoreUnsubscribe)) {
|
|
3567
|
-
__privateSet4(this, _mediaStoreUnsubscribe, (
|
|
3616
|
+
__privateSet4(this, _mediaStoreUnsubscribe, (_c = __privateGet4(this, _mediaStore)) == null ? void 0 : _c.subscribe(
|
|
3568
3617
|
__privateGet4(this, _mediaStateCallback)
|
|
3569
3618
|
));
|
|
3570
3619
|
}
|
|
3620
|
+
if (__privateGet4(this, _subtitlesState) !== void 0 && __privateGet4(this, _mediaStore) && this.media) {
|
|
3621
|
+
setTimeout(() => {
|
|
3622
|
+
var _a22, _b22, _c2;
|
|
3623
|
+
if ((_b22 = (_a22 = this.media) == null ? void 0 : _a22.textTracks) == null ? void 0 : _b22.length) {
|
|
3624
|
+
(_c2 = __privateGet4(this, _mediaStore)) == null ? void 0 : _c2.dispatch({
|
|
3625
|
+
type: MediaUIEvents.MEDIA_TOGGLE_SUBTITLES_REQUEST,
|
|
3626
|
+
detail: __privateGet4(this, _subtitlesState)
|
|
3627
|
+
});
|
|
3628
|
+
}
|
|
3629
|
+
}, 0);
|
|
3630
|
+
}
|
|
3571
3631
|
this.hasAttribute(Attributes2.NO_HOTKEYS) ? this.disableHotkeys() : this.enableHotkeys();
|
|
3572
3632
|
}
|
|
3573
3633
|
disconnectedCallback() {
|
|
3574
|
-
var _a3, _b2, _c, _d;
|
|
3634
|
+
var _a3, _b2, _c, _d, _e, _f;
|
|
3575
3635
|
(_a3 = super.disconnectedCallback) == null ? void 0 : _a3.call(this);
|
|
3636
|
+
this.disableHotkeys();
|
|
3576
3637
|
if (__privateGet4(this, _mediaStore)) {
|
|
3577
|
-
|
|
3638
|
+
const currentState = __privateGet4(this, _mediaStore).getState();
|
|
3639
|
+
__privateSet4(this, _subtitlesState, !!((_b2 = currentState.mediaSubtitlesShowing) == null ? void 0 : _b2.length));
|
|
3640
|
+
(_c = __privateGet4(this, _mediaStore)) == null ? void 0 : _c.dispatch({
|
|
3641
|
+
type: "fullscreenelementchangerequest",
|
|
3642
|
+
detail: void 0
|
|
3643
|
+
});
|
|
3644
|
+
(_d = __privateGet4(this, _mediaStore)) == null ? void 0 : _d.dispatch({
|
|
3578
3645
|
type: "documentelementchangerequest",
|
|
3579
3646
|
detail: void 0
|
|
3580
3647
|
});
|
|
3581
|
-
(
|
|
3648
|
+
(_e = __privateGet4(this, _mediaStore)) == null ? void 0 : _e.dispatch({
|
|
3582
3649
|
type: MediaUIEvents.MEDIA_TOGGLE_SUBTITLES_REQUEST,
|
|
3583
3650
|
detail: false
|
|
3584
3651
|
});
|
|
3585
3652
|
}
|
|
3586
3653
|
if (__privateGet4(this, _mediaStoreUnsubscribe)) {
|
|
3587
|
-
(
|
|
3654
|
+
(_f = __privateGet4(this, _mediaStoreUnsubscribe)) == null ? void 0 : _f.call(this);
|
|
3588
3655
|
__privateSet4(this, _mediaStoreUnsubscribe, void 0);
|
|
3589
3656
|
}
|
|
3657
|
+
this.unassociateElement(this);
|
|
3658
|
+
if (__privateGet4(this, _keyboardShortcutsDialog)) {
|
|
3659
|
+
__privateGet4(this, _keyboardShortcutsDialog).remove();
|
|
3660
|
+
__privateSet4(this, _keyboardShortcutsDialog, null);
|
|
3661
|
+
}
|
|
3590
3662
|
}
|
|
3591
3663
|
/**
|
|
3592
3664
|
* @override
|
|
@@ -3677,10 +3749,11 @@ var MediaController = class extends MediaContainer {
|
|
|
3677
3749
|
}
|
|
3678
3750
|
disableHotkeys() {
|
|
3679
3751
|
this.removeEventListener("keydown", __privateMethod2(this, _keyDownHandler, keyDownHandler_fn));
|
|
3680
|
-
this.removeEventListener("keyup",
|
|
3752
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3681
3753
|
}
|
|
3754
|
+
// Added string to support JSX compatibility
|
|
3682
3755
|
get hotkeys() {
|
|
3683
|
-
return
|
|
3756
|
+
return __privateGet4(this, _hotKeys);
|
|
3684
3757
|
}
|
|
3685
3758
|
set hotkeys(value) {
|
|
3686
3759
|
setStringAttr(this, Attributes2.HOTKEYS, value);
|
|
@@ -3855,6 +3928,7 @@ _keyboardShortcutsDialog = /* @__PURE__ */ new WeakMap();
|
|
|
3855
3928
|
_mediaStateCallback = /* @__PURE__ */ new WeakMap();
|
|
3856
3929
|
_mediaStoreUnsubscribe = /* @__PURE__ */ new WeakMap();
|
|
3857
3930
|
_mediaStateEventHandler = /* @__PURE__ */ new WeakMap();
|
|
3931
|
+
_subtitlesState = /* @__PURE__ */ new WeakMap();
|
|
3858
3932
|
_setupDefaultStore = /* @__PURE__ */ new WeakSet();
|
|
3859
3933
|
setupDefaultStore_fn = function() {
|
|
3860
3934
|
var _a3;
|
|
@@ -3882,28 +3956,18 @@ setupDefaultStore_fn = function() {
|
|
|
3882
3956
|
}
|
|
3883
3957
|
});
|
|
3884
3958
|
};
|
|
3885
|
-
_keyUpHandler = /* @__PURE__ */ new
|
|
3886
|
-
keyUpHandler_fn = function(e) {
|
|
3887
|
-
const { key, shiftKey } = e;
|
|
3888
|
-
const isShiftSlash = shiftKey && (key === "/" || key === "?");
|
|
3889
|
-
const shouldHandle = isShiftSlash || ButtonPressedKeys.includes(key);
|
|
3890
|
-
if (!shouldHandle) {
|
|
3891
|
-
this.removeEventListener("keyup", __privateMethod2(this, _keyUpHandler, keyUpHandler_fn));
|
|
3892
|
-
return;
|
|
3893
|
-
}
|
|
3894
|
-
this.keyboardShortcutHandler(e);
|
|
3895
|
-
};
|
|
3959
|
+
_keyUpHandler = /* @__PURE__ */ new WeakMap();
|
|
3896
3960
|
_keyDownHandler = /* @__PURE__ */ new WeakSet();
|
|
3897
3961
|
keyDownHandler_fn = function(e) {
|
|
3898
3962
|
var _a3;
|
|
3899
3963
|
const { metaKey, altKey, key, shiftKey } = e;
|
|
3900
3964
|
const isShiftSlash = shiftKey && (key === "/" || key === "?");
|
|
3901
3965
|
if (isShiftSlash && ((_a3 = __privateGet4(this, _keyboardShortcutsDialog)) == null ? void 0 : _a3.open)) {
|
|
3902
|
-
this.removeEventListener("keyup",
|
|
3966
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3903
3967
|
return;
|
|
3904
3968
|
}
|
|
3905
3969
|
if (metaKey || altKey || !isShiftSlash && !ButtonPressedKeys.includes(key)) {
|
|
3906
|
-
this.removeEventListener("keyup",
|
|
3970
|
+
this.removeEventListener("keyup", __privateGet4(this, _keyUpHandler));
|
|
3907
3971
|
return;
|
|
3908
3972
|
}
|
|
3909
3973
|
const target = e.target;
|
|
@@ -3911,7 +3975,7 @@ keyDownHandler_fn = function(e) {
|
|
|
3911
3975
|
if ([" ", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(key) && !(__privateGet4(this, _hotKeys).contains(`no${key.toLowerCase()}`) || key === " " && __privateGet4(this, _hotKeys).contains("nospace")) && !isRangeInput) {
|
|
3912
3976
|
e.preventDefault();
|
|
3913
3977
|
}
|
|
3914
|
-
this.addEventListener("keyup",
|
|
3978
|
+
this.addEventListener("keyup", __privateGet4(this, _keyUpHandler), { once: true });
|
|
3915
3979
|
};
|
|
3916
3980
|
_showKeyboardShortcutsDialog = /* @__PURE__ */ new WeakSet();
|
|
3917
3981
|
showKeyboardShortcutsDialog_fn = function() {
|
|
@@ -4625,11 +4689,9 @@ var MediaChromeButton = class extends GlobalThis.HTMLElement {
|
|
|
4625
4689
|
}
|
|
4626
4690
|
/**
|
|
4627
4691
|
* @abstract
|
|
4628
|
-
* @argument {Event} e
|
|
4629
4692
|
*/
|
|
4630
|
-
handleClick(
|
|
4693
|
+
handleClick(_e) {
|
|
4631
4694
|
}
|
|
4632
|
-
// eslint-disable-line
|
|
4633
4695
|
};
|
|
4634
4696
|
_mediaController2 = /* @__PURE__ */ new WeakMap();
|
|
4635
4697
|
_clickListener = /* @__PURE__ */ new WeakMap();
|
|
@@ -4810,7 +4872,7 @@ var MediaCaptionsButton = class extends MediaChromeButton {
|
|
|
4810
4872
|
}
|
|
4811
4873
|
connectedCallback() {
|
|
4812
4874
|
super.connectedCallback();
|
|
4813
|
-
this.setAttribute("role", "
|
|
4875
|
+
this.setAttribute("role", "button");
|
|
4814
4876
|
this.setAttribute("aria-label", t("closed captions"));
|
|
4815
4877
|
updateAriaChecked(this);
|
|
4816
4878
|
}
|
|
@@ -5079,9 +5141,6 @@ var MediaChromeDialog = class extends GlobalThis.HTMLElement {
|
|
|
5079
5141
|
__privateAdd6(this, _isInit, false);
|
|
5080
5142
|
__privateAdd6(this, _previouslyFocused, null);
|
|
5081
5143
|
__privateAdd6(this, _invokerElement, null);
|
|
5082
|
-
this.addEventListener("invoke", this);
|
|
5083
|
-
this.addEventListener("focusout", this);
|
|
5084
|
-
this.addEventListener("keydown", this);
|
|
5085
5144
|
}
|
|
5086
5145
|
static get observedAttributes() {
|
|
5087
5146
|
return [Attributes5.OPEN, Attributes5.ANCHOR];
|
|
@@ -5110,6 +5169,14 @@ var MediaChromeDialog = class extends GlobalThis.HTMLElement {
|
|
|
5110
5169
|
if (!this.role) {
|
|
5111
5170
|
this.role = "dialog";
|
|
5112
5171
|
}
|
|
5172
|
+
this.addEventListener("invoke", this);
|
|
5173
|
+
this.addEventListener("focusout", this);
|
|
5174
|
+
this.addEventListener("keydown", this);
|
|
5175
|
+
}
|
|
5176
|
+
disconnectedCallback() {
|
|
5177
|
+
this.removeEventListener("invoke", this);
|
|
5178
|
+
this.removeEventListener("focusout", this);
|
|
5179
|
+
this.removeEventListener("keydown", this);
|
|
5113
5180
|
}
|
|
5114
5181
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
5115
5182
|
__privateMethod4(this, _init, init_fn).call(this);
|
|
@@ -5490,6 +5557,14 @@ function getTemplateHTML6(_attrs) {
|
|
|
5490
5557
|
transform: var(--media-range-segment-transform, scaleY(1));
|
|
5491
5558
|
transform-origin: center;
|
|
5492
5559
|
}
|
|
5560
|
+
|
|
5561
|
+
/* Visible label for accessibility - positioned off-screen but technically visible (Firefox requires visible labels) */
|
|
5562
|
+
#range-label {
|
|
5563
|
+
position: absolute;
|
|
5564
|
+
left: -10000px;
|
|
5565
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
5566
|
+
pointer-events: none;
|
|
5567
|
+
}
|
|
5493
5568
|
</style>
|
|
5494
5569
|
<div id="leftgap"></div>
|
|
5495
5570
|
<div id="container">
|
|
@@ -5503,14 +5578,20 @@ function getTemplateHTML6(_attrs) {
|
|
|
5503
5578
|
<slot name="thumb">
|
|
5504
5579
|
<div id="thumb" part="thumb"></div>
|
|
5505
5580
|
</slot>
|
|
5506
|
-
<svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>
|
|
5581
|
+
<svg id="segments" aria-hidden="true"><clipPath id="segments-clipping"></clipPath></svg>
|
|
5507
5582
|
</div>
|
|
5508
|
-
|
|
5583
|
+
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
5584
|
+
<label for="range" id="range-label"></label>
|
|
5585
|
+
|
|
5586
|
+
${this.getContainerTemplateHTML(_attrs)}
|
|
5509
5587
|
</div>
|
|
5510
5588
|
<div id="rightgap"></div>
|
|
5511
5589
|
`
|
|
5512
5590
|
);
|
|
5513
5591
|
}
|
|
5592
|
+
function getContainerTemplateHTML(_attrs) {
|
|
5593
|
+
return "";
|
|
5594
|
+
}
|
|
5514
5595
|
var MediaChromeRange = class extends GlobalThis.HTMLElement {
|
|
5515
5596
|
constructor() {
|
|
5516
5597
|
super();
|
|
@@ -5740,7 +5821,7 @@ updateActiveSegment_fn = function(evt) {
|
|
|
5740
5821
|
};
|
|
5741
5822
|
_enableUserEvents = /* @__PURE__ */ new WeakSet();
|
|
5742
5823
|
enableUserEvents_fn = function() {
|
|
5743
|
-
if (this.hasAttribute("disabled"))
|
|
5824
|
+
if (this.hasAttribute("disabled") || !this.isConnected)
|
|
5744
5825
|
return;
|
|
5745
5826
|
this.addEventListener("input", this);
|
|
5746
5827
|
this.addEventListener("pointerdown", this);
|
|
@@ -5752,6 +5833,7 @@ disableUserEvents_fn = function() {
|
|
|
5752
5833
|
this.removeEventListener("input", this);
|
|
5753
5834
|
this.removeEventListener("pointerdown", this);
|
|
5754
5835
|
this.removeEventListener("pointerenter", this);
|
|
5836
|
+
this.removeEventListener("pointerleave", this);
|
|
5755
5837
|
(_a3 = GlobalThis.window) == null ? void 0 : _a3.removeEventListener("pointerup", this);
|
|
5756
5838
|
(_b2 = GlobalThis.window) == null ? void 0 : _b2.removeEventListener("pointermove", this);
|
|
5757
5839
|
};
|
|
@@ -5759,14 +5841,14 @@ _handlePointerDown = /* @__PURE__ */ new WeakSet();
|
|
|
5759
5841
|
handlePointerDown_fn = function(evt) {
|
|
5760
5842
|
var _a3;
|
|
5761
5843
|
__privateSet7(this, _isInputTarget, evt.composedPath().includes(this.range));
|
|
5762
|
-
(_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointerup", this);
|
|
5844
|
+
(_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointerup", this, { once: true });
|
|
5763
5845
|
};
|
|
5764
5846
|
_handlePointerEnter = /* @__PURE__ */ new WeakSet();
|
|
5765
5847
|
handlePointerEnter_fn = function(evt) {
|
|
5766
5848
|
var _a3;
|
|
5767
5849
|
if (evt.pointerType !== "mouse")
|
|
5768
5850
|
__privateMethod5(this, _handlePointerDown, handlePointerDown_fn).call(this, evt);
|
|
5769
|
-
this.addEventListener("pointerleave", this);
|
|
5851
|
+
this.addEventListener("pointerleave", this, { once: true });
|
|
5770
5852
|
(_a3 = GlobalThis.window) == null ? void 0 : _a3.addEventListener("pointermove", this);
|
|
5771
5853
|
};
|
|
5772
5854
|
_handlePointerUp2 = /* @__PURE__ */ new WeakSet();
|
|
@@ -5806,6 +5888,7 @@ handlePointerMove_fn2 = function(evt) {
|
|
|
5806
5888
|
};
|
|
5807
5889
|
MediaChromeRange.shadowRootOptions = { mode: "open" };
|
|
5808
5890
|
MediaChromeRange.getTemplateHTML = getTemplateHTML6;
|
|
5891
|
+
MediaChromeRange.getContainerTemplateHTML = getContainerTemplateHTML;
|
|
5809
5892
|
if (!GlobalThis.customElements.get("media-chrome-range")) {
|
|
5810
5893
|
GlobalThis.customElements.define("media-chrome-range", MediaChromeRange);
|
|
5811
5894
|
}
|
|
@@ -5963,7 +6046,7 @@ function getTemplateHTML8(_attrs, _props = {}) {
|
|
|
5963
6046
|
*/
|
|
5964
6047
|
""}
|
|
5965
6048
|
:host(:focus-visible) {
|
|
5966
|
-
box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
|
|
6049
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
5967
6050
|
outline: 0;
|
|
5968
6051
|
}
|
|
5969
6052
|
|
|
@@ -6223,6 +6306,11 @@ var MediaErrorDialog = class extends MediaChromeDialog {
|
|
|
6223
6306
|
if (this.open) {
|
|
6224
6307
|
this.shadowRoot.querySelector("slot").name = `error-${this.mediaErrorCode}`;
|
|
6225
6308
|
this.shadowRoot.querySelector("#content").innerHTML = this.formatErrorMessage(mediaError);
|
|
6309
|
+
if (!this.hasAttribute("aria-label")) {
|
|
6310
|
+
const { title } = formatError(mediaError);
|
|
6311
|
+
if (title)
|
|
6312
|
+
this.setAttribute("aria-label", title);
|
|
6313
|
+
}
|
|
6226
6314
|
}
|
|
6227
6315
|
}
|
|
6228
6316
|
get mediaError() {
|
|
@@ -6584,7 +6672,7 @@ if (!GlobalThis.customElements.get("media-fullscreen-button")) {
|
|
|
6584
6672
|
// ../../node_modules/media-chrome/dist/media-live-button.js
|
|
6585
6673
|
var { MEDIA_TIME_IS_LIVE, MEDIA_PAUSED } = MediaUIAttributes;
|
|
6586
6674
|
var { MEDIA_SEEK_TO_LIVE_REQUEST, MEDIA_PLAY_REQUEST } = MediaUIEvents;
|
|
6587
|
-
var indicatorSVG = '<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';
|
|
6675
|
+
var indicatorSVG = '<svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg>';
|
|
6588
6676
|
function getSlotTemplateHTML11(_attrs) {
|
|
6589
6677
|
return (
|
|
6590
6678
|
/*html*/
|
|
@@ -7581,21 +7669,36 @@ var MediaPreviewThumbnail = class extends GlobalThis.HTMLElement {
|
|
|
7581
7669
|
const src = previewImage.split("#")[0];
|
|
7582
7670
|
const computedStyle = getComputedStyle(this);
|
|
7583
7671
|
const { maxWidth, maxHeight, minWidth, minHeight } = computedStyle;
|
|
7584
|
-
const
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7672
|
+
const objectFit = computedStyle.getPropertyValue("--media-preview-thumbnail-object-fit").trim() || "contain";
|
|
7673
|
+
let scaleX;
|
|
7674
|
+
let scaleY;
|
|
7675
|
+
if (objectFit === "fill") {
|
|
7676
|
+
const maxRatioX = parseInt(maxWidth) / w;
|
|
7677
|
+
const maxRatioY = parseInt(maxHeight) / h;
|
|
7678
|
+
const minRatioX = parseInt(minWidth) / w;
|
|
7679
|
+
const minRatioY = parseInt(minHeight) / h;
|
|
7680
|
+
scaleX = maxRatioX < 1 ? maxRatioX : Math.max(maxRatioX, minRatioX);
|
|
7681
|
+
scaleY = maxRatioY < 1 ? maxRatioY : Math.max(maxRatioY, minRatioY);
|
|
7682
|
+
} else {
|
|
7683
|
+
const maxRatio = Math.min(parseInt(maxWidth) / w, parseInt(maxHeight) / h);
|
|
7684
|
+
const minRatio = Math.max(parseInt(minWidth) / w, parseInt(minHeight) / h);
|
|
7685
|
+
const isScalingDown2 = maxRatio < 1;
|
|
7686
|
+
const scale = isScalingDown2 ? maxRatio : minRatio > 1 ? minRatio : 1;
|
|
7687
|
+
scaleX = scale;
|
|
7688
|
+
scaleY = scale;
|
|
7689
|
+
}
|
|
7588
7690
|
const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
|
|
7589
7691
|
const imgStyle = getOrInsertCSSRule(this.shadowRoot, "img").style;
|
|
7590
7692
|
const img = this.shadowRoot.querySelector("img");
|
|
7693
|
+
const isScalingDown = Math.min(scaleX, scaleY) < 1;
|
|
7591
7694
|
const extremum = isScalingDown ? "min" : "max";
|
|
7592
7695
|
style.setProperty(`${extremum}-width`, "initial", "important");
|
|
7593
7696
|
style.setProperty(`${extremum}-height`, "initial", "important");
|
|
7594
|
-
style.width = `${w *
|
|
7595
|
-
style.height = `${h *
|
|
7697
|
+
style.width = `${w * scaleX}px`;
|
|
7698
|
+
style.height = `${h * scaleY}px`;
|
|
7596
7699
|
const resize = () => {
|
|
7597
|
-
imgStyle.width = `${this.imgWidth *
|
|
7598
|
-
imgStyle.height = `${this.imgHeight *
|
|
7700
|
+
imgStyle.width = `${this.imgWidth * scaleX}px`;
|
|
7701
|
+
imgStyle.height = `${this.imgHeight * scaleY}px`;
|
|
7599
7702
|
imgStyle.display = "block";
|
|
7600
7703
|
};
|
|
7601
7704
|
if (img.src !== src) {
|
|
@@ -7603,12 +7706,13 @@ var MediaPreviewThumbnail = class extends GlobalThis.HTMLElement {
|
|
|
7603
7706
|
this.imgWidth = img.naturalWidth;
|
|
7604
7707
|
this.imgHeight = img.naturalHeight;
|
|
7605
7708
|
resize();
|
|
7709
|
+
img.onload = null;
|
|
7606
7710
|
};
|
|
7607
7711
|
img.src = src;
|
|
7608
7712
|
resize();
|
|
7609
7713
|
}
|
|
7610
7714
|
resize();
|
|
7611
|
-
imgStyle.transform = `translate(-${x *
|
|
7715
|
+
imgStyle.transform = `translate(-${x * scaleX}px, -${y * scaleY}px)`;
|
|
7612
7716
|
}
|
|
7613
7717
|
};
|
|
7614
7718
|
_mediaController7 = /* @__PURE__ */ new WeakMap();
|
|
@@ -7697,6 +7801,9 @@ function getSlotTemplateHTML16(_attrs, props) {
|
|
|
7697
7801
|
`
|
|
7698
7802
|
);
|
|
7699
7803
|
}
|
|
7804
|
+
var updateAriaLabel7 = (el, seekOffset) => {
|
|
7805
|
+
el.setAttribute("aria-label", t("seek back {seekOffset} seconds", { seekOffset }));
|
|
7806
|
+
};
|
|
7700
7807
|
function getTooltipContentHTML10() {
|
|
7701
7808
|
return t("Seek backward");
|
|
7702
7809
|
}
|
|
@@ -7719,6 +7826,7 @@ var MediaSeekBackwardButton = class extends MediaChromeButton {
|
|
|
7719
7826
|
}
|
|
7720
7827
|
attributeChangedCallback(attrName, _oldValue, newValue) {
|
|
7721
7828
|
super.attributeChangedCallback(attrName, _oldValue, newValue);
|
|
7829
|
+
updateAriaLabel7(this, this.seekOffset);
|
|
7722
7830
|
if (attrName === Attributes9.SEEK_OFFSET) {
|
|
7723
7831
|
this.seekOffset = getNumericAttr(
|
|
7724
7832
|
this,
|
|
@@ -7796,6 +7904,9 @@ function getSlotTemplateHTML17(_attrs, props) {
|
|
|
7796
7904
|
`
|
|
7797
7905
|
);
|
|
7798
7906
|
}
|
|
7907
|
+
var updateAriaLabel8 = (el, seekOffset) => {
|
|
7908
|
+
el.setAttribute("aria-label", t("seek forward {seekOffset} seconds", { seekOffset }));
|
|
7909
|
+
};
|
|
7799
7910
|
function getTooltipContentHTML11() {
|
|
7800
7911
|
return t("Seek forward");
|
|
7801
7912
|
}
|
|
@@ -7818,6 +7929,7 @@ var MediaSeekForwardButton = class extends MediaChromeButton {
|
|
|
7818
7929
|
}
|
|
7819
7930
|
attributeChangedCallback(attrName, _oldValue, newValue) {
|
|
7820
7931
|
super.attributeChangedCallback(attrName, _oldValue, newValue);
|
|
7932
|
+
updateAriaLabel8(this, this.seekOffset);
|
|
7821
7933
|
if (attrName === Attributes10.SEEK_OFFSET) {
|
|
7822
7934
|
this.seekOffset = getNumericAttr(
|
|
7823
7935
|
this,
|
|
@@ -7893,7 +8005,21 @@ var __privateSet17 = (obj, member, value, setter) => {
|
|
|
7893
8005
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
7894
8006
|
return value;
|
|
7895
8007
|
};
|
|
8008
|
+
var __privateMethod6 = (obj, member, method) => {
|
|
8009
|
+
__accessCheck19(obj, member, "access private method");
|
|
8010
|
+
return method;
|
|
8011
|
+
};
|
|
7896
8012
|
var _slot4;
|
|
8013
|
+
var _keyUpHandler2;
|
|
8014
|
+
var _keyDownHandler3;
|
|
8015
|
+
var _setupEventListeners;
|
|
8016
|
+
var setupEventListeners_fn;
|
|
8017
|
+
var _removeEventListeners;
|
|
8018
|
+
var removeEventListeners_fn;
|
|
8019
|
+
var _makeInteractive;
|
|
8020
|
+
var makeInteractive_fn;
|
|
8021
|
+
var _makeNonInteractive;
|
|
8022
|
+
var makeNonInteractive_fn;
|
|
7897
8023
|
var Attributes11 = {
|
|
7898
8024
|
REMAINING: "remaining",
|
|
7899
8025
|
SHOW_DURATION: "showduration",
|
|
@@ -7922,8 +8048,7 @@ var formatTimesLabel = (el, { timesSep = DEFAULT_TIMES_SEP } = {}) => {
|
|
|
7922
8048
|
return timeLabel;
|
|
7923
8049
|
return `${timeLabel}${timesSep}${formatTime(endTime)}`;
|
|
7924
8050
|
};
|
|
7925
|
-
var
|
|
7926
|
-
var updateAriaValueText = (el) => {
|
|
8051
|
+
var updateAriaDescription = (el) => {
|
|
7927
8052
|
var _a3;
|
|
7928
8053
|
const currentTime = el.mediaCurrentTime;
|
|
7929
8054
|
const [, seekableEnd] = (_a3 = el.mediaSeekable) != null ? _a3 : [];
|
|
@@ -7934,17 +8059,20 @@ var updateAriaValueText = (el) => {
|
|
|
7934
8059
|
endTime = seekableEnd;
|
|
7935
8060
|
}
|
|
7936
8061
|
if (currentTime == null || endTime === null) {
|
|
7937
|
-
el.setAttribute("aria-
|
|
8062
|
+
el.setAttribute("aria-description", t("video not loaded, unknown time."));
|
|
7938
8063
|
return;
|
|
7939
8064
|
}
|
|
7940
8065
|
const currentTimePhrase = el.remaining ? formatAsTimePhrase(0 - (endTime - currentTime)) : formatAsTimePhrase(currentTime);
|
|
7941
8066
|
if (!el.showDuration) {
|
|
7942
|
-
el.setAttribute("aria-
|
|
8067
|
+
el.setAttribute("aria-description", currentTimePhrase);
|
|
7943
8068
|
return;
|
|
7944
8069
|
}
|
|
7945
8070
|
const totalTimePhrase = formatAsTimePhrase(endTime);
|
|
7946
|
-
const fullPhrase =
|
|
7947
|
-
|
|
8071
|
+
const fullPhrase = t("{currentTime} of {totalTime}", {
|
|
8072
|
+
currentTime: currentTimePhrase,
|
|
8073
|
+
totalTime: totalTimePhrase
|
|
8074
|
+
});
|
|
8075
|
+
el.setAttribute("aria-description", fullPhrase);
|
|
7948
8076
|
};
|
|
7949
8077
|
function getSlotTemplateHTML18(_attrs, props) {
|
|
7950
8078
|
return (
|
|
@@ -7954,10 +8082,26 @@ function getSlotTemplateHTML18(_attrs, props) {
|
|
|
7954
8082
|
`
|
|
7955
8083
|
);
|
|
7956
8084
|
}
|
|
8085
|
+
var updateAriaLabel9 = (el) => {
|
|
8086
|
+
el.setAttribute("aria-label", t("playback time"));
|
|
8087
|
+
};
|
|
7957
8088
|
var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
7958
8089
|
constructor() {
|
|
7959
8090
|
super();
|
|
8091
|
+
__privateAdd19(this, _setupEventListeners);
|
|
8092
|
+
__privateAdd19(this, _removeEventListeners);
|
|
8093
|
+
__privateAdd19(this, _makeInteractive);
|
|
8094
|
+
__privateAdd19(this, _makeNonInteractive);
|
|
7960
8095
|
__privateAdd19(this, _slot4, void 0);
|
|
8096
|
+
__privateAdd19(this, _keyUpHandler2, null);
|
|
8097
|
+
__privateAdd19(this, _keyDownHandler3, (evt) => {
|
|
8098
|
+
const { metaKey, altKey, key } = evt;
|
|
8099
|
+
if (metaKey || altKey || !ButtonPressedKeys2.includes(key)) {
|
|
8100
|
+
this.removeEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8101
|
+
return;
|
|
8102
|
+
}
|
|
8103
|
+
this.addEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8104
|
+
});
|
|
7961
8105
|
__privateSet17(this, _slot4, this.shadowRoot.querySelector("slot"));
|
|
7962
8106
|
__privateGet19(this, _slot4).innerHTML = `${formatTimesLabel(this)}`;
|
|
7963
8107
|
}
|
|
@@ -7974,28 +8118,8 @@ var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
|
7974
8118
|
"background",
|
|
7975
8119
|
"var(--media-control-hover-background, rgba(50 50 70 / .7))"
|
|
7976
8120
|
);
|
|
7977
|
-
if (!this.hasAttribute("disabled")) {
|
|
7978
|
-
this.enable();
|
|
7979
|
-
}
|
|
7980
|
-
this.setAttribute("role", "progressbar");
|
|
7981
8121
|
this.setAttribute("aria-label", t("playback time"));
|
|
7982
|
-
|
|
7983
|
-
const { key } = evt;
|
|
7984
|
-
if (!ButtonPressedKeys2.includes(key)) {
|
|
7985
|
-
this.removeEventListener("keyup", keyUpHandler);
|
|
7986
|
-
return;
|
|
7987
|
-
}
|
|
7988
|
-
this.toggleTimeDisplay();
|
|
7989
|
-
};
|
|
7990
|
-
this.addEventListener("keydown", (evt) => {
|
|
7991
|
-
const { metaKey, altKey, key } = evt;
|
|
7992
|
-
if (metaKey || altKey || !ButtonPressedKeys2.includes(key)) {
|
|
7993
|
-
this.removeEventListener("keyup", keyUpHandler);
|
|
7994
|
-
return;
|
|
7995
|
-
}
|
|
7996
|
-
this.addEventListener("keyup", keyUpHandler);
|
|
7997
|
-
});
|
|
7998
|
-
this.addEventListener("click", this.toggleTimeDisplay);
|
|
8122
|
+
__privateMethod6(this, _makeInteractive, makeInteractive_fn).call(this);
|
|
7999
8123
|
super.connectedCallback();
|
|
8000
8124
|
}
|
|
8001
8125
|
toggleTimeDisplay() {
|
|
@@ -8010,22 +8134,32 @@ var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
|
8010
8134
|
}
|
|
8011
8135
|
disconnectedCallback() {
|
|
8012
8136
|
this.disable();
|
|
8137
|
+
__privateMethod6(this, _removeEventListeners, removeEventListeners_fn).call(this);
|
|
8013
8138
|
super.disconnectedCallback();
|
|
8014
8139
|
}
|
|
8015
8140
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
8141
|
+
updateAriaLabel9(this);
|
|
8016
8142
|
if (CombinedAttributes.includes(attrName)) {
|
|
8017
8143
|
this.update();
|
|
8018
8144
|
} else if (attrName === "disabled" && newValue !== oldValue) {
|
|
8019
8145
|
if (newValue == null) {
|
|
8020
|
-
this.
|
|
8146
|
+
__privateMethod6(this, _makeInteractive, makeInteractive_fn).call(this);
|
|
8021
8147
|
} else {
|
|
8022
|
-
this.
|
|
8148
|
+
__privateMethod6(this, _makeNonInteractive, makeNonInteractive_fn).call(this);
|
|
8149
|
+
}
|
|
8150
|
+
} else if (attrName === Attributes11.NO_TOGGLE && newValue !== oldValue) {
|
|
8151
|
+
if (this.noToggle) {
|
|
8152
|
+
__privateMethod6(this, _makeNonInteractive, makeNonInteractive_fn).call(this);
|
|
8153
|
+
} else {
|
|
8154
|
+
__privateMethod6(this, _makeInteractive, makeInteractive_fn).call(this);
|
|
8023
8155
|
}
|
|
8024
8156
|
}
|
|
8025
8157
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
8026
8158
|
}
|
|
8027
8159
|
enable() {
|
|
8028
|
-
this.
|
|
8160
|
+
if (!this.noToggle) {
|
|
8161
|
+
this.tabIndex = 0;
|
|
8162
|
+
}
|
|
8029
8163
|
}
|
|
8030
8164
|
disable() {
|
|
8031
8165
|
this.tabIndex = -1;
|
|
@@ -8096,13 +8230,54 @@ var MediaTimeDisplay = class extends MediaTextDisplay {
|
|
|
8096
8230
|
}
|
|
8097
8231
|
update() {
|
|
8098
8232
|
const timesLabel = formatTimesLabel(this);
|
|
8099
|
-
|
|
8233
|
+
updateAriaDescription(this);
|
|
8100
8234
|
if (timesLabel !== __privateGet19(this, _slot4).innerHTML) {
|
|
8101
8235
|
__privateGet19(this, _slot4).innerHTML = timesLabel;
|
|
8102
8236
|
}
|
|
8103
8237
|
}
|
|
8104
8238
|
};
|
|
8105
8239
|
_slot4 = /* @__PURE__ */ new WeakMap();
|
|
8240
|
+
_keyUpHandler2 = /* @__PURE__ */ new WeakMap();
|
|
8241
|
+
_keyDownHandler3 = /* @__PURE__ */ new WeakMap();
|
|
8242
|
+
_setupEventListeners = /* @__PURE__ */ new WeakSet();
|
|
8243
|
+
setupEventListeners_fn = function() {
|
|
8244
|
+
if (__privateGet19(this, _keyUpHandler2)) {
|
|
8245
|
+
return;
|
|
8246
|
+
}
|
|
8247
|
+
__privateSet17(this, _keyUpHandler2, (evt) => {
|
|
8248
|
+
const { key } = evt;
|
|
8249
|
+
if (!ButtonPressedKeys2.includes(key)) {
|
|
8250
|
+
this.removeEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8251
|
+
return;
|
|
8252
|
+
}
|
|
8253
|
+
this.toggleTimeDisplay();
|
|
8254
|
+
});
|
|
8255
|
+
this.addEventListener("keydown", __privateGet19(this, _keyDownHandler3));
|
|
8256
|
+
this.addEventListener("click", this.toggleTimeDisplay);
|
|
8257
|
+
};
|
|
8258
|
+
_removeEventListeners = /* @__PURE__ */ new WeakSet();
|
|
8259
|
+
removeEventListeners_fn = function() {
|
|
8260
|
+
if (__privateGet19(this, _keyUpHandler2)) {
|
|
8261
|
+
this.removeEventListener("keyup", __privateGet19(this, _keyUpHandler2));
|
|
8262
|
+
this.removeEventListener("keydown", __privateGet19(this, _keyDownHandler3));
|
|
8263
|
+
this.removeEventListener("click", this.toggleTimeDisplay);
|
|
8264
|
+
__privateSet17(this, _keyUpHandler2, null);
|
|
8265
|
+
}
|
|
8266
|
+
};
|
|
8267
|
+
_makeInteractive = /* @__PURE__ */ new WeakSet();
|
|
8268
|
+
makeInteractive_fn = function() {
|
|
8269
|
+
if (!this.noToggle && !this.hasAttribute("disabled")) {
|
|
8270
|
+
this.setAttribute("role", "button");
|
|
8271
|
+
this.enable();
|
|
8272
|
+
__privateMethod6(this, _setupEventListeners, setupEventListeners_fn).call(this);
|
|
8273
|
+
}
|
|
8274
|
+
};
|
|
8275
|
+
_makeNonInteractive = /* @__PURE__ */ new WeakSet();
|
|
8276
|
+
makeNonInteractive_fn = function() {
|
|
8277
|
+
this.removeAttribute("role");
|
|
8278
|
+
this.disable();
|
|
8279
|
+
__privateMethod6(this, _removeEventListeners, removeEventListeners_fn).call(this);
|
|
8280
|
+
};
|
|
8106
8281
|
MediaTimeDisplay.getSlotTemplateHTML = getSlotTemplateHTML18;
|
|
8107
8282
|
if (!GlobalThis.customElements.get("media-time-display")) {
|
|
8108
8283
|
GlobalThis.customElements.define("media-time-display", MediaTimeDisplay);
|
|
@@ -8235,7 +8410,7 @@ var __privateSet19 = (obj, member, value, setter) => {
|
|
|
8235
8410
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
8236
8411
|
return value;
|
|
8237
8412
|
};
|
|
8238
|
-
var
|
|
8413
|
+
var __privateMethod7 = (obj, member, method) => {
|
|
8239
8414
|
__accessCheck21(obj, member, "access private method");
|
|
8240
8415
|
return method;
|
|
8241
8416
|
};
|
|
@@ -8250,7 +8425,6 @@ var _boxPaddingRight;
|
|
|
8250
8425
|
var _mediaChaptersCues;
|
|
8251
8426
|
var _isPointerDown;
|
|
8252
8427
|
var _toggleRangeAnimation;
|
|
8253
|
-
var toggleRangeAnimation_fn;
|
|
8254
8428
|
var _shouldRangeAnimate;
|
|
8255
8429
|
var shouldRangeAnimate_fn;
|
|
8256
8430
|
var _updateRange;
|
|
@@ -8266,19 +8440,20 @@ var _previewRequest;
|
|
|
8266
8440
|
var previewRequest_fn;
|
|
8267
8441
|
var _seekRequest;
|
|
8268
8442
|
var seekRequest_fn;
|
|
8269
|
-
var
|
|
8270
|
-
var updateAriaValueText2 = (el) => {
|
|
8443
|
+
var updateAriaValueText = (el) => {
|
|
8271
8444
|
const range = el.range;
|
|
8272
8445
|
const currentTimePhrase = formatAsTimePhrase(+calcTimeFromRangeValue(el));
|
|
8273
8446
|
const totalTimePhrase = formatAsTimePhrase(+el.mediaSeekableEnd);
|
|
8274
|
-
const fullPhrase = !(currentTimePhrase && totalTimePhrase) ?
|
|
8447
|
+
const fullPhrase = !(currentTimePhrase && totalTimePhrase) ? t("video not loaded, unknown time.") : t("{currentTime} of {totalTime}", {
|
|
8448
|
+
currentTime: currentTimePhrase,
|
|
8449
|
+
totalTime: totalTimePhrase
|
|
8450
|
+
});
|
|
8275
8451
|
range.setAttribute("aria-valuetext", fullPhrase);
|
|
8276
8452
|
};
|
|
8277
|
-
function
|
|
8453
|
+
function getContainerTemplateHTML2(_attrs) {
|
|
8278
8454
|
return (
|
|
8279
8455
|
/*html*/
|
|
8280
8456
|
`
|
|
8281
|
-
${MediaChromeRange.getTemplateHTML(_attrs)}
|
|
8282
8457
|
<style>
|
|
8283
8458
|
:host {
|
|
8284
8459
|
--media-box-border-radius: 4px;
|
|
@@ -8526,7 +8701,6 @@ var calcTimeFromRangeValue = (el, value = el.range.valueAsNumber) => {
|
|
|
8526
8701
|
var MediaTimeRange = class extends MediaChromeRange {
|
|
8527
8702
|
constructor() {
|
|
8528
8703
|
super();
|
|
8529
|
-
__privateAdd21(this, _toggleRangeAnimation);
|
|
8530
8704
|
__privateAdd21(this, _shouldRangeAnimate);
|
|
8531
8705
|
__privateAdd21(this, _getElementRects);
|
|
8532
8706
|
__privateAdd21(this, _getBoxPosition);
|
|
@@ -8534,7 +8708,7 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8534
8708
|
__privateAdd21(this, _handlePointerMove3);
|
|
8535
8709
|
__privateAdd21(this, _previewRequest);
|
|
8536
8710
|
__privateAdd21(this, _seekRequest);
|
|
8537
|
-
__privateAdd21(this, _rootNode,
|
|
8711
|
+
__privateAdd21(this, _rootNode, null);
|
|
8538
8712
|
__privateAdd21(this, _animation, void 0);
|
|
8539
8713
|
__privateAdd21(this, _boxes, void 0);
|
|
8540
8714
|
__privateAdd21(this, _previewTime, void 0);
|
|
@@ -8544,6 +8718,13 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8544
8718
|
__privateAdd21(this, _boxPaddingRight, void 0);
|
|
8545
8719
|
__privateAdd21(this, _mediaChaptersCues, void 0);
|
|
8546
8720
|
__privateAdd21(this, _isPointerDown, void 0);
|
|
8721
|
+
__privateAdd21(this, _toggleRangeAnimation, () => {
|
|
8722
|
+
if (__privateMethod7(this, _shouldRangeAnimate, shouldRangeAnimate_fn).call(this)) {
|
|
8723
|
+
__privateGet21(this, _animation).start();
|
|
8724
|
+
} else {
|
|
8725
|
+
__privateGet21(this, _animation).stop();
|
|
8726
|
+
}
|
|
8727
|
+
});
|
|
8547
8728
|
__privateAdd21(this, _updateRange, (value) => {
|
|
8548
8729
|
if (this.dragging)
|
|
8549
8730
|
return;
|
|
@@ -8591,14 +8772,14 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8591
8772
|
var _a3;
|
|
8592
8773
|
super.connectedCallback();
|
|
8593
8774
|
this.range.setAttribute("aria-label", t("seek"));
|
|
8594
|
-
|
|
8775
|
+
__privateGet21(this, _toggleRangeAnimation).call(this);
|
|
8595
8776
|
__privateSet19(this, _rootNode, this.getRootNode());
|
|
8596
8777
|
(_a3 = __privateGet21(this, _rootNode)) == null ? void 0 : _a3.addEventListener("transitionstart", this);
|
|
8597
8778
|
}
|
|
8598
8779
|
disconnectedCallback() {
|
|
8599
8780
|
var _a3;
|
|
8600
8781
|
super.disconnectedCallback();
|
|
8601
|
-
|
|
8782
|
+
__privateGet21(this, _animation).stop();
|
|
8602
8783
|
(_a3 = __privateGet21(this, _rootNode)) == null ? void 0 : _a3.removeEventListener("transitionstart", this);
|
|
8603
8784
|
__privateSet19(this, _rootNode, null);
|
|
8604
8785
|
}
|
|
@@ -8612,8 +8793,8 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8612
8793
|
duration: this.mediaSeekableEnd - this.mediaSeekableStart,
|
|
8613
8794
|
playbackRate: this.mediaPlaybackRate
|
|
8614
8795
|
});
|
|
8615
|
-
|
|
8616
|
-
|
|
8796
|
+
__privateGet21(this, _toggleRangeAnimation).call(this);
|
|
8797
|
+
updateAriaValueText(this);
|
|
8617
8798
|
} else if (attrName === MediaUIAttributes.MEDIA_BUFFERED) {
|
|
8618
8799
|
this.updateBufferedBar();
|
|
8619
8800
|
}
|
|
@@ -8794,9 +8975,9 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8794
8975
|
this.shadowRoot,
|
|
8795
8976
|
'[part~="current-box"]'
|
|
8796
8977
|
);
|
|
8797
|
-
const rects =
|
|
8798
|
-
const boxPos =
|
|
8799
|
-
const boxShift =
|
|
8978
|
+
const rects = __privateMethod7(this, _getElementRects, getElementRects_fn).call(this, __privateGet21(this, _currentBox));
|
|
8979
|
+
const boxPos = __privateMethod7(this, _getBoxPosition, getBoxPosition_fn).call(this, rects, this.range.valueAsNumber);
|
|
8980
|
+
const boxShift = __privateMethod7(this, _getBoxShiftPosition, getBoxShiftPosition_fn).call(this, rects, this.range.valueAsNumber);
|
|
8800
8981
|
currentRailRule.style.transform = `translateX(${boxPos})`;
|
|
8801
8982
|
currentRailRule.style.setProperty("--_range-width", `${rects.range.width}`);
|
|
8802
8983
|
currentBoxRule.style.setProperty("--_box-shift", `${boxShift}`);
|
|
@@ -8807,10 +8988,10 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8807
8988
|
super.handleEvent(evt);
|
|
8808
8989
|
switch (evt.type) {
|
|
8809
8990
|
case "input":
|
|
8810
|
-
|
|
8991
|
+
__privateMethod7(this, _seekRequest, seekRequest_fn).call(this);
|
|
8811
8992
|
break;
|
|
8812
8993
|
case "pointermove":
|
|
8813
|
-
|
|
8994
|
+
__privateMethod7(this, _handlePointerMove3, handlePointerMove_fn3).call(this, evt);
|
|
8814
8995
|
break;
|
|
8815
8996
|
case "pointerup":
|
|
8816
8997
|
if (__privateGet21(this, _isPointerDown))
|
|
@@ -8820,11 +9001,11 @@ var MediaTimeRange = class extends MediaChromeRange {
|
|
|
8820
9001
|
__privateSet19(this, _isPointerDown, true);
|
|
8821
9002
|
break;
|
|
8822
9003
|
case "pointerleave":
|
|
8823
|
-
|
|
9004
|
+
__privateMethod7(this, _previewRequest, previewRequest_fn).call(this, null);
|
|
8824
9005
|
break;
|
|
8825
9006
|
case "transitionstart":
|
|
8826
9007
|
if (containsComposedNode(evt.target, this)) {
|
|
8827
|
-
setTimeout(() =>
|
|
9008
|
+
setTimeout(() => __privateGet21(this, _toggleRangeAnimation).call(this), 0);
|
|
8828
9009
|
}
|
|
8829
9010
|
break;
|
|
8830
9011
|
}
|
|
@@ -8840,14 +9021,7 @@ _boxPaddingLeft = /* @__PURE__ */ new WeakMap();
|
|
|
8840
9021
|
_boxPaddingRight = /* @__PURE__ */ new WeakMap();
|
|
8841
9022
|
_mediaChaptersCues = /* @__PURE__ */ new WeakMap();
|
|
8842
9023
|
_isPointerDown = /* @__PURE__ */ new WeakMap();
|
|
8843
|
-
_toggleRangeAnimation = /* @__PURE__ */ new
|
|
8844
|
-
toggleRangeAnimation_fn = function() {
|
|
8845
|
-
if (__privateMethod6(this, _shouldRangeAnimate, shouldRangeAnimate_fn).call(this)) {
|
|
8846
|
-
__privateGet21(this, _animation).start();
|
|
8847
|
-
} else {
|
|
8848
|
-
__privateGet21(this, _animation).stop();
|
|
8849
|
-
}
|
|
8850
|
-
};
|
|
9024
|
+
_toggleRangeAnimation = /* @__PURE__ */ new WeakMap();
|
|
8851
9025
|
_shouldRangeAnimate = /* @__PURE__ */ new WeakSet();
|
|
8852
9026
|
shouldRangeAnimate_fn = function() {
|
|
8853
9027
|
return this.isConnected && !this.mediaPaused && !this.mediaLoading && !this.mediaEnded && this.mediaSeekableEnd > 0 && isElementVisible(this);
|
|
@@ -8906,7 +9080,7 @@ handlePointerMove_fn3 = function(evt) {
|
|
|
8906
9080
|
(b) => evt.composedPath().includes(b)
|
|
8907
9081
|
);
|
|
8908
9082
|
if (!this.dragging && (isOverBoxes || !evt.composedPath().includes(this))) {
|
|
8909
|
-
|
|
9083
|
+
__privateMethod7(this, _previewRequest, previewRequest_fn).call(this, null);
|
|
8910
9084
|
return;
|
|
8911
9085
|
}
|
|
8912
9086
|
const duration = this.mediaSeekableEnd;
|
|
@@ -8920,11 +9094,11 @@ handlePointerMove_fn3 = function(evt) {
|
|
|
8920
9094
|
this.shadowRoot,
|
|
8921
9095
|
'[part~="preview-box"]'
|
|
8922
9096
|
);
|
|
8923
|
-
const rects =
|
|
9097
|
+
const rects = __privateMethod7(this, _getElementRects, getElementRects_fn).call(this, __privateGet21(this, _previewBox));
|
|
8924
9098
|
let pointerRatio = (evt.clientX - rects.range.left) / rects.range.width;
|
|
8925
9099
|
pointerRatio = Math.max(0, Math.min(1, pointerRatio));
|
|
8926
|
-
const boxPos =
|
|
8927
|
-
const boxShift =
|
|
9100
|
+
const boxPos = __privateMethod7(this, _getBoxPosition, getBoxPosition_fn).call(this, rects, pointerRatio);
|
|
9101
|
+
const boxShift = __privateMethod7(this, _getBoxShiftPosition, getBoxShiftPosition_fn).call(this, rects, pointerRatio);
|
|
8928
9102
|
previewRailRule.style.transform = `translateX(${boxPos})`;
|
|
8929
9103
|
previewRailRule.style.setProperty("--_range-width", `${rects.range.width}`);
|
|
8930
9104
|
previewBoxRule.style.setProperty("--_box-shift", `${boxShift}`);
|
|
@@ -8933,7 +9107,7 @@ handlePointerMove_fn3 = function(evt) {
|
|
|
8933
9107
|
if (Math.abs(diff) < 1 && pointerRatio > 0.01 && pointerRatio < 0.99)
|
|
8934
9108
|
return;
|
|
8935
9109
|
__privateSet19(this, _previewTime, pointerRatio * duration);
|
|
8936
|
-
|
|
9110
|
+
__privateMethod7(this, _previewRequest, previewRequest_fn).call(this, __privateGet21(this, _previewTime));
|
|
8937
9111
|
};
|
|
8938
9112
|
_previewRequest = /* @__PURE__ */ new WeakSet();
|
|
8939
9113
|
previewRequest_fn = function(detail) {
|
|
@@ -8958,12 +9132,26 @@ seekRequest_fn = function() {
|
|
|
8958
9132
|
);
|
|
8959
9133
|
};
|
|
8960
9134
|
MediaTimeRange.shadowRootOptions = { mode: "open" };
|
|
8961
|
-
MediaTimeRange.
|
|
9135
|
+
MediaTimeRange.getContainerTemplateHTML = getContainerTemplateHTML2;
|
|
8962
9136
|
if (!GlobalThis.customElements.get("media-time-range")) {
|
|
8963
9137
|
GlobalThis.customElements.define("media-time-range", MediaTimeRange);
|
|
8964
9138
|
}
|
|
8965
9139
|
|
|
8966
9140
|
// ../../node_modules/media-chrome/dist/media-volume-range.js
|
|
9141
|
+
var __accessCheck22 = (obj, member, msg) => {
|
|
9142
|
+
if (!member.has(obj))
|
|
9143
|
+
throw TypeError("Cannot " + msg);
|
|
9144
|
+
};
|
|
9145
|
+
var __privateGet22 = (obj, member, getter) => {
|
|
9146
|
+
__accessCheck22(obj, member, "read from private field");
|
|
9147
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
9148
|
+
};
|
|
9149
|
+
var __privateAdd22 = (obj, member, value) => {
|
|
9150
|
+
if (member.has(obj))
|
|
9151
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
9152
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9153
|
+
};
|
|
9154
|
+
var _handleRangeInput;
|
|
8967
9155
|
var DEFAULT_VOLUME = 1;
|
|
8968
9156
|
var toVolume = (el) => {
|
|
8969
9157
|
if (el.mediaMuted)
|
|
@@ -8972,17 +9160,9 @@ var toVolume = (el) => {
|
|
|
8972
9160
|
};
|
|
8973
9161
|
var formatAsPercentString = (value) => `${Math.round(value * 100)}%`;
|
|
8974
9162
|
var MediaVolumeRange = class extends MediaChromeRange {
|
|
8975
|
-
static get observedAttributes() {
|
|
8976
|
-
return [
|
|
8977
|
-
...super.observedAttributes,
|
|
8978
|
-
MediaUIAttributes.MEDIA_VOLUME,
|
|
8979
|
-
MediaUIAttributes.MEDIA_MUTED,
|
|
8980
|
-
MediaUIAttributes.MEDIA_VOLUME_UNAVAILABLE
|
|
8981
|
-
];
|
|
8982
|
-
}
|
|
8983
9163
|
constructor() {
|
|
8984
|
-
super();
|
|
8985
|
-
this
|
|
9164
|
+
super(...arguments);
|
|
9165
|
+
__privateAdd22(this, _handleRangeInput, () => {
|
|
8986
9166
|
const detail = this.range.value;
|
|
8987
9167
|
const evt = new GlobalThis.CustomEvent(
|
|
8988
9168
|
MediaUIEvents.MEDIA_VOLUME_REQUEST,
|
|
@@ -8995,9 +9175,22 @@ var MediaVolumeRange = class extends MediaChromeRange {
|
|
|
8995
9175
|
this.dispatchEvent(evt);
|
|
8996
9176
|
});
|
|
8997
9177
|
}
|
|
9178
|
+
static get observedAttributes() {
|
|
9179
|
+
return [
|
|
9180
|
+
...super.observedAttributes,
|
|
9181
|
+
MediaUIAttributes.MEDIA_VOLUME,
|
|
9182
|
+
MediaUIAttributes.MEDIA_MUTED,
|
|
9183
|
+
MediaUIAttributes.MEDIA_VOLUME_UNAVAILABLE
|
|
9184
|
+
];
|
|
9185
|
+
}
|
|
8998
9186
|
connectedCallback() {
|
|
8999
9187
|
super.connectedCallback();
|
|
9000
9188
|
this.range.setAttribute("aria-label", t("volume"));
|
|
9189
|
+
this.range.addEventListener("input", __privateGet22(this, _handleRangeInput));
|
|
9190
|
+
}
|
|
9191
|
+
disconnectedCallback() {
|
|
9192
|
+
this.range.removeEventListener("input", __privateGet22(this, _handleRangeInput));
|
|
9193
|
+
super.disconnectedCallback();
|
|
9001
9194
|
}
|
|
9002
9195
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
9003
9196
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
@@ -9038,6 +9231,7 @@ var MediaVolumeRange = class extends MediaChromeRange {
|
|
|
9038
9231
|
setStringAttr(this, MediaUIAttributes.MEDIA_VOLUME_UNAVAILABLE, value);
|
|
9039
9232
|
}
|
|
9040
9233
|
};
|
|
9234
|
+
_handleRangeInput = /* @__PURE__ */ new WeakMap();
|
|
9041
9235
|
if (!GlobalThis.customElements.get("media-volume-range")) {
|
|
9042
9236
|
GlobalThis.customElements.define("media-volume-range", MediaVolumeRange);
|
|
9043
9237
|
}
|
|
@@ -9129,21 +9323,21 @@ if (!GlobalThis.customElements.get("media-loop-button")) {
|
|
|
9129
9323
|
}
|
|
9130
9324
|
|
|
9131
9325
|
// ../../node_modules/media-chrome/dist/utils/template-parts.js
|
|
9132
|
-
var
|
|
9326
|
+
var __accessCheck23 = (obj, member, msg) => {
|
|
9133
9327
|
if (!member.has(obj))
|
|
9134
9328
|
throw TypeError("Cannot " + msg);
|
|
9135
9329
|
};
|
|
9136
|
-
var
|
|
9137
|
-
|
|
9330
|
+
var __privateGet23 = (obj, member, getter) => {
|
|
9331
|
+
__accessCheck23(obj, member, "read from private field");
|
|
9138
9332
|
return getter ? getter.call(obj) : member.get(obj);
|
|
9139
9333
|
};
|
|
9140
|
-
var
|
|
9334
|
+
var __privateAdd23 = (obj, member, value) => {
|
|
9141
9335
|
if (member.has(obj))
|
|
9142
9336
|
throw TypeError("Cannot add the same private member more than once");
|
|
9143
9337
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9144
9338
|
};
|
|
9145
9339
|
var __privateSet20 = (obj, member, value, setter) => {
|
|
9146
|
-
|
|
9340
|
+
__accessCheck23(obj, member, "write to private field");
|
|
9147
9341
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
9148
9342
|
return value;
|
|
9149
9343
|
};
|
|
@@ -9183,16 +9377,16 @@ var TemplateInstance = class extends GlobalThis.DocumentFragment {
|
|
|
9183
9377
|
constructor(template2, state, processor2 = defaultProcessor) {
|
|
9184
9378
|
var _a3;
|
|
9185
9379
|
super();
|
|
9186
|
-
|
|
9187
|
-
|
|
9380
|
+
__privateAdd23(this, _parts, void 0);
|
|
9381
|
+
__privateAdd23(this, _processor, void 0);
|
|
9188
9382
|
this.append(template2.content.cloneNode(true));
|
|
9189
9383
|
__privateSet20(this, _parts, parse(this));
|
|
9190
9384
|
__privateSet20(this, _processor, processor2);
|
|
9191
|
-
(_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this,
|
|
9192
|
-
processor2.processCallback(this,
|
|
9385
|
+
(_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this, __privateGet23(this, _parts), state);
|
|
9386
|
+
processor2.processCallback(this, __privateGet23(this, _parts), state);
|
|
9193
9387
|
}
|
|
9194
9388
|
update(state) {
|
|
9195
|
-
|
|
9389
|
+
__privateGet23(this, _processor).processCallback(this, __privateGet23(this, _parts), state);
|
|
9196
9390
|
}
|
|
9197
9391
|
};
|
|
9198
9392
|
_parts = /* @__PURE__ */ new WeakMap();
|
|
@@ -9281,87 +9475,87 @@ var Part = class {
|
|
|
9281
9475
|
var attrPartToList = /* @__PURE__ */ new WeakMap();
|
|
9282
9476
|
var AttrPartList = class {
|
|
9283
9477
|
constructor() {
|
|
9284
|
-
|
|
9478
|
+
__privateAdd23(this, _items, []);
|
|
9285
9479
|
}
|
|
9286
9480
|
[Symbol.iterator]() {
|
|
9287
|
-
return
|
|
9481
|
+
return __privateGet23(this, _items).values();
|
|
9288
9482
|
}
|
|
9289
9483
|
get length() {
|
|
9290
|
-
return
|
|
9484
|
+
return __privateGet23(this, _items).length;
|
|
9291
9485
|
}
|
|
9292
9486
|
item(index) {
|
|
9293
|
-
return
|
|
9487
|
+
return __privateGet23(this, _items)[index];
|
|
9294
9488
|
}
|
|
9295
9489
|
append(...items) {
|
|
9296
9490
|
for (const item of items) {
|
|
9297
9491
|
if (item instanceof AttrPart) {
|
|
9298
9492
|
attrPartToList.set(item, this);
|
|
9299
9493
|
}
|
|
9300
|
-
|
|
9494
|
+
__privateGet23(this, _items).push(item);
|
|
9301
9495
|
}
|
|
9302
9496
|
}
|
|
9303
9497
|
toString() {
|
|
9304
|
-
return
|
|
9498
|
+
return __privateGet23(this, _items).join("");
|
|
9305
9499
|
}
|
|
9306
9500
|
};
|
|
9307
9501
|
_items = /* @__PURE__ */ new WeakMap();
|
|
9308
9502
|
var AttrPart = class extends Part {
|
|
9309
9503
|
constructor(element, attributeName, namespaceURI) {
|
|
9310
9504
|
super();
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9505
|
+
__privateAdd23(this, _list);
|
|
9506
|
+
__privateAdd23(this, _value, "");
|
|
9507
|
+
__privateAdd23(this, _element, void 0);
|
|
9508
|
+
__privateAdd23(this, _attributeName, void 0);
|
|
9509
|
+
__privateAdd23(this, _namespaceURI, void 0);
|
|
9316
9510
|
__privateSet20(this, _element, element);
|
|
9317
9511
|
__privateSet20(this, _attributeName, attributeName);
|
|
9318
9512
|
__privateSet20(this, _namespaceURI, namespaceURI);
|
|
9319
9513
|
}
|
|
9320
9514
|
get attributeName() {
|
|
9321
|
-
return
|
|
9515
|
+
return __privateGet23(this, _attributeName);
|
|
9322
9516
|
}
|
|
9323
9517
|
get attributeNamespace() {
|
|
9324
|
-
return
|
|
9518
|
+
return __privateGet23(this, _namespaceURI);
|
|
9325
9519
|
}
|
|
9326
9520
|
get element() {
|
|
9327
|
-
return
|
|
9521
|
+
return __privateGet23(this, _element);
|
|
9328
9522
|
}
|
|
9329
9523
|
get value() {
|
|
9330
|
-
return
|
|
9524
|
+
return __privateGet23(this, _value);
|
|
9331
9525
|
}
|
|
9332
9526
|
set value(newValue) {
|
|
9333
|
-
if (
|
|
9527
|
+
if (__privateGet23(this, _value) === newValue)
|
|
9334
9528
|
return;
|
|
9335
9529
|
__privateSet20(this, _value, newValue);
|
|
9336
|
-
if (!
|
|
9530
|
+
if (!__privateGet23(this, _list, list_get) || __privateGet23(this, _list, list_get).length === 1) {
|
|
9337
9531
|
if (newValue == null) {
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9532
|
+
__privateGet23(this, _element).removeAttributeNS(
|
|
9533
|
+
__privateGet23(this, _namespaceURI),
|
|
9534
|
+
__privateGet23(this, _attributeName)
|
|
9341
9535
|
);
|
|
9342
9536
|
} else {
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9537
|
+
__privateGet23(this, _element).setAttributeNS(
|
|
9538
|
+
__privateGet23(this, _namespaceURI),
|
|
9539
|
+
__privateGet23(this, _attributeName),
|
|
9346
9540
|
newValue
|
|
9347
9541
|
);
|
|
9348
9542
|
}
|
|
9349
9543
|
} else {
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9544
|
+
__privateGet23(this, _element).setAttributeNS(
|
|
9545
|
+
__privateGet23(this, _namespaceURI),
|
|
9546
|
+
__privateGet23(this, _attributeName),
|
|
9547
|
+
__privateGet23(this, _list, list_get).toString()
|
|
9354
9548
|
);
|
|
9355
9549
|
}
|
|
9356
9550
|
}
|
|
9357
9551
|
get booleanValue() {
|
|
9358
|
-
return
|
|
9359
|
-
|
|
9360
|
-
|
|
9552
|
+
return __privateGet23(this, _element).hasAttributeNS(
|
|
9553
|
+
__privateGet23(this, _namespaceURI),
|
|
9554
|
+
__privateGet23(this, _attributeName)
|
|
9361
9555
|
);
|
|
9362
9556
|
}
|
|
9363
9557
|
set booleanValue(value) {
|
|
9364
|
-
if (!
|
|
9558
|
+
if (!__privateGet23(this, _list, list_get) || __privateGet23(this, _list, list_get).length === 1)
|
|
9365
9559
|
this.value = value ? "" : null;
|
|
9366
9560
|
else
|
|
9367
9561
|
throw new DOMException("Value is not fully templatized");
|
|
@@ -9378,26 +9572,26 @@ list_get = function() {
|
|
|
9378
9572
|
var ChildNodePart = class extends Part {
|
|
9379
9573
|
constructor(parentNode, nodes) {
|
|
9380
9574
|
super();
|
|
9381
|
-
|
|
9382
|
-
|
|
9575
|
+
__privateAdd23(this, _parentNode, void 0);
|
|
9576
|
+
__privateAdd23(this, _nodes, void 0);
|
|
9383
9577
|
__privateSet20(this, _parentNode, parentNode);
|
|
9384
9578
|
__privateSet20(this, _nodes, nodes ? [...nodes] : [new Text()]);
|
|
9385
9579
|
}
|
|
9386
9580
|
get replacementNodes() {
|
|
9387
|
-
return
|
|
9581
|
+
return __privateGet23(this, _nodes);
|
|
9388
9582
|
}
|
|
9389
9583
|
get parentNode() {
|
|
9390
|
-
return
|
|
9584
|
+
return __privateGet23(this, _parentNode);
|
|
9391
9585
|
}
|
|
9392
9586
|
get nextSibling() {
|
|
9393
|
-
return
|
|
9587
|
+
return __privateGet23(this, _nodes)[__privateGet23(this, _nodes).length - 1].nextSibling;
|
|
9394
9588
|
}
|
|
9395
9589
|
get previousSibling() {
|
|
9396
|
-
return
|
|
9590
|
+
return __privateGet23(this, _nodes)[0].previousSibling;
|
|
9397
9591
|
}
|
|
9398
9592
|
// FIXME: not sure why do we need string serialization here? Just because parent class has type DOMString?
|
|
9399
9593
|
get value() {
|
|
9400
|
-
return
|
|
9594
|
+
return __privateGet23(this, _nodes).map((node) => node.textContent).join("");
|
|
9401
9595
|
}
|
|
9402
9596
|
set value(newValue) {
|
|
9403
9597
|
this.replace(newValue);
|
|
@@ -9409,8 +9603,8 @@ var ChildNodePart = class extends Part {
|
|
|
9409
9603
|
if (!normalisedNodes.length)
|
|
9410
9604
|
normalisedNodes.push(new Text());
|
|
9411
9605
|
__privateSet20(this, _nodes, swapdom(
|
|
9412
|
-
|
|
9413
|
-
|
|
9606
|
+
__privateGet23(this, _nodes)[0].parentNode,
|
|
9607
|
+
__privateGet23(this, _nodes),
|
|
9414
9608
|
normalisedNodes,
|
|
9415
9609
|
this.nextSibling
|
|
9416
9610
|
));
|
|
@@ -9687,35 +9881,37 @@ function tokenize2(str, parsers) {
|
|
|
9687
9881
|
}
|
|
9688
9882
|
|
|
9689
9883
|
// ../../node_modules/media-chrome/dist/media-theme-element.js
|
|
9690
|
-
var
|
|
9884
|
+
var __accessCheck24 = (obj, member, msg) => {
|
|
9691
9885
|
if (!member.has(obj))
|
|
9692
9886
|
throw TypeError("Cannot " + msg);
|
|
9693
9887
|
};
|
|
9694
|
-
var
|
|
9695
|
-
|
|
9888
|
+
var __privateGet24 = (obj, member, getter) => {
|
|
9889
|
+
__accessCheck24(obj, member, "read from private field");
|
|
9696
9890
|
return getter ? getter.call(obj) : member.get(obj);
|
|
9697
9891
|
};
|
|
9698
|
-
var
|
|
9892
|
+
var __privateAdd24 = (obj, member, value) => {
|
|
9699
9893
|
if (member.has(obj))
|
|
9700
9894
|
throw TypeError("Cannot add the same private member more than once");
|
|
9701
9895
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9702
9896
|
};
|
|
9703
9897
|
var __privateSet21 = (obj, member, value, setter) => {
|
|
9704
|
-
|
|
9898
|
+
__accessCheck24(obj, member, "write to private field");
|
|
9705
9899
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
9706
9900
|
return value;
|
|
9707
9901
|
};
|
|
9708
|
-
var
|
|
9709
|
-
|
|
9902
|
+
var __privateMethod8 = (obj, member, method) => {
|
|
9903
|
+
__accessCheck24(obj, member, "access private method");
|
|
9710
9904
|
return method;
|
|
9711
9905
|
};
|
|
9712
9906
|
var _template;
|
|
9713
9907
|
var _prevTemplate;
|
|
9714
9908
|
var _prevTemplateId;
|
|
9909
|
+
var _observer;
|
|
9715
9910
|
var _upgradeProperty;
|
|
9716
9911
|
var upgradeProperty_fn;
|
|
9717
9912
|
var _updateTemplate;
|
|
9718
9913
|
var updateTemplate_fn;
|
|
9914
|
+
var _renderBind;
|
|
9719
9915
|
var observedMediaAttributes = {
|
|
9720
9916
|
mediatargetlivewindow: "targetlivewindow",
|
|
9721
9917
|
mediastreamtype: "streamtype"
|
|
@@ -9753,18 +9949,20 @@ prependTemplate.innerHTML = /*html*/
|
|
|
9753
9949
|
var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
9754
9950
|
constructor() {
|
|
9755
9951
|
super();
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9952
|
+
__privateAdd24(this, _upgradeProperty);
|
|
9953
|
+
__privateAdd24(this, _updateTemplate);
|
|
9954
|
+
__privateAdd24(this, _template, void 0);
|
|
9955
|
+
__privateAdd24(this, _prevTemplate, void 0);
|
|
9956
|
+
__privateAdd24(this, _prevTemplateId, void 0);
|
|
9957
|
+
__privateAdd24(this, _observer, void 0);
|
|
9958
|
+
__privateAdd24(this, _renderBind, void 0);
|
|
9761
9959
|
if (this.shadowRoot) {
|
|
9762
9960
|
this.renderRoot = this.shadowRoot;
|
|
9763
9961
|
} else {
|
|
9764
9962
|
this.renderRoot = this.attachShadow({ mode: "open" });
|
|
9765
9963
|
this.createRenderer();
|
|
9766
9964
|
}
|
|
9767
|
-
|
|
9965
|
+
__privateSet21(this, _observer, new MutationObserver((mutationList) => {
|
|
9768
9966
|
var _a3;
|
|
9769
9967
|
if (this.mediaController && !((_a3 = this.mediaController) == null ? void 0 : _a3.breakpointsComputed))
|
|
9770
9968
|
return;
|
|
@@ -9782,17 +9980,9 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9782
9980
|
})) {
|
|
9783
9981
|
this.render();
|
|
9784
9982
|
}
|
|
9785
|
-
});
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
attributes: true,
|
|
9789
|
-
subtree: true
|
|
9790
|
-
});
|
|
9791
|
-
this.addEventListener(
|
|
9792
|
-
MediaStateChangeEvents.BREAKPOINTS_COMPUTED,
|
|
9793
|
-
this.render
|
|
9794
|
-
);
|
|
9795
|
-
__privateMethod7(this, _upgradeProperty, upgradeProperty_fn).call(this, "template");
|
|
9983
|
+
}));
|
|
9984
|
+
__privateSet21(this, _renderBind, this.render.bind(this));
|
|
9985
|
+
__privateMethod8(this, _upgradeProperty, upgradeProperty_fn).call(this, "template");
|
|
9796
9986
|
}
|
|
9797
9987
|
/** @type {HTMLElement & { breakpointsComputed?: boolean }} */
|
|
9798
9988
|
get mediaController() {
|
|
@@ -9800,7 +9990,7 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9800
9990
|
}
|
|
9801
9991
|
get template() {
|
|
9802
9992
|
var _a3;
|
|
9803
|
-
return (_a3 =
|
|
9993
|
+
return (_a3 = __privateGet24(this, _template)) != null ? _a3 : this.constructor.template;
|
|
9804
9994
|
}
|
|
9805
9995
|
set template(value) {
|
|
9806
9996
|
if (value === null) {
|
|
@@ -9842,14 +10032,30 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9842
10032
|
}
|
|
9843
10033
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
9844
10034
|
if (attrName === "template" && oldValue != newValue) {
|
|
9845
|
-
|
|
10035
|
+
__privateMethod8(this, _updateTemplate, updateTemplate_fn).call(this);
|
|
9846
10036
|
}
|
|
9847
10037
|
}
|
|
9848
10038
|
connectedCallback() {
|
|
9849
|
-
|
|
10039
|
+
this.addEventListener(
|
|
10040
|
+
MediaStateChangeEvents.BREAKPOINTS_COMPUTED,
|
|
10041
|
+
__privateGet24(this, _renderBind)
|
|
10042
|
+
);
|
|
10043
|
+
__privateGet24(this, _observer).observe(this, { attributes: true });
|
|
10044
|
+
__privateGet24(this, _observer).observe(this.renderRoot, {
|
|
10045
|
+
attributes: true,
|
|
10046
|
+
subtree: true
|
|
10047
|
+
});
|
|
10048
|
+
__privateMethod8(this, _updateTemplate, updateTemplate_fn).call(this);
|
|
10049
|
+
}
|
|
10050
|
+
disconnectedCallback() {
|
|
10051
|
+
this.removeEventListener(
|
|
10052
|
+
MediaStateChangeEvents.BREAKPOINTS_COMPUTED,
|
|
10053
|
+
__privateGet24(this, _renderBind)
|
|
10054
|
+
);
|
|
10055
|
+
__privateGet24(this, _observer).disconnect();
|
|
9850
10056
|
}
|
|
9851
10057
|
createRenderer() {
|
|
9852
|
-
if (this.template instanceof HTMLTemplateElement && this.template !==
|
|
10058
|
+
if (this.template instanceof HTMLTemplateElement && this.template !== __privateGet24(this, _prevTemplate)) {
|
|
9853
10059
|
__privateSet21(this, _prevTemplate, this.template);
|
|
9854
10060
|
this.renderer = new TemplateInstance(
|
|
9855
10061
|
this.template,
|
|
@@ -9872,6 +10078,7 @@ var MediaThemeElement = class extends GlobalThis.HTMLElement {
|
|
|
9872
10078
|
_template = /* @__PURE__ */ new WeakMap();
|
|
9873
10079
|
_prevTemplate = /* @__PURE__ */ new WeakMap();
|
|
9874
10080
|
_prevTemplateId = /* @__PURE__ */ new WeakMap();
|
|
10081
|
+
_observer = /* @__PURE__ */ new WeakMap();
|
|
9875
10082
|
_upgradeProperty = /* @__PURE__ */ new WeakSet();
|
|
9876
10083
|
upgradeProperty_fn = function(prop) {
|
|
9877
10084
|
if (Object.prototype.hasOwnProperty.call(this, prop)) {
|
|
@@ -9884,7 +10091,7 @@ _updateTemplate = /* @__PURE__ */ new WeakSet();
|
|
|
9884
10091
|
updateTemplate_fn = function() {
|
|
9885
10092
|
var _a3;
|
|
9886
10093
|
const templateId = this.getAttribute("template");
|
|
9887
|
-
if (!templateId || templateId ===
|
|
10094
|
+
if (!templateId || templateId === __privateGet24(this, _prevTemplateId))
|
|
9888
10095
|
return;
|
|
9889
10096
|
const rootNode = this.getRootNode();
|
|
9890
10097
|
const template2 = (_a3 = rootNode == null ? void 0 : rootNode.getElementById) == null ? void 0 : _a3.call(
|
|
@@ -9907,6 +10114,7 @@ updateTemplate_fn = function() {
|
|
|
9907
10114
|
}).catch(console.error);
|
|
9908
10115
|
}
|
|
9909
10116
|
};
|
|
10117
|
+
_renderBind = /* @__PURE__ */ new WeakMap();
|
|
9910
10118
|
MediaThemeElement.observedAttributes = ["template"];
|
|
9911
10119
|
MediaThemeElement.processor = processor;
|
|
9912
10120
|
function isValidUrl(url) {
|
|
@@ -10032,26 +10240,26 @@ var ToggleEvent = class extends Event {
|
|
|
10032
10240
|
};
|
|
10033
10241
|
|
|
10034
10242
|
// ../../node_modules/media-chrome/dist/menu/media-chrome-menu.js
|
|
10035
|
-
var
|
|
10243
|
+
var __accessCheck25 = (obj, member, msg) => {
|
|
10036
10244
|
if (!member.has(obj))
|
|
10037
10245
|
throw TypeError("Cannot " + msg);
|
|
10038
10246
|
};
|
|
10039
|
-
var
|
|
10040
|
-
|
|
10247
|
+
var __privateGet25 = (obj, member, getter) => {
|
|
10248
|
+
__accessCheck25(obj, member, "read from private field");
|
|
10041
10249
|
return getter ? getter.call(obj) : member.get(obj);
|
|
10042
10250
|
};
|
|
10043
|
-
var
|
|
10251
|
+
var __privateAdd25 = (obj, member, value) => {
|
|
10044
10252
|
if (member.has(obj))
|
|
10045
10253
|
throw TypeError("Cannot add the same private member more than once");
|
|
10046
10254
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10047
10255
|
};
|
|
10048
10256
|
var __privateSet22 = (obj, member, value, setter) => {
|
|
10049
|
-
|
|
10257
|
+
__accessCheck25(obj, member, "write to private field");
|
|
10050
10258
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
10051
10259
|
return value;
|
|
10052
10260
|
};
|
|
10053
|
-
var
|
|
10054
|
-
|
|
10261
|
+
var __privateMethod9 = (obj, member, method) => {
|
|
10262
|
+
__accessCheck25(obj, member, "access private method");
|
|
10055
10263
|
return method;
|
|
10056
10264
|
};
|
|
10057
10265
|
var _mediaController8;
|
|
@@ -10061,7 +10269,7 @@ var _previousItems;
|
|
|
10061
10269
|
var _mutationObserver2;
|
|
10062
10270
|
var _isPopover;
|
|
10063
10271
|
var _cssRule;
|
|
10064
|
-
var
|
|
10272
|
+
var _handleSlotChange2;
|
|
10065
10273
|
var handleSlotChange_fn;
|
|
10066
10274
|
var _toggleHeader;
|
|
10067
10275
|
var toggleHeader_fn;
|
|
@@ -10136,7 +10344,7 @@ function createIndicator(el, name) {
|
|
|
10136
10344
|
}
|
|
10137
10345
|
return "";
|
|
10138
10346
|
}
|
|
10139
|
-
function
|
|
10347
|
+
function getTemplateHTML12(_attrs) {
|
|
10140
10348
|
return (
|
|
10141
10349
|
/*html*/
|
|
10142
10350
|
`
|
|
@@ -10330,33 +10538,33 @@ var Attributes12 = {
|
|
|
10330
10538
|
var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
10331
10539
|
constructor() {
|
|
10332
10540
|
super();
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
const previousItems =
|
|
10541
|
+
__privateAdd25(this, _handleSlotChange2);
|
|
10542
|
+
__privateAdd25(this, _toggleHeader);
|
|
10543
|
+
__privateAdd25(this, _updateLayoutStyle);
|
|
10544
|
+
__privateAdd25(this, _handleInvoke2);
|
|
10545
|
+
__privateAdd25(this, _handleOpen2);
|
|
10546
|
+
__privateAdd25(this, _handleClosed2);
|
|
10547
|
+
__privateAdd25(this, _positionMenu);
|
|
10548
|
+
__privateAdd25(this, _resizeMenu);
|
|
10549
|
+
__privateAdd25(this, _handleClick);
|
|
10550
|
+
__privateAdd25(this, _backButtonElement);
|
|
10551
|
+
__privateAdd25(this, _handleToggle);
|
|
10552
|
+
__privateAdd25(this, _checkSubmenuHasExpanded);
|
|
10553
|
+
__privateAdd25(this, _handleFocusOut2);
|
|
10554
|
+
__privateAdd25(this, _handleKeyDown2);
|
|
10555
|
+
__privateAdd25(this, _getItem);
|
|
10556
|
+
__privateAdd25(this, _getTabItem);
|
|
10557
|
+
__privateAdd25(this, _setTabItem);
|
|
10558
|
+
__privateAdd25(this, _selectItem);
|
|
10559
|
+
__privateAdd25(this, _mediaController8, null);
|
|
10560
|
+
__privateAdd25(this, _previouslyFocused2, null);
|
|
10561
|
+
__privateAdd25(this, _invokerElement2, null);
|
|
10562
|
+
__privateAdd25(this, _previousItems, /* @__PURE__ */ new Set());
|
|
10563
|
+
__privateAdd25(this, _mutationObserver2, void 0);
|
|
10564
|
+
__privateAdd25(this, _isPopover, false);
|
|
10565
|
+
__privateAdd25(this, _cssRule, null);
|
|
10566
|
+
__privateAdd25(this, _handleMenuItems, () => {
|
|
10567
|
+
const previousItems = __privateGet25(this, _previousItems);
|
|
10360
10568
|
const currentItems = new Set(this.items);
|
|
10361
10569
|
for (const item of previousItems) {
|
|
10362
10570
|
if (!currentItems.has(item)) {
|
|
@@ -10370,12 +10578,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10370
10578
|
}
|
|
10371
10579
|
__privateSet22(this, _previousItems, currentItems);
|
|
10372
10580
|
});
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10581
|
+
__privateAdd25(this, _handleBoundsResize, () => {
|
|
10582
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this);
|
|
10583
|
+
__privateMethod9(this, _resizeMenu, resizeMenu_fn).call(this, false);
|
|
10376
10584
|
});
|
|
10377
|
-
|
|
10378
|
-
|
|
10585
|
+
__privateAdd25(this, _handleMenuResize, () => {
|
|
10586
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this);
|
|
10379
10587
|
});
|
|
10380
10588
|
if (!this.shadowRoot) {
|
|
10381
10589
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
@@ -10386,9 +10594,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10386
10594
|
this.defaultSlot = this.shadowRoot.querySelector(
|
|
10387
10595
|
"slot:not([name])"
|
|
10388
10596
|
);
|
|
10389
|
-
this
|
|
10390
|
-
__privateSet22(this, _mutationObserver2, new MutationObserver(__privateGet24(this, _handleMenuItems)));
|
|
10391
|
-
__privateGet24(this, _mutationObserver2).observe(this.defaultSlot, { childList: true });
|
|
10597
|
+
__privateSet22(this, _mutationObserver2, new MutationObserver(__privateGet25(this, _handleMenuItems)));
|
|
10392
10598
|
}
|
|
10393
10599
|
static get observedAttributes() {
|
|
10394
10600
|
return [
|
|
@@ -10419,29 +10625,30 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10419
10625
|
handleEvent(event) {
|
|
10420
10626
|
switch (event.type) {
|
|
10421
10627
|
case "slotchange":
|
|
10422
|
-
|
|
10628
|
+
__privateMethod9(this, _handleSlotChange2, handleSlotChange_fn).call(this, event);
|
|
10423
10629
|
break;
|
|
10424
10630
|
case "invoke":
|
|
10425
|
-
|
|
10631
|
+
__privateMethod9(this, _handleInvoke2, handleInvoke_fn2).call(this, event);
|
|
10426
10632
|
break;
|
|
10427
10633
|
case "click":
|
|
10428
|
-
|
|
10634
|
+
__privateMethod9(this, _handleClick, handleClick_fn).call(this, event);
|
|
10429
10635
|
break;
|
|
10430
10636
|
case "toggle":
|
|
10431
|
-
|
|
10637
|
+
__privateMethod9(this, _handleToggle, handleToggle_fn).call(this, event);
|
|
10432
10638
|
break;
|
|
10433
10639
|
case "focusout":
|
|
10434
|
-
|
|
10640
|
+
__privateMethod9(this, _handleFocusOut2, handleFocusOut_fn2).call(this, event);
|
|
10435
10641
|
break;
|
|
10436
10642
|
case "keydown":
|
|
10437
|
-
|
|
10643
|
+
__privateMethod9(this, _handleKeyDown2, handleKeyDown_fn2).call(this, event);
|
|
10438
10644
|
break;
|
|
10439
10645
|
}
|
|
10440
10646
|
}
|
|
10441
10647
|
connectedCallback() {
|
|
10442
10648
|
var _a3, _b2;
|
|
10649
|
+
__privateGet25(this, _mutationObserver2).observe(this.defaultSlot, { childList: true });
|
|
10443
10650
|
__privateSet22(this, _cssRule, insertCSSRule(this.shadowRoot, ":host"));
|
|
10444
|
-
|
|
10651
|
+
__privateMethod9(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
|
|
10445
10652
|
if (!this.hasAttribute("disabled")) {
|
|
10446
10653
|
this.enable();
|
|
10447
10654
|
}
|
|
@@ -10449,30 +10656,35 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10449
10656
|
this.role = "menu";
|
|
10450
10657
|
}
|
|
10451
10658
|
__privateSet22(this, _mediaController8, getAttributeMediaController(this));
|
|
10452
|
-
(_b2 = (_a3 =
|
|
10659
|
+
(_b2 = (_a3 = __privateGet25(this, _mediaController8)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
10453
10660
|
if (!this.hidden) {
|
|
10454
|
-
observeResize(getBoundsElement(this),
|
|
10455
|
-
observeResize(this,
|
|
10661
|
+
observeResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10662
|
+
observeResize(this, __privateGet25(this, _handleMenuResize));
|
|
10456
10663
|
}
|
|
10457
|
-
|
|
10664
|
+
__privateMethod9(this, _toggleHeader, toggleHeader_fn).call(this);
|
|
10665
|
+
this.shadowRoot.addEventListener("slotchange", this);
|
|
10458
10666
|
}
|
|
10459
10667
|
disconnectedCallback() {
|
|
10460
10668
|
var _a3, _b2;
|
|
10461
|
-
|
|
10462
|
-
unobserveResize(this,
|
|
10669
|
+
__privateGet25(this, _mutationObserver2).disconnect();
|
|
10670
|
+
unobserveResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10671
|
+
unobserveResize(this, __privateGet25(this, _handleMenuResize));
|
|
10463
10672
|
this.disable();
|
|
10464
|
-
(_b2 = (_a3 =
|
|
10673
|
+
(_b2 = (_a3 = __privateGet25(this, _mediaController8)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
10465
10674
|
__privateSet22(this, _mediaController8, null);
|
|
10675
|
+
__privateSet22(this, _previouslyFocused2, null);
|
|
10676
|
+
__privateSet22(this, _invokerElement2, null);
|
|
10677
|
+
this.shadowRoot.removeEventListener("slotchange", this);
|
|
10466
10678
|
}
|
|
10467
10679
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
10468
10680
|
var _a3, _b2, _c, _d;
|
|
10469
10681
|
if (attrName === Attributes12.HIDDEN && newValue !== oldValue) {
|
|
10470
|
-
if (!
|
|
10682
|
+
if (!__privateGet25(this, _isPopover))
|
|
10471
10683
|
__privateSet22(this, _isPopover, true);
|
|
10472
10684
|
if (this.hidden) {
|
|
10473
|
-
|
|
10685
|
+
__privateMethod9(this, _handleClosed2, handleClosed_fn2).call(this);
|
|
10474
10686
|
} else {
|
|
10475
|
-
|
|
10687
|
+
__privateMethod9(this, _handleOpen2, handleOpen_fn2).call(this);
|
|
10476
10688
|
}
|
|
10477
10689
|
this.dispatchEvent(
|
|
10478
10690
|
new ToggleEvent({
|
|
@@ -10483,12 +10695,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10483
10695
|
);
|
|
10484
10696
|
} else if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
|
|
10485
10697
|
if (oldValue) {
|
|
10486
|
-
(_b2 = (_a3 =
|
|
10698
|
+
(_b2 = (_a3 = __privateGet25(this, _mediaController8)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
|
|
10487
10699
|
__privateSet22(this, _mediaController8, null);
|
|
10488
10700
|
}
|
|
10489
10701
|
if (newValue && this.isConnected) {
|
|
10490
10702
|
__privateSet22(this, _mediaController8, getAttributeMediaController(this));
|
|
10491
|
-
(_d = (_c =
|
|
10703
|
+
(_d = (_c = __privateGet25(this, _mediaController8)) == null ? void 0 : _c.associateElement) == null ? void 0 : _d.call(_c, this);
|
|
10492
10704
|
}
|
|
10493
10705
|
} else if (attrName === Attributes12.DISABLED && newValue !== oldValue) {
|
|
10494
10706
|
if (newValue == null) {
|
|
@@ -10497,7 +10709,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10497
10709
|
this.disable();
|
|
10498
10710
|
}
|
|
10499
10711
|
} else if (attrName === Attributes12.STYLE && newValue !== oldValue) {
|
|
10500
|
-
|
|
10712
|
+
__privateMethod9(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
|
|
10501
10713
|
}
|
|
10502
10714
|
}
|
|
10503
10715
|
formatMenuItemText(text, data) {
|
|
@@ -10544,12 +10756,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10544
10756
|
const item = this.items.find((item2) => item2.value === newValue);
|
|
10545
10757
|
if (!item)
|
|
10546
10758
|
return;
|
|
10547
|
-
|
|
10759
|
+
__privateMethod9(this, _selectItem, selectItem_fn).call(this, item);
|
|
10548
10760
|
}
|
|
10549
10761
|
focus() {
|
|
10550
10762
|
__privateSet22(this, _previouslyFocused2, getActiveElement());
|
|
10551
10763
|
if (this.items.length) {
|
|
10552
|
-
|
|
10764
|
+
__privateMethod9(this, _setTabItem, setTabItem_fn).call(this, this.items[0]);
|
|
10553
10765
|
this.items[0].focus();
|
|
10554
10766
|
return;
|
|
10555
10767
|
}
|
|
@@ -10560,12 +10772,12 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10560
10772
|
}
|
|
10561
10773
|
handleSelect(event) {
|
|
10562
10774
|
var _a3;
|
|
10563
|
-
const item =
|
|
10775
|
+
const item = __privateMethod9(this, _getItem, getItem_fn).call(this, event);
|
|
10564
10776
|
if (!item)
|
|
10565
10777
|
return;
|
|
10566
|
-
|
|
10567
|
-
if (
|
|
10568
|
-
(_a3 =
|
|
10778
|
+
__privateMethod9(this, _selectItem, selectItem_fn).call(this, item, item.type === "checkbox");
|
|
10779
|
+
if (__privateGet25(this, _invokerElement2) && !this.hidden) {
|
|
10780
|
+
(_a3 = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
|
|
10569
10781
|
this.hidden = true;
|
|
10570
10782
|
}
|
|
10571
10783
|
}
|
|
@@ -10585,7 +10797,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10585
10797
|
var _a3, _b2;
|
|
10586
10798
|
const { key } = event;
|
|
10587
10799
|
const items = this.items;
|
|
10588
|
-
const currentItem = (_b2 = (_a3 =
|
|
10800
|
+
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];
|
|
10589
10801
|
const currentIndex = items.indexOf(currentItem);
|
|
10590
10802
|
let index = Math.max(0, currentIndex);
|
|
10591
10803
|
if (key === "ArrowDown") {
|
|
@@ -10603,7 +10815,7 @@ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
|
|
|
10603
10815
|
if (index > items.length - 1) {
|
|
10604
10816
|
index = 0;
|
|
10605
10817
|
}
|
|
10606
|
-
|
|
10818
|
+
__privateMethod9(this, _setTabItem, setTabItem_fn).call(this, items[index]);
|
|
10607
10819
|
items[index].focus();
|
|
10608
10820
|
}
|
|
10609
10821
|
};
|
|
@@ -10614,7 +10826,7 @@ _previousItems = /* @__PURE__ */ new WeakMap();
|
|
|
10614
10826
|
_mutationObserver2 = /* @__PURE__ */ new WeakMap();
|
|
10615
10827
|
_isPopover = /* @__PURE__ */ new WeakMap();
|
|
10616
10828
|
_cssRule = /* @__PURE__ */ new WeakMap();
|
|
10617
|
-
|
|
10829
|
+
_handleSlotChange2 = /* @__PURE__ */ new WeakSet();
|
|
10618
10830
|
handleSlotChange_fn = function(event) {
|
|
10619
10831
|
const slot = event.target;
|
|
10620
10832
|
for (const node of slot.assignedNodes({ flatten: true })) {
|
|
@@ -10623,10 +10835,10 @@ handleSlotChange_fn = function(event) {
|
|
|
10623
10835
|
}
|
|
10624
10836
|
}
|
|
10625
10837
|
if (["header", "title"].includes(slot.name)) {
|
|
10626
|
-
|
|
10838
|
+
__privateMethod9(this, _toggleHeader, toggleHeader_fn).call(this);
|
|
10627
10839
|
}
|
|
10628
10840
|
if (!slot.name) {
|
|
10629
|
-
|
|
10841
|
+
__privateGet25(this, _handleMenuItems).call(this);
|
|
10630
10842
|
}
|
|
10631
10843
|
};
|
|
10632
10844
|
_toggleHeader = /* @__PURE__ */ new WeakSet();
|
|
@@ -10657,17 +10869,17 @@ handleInvoke_fn2 = function(event) {
|
|
|
10657
10869
|
_handleOpen2 = /* @__PURE__ */ new WeakSet();
|
|
10658
10870
|
handleOpen_fn2 = function() {
|
|
10659
10871
|
var _a3;
|
|
10660
|
-
(_a3 =
|
|
10872
|
+
(_a3 = __privateGet25(this, _invokerElement2)) == null ? void 0 : _a3.setAttribute("aria-expanded", "true");
|
|
10661
10873
|
this.addEventListener("transitionend", () => this.focus(), { once: true });
|
|
10662
|
-
observeResize(getBoundsElement(this),
|
|
10663
|
-
observeResize(this,
|
|
10874
|
+
observeResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10875
|
+
observeResize(this, __privateGet25(this, _handleMenuResize));
|
|
10664
10876
|
};
|
|
10665
10877
|
_handleClosed2 = /* @__PURE__ */ new WeakSet();
|
|
10666
10878
|
handleClosed_fn2 = function() {
|
|
10667
10879
|
var _a3;
|
|
10668
|
-
(_a3 =
|
|
10669
|
-
unobserveResize(getBoundsElement(this),
|
|
10670
|
-
unobserveResize(this,
|
|
10880
|
+
(_a3 = __privateGet25(this, _invokerElement2)) == null ? void 0 : _a3.setAttribute("aria-expanded", "false");
|
|
10881
|
+
unobserveResize(getBoundsElement(this), __privateGet25(this, _handleBoundsResize));
|
|
10882
|
+
unobserveResize(this, __privateGet25(this, _handleMenuResize));
|
|
10671
10883
|
};
|
|
10672
10884
|
_handleBoundsResize = /* @__PURE__ */ new WeakMap();
|
|
10673
10885
|
_handleMenuResize = /* @__PURE__ */ new WeakMap();
|
|
@@ -10687,7 +10899,7 @@ positionMenu_fn = function(menuWidth) {
|
|
|
10687
10899
|
const boundsRect = bounds.getBoundingClientRect();
|
|
10688
10900
|
const right = boundsRect.width - x - menuWidth;
|
|
10689
10901
|
const bottom = boundsRect.height - y - this.offsetHeight;
|
|
10690
|
-
const { style } =
|
|
10902
|
+
const { style } = __privateGet25(this, _cssRule);
|
|
10691
10903
|
style.setProperty("position", "absolute");
|
|
10692
10904
|
style.setProperty("right", `${Math.max(0, right)}px`);
|
|
10693
10905
|
style.setProperty("--_menu-bottom", `${bottom}px`);
|
|
@@ -10705,7 +10917,7 @@ resizeMenu_fn = function(animate) {
|
|
|
10705
10917
|
const expandedSubmenu = expandedMenuItem == null ? void 0 : expandedMenuItem.querySelector(
|
|
10706
10918
|
'[role="menu"]'
|
|
10707
10919
|
);
|
|
10708
|
-
const { style } =
|
|
10920
|
+
const { style } = __privateGet25(this, _cssRule);
|
|
10709
10921
|
if (!animate) {
|
|
10710
10922
|
style.setProperty("--media-menu-transition-in", "none");
|
|
10711
10923
|
}
|
|
@@ -10717,11 +10929,11 @@ resizeMenu_fn = function(animate) {
|
|
|
10717
10929
|
);
|
|
10718
10930
|
this.style.setProperty("min-width", `${width}px`);
|
|
10719
10931
|
this.style.setProperty("min-height", `${height}px`);
|
|
10720
|
-
|
|
10932
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this, width);
|
|
10721
10933
|
} else {
|
|
10722
10934
|
this.style.removeProperty("min-width");
|
|
10723
10935
|
this.style.removeProperty("min-height");
|
|
10724
|
-
|
|
10936
|
+
__privateMethod9(this, _positionMenu, positionMenu_fn).call(this);
|
|
10725
10937
|
}
|
|
10726
10938
|
style.removeProperty("--media-menu-transition-in");
|
|
10727
10939
|
};
|
|
@@ -10729,15 +10941,15 @@ _handleClick = /* @__PURE__ */ new WeakSet();
|
|
|
10729
10941
|
handleClick_fn = function(event) {
|
|
10730
10942
|
var _a3;
|
|
10731
10943
|
event.stopPropagation();
|
|
10732
|
-
if (event.composedPath().includes(
|
|
10733
|
-
(_a3 =
|
|
10944
|
+
if (event.composedPath().includes(__privateGet25(this, _backButtonElement, backButtonElement_get))) {
|
|
10945
|
+
(_a3 = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
|
|
10734
10946
|
this.hidden = true;
|
|
10735
10947
|
return;
|
|
10736
10948
|
}
|
|
10737
|
-
const item =
|
|
10949
|
+
const item = __privateMethod9(this, _getItem, getItem_fn).call(this, event);
|
|
10738
10950
|
if (!item || item.hasAttribute("disabled"))
|
|
10739
10951
|
return;
|
|
10740
|
-
|
|
10952
|
+
__privateMethod9(this, _setTabItem, setTabItem_fn).call(this, item);
|
|
10741
10953
|
this.handleSelect(event);
|
|
10742
10954
|
};
|
|
10743
10955
|
_backButtonElement = /* @__PURE__ */ new WeakSet();
|
|
@@ -10752,7 +10964,7 @@ _handleToggle = /* @__PURE__ */ new WeakSet();
|
|
|
10752
10964
|
handleToggle_fn = function(event) {
|
|
10753
10965
|
if (event.target === this)
|
|
10754
10966
|
return;
|
|
10755
|
-
|
|
10967
|
+
__privateMethod9(this, _checkSubmenuHasExpanded, checkSubmenuHasExpanded_fn).call(this);
|
|
10756
10968
|
const menuItemsWithSubmenu = Array.from(
|
|
10757
10969
|
this.querySelectorAll('[role="menuitem"][aria-haspopup]')
|
|
10758
10970
|
);
|
|
@@ -10768,7 +10980,7 @@ handleToggle_fn = function(event) {
|
|
|
10768
10980
|
for (const item of menuItemsWithSubmenu) {
|
|
10769
10981
|
item.setAttribute("aria-expanded", `${!item.submenuElement.hidden}`);
|
|
10770
10982
|
}
|
|
10771
|
-
|
|
10983
|
+
__privateMethod9(this, _resizeMenu, resizeMenu_fn).call(this, true);
|
|
10772
10984
|
};
|
|
10773
10985
|
_checkSubmenuHasExpanded = /* @__PURE__ */ new WeakSet();
|
|
10774
10986
|
checkSubmenuHasExpanded_fn = function() {
|
|
@@ -10780,10 +10992,10 @@ _handleFocusOut2 = /* @__PURE__ */ new WeakSet();
|
|
|
10780
10992
|
handleFocusOut_fn2 = function(event) {
|
|
10781
10993
|
var _a3;
|
|
10782
10994
|
if (!containsComposedNode(this, event.relatedTarget)) {
|
|
10783
|
-
if (
|
|
10784
|
-
(_a3 =
|
|
10995
|
+
if (__privateGet25(this, _isPopover)) {
|
|
10996
|
+
(_a3 = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _a3.focus();
|
|
10785
10997
|
}
|
|
10786
|
-
if (
|
|
10998
|
+
if (__privateGet25(this, _invokerElement2) && __privateGet25(this, _invokerElement2) !== event.relatedTarget && !this.hidden) {
|
|
10787
10999
|
this.hidden = true;
|
|
10788
11000
|
}
|
|
10789
11001
|
}
|
|
@@ -10801,7 +11013,7 @@ handleKeyDown_fn2 = function(event) {
|
|
|
10801
11013
|
event.preventDefault();
|
|
10802
11014
|
event.stopPropagation();
|
|
10803
11015
|
if (key === "Tab") {
|
|
10804
|
-
if (
|
|
11016
|
+
if (__privateGet25(this, _isPopover)) {
|
|
10805
11017
|
this.hidden = true;
|
|
10806
11018
|
return;
|
|
10807
11019
|
}
|
|
@@ -10812,8 +11024,8 @@ handleKeyDown_fn2 = function(event) {
|
|
|
10812
11024
|
}
|
|
10813
11025
|
this.blur();
|
|
10814
11026
|
} else if (key === "Escape") {
|
|
10815
|
-
(_e =
|
|
10816
|
-
if (
|
|
11027
|
+
(_e = __privateGet25(this, _previouslyFocused2)) == null ? void 0 : _e.focus();
|
|
11028
|
+
if (__privateGet25(this, _isPopover)) {
|
|
10817
11029
|
this.hidden = true;
|
|
10818
11030
|
}
|
|
10819
11031
|
} else if (key === "Enter" || key === " ") {
|
|
@@ -10858,7 +11070,7 @@ selectItem_fn = function(item, toggle) {
|
|
|
10858
11070
|
}
|
|
10859
11071
|
};
|
|
10860
11072
|
MediaChromeMenu.shadowRootOptions = { mode: "open" };
|
|
10861
|
-
MediaChromeMenu.getTemplateHTML =
|
|
11073
|
+
MediaChromeMenu.getTemplateHTML = getTemplateHTML12;
|
|
10862
11074
|
function isMenuItem(element) {
|
|
10863
11075
|
return ["menuitem", "menuitemradio", "menuitemcheckbox"].includes(
|
|
10864
11076
|
element == null ? void 0 : element.role
|
|
@@ -10873,31 +11085,31 @@ if (!GlobalThis.customElements.get("media-chrome-menu")) {
|
|
|
10873
11085
|
}
|
|
10874
11086
|
|
|
10875
11087
|
// ../../node_modules/media-chrome/dist/menu/media-chrome-menu-item.js
|
|
10876
|
-
var
|
|
11088
|
+
var __accessCheck26 = (obj, member, msg) => {
|
|
10877
11089
|
if (!member.has(obj))
|
|
10878
11090
|
throw TypeError("Cannot " + msg);
|
|
10879
11091
|
};
|
|
10880
|
-
var
|
|
10881
|
-
|
|
11092
|
+
var __privateGet26 = (obj, member, getter) => {
|
|
11093
|
+
__accessCheck26(obj, member, "read from private field");
|
|
10882
11094
|
return getter ? getter.call(obj) : member.get(obj);
|
|
10883
11095
|
};
|
|
10884
|
-
var
|
|
11096
|
+
var __privateAdd26 = (obj, member, value) => {
|
|
10885
11097
|
if (member.has(obj))
|
|
10886
11098
|
throw TypeError("Cannot add the same private member more than once");
|
|
10887
11099
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10888
11100
|
};
|
|
10889
11101
|
var __privateSet23 = (obj, member, value, setter) => {
|
|
10890
|
-
|
|
11102
|
+
__accessCheck26(obj, member, "write to private field");
|
|
10891
11103
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
10892
11104
|
return value;
|
|
10893
11105
|
};
|
|
10894
|
-
var
|
|
10895
|
-
|
|
11106
|
+
var __privateMethod10 = (obj, member, method) => {
|
|
11107
|
+
__accessCheck26(obj, member, "access private method");
|
|
10896
11108
|
return method;
|
|
10897
11109
|
};
|
|
10898
11110
|
var _dirty;
|
|
10899
11111
|
var _ownerElement;
|
|
10900
|
-
var
|
|
11112
|
+
var _handleSlotChange3;
|
|
10901
11113
|
var handleSlotChange_fn2;
|
|
10902
11114
|
var _submenuConnected;
|
|
10903
11115
|
var submenuConnected_fn;
|
|
@@ -10905,12 +11117,10 @@ var _submenuDisconnected;
|
|
|
10905
11117
|
var submenuDisconnected_fn;
|
|
10906
11118
|
var _handleMenuItem;
|
|
10907
11119
|
var _handleKeyUp;
|
|
10908
|
-
var handleKeyUp_fn;
|
|
10909
11120
|
var _handleKeyDown3;
|
|
10910
|
-
var handleKeyDown_fn3;
|
|
10911
11121
|
var _reset;
|
|
10912
11122
|
var reset_fn;
|
|
10913
|
-
function
|
|
11123
|
+
function getTemplateHTML13(_attrs) {
|
|
10914
11124
|
return (
|
|
10915
11125
|
/*html*/
|
|
10916
11126
|
`
|
|
@@ -11048,15 +11258,13 @@ var Attributes13 = {
|
|
|
11048
11258
|
var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
11049
11259
|
constructor() {
|
|
11050
11260
|
super();
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
__privateAdd25(this, _ownerElement, void 0);
|
|
11059
|
-
__privateAdd25(this, _handleMenuItem, () => {
|
|
11261
|
+
__privateAdd26(this, _handleSlotChange3);
|
|
11262
|
+
__privateAdd26(this, _submenuConnected);
|
|
11263
|
+
__privateAdd26(this, _submenuDisconnected);
|
|
11264
|
+
__privateAdd26(this, _reset);
|
|
11265
|
+
__privateAdd26(this, _dirty, false);
|
|
11266
|
+
__privateAdd26(this, _ownerElement, void 0);
|
|
11267
|
+
__privateAdd26(this, _handleMenuItem, () => {
|
|
11060
11268
|
var _a3, _b2;
|
|
11061
11269
|
if (this.submenuElement.items) {
|
|
11062
11270
|
this.setAttribute("submenusize", `${this.submenuElement.items.length}`);
|
|
@@ -11070,12 +11278,27 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11070
11278
|
span.textContent = description != null ? description : "";
|
|
11071
11279
|
descriptionSlot.replaceChildren(span);
|
|
11072
11280
|
});
|
|
11281
|
+
__privateAdd26(this, _handleKeyUp, (event) => {
|
|
11282
|
+
const { key } = event;
|
|
11283
|
+
if (!this.keysUsed.includes(key)) {
|
|
11284
|
+
this.removeEventListener("keyup", __privateGet26(this, _handleKeyUp));
|
|
11285
|
+
return;
|
|
11286
|
+
}
|
|
11287
|
+
this.handleClick(event);
|
|
11288
|
+
});
|
|
11289
|
+
__privateAdd26(this, _handleKeyDown3, (event) => {
|
|
11290
|
+
const { metaKey, altKey, key } = event;
|
|
11291
|
+
if (metaKey || altKey || !this.keysUsed.includes(key)) {
|
|
11292
|
+
this.removeEventListener("keyup", __privateGet26(this, _handleKeyUp));
|
|
11293
|
+
return;
|
|
11294
|
+
}
|
|
11295
|
+
this.addEventListener("keyup", __privateGet26(this, _handleKeyUp), { once: true });
|
|
11296
|
+
});
|
|
11073
11297
|
if (!this.shadowRoot) {
|
|
11074
11298
|
this.attachShadow(this.constructor.shadowRootOptions);
|
|
11075
11299
|
const attrs = namedNodeMapToObject(this.attributes);
|
|
11076
11300
|
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(attrs);
|
|
11077
11301
|
}
|
|
11078
|
-
this.shadowRoot.addEventListener("slotchange", this);
|
|
11079
11302
|
}
|
|
11080
11303
|
static get observedAttributes() {
|
|
11081
11304
|
return [
|
|
@@ -11104,21 +11327,21 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11104
11327
|
handleEvent(event) {
|
|
11105
11328
|
switch (event.type) {
|
|
11106
11329
|
case "slotchange":
|
|
11107
|
-
|
|
11330
|
+
__privateMethod10(this, _handleSlotChange3, handleSlotChange_fn2).call(this, event);
|
|
11108
11331
|
break;
|
|
11109
11332
|
case "click":
|
|
11110
11333
|
this.handleClick(event);
|
|
11111
11334
|
break;
|
|
11112
11335
|
case "keydown":
|
|
11113
|
-
|
|
11336
|
+
__privateGet26(this, _handleKeyDown3).call(this, event);
|
|
11114
11337
|
break;
|
|
11115
11338
|
case "keyup":
|
|
11116
|
-
|
|
11339
|
+
__privateGet26(this, _handleKeyUp).call(this, event);
|
|
11117
11340
|
break;
|
|
11118
11341
|
}
|
|
11119
11342
|
}
|
|
11120
11343
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
11121
|
-
if (attrName === Attributes13.CHECKED && isCheckable(this) && !
|
|
11344
|
+
if (attrName === Attributes13.CHECKED && isCheckable(this) && !__privateGet26(this, _dirty)) {
|
|
11122
11345
|
this.setAttribute("aria-checked", newValue != null ? "true" : "false");
|
|
11123
11346
|
} else if (attrName === Attributes13.TYPE && newValue !== oldValue) {
|
|
11124
11347
|
this.role = "menuitem" + newValue;
|
|
@@ -11136,15 +11359,17 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11136
11359
|
}
|
|
11137
11360
|
this.role = "menuitem" + this.type;
|
|
11138
11361
|
__privateSet23(this, _ownerElement, closestMenuItemsContainer(this, this.parentNode));
|
|
11139
|
-
|
|
11362
|
+
__privateMethod10(this, _reset, reset_fn).call(this);
|
|
11140
11363
|
if (this.submenuElement) {
|
|
11141
|
-
|
|
11364
|
+
__privateMethod10(this, _submenuConnected, submenuConnected_fn).call(this);
|
|
11142
11365
|
}
|
|
11366
|
+
this.shadowRoot.addEventListener("slotchange", this);
|
|
11143
11367
|
}
|
|
11144
11368
|
disconnectedCallback() {
|
|
11145
11369
|
this.disable();
|
|
11146
|
-
|
|
11370
|
+
__privateMethod10(this, _reset, reset_fn).call(this);
|
|
11147
11371
|
__privateSet23(this, _ownerElement, null);
|
|
11372
|
+
this.shadowRoot.removeEventListener("slotchange", this);
|
|
11148
11373
|
}
|
|
11149
11374
|
get invokeTarget() {
|
|
11150
11375
|
return this.getAttribute("invoketarget");
|
|
@@ -11225,7 +11450,7 @@ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
|
|
|
11225
11450
|
};
|
|
11226
11451
|
_dirty = /* @__PURE__ */ new WeakMap();
|
|
11227
11452
|
_ownerElement = /* @__PURE__ */ new WeakMap();
|
|
11228
|
-
|
|
11453
|
+
_handleSlotChange3 = /* @__PURE__ */ new WeakSet();
|
|
11229
11454
|
handleSlotChange_fn2 = function(event) {
|
|
11230
11455
|
const slot = event.target;
|
|
11231
11456
|
const isDefaultSlot = !(slot == null ? void 0 : slot.name);
|
|
@@ -11238,9 +11463,9 @@ handleSlotChange_fn2 = function(event) {
|
|
|
11238
11463
|
}
|
|
11239
11464
|
if (slot.name === "submenu") {
|
|
11240
11465
|
if (this.submenuElement) {
|
|
11241
|
-
|
|
11466
|
+
__privateMethod10(this, _submenuConnected, submenuConnected_fn).call(this);
|
|
11242
11467
|
} else {
|
|
11243
|
-
|
|
11468
|
+
__privateMethod10(this, _submenuDisconnected, submenuDisconnected_fn).call(this);
|
|
11244
11469
|
}
|
|
11245
11470
|
}
|
|
11246
11471
|
};
|
|
@@ -11248,52 +11473,36 @@ _submenuConnected = /* @__PURE__ */ new WeakSet();
|
|
|
11248
11473
|
submenuConnected_fn = async function() {
|
|
11249
11474
|
this.setAttribute("aria-haspopup", "menu");
|
|
11250
11475
|
this.setAttribute("aria-expanded", `${!this.submenuElement.hidden}`);
|
|
11251
|
-
this.submenuElement.addEventListener("change",
|
|
11252
|
-
this.submenuElement.addEventListener("addmenuitem",
|
|
11476
|
+
this.submenuElement.addEventListener("change", __privateGet26(this, _handleMenuItem));
|
|
11477
|
+
this.submenuElement.addEventListener("addmenuitem", __privateGet26(this, _handleMenuItem));
|
|
11253
11478
|
this.submenuElement.addEventListener(
|
|
11254
11479
|
"removemenuitem",
|
|
11255
|
-
|
|
11480
|
+
__privateGet26(this, _handleMenuItem)
|
|
11256
11481
|
);
|
|
11257
|
-
|
|
11482
|
+
__privateGet26(this, _handleMenuItem).call(this);
|
|
11258
11483
|
};
|
|
11259
11484
|
_submenuDisconnected = /* @__PURE__ */ new WeakSet();
|
|
11260
11485
|
submenuDisconnected_fn = function() {
|
|
11261
11486
|
this.removeAttribute("aria-haspopup");
|
|
11262
11487
|
this.removeAttribute("aria-expanded");
|
|
11263
|
-
this.submenuElement.removeEventListener("change",
|
|
11488
|
+
this.submenuElement.removeEventListener("change", __privateGet26(this, _handleMenuItem));
|
|
11264
11489
|
this.submenuElement.removeEventListener(
|
|
11265
11490
|
"addmenuitem",
|
|
11266
|
-
|
|
11491
|
+
__privateGet26(this, _handleMenuItem)
|
|
11267
11492
|
);
|
|
11268
11493
|
this.submenuElement.removeEventListener(
|
|
11269
11494
|
"removemenuitem",
|
|
11270
|
-
|
|
11495
|
+
__privateGet26(this, _handleMenuItem)
|
|
11271
11496
|
);
|
|
11272
|
-
|
|
11497
|
+
__privateGet26(this, _handleMenuItem).call(this);
|
|
11273
11498
|
};
|
|
11274
11499
|
_handleMenuItem = /* @__PURE__ */ new WeakMap();
|
|
11275
|
-
_handleKeyUp = /* @__PURE__ */ new
|
|
11276
|
-
|
|
11277
|
-
const { key } = event;
|
|
11278
|
-
if (!this.keysUsed.includes(key)) {
|
|
11279
|
-
this.removeEventListener("keyup", __privateMethod9(this, _handleKeyUp, handleKeyUp_fn));
|
|
11280
|
-
return;
|
|
11281
|
-
}
|
|
11282
|
-
this.handleClick(event);
|
|
11283
|
-
};
|
|
11284
|
-
_handleKeyDown3 = /* @__PURE__ */ new WeakSet();
|
|
11285
|
-
handleKeyDown_fn3 = function(event) {
|
|
11286
|
-
const { metaKey, altKey, key } = event;
|
|
11287
|
-
if (metaKey || altKey || !this.keysUsed.includes(key)) {
|
|
11288
|
-
this.removeEventListener("keyup", __privateMethod9(this, _handleKeyUp, handleKeyUp_fn));
|
|
11289
|
-
return;
|
|
11290
|
-
}
|
|
11291
|
-
this.addEventListener("keyup", __privateMethod9(this, _handleKeyUp, handleKeyUp_fn), { once: true });
|
|
11292
|
-
};
|
|
11500
|
+
_handleKeyUp = /* @__PURE__ */ new WeakMap();
|
|
11501
|
+
_handleKeyDown3 = /* @__PURE__ */ new WeakMap();
|
|
11293
11502
|
_reset = /* @__PURE__ */ new WeakSet();
|
|
11294
11503
|
reset_fn = function() {
|
|
11295
11504
|
var _a3;
|
|
11296
|
-
const items = (_a3 =
|
|
11505
|
+
const items = (_a3 = __privateGet26(this, _ownerElement)) == null ? void 0 : _a3.radioGroupItems;
|
|
11297
11506
|
if (!items)
|
|
11298
11507
|
return;
|
|
11299
11508
|
let checkedItem = items.filter((item) => item.getAttribute("aria-checked") === "true").pop();
|
|
@@ -11305,7 +11514,7 @@ reset_fn = function() {
|
|
|
11305
11514
|
checkedItem == null ? void 0 : checkedItem.setAttribute("aria-checked", "true");
|
|
11306
11515
|
};
|
|
11307
11516
|
MediaChromeMenuItem.shadowRootOptions = { mode: "open" };
|
|
11308
|
-
MediaChromeMenuItem.getTemplateHTML =
|
|
11517
|
+
MediaChromeMenuItem.getTemplateHTML = getTemplateHTML13;
|
|
11309
11518
|
MediaChromeMenuItem.getSuffixSlotInnerHTML = getSuffixSlotInnerHTML;
|
|
11310
11519
|
function isCheckable(item) {
|
|
11311
11520
|
return item.type === "radio" || item.type === "checkbox";
|
|
@@ -11328,7 +11537,7 @@ if (!GlobalThis.customElements.get("media-chrome-menu-item")) {
|
|
|
11328
11537
|
}
|
|
11329
11538
|
|
|
11330
11539
|
// ../../node_modules/media-chrome/dist/menu/media-settings-menu.js
|
|
11331
|
-
function
|
|
11540
|
+
function getTemplateHTML14(_attrs) {
|
|
11332
11541
|
return (
|
|
11333
11542
|
/*html*/
|
|
11334
11543
|
`
|
|
@@ -11382,13 +11591,13 @@ var MediaSettingsMenu = class extends MediaChromeMenu {
|
|
|
11382
11591
|
);
|
|
11383
11592
|
}
|
|
11384
11593
|
};
|
|
11385
|
-
MediaSettingsMenu.getTemplateHTML =
|
|
11594
|
+
MediaSettingsMenu.getTemplateHTML = getTemplateHTML14;
|
|
11386
11595
|
if (!GlobalThis.customElements.get("media-settings-menu")) {
|
|
11387
11596
|
GlobalThis.customElements.define("media-settings-menu", MediaSettingsMenu);
|
|
11388
11597
|
}
|
|
11389
11598
|
|
|
11390
11599
|
// ../../node_modules/media-chrome/dist/menu/media-settings-menu-item.js
|
|
11391
|
-
function
|
|
11600
|
+
function getTemplateHTML15(_attrs) {
|
|
11392
11601
|
return (
|
|
11393
11602
|
/*html*/
|
|
11394
11603
|
`
|
|
@@ -11418,7 +11627,7 @@ function getSuffixSlotInnerHTML2(_attrs) {
|
|
|
11418
11627
|
var MediaSettingsMenuItem = class extends MediaChromeMenuItem {
|
|
11419
11628
|
};
|
|
11420
11629
|
MediaSettingsMenuItem.shadowRootOptions = { mode: "open" };
|
|
11421
|
-
MediaSettingsMenuItem.getTemplateHTML =
|
|
11630
|
+
MediaSettingsMenuItem.getTemplateHTML = getTemplateHTML15;
|
|
11422
11631
|
MediaSettingsMenuItem.getSuffixSlotInnerHTML = getSuffixSlotInnerHTML2;
|
|
11423
11632
|
if (!GlobalThis.customElements.get("media-settings-menu-item")) {
|
|
11424
11633
|
GlobalThis.customElements.define(
|
|
@@ -11517,26 +11726,26 @@ if (!GlobalThis.customElements.get("media-settings-menu-button")) {
|
|
|
11517
11726
|
}
|
|
11518
11727
|
|
|
11519
11728
|
// ../../node_modules/media-chrome/dist/menu/media-audio-track-menu.js
|
|
11520
|
-
var
|
|
11729
|
+
var __accessCheck27 = (obj, member, msg) => {
|
|
11521
11730
|
if (!member.has(obj))
|
|
11522
11731
|
throw TypeError("Cannot " + msg);
|
|
11523
11732
|
};
|
|
11524
|
-
var
|
|
11525
|
-
|
|
11733
|
+
var __privateGet27 = (obj, member, getter) => {
|
|
11734
|
+
__accessCheck27(obj, member, "read from private field");
|
|
11526
11735
|
return getter ? getter.call(obj) : member.get(obj);
|
|
11527
11736
|
};
|
|
11528
|
-
var
|
|
11737
|
+
var __privateAdd27 = (obj, member, value) => {
|
|
11529
11738
|
if (member.has(obj))
|
|
11530
11739
|
throw TypeError("Cannot add the same private member more than once");
|
|
11531
11740
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
11532
11741
|
};
|
|
11533
11742
|
var __privateSet24 = (obj, member, value, setter) => {
|
|
11534
|
-
|
|
11743
|
+
__accessCheck27(obj, member, "write to private field");
|
|
11535
11744
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
11536
11745
|
return value;
|
|
11537
11746
|
};
|
|
11538
|
-
var
|
|
11539
|
-
|
|
11747
|
+
var __privateMethod11 = (obj, member, method) => {
|
|
11748
|
+
__accessCheck27(obj, member, "access private method");
|
|
11540
11749
|
return method;
|
|
11541
11750
|
};
|
|
11542
11751
|
var _audioTrackList;
|
|
@@ -11548,10 +11757,10 @@ var onChange_fn;
|
|
|
11548
11757
|
var MediaAudioTrackMenu = class extends MediaChromeMenu {
|
|
11549
11758
|
constructor() {
|
|
11550
11759
|
super(...arguments);
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11760
|
+
__privateAdd27(this, _render);
|
|
11761
|
+
__privateAdd27(this, _onChange);
|
|
11762
|
+
__privateAdd27(this, _audioTrackList, []);
|
|
11763
|
+
__privateAdd27(this, _prevState, void 0);
|
|
11555
11764
|
}
|
|
11556
11765
|
static get observedAttributes() {
|
|
11557
11766
|
return [
|
|
@@ -11567,16 +11776,16 @@ var MediaAudioTrackMenu = class extends MediaChromeMenu {
|
|
|
11567
11776
|
this.value = newValue;
|
|
11568
11777
|
} else if (attrName === MediaUIAttributes.MEDIA_AUDIO_TRACK_LIST && oldValue !== newValue) {
|
|
11569
11778
|
__privateSet24(this, _audioTrackList, parseAudioTrackList(newValue != null ? newValue : ""));
|
|
11570
|
-
|
|
11779
|
+
__privateMethod11(this, _render, render_fn).call(this);
|
|
11571
11780
|
}
|
|
11572
11781
|
}
|
|
11573
11782
|
connectedCallback() {
|
|
11574
11783
|
super.connectedCallback();
|
|
11575
|
-
this.addEventListener("change",
|
|
11784
|
+
this.addEventListener("change", __privateMethod11(this, _onChange, onChange_fn));
|
|
11576
11785
|
}
|
|
11577
11786
|
disconnectedCallback() {
|
|
11578
11787
|
super.disconnectedCallback();
|
|
11579
|
-
this.removeEventListener("change",
|
|
11788
|
+
this.removeEventListener("change", __privateMethod11(this, _onChange, onChange_fn));
|
|
11580
11789
|
}
|
|
11581
11790
|
/**
|
|
11582
11791
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -11590,11 +11799,11 @@ var MediaAudioTrackMenu = class extends MediaChromeMenu {
|
|
|
11590
11799
|
);
|
|
11591
11800
|
}
|
|
11592
11801
|
get mediaAudioTrackList() {
|
|
11593
|
-
return
|
|
11802
|
+
return __privateGet27(this, _audioTrackList);
|
|
11594
11803
|
}
|
|
11595
11804
|
set mediaAudioTrackList(list) {
|
|
11596
11805
|
__privateSet24(this, _audioTrackList, list);
|
|
11597
|
-
|
|
11806
|
+
__privateMethod11(this, _render, render_fn).call(this);
|
|
11598
11807
|
}
|
|
11599
11808
|
/**
|
|
11600
11809
|
* Get enabled audio track id.
|
|
@@ -11611,7 +11820,7 @@ _audioTrackList = /* @__PURE__ */ new WeakMap();
|
|
|
11611
11820
|
_prevState = /* @__PURE__ */ new WeakMap();
|
|
11612
11821
|
_render = /* @__PURE__ */ new WeakSet();
|
|
11613
11822
|
render_fn = function() {
|
|
11614
|
-
if (
|
|
11823
|
+
if (__privateGet27(this, _prevState) === JSON.stringify(this.mediaAudioTrackList))
|
|
11615
11824
|
return;
|
|
11616
11825
|
__privateSet24(this, _prevState, JSON.stringify(this.mediaAudioTrackList));
|
|
11617
11826
|
const audioTrackList = this.mediaAudioTrackList;
|
|
@@ -11674,7 +11883,7 @@ function getSlotTemplateHTML21() {
|
|
|
11674
11883
|
function getTooltipContentHTML14() {
|
|
11675
11884
|
return t("Audio");
|
|
11676
11885
|
}
|
|
11677
|
-
var
|
|
11886
|
+
var updateAriaLabel10 = (el) => {
|
|
11678
11887
|
const label = t("Audio");
|
|
11679
11888
|
el.setAttribute("aria-label", label);
|
|
11680
11889
|
};
|
|
@@ -11688,12 +11897,12 @@ var MediaAudioTrackMenuButton = class extends MediaChromeMenuButton {
|
|
|
11688
11897
|
}
|
|
11689
11898
|
connectedCallback() {
|
|
11690
11899
|
super.connectedCallback();
|
|
11691
|
-
|
|
11900
|
+
updateAriaLabel10(this);
|
|
11692
11901
|
}
|
|
11693
11902
|
attributeChangedCallback(attrName, _oldValue, newValue) {
|
|
11694
11903
|
super.attributeChangedCallback(attrName, _oldValue, newValue);
|
|
11695
11904
|
if (attrName === MediaUIAttributes.MEDIA_LANG) {
|
|
11696
|
-
|
|
11905
|
+
updateAriaLabel10(this);
|
|
11697
11906
|
}
|
|
11698
11907
|
}
|
|
11699
11908
|
/**
|
|
@@ -11728,26 +11937,26 @@ if (!GlobalThis.customElements.get("media-audio-track-menu-button")) {
|
|
|
11728
11937
|
}
|
|
11729
11938
|
|
|
11730
11939
|
// ../../node_modules/media-chrome/dist/menu/media-captions-menu.js
|
|
11731
|
-
var
|
|
11940
|
+
var __accessCheck28 = (obj, member, msg) => {
|
|
11732
11941
|
if (!member.has(obj))
|
|
11733
11942
|
throw TypeError("Cannot " + msg);
|
|
11734
11943
|
};
|
|
11735
|
-
var
|
|
11736
|
-
|
|
11944
|
+
var __privateGet28 = (obj, member, getter) => {
|
|
11945
|
+
__accessCheck28(obj, member, "read from private field");
|
|
11737
11946
|
return getter ? getter.call(obj) : member.get(obj);
|
|
11738
11947
|
};
|
|
11739
|
-
var
|
|
11948
|
+
var __privateAdd28 = (obj, member, value) => {
|
|
11740
11949
|
if (member.has(obj))
|
|
11741
11950
|
throw TypeError("Cannot add the same private member more than once");
|
|
11742
11951
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
11743
11952
|
};
|
|
11744
11953
|
var __privateSet25 = (obj, member, value, setter) => {
|
|
11745
|
-
|
|
11954
|
+
__accessCheck28(obj, member, "write to private field");
|
|
11746
11955
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
11747
11956
|
return value;
|
|
11748
11957
|
};
|
|
11749
|
-
var
|
|
11750
|
-
|
|
11958
|
+
var __privateMethod12 = (obj, member, method) => {
|
|
11959
|
+
__accessCheck28(obj, member, "access private method");
|
|
11751
11960
|
return method;
|
|
11752
11961
|
};
|
|
11753
11962
|
var _prevState2;
|
|
@@ -11762,7 +11971,7 @@ var ccIcon = (
|
|
|
11762
11971
|
<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"/>
|
|
11763
11972
|
</svg>`
|
|
11764
11973
|
);
|
|
11765
|
-
function
|
|
11974
|
+
function getTemplateHTML16(_attrs) {
|
|
11766
11975
|
return (
|
|
11767
11976
|
/*html*/
|
|
11768
11977
|
`
|
|
@@ -11774,9 +11983,9 @@ function getTemplateHTML17(_attrs) {
|
|
|
11774
11983
|
var MediaCaptionsMenu = class extends MediaChromeMenu {
|
|
11775
11984
|
constructor() {
|
|
11776
11985
|
super(...arguments);
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11986
|
+
__privateAdd28(this, _render2);
|
|
11987
|
+
__privateAdd28(this, _onChange2);
|
|
11988
|
+
__privateAdd28(this, _prevState2, void 0);
|
|
11780
11989
|
}
|
|
11781
11990
|
static get observedAttributes() {
|
|
11782
11991
|
return [
|
|
@@ -11788,19 +11997,19 @@ var MediaCaptionsMenu = class extends MediaChromeMenu {
|
|
|
11788
11997
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
11789
11998
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
11790
11999
|
if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_LIST && oldValue !== newValue) {
|
|
11791
|
-
|
|
12000
|
+
__privateMethod12(this, _render2, render_fn2).call(this);
|
|
11792
12001
|
} else if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_SHOWING && oldValue !== newValue) {
|
|
11793
12002
|
this.value = newValue || "";
|
|
11794
|
-
|
|
12003
|
+
__privateMethod12(this, _render2, render_fn2).call(this);
|
|
11795
12004
|
}
|
|
11796
12005
|
}
|
|
11797
12006
|
connectedCallback() {
|
|
11798
12007
|
super.connectedCallback();
|
|
11799
|
-
this.addEventListener("change",
|
|
12008
|
+
this.addEventListener("change", __privateMethod12(this, _onChange2, onChange_fn2));
|
|
11800
12009
|
}
|
|
11801
12010
|
disconnectedCallback() {
|
|
11802
12011
|
super.disconnectedCallback();
|
|
11803
|
-
this.removeEventListener("change",
|
|
12012
|
+
this.removeEventListener("change", __privateMethod12(this, _onChange2, onChange_fn2));
|
|
11804
12013
|
}
|
|
11805
12014
|
/**
|
|
11806
12015
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -11838,7 +12047,7 @@ _prevState2 = /* @__PURE__ */ new WeakMap();
|
|
|
11838
12047
|
_render2 = /* @__PURE__ */ new WeakSet();
|
|
11839
12048
|
render_fn2 = function() {
|
|
11840
12049
|
var _a3;
|
|
11841
|
-
const hasListChanged =
|
|
12050
|
+
const hasListChanged = __privateGet28(this, _prevState2) !== JSON.stringify(this.mediaSubtitlesList);
|
|
11842
12051
|
const hasShowingChanged = this.value !== this.getAttribute(MediaUIAttributes.MEDIA_SUBTITLES_SHOWING);
|
|
11843
12052
|
if (!hasListChanged && !hasShowingChanged)
|
|
11844
12053
|
return;
|
|
@@ -11900,7 +12109,7 @@ onChange_fn2 = function() {
|
|
|
11900
12109
|
);
|
|
11901
12110
|
this.dispatchEvent(event);
|
|
11902
12111
|
};
|
|
11903
|
-
MediaCaptionsMenu.getTemplateHTML =
|
|
12112
|
+
MediaCaptionsMenu.getTemplateHTML = getTemplateHTML16;
|
|
11904
12113
|
var getSubtitlesListAttr2 = (el, attrName) => {
|
|
11905
12114
|
const attrVal = el.getAttribute(attrName);
|
|
11906
12115
|
return attrVal ? parseTextTracksStr(attrVal) : [];
|
|
@@ -11960,7 +12169,7 @@ function getTooltipContentHTML15() {
|
|
|
11960
12169
|
var updateAriaChecked2 = (el) => {
|
|
11961
12170
|
el.setAttribute("data-captions-enabled", areSubsOn(el).toString());
|
|
11962
12171
|
};
|
|
11963
|
-
var
|
|
12172
|
+
var updateAriaLabel11 = (el) => {
|
|
11964
12173
|
el.setAttribute("aria-label", t("closed captions"));
|
|
11965
12174
|
};
|
|
11966
12175
|
var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
|
|
@@ -11974,7 +12183,7 @@ var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
|
|
|
11974
12183
|
}
|
|
11975
12184
|
connectedCallback() {
|
|
11976
12185
|
super.connectedCallback();
|
|
11977
|
-
|
|
12186
|
+
updateAriaLabel11(this);
|
|
11978
12187
|
updateAriaChecked2(this);
|
|
11979
12188
|
}
|
|
11980
12189
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
@@ -11982,7 +12191,7 @@ var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
|
|
|
11982
12191
|
if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_SHOWING) {
|
|
11983
12192
|
updateAriaChecked2(this);
|
|
11984
12193
|
} else if (attrName === MediaUIAttributes.MEDIA_LANG) {
|
|
11985
|
-
|
|
12194
|
+
updateAriaLabel11(this);
|
|
11986
12195
|
}
|
|
11987
12196
|
}
|
|
11988
12197
|
/**
|
|
@@ -12044,21 +12253,21 @@ if (!GlobalThis.customElements.get("media-captions-menu-button")) {
|
|
|
12044
12253
|
}
|
|
12045
12254
|
|
|
12046
12255
|
// ../../node_modules/media-chrome/dist/menu/media-playback-rate-menu.js
|
|
12047
|
-
var
|
|
12256
|
+
var __accessCheck29 = (obj, member, msg) => {
|
|
12048
12257
|
if (!member.has(obj))
|
|
12049
12258
|
throw TypeError("Cannot " + msg);
|
|
12050
12259
|
};
|
|
12051
|
-
var
|
|
12052
|
-
|
|
12260
|
+
var __privateGet29 = (obj, member, getter) => {
|
|
12261
|
+
__accessCheck29(obj, member, "read from private field");
|
|
12053
12262
|
return getter ? getter.call(obj) : member.get(obj);
|
|
12054
12263
|
};
|
|
12055
|
-
var
|
|
12264
|
+
var __privateAdd29 = (obj, member, value) => {
|
|
12056
12265
|
if (member.has(obj))
|
|
12057
12266
|
throw TypeError("Cannot add the same private member more than once");
|
|
12058
12267
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12059
12268
|
};
|
|
12060
|
-
var
|
|
12061
|
-
|
|
12269
|
+
var __privateMethod13 = (obj, member, method) => {
|
|
12270
|
+
__accessCheck29(obj, member, "access private method");
|
|
12062
12271
|
return method;
|
|
12063
12272
|
};
|
|
12064
12273
|
var _rates2;
|
|
@@ -12072,12 +12281,12 @@ var Attributes14 = {
|
|
|
12072
12281
|
var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
12073
12282
|
constructor() {
|
|
12074
12283
|
super();
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12284
|
+
__privateAdd29(this, _render3);
|
|
12285
|
+
__privateAdd29(this, _onChange3);
|
|
12286
|
+
__privateAdd29(this, _rates2, new AttributeTokenList(this, Attributes14.RATES, {
|
|
12078
12287
|
defaultValue: DEFAULT_RATES
|
|
12079
12288
|
}));
|
|
12080
|
-
|
|
12289
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12081
12290
|
}
|
|
12082
12291
|
static get observedAttributes() {
|
|
12083
12292
|
return [
|
|
@@ -12090,19 +12299,19 @@ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
|
12090
12299
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
12091
12300
|
if (attrName === MediaUIAttributes.MEDIA_PLAYBACK_RATE && oldValue != newValue) {
|
|
12092
12301
|
this.value = newValue;
|
|
12093
|
-
|
|
12302
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12094
12303
|
} else if (attrName === Attributes14.RATES && oldValue != newValue) {
|
|
12095
|
-
|
|
12096
|
-
|
|
12304
|
+
__privateGet29(this, _rates2).value = newValue;
|
|
12305
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12097
12306
|
}
|
|
12098
12307
|
}
|
|
12099
12308
|
connectedCallback() {
|
|
12100
12309
|
super.connectedCallback();
|
|
12101
|
-
this.addEventListener("change",
|
|
12310
|
+
this.addEventListener("change", __privateMethod13(this, _onChange3, onChange_fn3));
|
|
12102
12311
|
}
|
|
12103
12312
|
disconnectedCallback() {
|
|
12104
12313
|
super.disconnectedCallback();
|
|
12105
|
-
this.removeEventListener("change",
|
|
12314
|
+
this.removeEventListener("change", __privateMethod13(this, _onChange3, onChange_fn3));
|
|
12106
12315
|
}
|
|
12107
12316
|
/**
|
|
12108
12317
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -12118,7 +12327,7 @@ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
|
12118
12327
|
* Get the playback rates for the button.
|
|
12119
12328
|
*/
|
|
12120
12329
|
get rates() {
|
|
12121
|
-
return
|
|
12330
|
+
return __privateGet29(this, _rates2);
|
|
12122
12331
|
}
|
|
12123
12332
|
/**
|
|
12124
12333
|
* Set the playback rates for the button.
|
|
@@ -12126,13 +12335,13 @@ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
|
|
|
12126
12335
|
*/
|
|
12127
12336
|
set rates(value) {
|
|
12128
12337
|
if (!value) {
|
|
12129
|
-
|
|
12338
|
+
__privateGet29(this, _rates2).value = "";
|
|
12130
12339
|
} else if (Array.isArray(value)) {
|
|
12131
|
-
|
|
12340
|
+
__privateGet29(this, _rates2).value = value.join(" ");
|
|
12132
12341
|
} else if (typeof value === "string") {
|
|
12133
|
-
|
|
12342
|
+
__privateGet29(this, _rates2).value = value;
|
|
12134
12343
|
}
|
|
12135
|
-
|
|
12344
|
+
__privateMethod13(this, _render3, render_fn3).call(this);
|
|
12136
12345
|
}
|
|
12137
12346
|
/**
|
|
12138
12347
|
* The current playback rate
|
|
@@ -12153,7 +12362,7 @@ _render3 = /* @__PURE__ */ new WeakSet();
|
|
|
12153
12362
|
render_fn3 = function() {
|
|
12154
12363
|
this.defaultSlot.textContent = "";
|
|
12155
12364
|
const currentRate = this.mediaPlaybackRate;
|
|
12156
|
-
const ratesSet = new Set(Array.from(
|
|
12365
|
+
const ratesSet = new Set(Array.from(__privateGet29(this, _rates2)).map((rate) => Number(rate)));
|
|
12157
12366
|
if (currentRate > 0 && !ratesSet.has(currentRate)) {
|
|
12158
12367
|
ratesSet.add(currentRate);
|
|
12159
12368
|
}
|
|
@@ -12202,6 +12411,10 @@ function getSlotTemplateHTML23(attrs) {
|
|
|
12202
12411
|
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
12203
12412
|
}
|
|
12204
12413
|
|
|
12414
|
+
:host([aria-expanded="true"]) slot {
|
|
12415
|
+
display: block;
|
|
12416
|
+
}
|
|
12417
|
+
|
|
12205
12418
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
12206
12419
|
display: none;
|
|
12207
12420
|
}
|
|
@@ -12270,26 +12483,26 @@ if (!GlobalThis.customElements.get("media-playback-rate-menu-button")) {
|
|
|
12270
12483
|
}
|
|
12271
12484
|
|
|
12272
12485
|
// ../../node_modules/media-chrome/dist/menu/media-rendition-menu.js
|
|
12273
|
-
var
|
|
12486
|
+
var __accessCheck30 = (obj, member, msg) => {
|
|
12274
12487
|
if (!member.has(obj))
|
|
12275
12488
|
throw TypeError("Cannot " + msg);
|
|
12276
12489
|
};
|
|
12277
|
-
var
|
|
12278
|
-
|
|
12490
|
+
var __privateGet30 = (obj, member, getter) => {
|
|
12491
|
+
__accessCheck30(obj, member, "read from private field");
|
|
12279
12492
|
return getter ? getter.call(obj) : member.get(obj);
|
|
12280
12493
|
};
|
|
12281
|
-
var
|
|
12494
|
+
var __privateAdd30 = (obj, member, value) => {
|
|
12282
12495
|
if (member.has(obj))
|
|
12283
12496
|
throw TypeError("Cannot add the same private member more than once");
|
|
12284
12497
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12285
12498
|
};
|
|
12286
12499
|
var __privateSet26 = (obj, member, value, setter) => {
|
|
12287
|
-
|
|
12500
|
+
__accessCheck30(obj, member, "write to private field");
|
|
12288
12501
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
12289
12502
|
return value;
|
|
12290
12503
|
};
|
|
12291
|
-
var
|
|
12292
|
-
|
|
12504
|
+
var __privateMethod14 = (obj, member, method) => {
|
|
12505
|
+
__accessCheck30(obj, member, "access private method");
|
|
12293
12506
|
return method;
|
|
12294
12507
|
};
|
|
12295
12508
|
var _renditionList;
|
|
@@ -12301,10 +12514,10 @@ var onChange_fn4;
|
|
|
12301
12514
|
var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
12302
12515
|
constructor() {
|
|
12303
12516
|
super(...arguments);
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12517
|
+
__privateAdd30(this, _render4);
|
|
12518
|
+
__privateAdd30(this, _onChange4);
|
|
12519
|
+
__privateAdd30(this, _renditionList, []);
|
|
12520
|
+
__privateAdd30(this, _prevState3, {});
|
|
12308
12521
|
}
|
|
12309
12522
|
static get observedAttributes() {
|
|
12310
12523
|
return [
|
|
@@ -12312,7 +12525,8 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12312
12525
|
MediaUIAttributes.MEDIA_RENDITION_LIST,
|
|
12313
12526
|
MediaUIAttributes.MEDIA_RENDITION_SELECTED,
|
|
12314
12527
|
MediaUIAttributes.MEDIA_RENDITION_UNAVAILABLE,
|
|
12315
|
-
MediaUIAttributes.MEDIA_HEIGHT
|
|
12528
|
+
MediaUIAttributes.MEDIA_HEIGHT,
|
|
12529
|
+
MediaUIAttributes.MEDIA_WIDTH
|
|
12316
12530
|
];
|
|
12317
12531
|
}
|
|
12318
12532
|
static formatMenuItemText(text, rendition) {
|
|
@@ -12336,23 +12550,30 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12336
12550
|
}
|
|
12337
12551
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
12338
12552
|
super.attributeChangedCallback(attrName, oldValue, newValue);
|
|
12339
|
-
if (
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12553
|
+
if (oldValue !== newValue) {
|
|
12554
|
+
switch (attrName) {
|
|
12555
|
+
case MediaUIAttributes.MEDIA_RENDITION_SELECTED:
|
|
12556
|
+
this.value = newValue != null ? newValue : "auto";
|
|
12557
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12558
|
+
break;
|
|
12559
|
+
case MediaUIAttributes.MEDIA_RENDITION_LIST:
|
|
12560
|
+
__privateSet26(this, _renditionList, parseRenditionList(newValue));
|
|
12561
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12562
|
+
break;
|
|
12563
|
+
case MediaUIAttributes.MEDIA_HEIGHT:
|
|
12564
|
+
case MediaUIAttributes.MEDIA_WIDTH:
|
|
12565
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12566
|
+
break;
|
|
12567
|
+
}
|
|
12347
12568
|
}
|
|
12348
12569
|
}
|
|
12349
12570
|
connectedCallback() {
|
|
12350
12571
|
super.connectedCallback();
|
|
12351
|
-
this.addEventListener("change",
|
|
12572
|
+
this.addEventListener("change", __privateMethod14(this, _onChange4, onChange_fn4));
|
|
12352
12573
|
}
|
|
12353
12574
|
disconnectedCallback() {
|
|
12354
12575
|
super.disconnectedCallback();
|
|
12355
|
-
this.removeEventListener("change",
|
|
12576
|
+
this.removeEventListener("change", __privateMethod14(this, _onChange4, onChange_fn4));
|
|
12356
12577
|
}
|
|
12357
12578
|
/**
|
|
12358
12579
|
* Returns the anchor element when it is a floating menu.
|
|
@@ -12365,11 +12586,11 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12365
12586
|
);
|
|
12366
12587
|
}
|
|
12367
12588
|
get mediaRenditionList() {
|
|
12368
|
-
return
|
|
12589
|
+
return __privateGet30(this, _renditionList);
|
|
12369
12590
|
}
|
|
12370
12591
|
set mediaRenditionList(list) {
|
|
12371
12592
|
__privateSet26(this, _renditionList, list);
|
|
12372
|
-
|
|
12593
|
+
__privateMethod14(this, _render4, render_fn4).call(this);
|
|
12373
12594
|
}
|
|
12374
12595
|
/**
|
|
12375
12596
|
* Get selected rendition id.
|
|
@@ -12386,6 +12607,12 @@ var MediaRenditionMenu = class extends MediaChromeMenu {
|
|
|
12386
12607
|
set mediaHeight(height) {
|
|
12387
12608
|
setNumericAttr(this, MediaUIAttributes.MEDIA_HEIGHT, height);
|
|
12388
12609
|
}
|
|
12610
|
+
get mediaWidth() {
|
|
12611
|
+
return getNumericAttr(this, MediaUIAttributes.MEDIA_WIDTH);
|
|
12612
|
+
}
|
|
12613
|
+
set mediaWidth(width) {
|
|
12614
|
+
setNumericAttr(this, MediaUIAttributes.MEDIA_WIDTH, width);
|
|
12615
|
+
}
|
|
12389
12616
|
compareRendition(a, b) {
|
|
12390
12617
|
const ctor = this.constructor;
|
|
12391
12618
|
return ctor.compareRendition(a, b);
|
|
@@ -12408,12 +12635,15 @@ _renditionList = /* @__PURE__ */ new WeakMap();
|
|
|
12408
12635
|
_prevState3 = /* @__PURE__ */ new WeakMap();
|
|
12409
12636
|
_render4 = /* @__PURE__ */ new WeakSet();
|
|
12410
12637
|
render_fn4 = function() {
|
|
12411
|
-
|
|
12638
|
+
const isAuto = !this.mediaRenditionSelected;
|
|
12639
|
+
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)
|
|
12412
12640
|
return;
|
|
12413
|
-
|
|
12641
|
+
__privateGet30(this, _prevState3).mediaRenditionList = JSON.stringify(
|
|
12414
12642
|
this.mediaRenditionList
|
|
12415
12643
|
);
|
|
12416
|
-
|
|
12644
|
+
__privateGet30(this, _prevState3).mediaHeight = this.mediaHeight;
|
|
12645
|
+
__privateGet30(this, _prevState3).mediaWidth = this.mediaWidth;
|
|
12646
|
+
__privateGet30(this, _prevState3).isAuto = isAuto;
|
|
12417
12647
|
const renditionList = this.mediaRenditionList.sort(
|
|
12418
12648
|
this.compareRendition.bind(this)
|
|
12419
12649
|
);
|
|
@@ -12424,7 +12654,6 @@ render_fn4 = function() {
|
|
|
12424
12654
|
rendition.selected = rendition === selectedRendition;
|
|
12425
12655
|
}
|
|
12426
12656
|
this.defaultSlot.textContent = "";
|
|
12427
|
-
const isAuto = !this.mediaRenditionSelected;
|
|
12428
12657
|
for (const rendition of renditionList) {
|
|
12429
12658
|
const text = this.formatRendition(rendition, {
|
|
12430
12659
|
showBitrate: this.showRenditionBitrate(rendition)
|
|
@@ -12439,15 +12668,22 @@ render_fn4 = function() {
|
|
|
12439
12668
|
this.defaultSlot.append(item2);
|
|
12440
12669
|
}
|
|
12441
12670
|
const showSelectedBitrate = selectedRendition && this.showRenditionBitrate(selectedRendition);
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
selectedRendition
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12671
|
+
let autoText = void 0;
|
|
12672
|
+
if (isAuto) {
|
|
12673
|
+
if (selectedRendition) {
|
|
12674
|
+
autoText = this.formatMenuItemText(
|
|
12675
|
+
`${t("Auto")} \u2022 ${this.formatRendition(selectedRendition, {
|
|
12676
|
+
showBitrate: showSelectedBitrate
|
|
12677
|
+
})}`,
|
|
12678
|
+
selectedRendition
|
|
12679
|
+
);
|
|
12680
|
+
} else if (this.mediaHeight > 0 && this.mediaWidth > 0) {
|
|
12681
|
+
autoText = this.formatMenuItemText(`${t("Auto")} (${Math.min(this.mediaWidth, this.mediaHeight)}p)`);
|
|
12682
|
+
}
|
|
12683
|
+
}
|
|
12684
|
+
if (!autoText) {
|
|
12685
|
+
autoText = this.formatMenuItemText(t("Auto"));
|
|
12686
|
+
}
|
|
12451
12687
|
const item = createMenuItem({
|
|
12452
12688
|
type: "radio",
|
|
12453
12689
|
text: autoText,
|
|
@@ -12546,26 +12782,26 @@ if (!GlobalThis.customElements.get("media-rendition-menu-button")) {
|
|
|
12546
12782
|
}
|
|
12547
12783
|
|
|
12548
12784
|
// ../../node_modules/media-chrome/dist/menu/media-context-menu.js
|
|
12549
|
-
var
|
|
12785
|
+
var __accessCheck31 = (obj, member, msg) => {
|
|
12550
12786
|
if (!member.has(obj))
|
|
12551
12787
|
throw TypeError("Cannot " + msg);
|
|
12552
12788
|
};
|
|
12553
|
-
var
|
|
12554
|
-
|
|
12789
|
+
var __privateGet31 = (obj, member, getter) => {
|
|
12790
|
+
__accessCheck31(obj, member, "read from private field");
|
|
12555
12791
|
return getter ? getter.call(obj) : member.get(obj);
|
|
12556
12792
|
};
|
|
12557
|
-
var
|
|
12793
|
+
var __privateAdd31 = (obj, member, value) => {
|
|
12558
12794
|
if (member.has(obj))
|
|
12559
12795
|
throw TypeError("Cannot add the same private member more than once");
|
|
12560
12796
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12561
12797
|
};
|
|
12562
12798
|
var __privateSet27 = (obj, member, value, setter) => {
|
|
12563
|
-
|
|
12799
|
+
__accessCheck31(obj, member, "write to private field");
|
|
12564
12800
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
12565
12801
|
return value;
|
|
12566
12802
|
};
|
|
12567
|
-
var
|
|
12568
|
-
|
|
12803
|
+
var __privateMethod15 = (obj, member, method) => {
|
|
12804
|
+
__accessCheck31(obj, member, "access private method");
|
|
12569
12805
|
return method;
|
|
12570
12806
|
};
|
|
12571
12807
|
var _isContextMenuOpen;
|
|
@@ -12583,7 +12819,7 @@ var onContextMenu_fn;
|
|
|
12583
12819
|
var _onDocumentClick;
|
|
12584
12820
|
var _onKeyDown;
|
|
12585
12821
|
var _onMenuClick;
|
|
12586
|
-
function
|
|
12822
|
+
function getTemplateHTML17(_attrs) {
|
|
12587
12823
|
return (
|
|
12588
12824
|
/*html*/
|
|
12589
12825
|
`
|
|
@@ -12606,30 +12842,30 @@ function getTemplateHTML18(_attrs) {
|
|
|
12606
12842
|
var MediaContextMenu = class extends MediaChromeMenu {
|
|
12607
12843
|
constructor() {
|
|
12608
12844
|
super();
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
|
|
12615
|
-
|
|
12845
|
+
__privateAdd31(this, _updateVisibility);
|
|
12846
|
+
__privateAdd31(this, _closeContextMenu);
|
|
12847
|
+
__privateAdd31(this, _closeOtherContextMenus);
|
|
12848
|
+
__privateAdd31(this, _isVideoContainer);
|
|
12849
|
+
__privateAdd31(this, _onContextMenu);
|
|
12850
|
+
__privateAdd31(this, _isContextMenuOpen, false);
|
|
12851
|
+
__privateAdd31(this, _onControllerContextMenu, (event) => {
|
|
12616
12852
|
const target = event.target;
|
|
12617
12853
|
const isVideoElement = (target == null ? void 0 : target.nodeName) === "VIDEO";
|
|
12618
|
-
const isVideoContainer =
|
|
12854
|
+
const isVideoContainer = __privateMethod15(this, _isVideoContainer, isVideoContainer_fn).call(this, target);
|
|
12619
12855
|
if (isVideoElement || isVideoContainer) {
|
|
12620
|
-
if (!
|
|
12621
|
-
|
|
12856
|
+
if (!__privateGet31(this, _isContextMenuOpen)) {
|
|
12857
|
+
__privateMethod15(this, _onContextMenu, onContextMenu_fn).call(this, event);
|
|
12622
12858
|
} else {
|
|
12623
|
-
|
|
12859
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12624
12860
|
}
|
|
12625
12861
|
}
|
|
12626
12862
|
});
|
|
12627
|
-
|
|
12863
|
+
__privateAdd31(this, _onDocumentClick, (event) => {
|
|
12628
12864
|
const target = event.target;
|
|
12629
12865
|
const isInsideMenu = this.contains(target);
|
|
12630
12866
|
const isRightClick = event.button === 2;
|
|
12631
12867
|
const isVideo = (target == null ? void 0 : target.nodeName) === "VIDEO";
|
|
12632
|
-
const isVideoContainer =
|
|
12868
|
+
const isVideoContainer = __privateMethod15(this, _isVideoContainer, isVideoContainer_fn).call(this, target);
|
|
12633
12869
|
if (isInsideMenu) {
|
|
12634
12870
|
return;
|
|
12635
12871
|
}
|
|
@@ -12637,53 +12873,53 @@ var MediaContextMenu = class extends MediaChromeMenu {
|
|
|
12637
12873
|
if (isRightClickOnVideo) {
|
|
12638
12874
|
return;
|
|
12639
12875
|
}
|
|
12640
|
-
|
|
12876
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12641
12877
|
});
|
|
12642
|
-
|
|
12878
|
+
__privateAdd31(this, _onKeyDown, (event) => {
|
|
12643
12879
|
if (event.key === "Escape") {
|
|
12644
|
-
|
|
12880
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12645
12881
|
}
|
|
12646
12882
|
});
|
|
12647
|
-
|
|
12883
|
+
__privateAdd31(this, _onMenuClick, (event) => {
|
|
12648
12884
|
var _a3, _b2;
|
|
12649
12885
|
const target = event.target;
|
|
12650
12886
|
if ((_a3 = target.matches) == null ? void 0 : _a3.call(target, 'button[invoke="copy"]')) {
|
|
12651
12887
|
const input = (_b2 = target.closest("media-context-menu-item")) == null ? void 0 : _b2.querySelector('input[slot="copy"]');
|
|
12652
12888
|
input && navigator.clipboard.writeText(input.value);
|
|
12653
12889
|
}
|
|
12654
|
-
|
|
12890
|
+
__privateMethod15(this, _closeContextMenu, closeContextMenu_fn).call(this);
|
|
12655
12891
|
});
|
|
12656
12892
|
this.setAttribute("noautohide", "");
|
|
12657
|
-
|
|
12893
|
+
__privateMethod15(this, _updateVisibility, updateVisibility_fn).call(this);
|
|
12658
12894
|
}
|
|
12659
12895
|
connectedCallback() {
|
|
12660
12896
|
super.connectedCallback();
|
|
12661
12897
|
getMediaController(this).addEventListener(
|
|
12662
12898
|
"contextmenu",
|
|
12663
|
-
|
|
12899
|
+
__privateGet31(this, _onControllerContextMenu)
|
|
12664
12900
|
);
|
|
12665
|
-
this.addEventListener("click",
|
|
12901
|
+
this.addEventListener("click", __privateGet31(this, _onMenuClick));
|
|
12666
12902
|
}
|
|
12667
12903
|
disconnectedCallback() {
|
|
12668
12904
|
super.disconnectedCallback();
|
|
12669
12905
|
getMediaController(this).removeEventListener(
|
|
12670
12906
|
"contextmenu",
|
|
12671
|
-
|
|
12907
|
+
__privateGet31(this, _onControllerContextMenu)
|
|
12672
12908
|
);
|
|
12673
|
-
this.removeEventListener("click",
|
|
12674
|
-
document.removeEventListener("mousedown",
|
|
12675
|
-
document.removeEventListener("keydown",
|
|
12909
|
+
this.removeEventListener("click", __privateGet31(this, _onMenuClick));
|
|
12910
|
+
document.removeEventListener("mousedown", __privateGet31(this, _onDocumentClick));
|
|
12911
|
+
document.removeEventListener("keydown", __privateGet31(this, _onKeyDown));
|
|
12676
12912
|
}
|
|
12677
12913
|
};
|
|
12678
12914
|
_isContextMenuOpen = /* @__PURE__ */ new WeakMap();
|
|
12679
12915
|
_updateVisibility = /* @__PURE__ */ new WeakSet();
|
|
12680
12916
|
updateVisibility_fn = function() {
|
|
12681
|
-
this.hidden = !
|
|
12917
|
+
this.hidden = !__privateGet31(this, _isContextMenuOpen);
|
|
12682
12918
|
};
|
|
12683
12919
|
_closeContextMenu = /* @__PURE__ */ new WeakSet();
|
|
12684
12920
|
closeContextMenu_fn = function() {
|
|
12685
12921
|
__privateSet27(this, _isContextMenuOpen, false);
|
|
12686
|
-
|
|
12922
|
+
__privateMethod15(this, _updateVisibility, updateVisibility_fn).call(this);
|
|
12687
12923
|
};
|
|
12688
12924
|
_closeOtherContextMenus = /* @__PURE__ */ new WeakSet();
|
|
12689
12925
|
closeOtherContextMenus_fn = function() {
|
|
@@ -12691,7 +12927,7 @@ closeOtherContextMenus_fn = function() {
|
|
|
12691
12927
|
allContextMenus.forEach((menu) => {
|
|
12692
12928
|
var _a3;
|
|
12693
12929
|
if (menu !== this) {
|
|
12694
|
-
|
|
12930
|
+
__privateMethod15(_a3 = menu, _closeContextMenu, closeContextMenu_fn).call(_a3);
|
|
12695
12931
|
}
|
|
12696
12932
|
});
|
|
12697
12933
|
};
|
|
@@ -12712,27 +12948,27 @@ _onControllerContextMenu = /* @__PURE__ */ new WeakMap();
|
|
|
12712
12948
|
_onContextMenu = /* @__PURE__ */ new WeakSet();
|
|
12713
12949
|
onContextMenu_fn = function(event) {
|
|
12714
12950
|
event.preventDefault();
|
|
12715
|
-
|
|
12951
|
+
__privateMethod15(this, _closeOtherContextMenus, closeOtherContextMenus_fn).call(this);
|
|
12716
12952
|
__privateSet27(this, _isContextMenuOpen, true);
|
|
12717
12953
|
this.style.position = "fixed";
|
|
12718
12954
|
this.style.left = `${event.clientX}px`;
|
|
12719
12955
|
this.style.top = `${event.clientY}px`;
|
|
12720
|
-
|
|
12721
|
-
document.addEventListener("mousedown",
|
|
12956
|
+
__privateMethod15(this, _updateVisibility, updateVisibility_fn).call(this);
|
|
12957
|
+
document.addEventListener("mousedown", __privateGet31(this, _onDocumentClick), {
|
|
12722
12958
|
once: true
|
|
12723
12959
|
});
|
|
12724
|
-
document.addEventListener("keydown",
|
|
12960
|
+
document.addEventListener("keydown", __privateGet31(this, _onKeyDown), { once: true });
|
|
12725
12961
|
};
|
|
12726
12962
|
_onDocumentClick = /* @__PURE__ */ new WeakMap();
|
|
12727
12963
|
_onKeyDown = /* @__PURE__ */ new WeakMap();
|
|
12728
12964
|
_onMenuClick = /* @__PURE__ */ new WeakMap();
|
|
12729
|
-
MediaContextMenu.getTemplateHTML =
|
|
12965
|
+
MediaContextMenu.getTemplateHTML = getTemplateHTML17;
|
|
12730
12966
|
if (!GlobalThis.customElements.get("media-context-menu")) {
|
|
12731
12967
|
GlobalThis.customElements.define("media-context-menu", MediaContextMenu);
|
|
12732
12968
|
}
|
|
12733
12969
|
|
|
12734
12970
|
// ../../node_modules/media-chrome/dist/menu/media-context-menu-item.js
|
|
12735
|
-
function
|
|
12971
|
+
function getTemplateHTML18(_attrs) {
|
|
12736
12972
|
return (
|
|
12737
12973
|
/*html*/
|
|
12738
12974
|
`
|
|
@@ -12754,7 +12990,7 @@ function getTemplateHTML19(_attrs) {
|
|
|
12754
12990
|
var MediaContextMenuItem = class extends MediaChromeMenuItem {
|
|
12755
12991
|
};
|
|
12756
12992
|
MediaContextMenuItem.shadowRootOptions = { mode: "open" };
|
|
12757
|
-
MediaContextMenuItem.getTemplateHTML =
|
|
12993
|
+
MediaContextMenuItem.getTemplateHTML = getTemplateHTML18;
|
|
12758
12994
|
if (!GlobalThis.customElements.get("media-context-menu-item")) {
|
|
12759
12995
|
GlobalThis.customElements.define(
|
|
12760
12996
|
"media-context-menu-item",
|