aptechka 0.78.6 → 0.78.7
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/lib/SourceElement-BnMxiOqY.js +265 -0
- package/lib/SourceElement-VVdVc1d-.cjs +5 -0
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +1 -1
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +26 -22
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +1 -1
- package/package.json +1 -1
- package/lib/SourceElement-DE6khDs3.cjs +0 -5
- package/lib/SourceElement-DJxX7uN5.js +0 -260
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
var X = (l) => {
|
|
2
|
+
throw TypeError(l);
|
|
3
|
+
};
|
|
4
|
+
var Z = (l, a, e) => a.has(l) || X("Cannot " + e);
|
|
5
|
+
var t = (l, a, e) => (Z(l, a, "read from private field"), e ? e.call(l) : a.get(l)), i = (l, a, e) => a.has(l) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(l) : a.set(l, e), s = (l, a, e, h) => (Z(l, a, "write to private field"), h ? h.call(l, e) : a.set(l, e), e), F = (l, a, e) => (Z(l, a, "access private method"), e);
|
|
6
|
+
import { ElementLinkedStore as st } from "./element-linked-store/index.js";
|
|
7
|
+
import { i as it } from "./index-Bv9zgfdb.js";
|
|
8
|
+
import { d as w } from "./events-CsVF98U6.js";
|
|
9
|
+
import { k as Y } from "./string-BlMQbe8b.js";
|
|
10
|
+
import "construct-style-sheets-polyfill";
|
|
11
|
+
import { loading as J } from "./loading/index.js";
|
|
12
|
+
import { RESIZE_ORDER as rt } from "./order/index.js";
|
|
13
|
+
import { windowResizer as tt } from "./window-resizer/index.js";
|
|
14
|
+
import { S as at } from "./Store-0BVty6AZ.js";
|
|
15
|
+
var C, S, z, x, m, p, q;
|
|
16
|
+
class nt {
|
|
17
|
+
constructor(a) {
|
|
18
|
+
i(this, C);
|
|
19
|
+
i(this, S);
|
|
20
|
+
i(this, z);
|
|
21
|
+
i(this, x);
|
|
22
|
+
i(this, m);
|
|
23
|
+
i(this, p);
|
|
24
|
+
i(this, q);
|
|
25
|
+
s(this, C, a);
|
|
26
|
+
let e = a.split(".");
|
|
27
|
+
const h = /\b\d{1,2}x\b/g, n = e.find((y) => y.match(h) && parseInt(y));
|
|
28
|
+
s(this, z, n ? parseInt(n) : 1), n && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
+
const o = /\d+max/g, d = /\d+min/g, N = /\d+mar/g, U = /\d+mir/g, W = e.find((y) => y.match(o)), u = e.find((y) => y.match(d)), L = e.find((y) => y.match(N)), Q = e.find((y) => y.match(U));
|
|
30
|
+
L ? (s(this, m, parseInt(L)), s(this, p, "max"), s(this, x, `(max-aspect-ratio: ${t(this, m)})`)) : Q ? (s(this, m, parseInt(Q)), s(this, p, "max"), s(this, x, `(min-aspect-ratio: ${t(this, m)})`)) : W ? (s(this, m, parseInt(W)), s(this, p, "max"), s(this, x, `(max-width: ${t(this, m)}px)`)) : u ? (s(this, m, parseInt(u)), s(this, x, `(min-width: ${t(this, m)}px)`), s(this, p, "min")) : (s(this, m, 0), s(this, x, `(min-width: ${t(this, m)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
|
|
31
|
+
`.${t(this, m)}${t(this, p)}`,
|
|
32
|
+
""
|
|
33
|
+
)), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
|
|
34
|
+
`.${t(this, m)}${t(this, p)}`,
|
|
35
|
+
""
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
get url() {
|
|
39
|
+
return t(this, C);
|
|
40
|
+
}
|
|
41
|
+
get name() {
|
|
42
|
+
return t(this, S);
|
|
43
|
+
}
|
|
44
|
+
get density() {
|
|
45
|
+
return t(this, z);
|
|
46
|
+
}
|
|
47
|
+
get query() {
|
|
48
|
+
return t(this, x);
|
|
49
|
+
}
|
|
50
|
+
get extension() {
|
|
51
|
+
return t(this, q);
|
|
52
|
+
}
|
|
53
|
+
get queryType() {
|
|
54
|
+
return t(this, p);
|
|
55
|
+
}
|
|
56
|
+
get queryValue() {
|
|
57
|
+
return t(this, m);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), x = new WeakMap(), m = new WeakMap(), p = new WeakMap(), q = new WeakMap();
|
|
61
|
+
var v;
|
|
62
|
+
class et {
|
|
63
|
+
constructor(a, e) {
|
|
64
|
+
i(this, v);
|
|
65
|
+
s(this, v, /* @__PURE__ */ new Map());
|
|
66
|
+
const h = (e == null ? void 0 : e.mediaBuckets) !== !1, n = typeof a == "string" ? h ? a.trim().split(",").map((u) => u.trim()).filter((u) => !!u) : [a] : a, o = [];
|
|
67
|
+
n.forEach((u) => {
|
|
68
|
+
const L = new nt(u);
|
|
69
|
+
o.push([L.query, L]);
|
|
70
|
+
});
|
|
71
|
+
const d = o.filter((u) => u[1].queryType.includes("max")).sort((u, L) => L[1].queryValue - u[1].queryValue), N = o.filter((u) => u[1].queryType.includes("min") && u[1].queryValue !== 0).sort((u, L) => u[1].queryValue - L[1].queryValue), U = o.filter((u) => u[0] === "(min-width: 0px)");
|
|
72
|
+
(U ? [...U, ...d, ...N] : [...d, ...N]).forEach((u) => {
|
|
73
|
+
t(this, v).has(u[0]) || t(this, v).set(u[0], []), t(this, v).get(u[0]).push(u[1]);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
get mediaBuckets() {
|
|
77
|
+
return t(this, v);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
v = new WeakMap();
|
|
81
|
+
var k, $;
|
|
82
|
+
class ht extends at {
|
|
83
|
+
constructor(e) {
|
|
84
|
+
super(void 0);
|
|
85
|
+
i(this, k);
|
|
86
|
+
i(this, $, () => {
|
|
87
|
+
let e;
|
|
88
|
+
t(this, k).mediaBuckets.forEach((o, d) => {
|
|
89
|
+
matchMedia(d).matches && (e = o);
|
|
90
|
+
});
|
|
91
|
+
let h, n = 0;
|
|
92
|
+
e == null || e.forEach((o) => {
|
|
93
|
+
o.density > n && o.density <= Math.max(devicePixelRatio, 1) && (n = o.density, h = o);
|
|
94
|
+
}), e != null && e.length && !h && (h = e[0]), this.current = h;
|
|
95
|
+
});
|
|
96
|
+
s(this, k, new et(e.srcset, e.sourceSetOptions));
|
|
97
|
+
}
|
|
98
|
+
updateSource(e) {
|
|
99
|
+
s(this, k, new et(e.srcset, e.sourceSetOptions)), t(this, $).call(this);
|
|
100
|
+
}
|
|
101
|
+
close() {
|
|
102
|
+
super.close(), this.disconnect();
|
|
103
|
+
}
|
|
104
|
+
connect() {
|
|
105
|
+
tt.subscribe(t(this, $), rt.SOURCE_MANAGER), t(this, $).call(this);
|
|
106
|
+
}
|
|
107
|
+
disconnect() {
|
|
108
|
+
tt.unsubscribe(t(this, $));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
k = new WeakMap(), $ = new WeakMap();
|
|
112
|
+
function ot(l) {
|
|
113
|
+
if (isNaN(l)) return "0:00";
|
|
114
|
+
const a = Math.floor(Math.max(0, l)), e = Math.floor(a / 3600), h = Math.floor(a % 3600 / 60), o = (a % 60).toString().padStart(2, "0");
|
|
115
|
+
if (e > 0) {
|
|
116
|
+
const d = h.toString().padStart(2, "0");
|
|
117
|
+
return `${e}:${d}:${o}`;
|
|
118
|
+
} else
|
|
119
|
+
return `${h}:${o}`;
|
|
120
|
+
}
|
|
121
|
+
let ct = 0;
|
|
122
|
+
var f, r, I, E, b, g, B, A, c, O, R, M, P, T, j, G, D, K, _, H, V;
|
|
123
|
+
class xt extends HTMLElement {
|
|
124
|
+
constructor(e) {
|
|
125
|
+
super();
|
|
126
|
+
i(this, T);
|
|
127
|
+
i(this, f, null);
|
|
128
|
+
i(this, r, null);
|
|
129
|
+
i(this, I, this);
|
|
130
|
+
i(this, E, !1);
|
|
131
|
+
i(this, b, !1);
|
|
132
|
+
i(this, g, !1);
|
|
133
|
+
i(this, B, "");
|
|
134
|
+
i(this, A, "");
|
|
135
|
+
i(this, c, new st(this, {
|
|
136
|
+
loading: !1,
|
|
137
|
+
loaded: !1,
|
|
138
|
+
error: !1,
|
|
139
|
+
clear: !1,
|
|
140
|
+
playing: !1,
|
|
141
|
+
metadata: !1
|
|
142
|
+
}));
|
|
143
|
+
i(this, O, null);
|
|
144
|
+
i(this, R);
|
|
145
|
+
i(this, M, null);
|
|
146
|
+
i(this, P);
|
|
147
|
+
i(this, G, (e) => {
|
|
148
|
+
const h = e[0];
|
|
149
|
+
t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && h.isIntersecting && this.triggerLazyLoad(), h.isIntersecting ? w(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (F(this, T, j).call(this, void 0), s(this, b, !1)), w(this, "sourceRelease", { custom: !0 }));
|
|
150
|
+
});
|
|
151
|
+
i(this, D, () => {
|
|
152
|
+
t(this, c).set("loaded", !0), t(this, c).set("error", !1), t(this, c).set("loading", !1), !t(this, g) && !t(this, E) && J.complete(t(this, A)), w(this, "sourceLoaded", { custom: !0 });
|
|
153
|
+
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
154
|
+
e ? s(this, R, setTimeout(() => {
|
|
155
|
+
t(this, c).set("clear", !0);
|
|
156
|
+
}, parseFloat(e) * 1e3)) : t(this, c).set("clear", !0), s(this, E, !0);
|
|
157
|
+
});
|
|
158
|
+
i(this, K, (e) => {
|
|
159
|
+
t(this, c).set("loaded", !1), t(this, c).set("error", !0), t(this, c).set("loading", !1), !t(this, g) && !t(this, E) && J.error(t(this, A)), w(this, "sourceError", { custom: !0 }), s(this, E, !0);
|
|
160
|
+
});
|
|
161
|
+
i(this, _, () => {
|
|
162
|
+
t(this, c).set("playing", !0), w(this, "sourcePlay", { custom: !0 });
|
|
163
|
+
});
|
|
164
|
+
i(this, H, () => {
|
|
165
|
+
t(this, c).set("playing", !1), w(this, "sourcePause", { custom: !0 });
|
|
166
|
+
});
|
|
167
|
+
i(this, V, () => {
|
|
168
|
+
const e = t(this, r);
|
|
169
|
+
(e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, c).set("metadata", !0), w(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((h) => {
|
|
170
|
+
h.textContent = ot(e.duration);
|
|
171
|
+
}));
|
|
172
|
+
});
|
|
173
|
+
s(this, P, e == null ? void 0 : e.sourceSetOptions), it && window.IntersectionObserver && s(this, O, new IntersectionObserver(
|
|
174
|
+
t(this, G)
|
|
175
|
+
)), t(this, c).subscribe((h) => {
|
|
176
|
+
var o;
|
|
177
|
+
const n = (o = this.getAttribute("data-global-play-class")) == null ? void 0 : o.split(
|
|
178
|
+
","
|
|
179
|
+
);
|
|
180
|
+
n != null && n.length && (h.current.playing ? n.forEach((d) => {
|
|
181
|
+
document.documentElement.classList.add(d.trim());
|
|
182
|
+
}) : n.forEach((d) => {
|
|
183
|
+
document.documentElement.classList.remove(d.trim());
|
|
184
|
+
}));
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
get consumerElement() {
|
|
188
|
+
return t(this, r);
|
|
189
|
+
}
|
|
190
|
+
get consumerHolderElement() {
|
|
191
|
+
return t(this, I);
|
|
192
|
+
}
|
|
193
|
+
get sourceManager() {
|
|
194
|
+
return t(this, f);
|
|
195
|
+
}
|
|
196
|
+
get status() {
|
|
197
|
+
return t(this, c);
|
|
198
|
+
}
|
|
199
|
+
get isLazy() {
|
|
200
|
+
return t(this, g);
|
|
201
|
+
}
|
|
202
|
+
get currentURL() {
|
|
203
|
+
return t(this, M);
|
|
204
|
+
}
|
|
205
|
+
get isFirstLoadHappened() {
|
|
206
|
+
return t(this, E);
|
|
207
|
+
}
|
|
208
|
+
triggerLazyLoad() {
|
|
209
|
+
!t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), F(this, T, j).call(this, t(this, f).current));
|
|
210
|
+
}
|
|
211
|
+
connectedCallback() {
|
|
212
|
+
s(this, B, `source-consumer-${++ct}`);
|
|
213
|
+
const e = this.getAttribute("srcset") || "", h = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
214
|
+
h && t(this, c).addElement(h), s(this, I, this.querySelector("[data-consumer-holder]") || this), this.querySelectorAll(".source-consumer").forEach((n) => n == null ? void 0 : n.remove()), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
215
|
+
display: block;
|
|
216
|
+
width: 100%;
|
|
217
|
+
height: 100%;
|
|
218
|
+
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, _)), t(this, r).addEventListener("pause", t(this, H)), t(this, r).addEventListener(
|
|
219
|
+
"loadedmetadata",
|
|
220
|
+
t(this, V)
|
|
221
|
+
), t(this, V).call(this), this.classList.contains("MaskedVideo__video__element") && console.log(), Array.from(this.attributes).forEach((n) => {
|
|
222
|
+
if (n.name !== "srcset") {
|
|
223
|
+
const o = n.nodeValue || "", d = Y(n.name);
|
|
224
|
+
d in t(this, r) && (t(this, r)[d] = o || !0);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
for (const n in this.dataset) {
|
|
228
|
+
const o = this.dataset[n], d = Y(n);
|
|
229
|
+
d in t(this, r) && (t(this, r)[d] = o ? o === "false" ? !1 : o : !0);
|
|
230
|
+
}
|
|
231
|
+
t(this, I).appendChild(t(this, r)), s(this, f, new ht({
|
|
232
|
+
srcset: e,
|
|
233
|
+
sourceSetOptions: t(this, P)
|
|
234
|
+
})), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((n) => {
|
|
235
|
+
(!t(this, g) || t(this, g) && t(this, b)) && F(this, T, j).call(this, n.current);
|
|
236
|
+
}), t(this, f).connect(), t(this, O).observe(this);
|
|
237
|
+
}
|
|
238
|
+
disconnectedCallback() {
|
|
239
|
+
var e;
|
|
240
|
+
clearTimeout(t(this, R)), t(this, O).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, _)), t(this, r).removeEventListener("pause", t(this, H)), t(this, r).removeEventListener(
|
|
241
|
+
"loadedmetadata",
|
|
242
|
+
t(this, V)
|
|
243
|
+
), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, E, !1), s(this, b, !1), t(this, c).reset();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
f = new WeakMap(), r = new WeakMap(), I = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), B = new WeakMap(), A = new WeakMap(), c = new WeakMap(), O = new WeakMap(), R = new WeakMap(), M = new WeakMap(), P = new WeakMap(), T = new WeakSet(), j = function(e) {
|
|
247
|
+
if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, c).set("loaded", !1), t(this, c).set("error", !1), t(this, c).set("loading", !1), t(this, c).set("clear", !1), t(this, c).set("playing", !1), t(this, c).set("metadata", !1), e) {
|
|
248
|
+
s(this, A, `${t(this, B)}-${e.url}`);
|
|
249
|
+
const h = this.hasAttribute("keep-source-parameters");
|
|
250
|
+
t(this, c).set("loading", !0), s(this, M, h ? e.url : e.name + e.extension), this.consumeSource(t(this, M)), !t(this, g) && !t(this, E) && J.add(t(this, A)), t(this, r).onloadeddata = () => {
|
|
251
|
+
t(this, D).call(this);
|
|
252
|
+
}, t(this, r).onload = () => {
|
|
253
|
+
t(this, D).call(this);
|
|
254
|
+
}, t(this, r).onerror = () => {
|
|
255
|
+
t(this, K).call(this, t(this, M));
|
|
256
|
+
};
|
|
257
|
+
} else
|
|
258
|
+
s(this, M, null), this.consumeSource(null);
|
|
259
|
+
}, G = new WeakMap(), D = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), H = new WeakMap(), V = new WeakMap();
|
|
260
|
+
export {
|
|
261
|
+
nt as S,
|
|
262
|
+
xt as a,
|
|
263
|
+
et as b,
|
|
264
|
+
ht as c
|
|
265
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var Y=l=>{throw TypeError(l)};var Z=(l,n,e)=>n.has(l)||Y("Cannot "+e);var t=(l,n,e)=>(Z(l,n,"read from private field"),e?e.call(l):n.get(l)),i=(l,n,e)=>n.has(l)?Y("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,e),s=(l,n,e,h)=>(Z(l,n,"write to private field"),h?h.call(l,e):n.set(l,e),e),F=(l,n,e)=>(Z(l,n,"access private method"),e);const rt=require("./element-linked-store/index.cjs"),nt=require("./index-DekP7OZe.cjs"),w=require("./events-KVanG9sR.cjs"),tt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const J=require("./loading/index.cjs"),at=require("./order/index.cjs"),et=require("./window-resizer/index.cjs"),ht=require("./Store-Cd1GlEmZ.cjs");var V,b,_,L,m,p,M;class st{constructor(n){i(this,V);i(this,b);i(this,_);i(this,L);i(this,m);i(this,p);i(this,M);s(this,V,n);let e=n.split(".");const h=/\b\d{1,2}x\b/g,a=e.find(y=>y.match(h)&&parseInt(y));s(this,_,a?parseInt(a):1),a&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const o=/\d+max/g,d=/\d+min/g,N=/\d+mar/g,U=/\d+mir/g,W=e.find(y=>y.match(o)),u=e.find(y=>y.match(d)),x=e.find(y=>y.match(N)),X=e.find(y=>y.match(U));x?(s(this,m,parseInt(x)),s(this,p,"max"),s(this,L,`(max-aspect-ratio: ${t(this,m)})`)):X?(s(this,m,parseInt(X)),s(this,p,"max"),s(this,L,`(min-aspect-ratio: ${t(this,m)})`)):W?(s(this,m,parseInt(W)),s(this,p,"max"),s(this,L,`(max-width: ${t(this,m)}px)`)):u?(s(this,m,parseInt(u)),s(this,L,`(min-width: ${t(this,m)}px)`),s(this,p,"min")):(s(this,m,0),s(this,L,`(min-width: ${t(this,m)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,m)}${t(this,p)}`,"")),s(this,M,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,m)}${t(this,p)}`,""))}get url(){return t(this,V)}get name(){return t(this,b)}get density(){return t(this,_)}get query(){return t(this,L)}get extension(){return t(this,M)}get queryType(){return t(this,p)}get queryValue(){return t(this,m)}}V=new WeakMap,b=new WeakMap,_=new WeakMap,L=new WeakMap,m=new WeakMap,p=new WeakMap,M=new WeakMap;var v;class Q{constructor(n,e){i(this,v);s(this,v,new Map);const h=(e==null?void 0:e.mediaBuckets)!==!1,a=typeof n=="string"?h?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,o=[];a.forEach(u=>{const x=new st(u);o.push([x.query,x])});const d=o.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),N=o.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=o.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...d,...N]:[...d,...N]).forEach(u=>{t(this,v).has(u[0])||t(this,v).set(u[0],[]),t(this,v).get(u[0]).push(u[1])})}get mediaBuckets(){return t(this,v)}}v=new WeakMap;var A,$;class it extends ht.Store{constructor(e){super(void 0);i(this,A);i(this,$,()=>{let e;t(this,A).mediaBuckets.forEach((o,d)=>{matchMedia(d).matches&&(e=o)});let h,a=0;e==null||e.forEach(o=>{o.density>a&&o.density<=Math.max(devicePixelRatio,1)&&(a=o.density,h=o)}),e!=null&&e.length&&!h&&(h=e[0]),this.current=h});s(this,A,new Q(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,A,new Q(e.srcset,e.sourceSetOptions)),t(this,$).call(this)}close(){super.close(),this.disconnect()}connect(){et.windowResizer.subscribe(t(this,$),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,$).call(this)}disconnect(){et.windowResizer.unsubscribe(t(this,$))}}A=new WeakMap,$=new WeakMap;function ot(l){if(isNaN(l))return"0:00";const n=Math.floor(Math.max(0,l)),e=Math.floor(n/3600),h=Math.floor(n%3600/60),o=(n%60).toString().padStart(2,"0");if(e>0){const d=h.toString().padStart(2,"0");return`${e}:${d}:${o}`}else return`${h}:${o}`}let ct=0;var f,r,I,E,S,g,z,k,c,R,O,q,B,T,j,G,P,K,D,H,C;class lt extends HTMLElement{constructor(e){super();i(this,T);i(this,f,null);i(this,r,null);i(this,I,this);i(this,E,!1);i(this,S,!1);i(this,g,!1);i(this,z,"");i(this,k,"");i(this,c,new rt.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,R,null);i(this,O);i(this,q,null);i(this,B);i(this,G,e=>{const h=e[0];t(this,g)&&(!t(this,S)||this.hasAttribute("reload-source"))&&h.isIntersecting&&this.triggerLazyLoad(),h.isIntersecting?w.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,T,j).call(this,void 0),s(this,S,!1)),w.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,P,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.complete(t(this,k)),w.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,O,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,E,!0)});i(this,K,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.error(t(this,k)),w.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,D,()=>{t(this,c).set("playing",!0),w.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,H,()=>{t(this,c).set("playing",!1),w.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,C,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,c).set("metadata",!0),w.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(h=>{h.textContent=ot(e.duration)}))});s(this,B,e==null?void 0:e.sourceSetOptions),nt.isBrowser&&window.IntersectionObserver&&s(this,R,new IntersectionObserver(t(this,G))),t(this,c).subscribe(h=>{var o;const a=(o=this.getAttribute("data-global-play-class"))==null?void 0:o.split(",");a!=null&&a.length&&(h.current.playing?a.forEach(d=>{document.documentElement.classList.add(d.trim())}):a.forEach(d=>{document.documentElement.classList.remove(d.trim())}))})}get consumerElement(){return t(this,r)}get consumerHolderElement(){return t(this,I)}get sourceManager(){return t(this,f)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,q)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,S)&&t(this,f).current&&t(this,f).current!==t(this,f).previous&&(s(this,S,!0),F(this,T,j).call(this,t(this,f).current))}connectedCallback(){s(this,z,`source-consumer-${++ct}`);const e=this.getAttribute("srcset")||"",h=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;h&&t(this,c).addElement(h),s(this,I,this.querySelector("[data-consumer-holder]")||this),this.querySelectorAll(".source-consumer").forEach(a=>a==null?void 0:a.remove()),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,D)),t(this,r).addEventListener("pause",t(this,H)),t(this,r).addEventListener("loadedmetadata",t(this,C)),t(this,C).call(this),this.classList.contains("MaskedVideo__video__element")&&console.log(),Array.from(this.attributes).forEach(a=>{if(a.name!=="srcset"){const o=a.nodeValue||"",d=tt.kebabToCamel(a.name);d in t(this,r)&&(t(this,r)[d]=o||!0)}});for(const a in this.dataset){const o=this.dataset[a],d=tt.kebabToCamel(a);d in t(this,r)&&(t(this,r)[d]=o?o==="false"?!1:o:!0)}t(this,I).appendChild(t(this,r)),s(this,f,new it({srcset:e,sourceSetOptions:t(this,B)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(a=>{(!t(this,g)||t(this,g)&&t(this,S))&&F(this,T,j).call(this,a.current)}),t(this,f).connect(),t(this,R).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,O)),t(this,R).disconnect(),(e=t(this,f))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,D)),t(this,r).removeEventListener("pause",t(this,H)),t(this,r).removeEventListener("loadedmetadata",t(this,C)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,S,!1),t(this,c).reset()}}f=new WeakMap,r=new WeakMap,I=new WeakMap,E=new WeakMap,S=new WeakMap,g=new WeakMap,z=new WeakMap,k=new WeakMap,c=new WeakMap,R=new WeakMap,O=new WeakMap,q=new WeakMap,B=new WeakMap,T=new WeakSet,j=function(e){if(clearTimeout(t(this,O)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),t(this,c).set("playing",!1),t(this,c).set("metadata",!1),e){s(this,k,`${t(this,z)}-${e.url}`);const h=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,q,h?e.url:e.name+e.extension),this.consumeSource(t(this,q)),!t(this,g)&&!t(this,E)&&J.loading.add(t(this,k)),t(this,r).onloadeddata=()=>{t(this,P).call(this)},t(this,r).onload=()=>{t(this,P).call(this)},t(this,r).onerror=()=>{t(this,K).call(this,t(this,q))}}else s(this,q,null),this.consumeSource(null)},G=new WeakMap,P=new WeakMap,K=new WeakMap,D=new WeakMap,H=new WeakMap,C=new WeakMap;exports.Source=st;exports.SourceElement=lt;exports.SourceManager=it;exports.SourceSet=Q;
|
package/lib/iframe/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-
|
|
1
|
+
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
|
package/lib/iframe/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var a = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var u = (r, t, e) => t.has(r) || a("Cannot " + e);
|
|
5
5
|
var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
|
|
6
|
-
import { a as E } from "../SourceElement-
|
|
6
|
+
import { a as E } from "../SourceElement-BnMxiOqY.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as f } from "../index-Bv9zgfdb.js";
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
|
package/lib/image/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as m } from "../Viewport-DA10iWAO.js";
|
|
2
|
-
import { a as s } from "../SourceElement-
|
|
2
|
+
import { a as s } from "../SourceElement-BnMxiOqY.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
4
|
import "../Store-0BVty6AZ.js";
|
|
5
5
|
import { i } from "../index-Bv9zgfdb.js";
|
package/lib/sequence/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-
|
|
1
|
+
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const M=require("../canvas/index.cjs");function W(s){const n=s.match(/\{([\d-]+)\}/);if(n){const e=n[1].split("-");if(e.length===2){const i=parseInt(e[0],10),f=parseInt(e[1],10);return{start:i,end:f}}}return null}var h,E,S,m,d,b,g,p,a,v;class B extends H.SourceElement{constructor(e){super();c(this,h,[]);c(this,E,new q.CSSProperty(this,"--fit","contain"));c(this,S,new q.CSSProperty(this,"--autoplay",!1));c(this,m,new q.CSSProperty(this,"--offset-x",.5));c(this,d,new q.CSSProperty(this,"--offset-y",.5));c(this,b,null);c(this,g,0);c(this,p,1);c(this,a,()=>{if(t(this,h).length){const e=t(this,h)[0];t(this,E).current==="cover"?l(this,b,z.cover(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current)):l(this,b,z.contain(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current))}});c(this,v,e=>{if(this.status.isFalse("loaded")||!t(this,b))return;e.detail.context.clearRect(0,0,e.detail.width,e.detail.height);const i=t(this,h)[t(this,g)];i&&e.detail.context.drawImage(i,...t(this,b)),t(this,S).current&&l(this,g,(t(this,g)+1)%t(this,h).length)});k.isBrowser&&(l(this,p,parseInt(((e==null?void 0:e.pad)||this.getAttribute("pad")||"1").toString())),t(this,E).subscribe(t(this,a)),t(this,m).subscribe(t(this,a)),t(this,d).subscribe(t(this,a)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",t(this,v))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",t(this,v))}))}setProgress(e){t(this,h).length&&l(this,g,Math.floor((t(this,h).length-1)*e))}connectedCallback(){super.connectedCallback(),t(this,S).observe(),t(this,E).observe(),t(this,m).observe(),t(this,d).observe(),R.elementResizer.subscribe(this,t(this,a))}disconnectedCallback(){super.disconnectedCallback(),t(this,S).unobserve(),t(this,E).unobserve(),t(this,m).unobserve(),t(this,d).unobserve(),l(this,h,[]),R.elementResizer.unsubscribe(t(this,a)),this.consumerElement.removeEventListener("canvasRender",t(this,v))}createConsumer(){return new M.CanvasElement}consumeSource(e){return L(this,null,function*(){var i,f,w,y;if(e){this.consumerElement.removeEventListener("canvasRender",t(this,v));const u=[],o=W(e);if(o)for(let r=o.start;r<=o.end;r++){const P=e.replace(/\{([^}]+)\}/,r.toString().padStart(t(this,p),"0")),C=new Image;C.src=P,u.push(C)}else{const r=new Image;r.src=e,u.push(r)}try{yield Promise.all(u.map((r,P)=>new Promise((C,_)=>{r.onload=()=>{C()},r.onerror=j=>{_(`${r.src} Image not found`)}}))),l(this,h,u),t(this,a).call(this),(f=(i=this.consumerElement).onload)==null||f.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",t(this,v))}catch(r){console.error(r),(y=(w=this.consumerElement).onerror)==null||y.call(w,new Event("error"))}}})}}h=new WeakMap,E=new WeakMap,S=new WeakMap,m=new WeakMap,d=new WeakMap,b=new WeakMap,g=new WeakMap,p=new WeakMap,a=new WeakMap,v=new WeakMap;k.isBrowser&&!customElements.get("e-sequence")&&customElements.define("e-sequence",B);exports.SequenceElement=B;
|
package/lib/sequence/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { elementResizer as k } from "../element-resizer/index.js";
|
|
|
24
24
|
import { i as q } from "../index-Bv9zgfdb.js";
|
|
25
25
|
import { c as B, a as H } from "../canvas-DeZ0SLUJ.js";
|
|
26
26
|
import "construct-style-sheets-polyfill";
|
|
27
|
-
import { a as W } from "../SourceElement-
|
|
27
|
+
import { a as W } from "../SourceElement-BnMxiOqY.js";
|
|
28
28
|
import "../window-resizer/index.js";
|
|
29
29
|
import "../Store-0BVty6AZ.js";
|
|
30
30
|
import { CanvasElement as A } from "../canvas/index.js";
|
package/lib/source/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-VVdVc1d-.cjs");exports.Source=e.Source;exports.SourceElement=e.SourceElement;exports.SourceManager=e.SourceManager;exports.SourceSet=e.SourceSet;
|
package/lib/source/index.js
CHANGED
package/lib/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=t=>{throw TypeError(t)};var E=(t,s,e)=>s.has(t)||d("Cannot "+e);var i=(t,s,e)=>(E(t,s,"read from private field"),e?e.call(t):s.get(t)),a=(t,s,e)=>s.has(t)?d("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),n=(t,s,e,m)=>(E(t,s,"write to private field"),m?m.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs"),y=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const h=require("../ticker/index.cjs");var r,u,c,o,l;class p extends b.SourceElement{constructor(){super(...arguments);a(this,r,0);a(this,u,!1);a(this,c,this);a(this,o,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e!==i(this,r)&&y.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}}),e>i(this,r)&&n(this,r,e),this.consumerElement.readyState===4&&(h.ticker.unsubscribe(i(this,o)),i(this,u)&&this.sourceManager.current&&this.consumerElement.play())});a(this,l,()=>{this.hasAttribute("click-controls")&&(this.consumerElement.paused?this.consumerElement.play():this.hasAttribute("controls")||this.consumerElement.pause())})}connectedCallback(){super.connectedCallback();const e=this.getAttribute("click-controls");e&&(e==="parent"?n(this,c,this.parentElement):n(this,c,document.querySelector(e)||this)),this.addEventListener("sourceCapture",()=>{n(this,u,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():n(this,u,!0)),h.ticker.subscribe(i(this,o))}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&this.consumerElement.pause(),this.hasAttribute("release-pause")&&this.consumerElement.pause(),this.hasAttribute("release-stop")&&(this.consumerElement.pause(),this.consumerElement.currentTime=0),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")}),i(this,c).addEventListener("click",i(this,l))}disconnectedCallback(){super.disconnectedCallback(),h.ticker.unsubscribe(i(this,o)),n(this,r,0),i(this,c).removeEventListener("click",i(this,l))}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||"",e&&this.hasAttribute("volume")&&(this.consumerElement.volume=parseFloat(this.getAttribute("volume")||"1"))}}r=new WeakMap,u=new WeakMap,c=new WeakMap,o=new WeakMap,l=new WeakMap;f.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",p);exports.VideoElement=p;
|
package/lib/video/index.js
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var i = (t, s, e) => (
|
|
6
|
-
import { a as
|
|
4
|
+
var p = (t, s, e) => s.has(t) || d("Cannot " + e);
|
|
5
|
+
var i = (t, s, e) => (p(t, s, "read from private field"), e ? e.call(t) : s.get(t)), c = (t, s, e) => s.has(t) ? d("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), a = (t, s, e, m) => (p(t, s, "write to private field"), m ? m.call(t, e) : s.set(t, e), e);
|
|
6
|
+
import { a as E } from "../SourceElement-BnMxiOqY.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
|
-
import { i as
|
|
10
|
-
import { d as
|
|
9
|
+
import { i as f } from "../index-Bv9zgfdb.js";
|
|
10
|
+
import { d as b } from "../events-CsVF98U6.js";
|
|
11
11
|
import "construct-style-sheets-polyfill";
|
|
12
|
-
import { ticker as
|
|
13
|
-
var r,
|
|
14
|
-
class
|
|
12
|
+
import { ticker as h } from "../ticker/index.js";
|
|
13
|
+
var r, o, n, l, u;
|
|
14
|
+
class y extends E {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
c(this, r, 0);
|
|
18
|
-
c(this,
|
|
19
|
-
c(this, n,
|
|
18
|
+
c(this, o, !1);
|
|
19
|
+
c(this, n, this);
|
|
20
|
+
c(this, l, () => {
|
|
20
21
|
this.classList.add(`state-${this.consumerElement.readyState}`);
|
|
21
22
|
const e = this.consumerElement.readyState / 4;
|
|
22
|
-
e !== i(this, r) &&
|
|
23
|
+
e !== i(this, r) && b(this, "videoReadyStateChange", {
|
|
23
24
|
detail: {
|
|
24
25
|
readyState: this.consumerElement.readyState,
|
|
25
26
|
progress: i(this, r)
|
|
26
27
|
}
|
|
27
|
-
}), e > i(this, r) &&
|
|
28
|
+
}), e > i(this, r) && a(this, r, e), this.consumerElement.readyState === 4 && (h.unsubscribe(i(this, l)), i(this, o) && this.sourceManager.current && this.consumerElement.play());
|
|
29
|
+
});
|
|
30
|
+
c(this, u, () => {
|
|
31
|
+
this.hasAttribute("click-controls") && (this.consumerElement.paused ? this.consumerElement.play() : this.hasAttribute("controls") || this.consumerElement.pause());
|
|
28
32
|
});
|
|
29
33
|
}
|
|
30
34
|
connectedCallback() {
|
|
31
|
-
super.connectedCallback()
|
|
32
|
-
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
const e = this.getAttribute("click-controls");
|
|
37
|
+
e && (e === "parent" ? a(this, n, this.parentElement) : a(this, n, document.querySelector(e) || this)), this.addEventListener("sourceCapture", () => {
|
|
38
|
+
a(this, o, !1), this.hasAttribute("capture-autoplay") && (this.sourceManager.current ? this.consumerElement.play() : a(this, o, !0)), h.subscribe(i(this, l));
|
|
33
39
|
}), this.addEventListener("sourceRelease", () => {
|
|
34
40
|
this.hasAttribute("capture-autoplay") && this.consumerElement.pause(), this.hasAttribute("release-pause") && this.consumerElement.pause(), this.hasAttribute("release-stop") && (this.consumerElement.pause(), this.consumerElement.currentTime = 0), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0), this.hasAttribute("reload-source") && this.classList.remove(
|
|
35
41
|
"state-0",
|
|
@@ -38,12 +44,10 @@ class f extends d {
|
|
|
38
44
|
"state-3",
|
|
39
45
|
"state-4"
|
|
40
46
|
);
|
|
41
|
-
}), this.addEventListener("click", ()
|
|
42
|
-
this.hasAttribute("click-controls") && (this.consumerElement.paused ? this.consumerElement.play() : this.hasAttribute("controls") || this.consumerElement.pause());
|
|
43
|
-
});
|
|
47
|
+
}), i(this, n).addEventListener("click", i(this, u));
|
|
44
48
|
}
|
|
45
49
|
disconnectedCallback() {
|
|
46
|
-
super.disconnectedCallback(),
|
|
50
|
+
super.disconnectedCallback(), h.unsubscribe(i(this, l)), a(this, r, 0), i(this, n).removeEventListener("click", i(this, u));
|
|
47
51
|
}
|
|
48
52
|
createConsumer() {
|
|
49
53
|
return document.createElement("video");
|
|
@@ -54,8 +58,8 @@ class f extends d {
|
|
|
54
58
|
));
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
|
-
r = new WeakMap(),
|
|
58
|
-
|
|
61
|
+
r = new WeakMap(), o = new WeakMap(), n = new WeakMap(), l = new WeakMap(), u = new WeakMap();
|
|
62
|
+
f && !customElements.get("e-video") && customElements.define("e-video", y);
|
|
59
63
|
export {
|
|
60
|
-
|
|
64
|
+
y as VideoElement
|
|
61
65
|
};
|
package/lib/youtube/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-
|
|
1
|
+
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-VVdVc1d-.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const L=require("../index-DekP7OZe.cjs"),T=require("../events-KVanG9sR.cjs"),_=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");var i,c,n,y,l,f,b,R,p,I;const d=class d extends A.SourceElement{constructor(){super();o(this,p);o(this,i);o(this,c);o(this,n,!1);o(this,y,!1);o(this,l,()=>{u(this,n,e(this,n)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),u(this,i,new window.YT.Player(e(this,c),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,f),onError:e(this,b),onStateChange:e(this,R)}}))});o(this,f,()=>{u(this,y,!0),w(this,p,I).call(this)});o(this,b,t=>{var a,h;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(h=(a=this.consumerElement).onerror)==null||h.call(a,new Event("error"))});o(this,R,()=>{});u(this,c,"yt-"+_.generateId(10)),d.__apiReady||(window.onYouTubeIframeAPIReady=()=>{d.__apiReady=!0,T.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,y)?e(this,i).playVideo():u(this,n,!0))}),this.addEventListener("sourceRelease",()=>{e(this,i)&&this.hasAttribute("capture-autoplay")&&(e(this,i).pauseVideo(),this.hasAttribute("replay")&&e(this,i).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,c),t}consumeSource(t){var a;if(t){if(!document.getElementById("youtube-script")){const h=document.createElement("script");h.id,h.src="https://www.youtube.com/iframe_api";const g=document.getElementsByTagName("script")[0];(a=g.parentNode)==null||a.insertBefore(h,g)}e(this,i)?w(this,p,I).call(this):d.__apiReady?e(this,l).call(this):addEventListener("youTubeIframeAPIReady",e(this,l))}else e(this,i)&&e(this,i).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,i)&&e(this,i).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,l))}};i=new WeakMap,c=new WeakMap,n=new WeakMap,y=new WeakMap,l=new WeakMap,f=new WeakMap,b=new WeakMap,R=new WeakMap,p=new WeakSet,I=function(){var t,a;this.currentURL&&(this.currentURL.startsWith("http")?e(this,i).loadVideoByUrl(this.currentURL):e(this,i).loadVideoById(this.currentURL)),e(this,n)?e(this,i).playVideo():e(this,i).stopVideo(),u(this,n,!1),(a=(t=this.consumerElement).onload)==null||a.call(t,new Event("load"))},d.__apiReady=!1;let m=d;L.isBrowser&&!customElements.get("e-youtube")&&customElements.define("e-youtube",m);exports.YouTubeElement=m;
|
package/lib/youtube/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var L = (s) => {
|
|
|
3
3
|
};
|
|
4
4
|
var b = (s, r, t) => r.has(s) || L("Cannot " + t);
|
|
5
5
|
var e = (s, r, t) => (b(s, r, "read from private field"), t ? t.call(s) : r.get(s)), o = (s, r, t) => r.has(s) ? L("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), u = (s, r, t, a) => (b(s, r, "write to private field"), a ? a.call(s, t) : r.set(s, t), t), E = (s, r, t) => (b(s, r, "access private method"), t);
|
|
6
|
-
import { a as g } from "../SourceElement-
|
|
6
|
+
import { a as g } from "../SourceElement-BnMxiOqY.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as v } from "../index-Bv9zgfdb.js";
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var Y=c=>{throw TypeError(c)};var Z=(c,n,e)=>n.has(c)||Y("Cannot "+e);var t=(c,n,e)=>(Z(c,n,"read from private field"),e?e.call(c):n.get(c)),i=(c,n,e)=>n.has(c)?Y("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,e),s=(c,n,e,a)=>(Z(c,n,"write to private field"),a?a.call(c,e):n.set(c,e),e),F=(c,n,e)=>(Z(c,n,"access private method"),e);const it=require("./element-linked-store/index.cjs"),rt=require("./index-DekP7OZe.cjs"),w=require("./events-KVanG9sR.cjs"),nt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const J=require("./loading/index.cjs"),at=require("./order/index.cjs"),tt=require("./window-resizer/index.cjs"),ht=require("./Store-Cd1GlEmZ.cjs");var V,b,C,S,d,p,M;class et{constructor(n){i(this,V);i(this,b);i(this,C);i(this,S);i(this,d);i(this,p);i(this,M);s(this,V,n);let e=n.split(".");const a=/\b\d{1,2}x\b/g,h=e.find(y=>y.match(a)&&parseInt(y));s(this,C,h?parseInt(h):1),h&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,m=/\d+min/g,N=/\d+mar/g,U=/\d+mir/g,W=e.find(y=>y.match(l)),u=e.find(y=>y.match(m)),x=e.find(y=>y.match(N)),X=e.find(y=>y.match(U));x?(s(this,d,parseInt(x)),s(this,p,"max"),s(this,S,`(max-aspect-ratio: ${t(this,d)})`)):X?(s(this,d,parseInt(X)),s(this,p,"max"),s(this,S,`(min-aspect-ratio: ${t(this,d)})`)):W?(s(this,d,parseInt(W)),s(this,p,"max"),s(this,S,`(max-width: ${t(this,d)}px)`)):u?(s(this,d,parseInt(u)),s(this,S,`(min-width: ${t(this,d)}px)`),s(this,p,"min")):(s(this,d,0),s(this,S,`(min-width: ${t(this,d)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,d)}${t(this,p)}`,"")),s(this,M,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,d)}${t(this,p)}`,""))}get url(){return t(this,V)}get name(){return t(this,b)}get density(){return t(this,C)}get query(){return t(this,S)}get extension(){return t(this,M)}get queryType(){return t(this,p)}get queryValue(){return t(this,d)}}V=new WeakMap,b=new WeakMap,C=new WeakMap,S=new WeakMap,d=new WeakMap,p=new WeakMap,M=new WeakMap;var q;class Q{constructor(n,e){i(this,q);s(this,q,new Map);const a=(e==null?void 0:e.mediaBuckets)!==!1,h=typeof n=="string"?a?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,l=[];h.forEach(u=>{const x=new et(u);l.push([x.query,x])});const m=l.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),N=l.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=l.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...m,...N]:[...m,...N]).forEach(u=>{t(this,q).has(u[0])||t(this,q).set(u[0],[]),t(this,q).get(u[0]).push(u[1])})}get mediaBuckets(){return t(this,q)}}q=new WeakMap;var I,$;class st extends ht.Store{constructor(e){super(void 0);i(this,I);i(this,$,()=>{let e;t(this,I).mediaBuckets.forEach((l,m)=>{matchMedia(m).matches&&(e=l)});let a,h=0;e==null||e.forEach(l=>{l.density>h&&l.density<=Math.max(devicePixelRatio,1)&&(h=l.density,a=l)}),e!=null&&e.length&&!a&&(a=e[0]),this.current=a});s(this,I,new Q(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,I,new Q(e.srcset,e.sourceSetOptions)),t(this,$).call(this)}close(){super.close(),this.disconnect()}connect(){tt.windowResizer.subscribe(t(this,$),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,$).call(this)}disconnect(){tt.windowResizer.unsubscribe(t(this,$))}}I=new WeakMap,$=new WeakMap;function ot(c){if(isNaN(c))return"0:00";const n=Math.floor(Math.max(0,c)),e=Math.floor(n/3600),a=Math.floor(n%3600/60),l=(n%60).toString().padStart(2,"0");if(e>0){const m=a.toString().padStart(2,"0");return`${e}:${m}:${l}`}else return`${a}:${l}`}let ct=0;var f,r,R,E,L,g,B,A,o,k,O,v,P,T,j,G,_,K,D,H,z;class ut extends HTMLElement{constructor(e){super();i(this,T);i(this,f,null);i(this,r,null);i(this,R,this);i(this,E,!1);i(this,L,!1);i(this,g,!1);i(this,B,"");i(this,A,"");i(this,o,new it.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,k,null);i(this,O);i(this,v,null);i(this,P);i(this,G,e=>{const a=e[0];t(this,g)&&(!t(this,L)||this.hasAttribute("reload-source"))&&a.isIntersecting&&this.triggerLazyLoad(),a.isIntersecting?w.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,T,j).call(this,void 0),s(this,L,!1)),w.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,_,()=>{t(this,o).set("loaded",!0),t(this,o).set("error",!1),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.complete(t(this,A)),w.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,O,setTimeout(()=>{t(this,o).set("clear",!0)},parseFloat(e)*1e3)):t(this,o).set("clear",!0),s(this,E,!0)});i(this,K,e=>{t(this,o).set("loaded",!1),t(this,o).set("error",!0),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.error(t(this,A)),w.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,D,()=>{t(this,o).set("playing",!0),w.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,H,()=>{t(this,o).set("playing",!1),w.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,z,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,o).set("metadata",!0),w.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(a=>{a.textContent=ot(e.duration)}))});s(this,P,e==null?void 0:e.sourceSetOptions),rt.isBrowser&&window.IntersectionObserver&&s(this,k,new IntersectionObserver(t(this,G))),t(this,o).subscribe(a=>{var l;const h=(l=this.getAttribute("data-global-play-class"))==null?void 0:l.split(",");h!=null&&h.length&&(a.current.playing?h.forEach(m=>{document.documentElement.classList.add(m.trim())}):h.forEach(m=>{document.documentElement.classList.remove(m.trim())}))})}get consumerElement(){return t(this,r)}get consumerHolderElement(){return t(this,R)}get sourceManager(){return t(this,f)}get status(){return t(this,o)}get isLazy(){return t(this,g)}get currentURL(){return t(this,v)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,L)&&t(this,f).current&&t(this,f).current!==t(this,f).previous&&(s(this,L,!0),F(this,T,j).call(this,t(this,f).current))}connectedCallback(){s(this,B,`source-consumer-${++ct}`);const e=this.getAttribute("srcset")||"",a=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;a&&t(this,o).addElement(a),s(this,R,this.querySelector("[data-consumer-holder]")||this),this.querySelectorAll(".source-consumer").forEach(h=>h==null?void 0:h.remove()),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,D)),t(this,r).addEventListener("pause",t(this,H)),t(this,r).addEventListener("loadedmetadata",t(this,z)),t(this,z).call(this),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const l=h.nodeValue||"",m=nt.kebabToCamel(h.name);m in t(this,r)&&(t(this,r)[m]=l||!0)}}),t(this,R).appendChild(t(this,r)),s(this,f,new st({srcset:e,sourceSetOptions:t(this,P)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(h=>{(!t(this,g)||t(this,g)&&t(this,L))&&F(this,T,j).call(this,h.current)}),t(this,f).connect(),t(this,k).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,O)),t(this,k).disconnect(),(e=t(this,f))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,D)),t(this,r).removeEventListener("pause",t(this,H)),t(this,r).removeEventListener("loadedmetadata",t(this,z)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,L,!1),t(this,o).reset()}}f=new WeakMap,r=new WeakMap,R=new WeakMap,E=new WeakMap,L=new WeakMap,g=new WeakMap,B=new WeakMap,A=new WeakMap,o=new WeakMap,k=new WeakMap,O=new WeakMap,v=new WeakMap,P=new WeakMap,T=new WeakSet,j=function(e){if(clearTimeout(t(this,O)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,o).set("loaded",!1),t(this,o).set("error",!1),t(this,o).set("loading",!1),t(this,o).set("clear",!1),t(this,o).set("playing",!1),t(this,o).set("metadata",!1),e){s(this,A,`${t(this,B)}-${e.url}`);const a=this.hasAttribute("keep-source-parameters");t(this,o).set("loading",!0),s(this,v,a?e.url:e.name+e.extension),this.consumeSource(t(this,v)),!t(this,g)&&!t(this,E)&&J.loading.add(t(this,A)),t(this,r).onloadeddata=()=>{t(this,_).call(this)},t(this,r).onload=()=>{t(this,_).call(this)},t(this,r).onerror=()=>{t(this,K).call(this,t(this,v))}}else s(this,v,null),this.consumeSource(null)},G=new WeakMap,_=new WeakMap,K=new WeakMap,D=new WeakMap,H=new WeakMap,z=new WeakMap;exports.Source=et;exports.SourceElement=ut;exports.SourceManager=st;exports.SourceSet=Q;
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
var X = (c) => {
|
|
2
|
-
throw TypeError(c);
|
|
3
|
-
};
|
|
4
|
-
var Z = (c, a, e) => a.has(c) || X("Cannot " + e);
|
|
5
|
-
var t = (c, a, e) => (Z(c, a, "read from private field"), e ? e.call(c) : a.get(c)), i = (c, a, e) => a.has(c) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(c) : a.set(c, e), s = (c, a, e, n) => (Z(c, a, "write to private field"), n ? n.call(c, e) : a.set(c, e), e), j = (c, a, e) => (Z(c, a, "access private method"), e);
|
|
6
|
-
import { ElementLinkedStore as et } from "./element-linked-store/index.js";
|
|
7
|
-
import { i as st } from "./index-Bv9zgfdb.js";
|
|
8
|
-
import { d as w } from "./events-CsVF98U6.js";
|
|
9
|
-
import { k as it } from "./string-BlMQbe8b.js";
|
|
10
|
-
import "construct-style-sheets-polyfill";
|
|
11
|
-
import { loading as J } from "./loading/index.js";
|
|
12
|
-
import { RESIZE_ORDER as rt } from "./order/index.js";
|
|
13
|
-
import { windowResizer as Y } from "./window-resizer/index.js";
|
|
14
|
-
import { S as at } from "./Store-0BVty6AZ.js";
|
|
15
|
-
var C, S, z, L, d, p, q;
|
|
16
|
-
class nt {
|
|
17
|
-
constructor(a) {
|
|
18
|
-
i(this, C);
|
|
19
|
-
i(this, S);
|
|
20
|
-
i(this, z);
|
|
21
|
-
i(this, L);
|
|
22
|
-
i(this, d);
|
|
23
|
-
i(this, p);
|
|
24
|
-
i(this, q);
|
|
25
|
-
s(this, C, a);
|
|
26
|
-
let e = a.split(".");
|
|
27
|
-
const n = /\b\d{1,2}x\b/g, h = e.find((y) => y.match(n) && parseInt(y));
|
|
28
|
-
s(this, z, h ? parseInt(h) : 1), h && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
-
const u = /\d+max/g, m = /\d+min/g, U = /\d+mar/g, F = /\d+mir/g, W = e.find((y) => y.match(u)), l = e.find((y) => y.match(m)), x = e.find((y) => y.match(U)), Q = e.find((y) => y.match(F));
|
|
30
|
-
x ? (s(this, d, parseInt(x)), s(this, p, "max"), s(this, L, `(max-aspect-ratio: ${t(this, d)})`)) : Q ? (s(this, d, parseInt(Q)), s(this, p, "max"), s(this, L, `(min-aspect-ratio: ${t(this, d)})`)) : W ? (s(this, d, parseInt(W)), s(this, p, "max"), s(this, L, `(max-width: ${t(this, d)}px)`)) : l ? (s(this, d, parseInt(l)), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")) : (s(this, d, 0), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
|
|
31
|
-
`.${t(this, d)}${t(this, p)}`,
|
|
32
|
-
""
|
|
33
|
-
)), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
|
|
34
|
-
`.${t(this, d)}${t(this, p)}`,
|
|
35
|
-
""
|
|
36
|
-
));
|
|
37
|
-
}
|
|
38
|
-
get url() {
|
|
39
|
-
return t(this, C);
|
|
40
|
-
}
|
|
41
|
-
get name() {
|
|
42
|
-
return t(this, S);
|
|
43
|
-
}
|
|
44
|
-
get density() {
|
|
45
|
-
return t(this, z);
|
|
46
|
-
}
|
|
47
|
-
get query() {
|
|
48
|
-
return t(this, L);
|
|
49
|
-
}
|
|
50
|
-
get extension() {
|
|
51
|
-
return t(this, q);
|
|
52
|
-
}
|
|
53
|
-
get queryType() {
|
|
54
|
-
return t(this, p);
|
|
55
|
-
}
|
|
56
|
-
get queryValue() {
|
|
57
|
-
return t(this, d);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), q = new WeakMap();
|
|
61
|
-
var M;
|
|
62
|
-
class tt {
|
|
63
|
-
constructor(a, e) {
|
|
64
|
-
i(this, M);
|
|
65
|
-
s(this, M, /* @__PURE__ */ new Map());
|
|
66
|
-
const n = (e == null ? void 0 : e.mediaBuckets) !== !1, h = typeof a == "string" ? n ? a.trim().split(",").map((l) => l.trim()).filter((l) => !!l) : [a] : a, u = [];
|
|
67
|
-
h.forEach((l) => {
|
|
68
|
-
const x = new nt(l);
|
|
69
|
-
u.push([x.query, x]);
|
|
70
|
-
});
|
|
71
|
-
const m = u.filter((l) => l[1].queryType.includes("max")).sort((l, x) => x[1].queryValue - l[1].queryValue), U = u.filter((l) => l[1].queryType.includes("min") && l[1].queryValue !== 0).sort((l, x) => l[1].queryValue - x[1].queryValue), F = u.filter((l) => l[0] === "(min-width: 0px)");
|
|
72
|
-
(F ? [...F, ...m, ...U] : [...m, ...U]).forEach((l) => {
|
|
73
|
-
t(this, M).has(l[0]) || t(this, M).set(l[0], []), t(this, M).get(l[0]).push(l[1]);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
get mediaBuckets() {
|
|
77
|
-
return t(this, M);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
M = new WeakMap();
|
|
81
|
-
var I, $;
|
|
82
|
-
class ht extends at {
|
|
83
|
-
constructor(e) {
|
|
84
|
-
super(void 0);
|
|
85
|
-
i(this, I);
|
|
86
|
-
i(this, $, () => {
|
|
87
|
-
let e;
|
|
88
|
-
t(this, I).mediaBuckets.forEach((u, m) => {
|
|
89
|
-
matchMedia(m).matches && (e = u);
|
|
90
|
-
});
|
|
91
|
-
let n, h = 0;
|
|
92
|
-
e == null || e.forEach((u) => {
|
|
93
|
-
u.density > h && u.density <= Math.max(devicePixelRatio, 1) && (h = u.density, n = u);
|
|
94
|
-
}), e != null && e.length && !n && (n = e[0]), this.current = n;
|
|
95
|
-
});
|
|
96
|
-
s(this, I, new tt(e.srcset, e.sourceSetOptions));
|
|
97
|
-
}
|
|
98
|
-
updateSource(e) {
|
|
99
|
-
s(this, I, new tt(e.srcset, e.sourceSetOptions)), t(this, $).call(this);
|
|
100
|
-
}
|
|
101
|
-
close() {
|
|
102
|
-
super.close(), this.disconnect();
|
|
103
|
-
}
|
|
104
|
-
connect() {
|
|
105
|
-
Y.subscribe(t(this, $), rt.SOURCE_MANAGER), t(this, $).call(this);
|
|
106
|
-
}
|
|
107
|
-
disconnect() {
|
|
108
|
-
Y.unsubscribe(t(this, $));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
I = new WeakMap(), $ = new WeakMap();
|
|
112
|
-
function ot(c) {
|
|
113
|
-
if (isNaN(c)) return "0:00";
|
|
114
|
-
const a = Math.floor(Math.max(0, c)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), u = (a % 60).toString().padStart(2, "0");
|
|
115
|
-
if (e > 0) {
|
|
116
|
-
const m = n.toString().padStart(2, "0");
|
|
117
|
-
return `${e}:${m}:${u}`;
|
|
118
|
-
} else
|
|
119
|
-
return `${n}:${u}`;
|
|
120
|
-
}
|
|
121
|
-
let ct = 0;
|
|
122
|
-
var f, r, k, E, b, g, B, A, o, O, R, v, P, T, _, G, D, K, H, N, V;
|
|
123
|
-
class Lt extends HTMLElement {
|
|
124
|
-
constructor(e) {
|
|
125
|
-
super();
|
|
126
|
-
i(this, T);
|
|
127
|
-
i(this, f, null);
|
|
128
|
-
i(this, r, null);
|
|
129
|
-
i(this, k, this);
|
|
130
|
-
i(this, E, !1);
|
|
131
|
-
i(this, b, !1);
|
|
132
|
-
i(this, g, !1);
|
|
133
|
-
i(this, B, "");
|
|
134
|
-
i(this, A, "");
|
|
135
|
-
i(this, o, new et(this, {
|
|
136
|
-
loading: !1,
|
|
137
|
-
loaded: !1,
|
|
138
|
-
error: !1,
|
|
139
|
-
clear: !1,
|
|
140
|
-
playing: !1,
|
|
141
|
-
metadata: !1
|
|
142
|
-
}));
|
|
143
|
-
i(this, O, null);
|
|
144
|
-
i(this, R);
|
|
145
|
-
i(this, v, null);
|
|
146
|
-
i(this, P);
|
|
147
|
-
i(this, G, (e) => {
|
|
148
|
-
const n = e[0];
|
|
149
|
-
t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? w(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (j(this, T, _).call(this, void 0), s(this, b, !1)), w(this, "sourceRelease", { custom: !0 }));
|
|
150
|
-
});
|
|
151
|
-
i(this, D, () => {
|
|
152
|
-
t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.complete(t(this, A)), w(this, "sourceLoaded", { custom: !0 });
|
|
153
|
-
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
154
|
-
e ? s(this, R, setTimeout(() => {
|
|
155
|
-
t(this, o).set("clear", !0);
|
|
156
|
-
}, parseFloat(e) * 1e3)) : t(this, o).set("clear", !0), s(this, E, !0);
|
|
157
|
-
});
|
|
158
|
-
i(this, K, (e) => {
|
|
159
|
-
t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.error(t(this, A)), w(this, "sourceError", { custom: !0 }), s(this, E, !0);
|
|
160
|
-
});
|
|
161
|
-
i(this, H, () => {
|
|
162
|
-
t(this, o).set("playing", !0), w(this, "sourcePlay", { custom: !0 });
|
|
163
|
-
});
|
|
164
|
-
i(this, N, () => {
|
|
165
|
-
t(this, o).set("playing", !1), w(this, "sourcePause", { custom: !0 });
|
|
166
|
-
});
|
|
167
|
-
i(this, V, () => {
|
|
168
|
-
const e = t(this, r);
|
|
169
|
-
(e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0), w(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
|
|
170
|
-
n.textContent = ot(e.duration);
|
|
171
|
-
}));
|
|
172
|
-
});
|
|
173
|
-
s(this, P, e == null ? void 0 : e.sourceSetOptions), st && window.IntersectionObserver && s(this, O, new IntersectionObserver(
|
|
174
|
-
t(this, G)
|
|
175
|
-
)), t(this, o).subscribe((n) => {
|
|
176
|
-
var u;
|
|
177
|
-
const h = (u = this.getAttribute("data-global-play-class")) == null ? void 0 : u.split(
|
|
178
|
-
","
|
|
179
|
-
);
|
|
180
|
-
h != null && h.length && (n.current.playing ? h.forEach((m) => {
|
|
181
|
-
document.documentElement.classList.add(m.trim());
|
|
182
|
-
}) : h.forEach((m) => {
|
|
183
|
-
document.documentElement.classList.remove(m.trim());
|
|
184
|
-
}));
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
get consumerElement() {
|
|
188
|
-
return t(this, r);
|
|
189
|
-
}
|
|
190
|
-
get consumerHolderElement() {
|
|
191
|
-
return t(this, k);
|
|
192
|
-
}
|
|
193
|
-
get sourceManager() {
|
|
194
|
-
return t(this, f);
|
|
195
|
-
}
|
|
196
|
-
get status() {
|
|
197
|
-
return t(this, o);
|
|
198
|
-
}
|
|
199
|
-
get isLazy() {
|
|
200
|
-
return t(this, g);
|
|
201
|
-
}
|
|
202
|
-
get currentURL() {
|
|
203
|
-
return t(this, v);
|
|
204
|
-
}
|
|
205
|
-
get isFirstLoadHappened() {
|
|
206
|
-
return t(this, E);
|
|
207
|
-
}
|
|
208
|
-
triggerLazyLoad() {
|
|
209
|
-
!t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), j(this, T, _).call(this, t(this, f).current));
|
|
210
|
-
}
|
|
211
|
-
connectedCallback() {
|
|
212
|
-
s(this, B, `source-consumer-${++ct}`);
|
|
213
|
-
const e = this.getAttribute("srcset") || "", n = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
214
|
-
n && t(this, o).addElement(n), s(this, k, this.querySelector("[data-consumer-holder]") || this), this.querySelectorAll(".source-consumer").forEach((h) => h == null ? void 0 : h.remove()), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
215
|
-
display: block;
|
|
216
|
-
width: 100%;
|
|
217
|
-
height: 100%;
|
|
218
|
-
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, H)), t(this, r).addEventListener("pause", t(this, N)), t(this, r).addEventListener(
|
|
219
|
-
"loadedmetadata",
|
|
220
|
-
t(this, V)
|
|
221
|
-
), t(this, V).call(this), Array.from(this.attributes).forEach((h) => {
|
|
222
|
-
if (h.name !== "srcset") {
|
|
223
|
-
const u = h.nodeValue || "", m = it(h.name);
|
|
224
|
-
m in t(this, r) && (t(this, r)[m] = u || !0);
|
|
225
|
-
}
|
|
226
|
-
}), t(this, k).appendChild(t(this, r)), s(this, f, new ht({
|
|
227
|
-
srcset: e,
|
|
228
|
-
sourceSetOptions: t(this, P)
|
|
229
|
-
})), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((h) => {
|
|
230
|
-
(!t(this, g) || t(this, g) && t(this, b)) && j(this, T, _).call(this, h.current);
|
|
231
|
-
}), t(this, f).connect(), t(this, O).observe(this);
|
|
232
|
-
}
|
|
233
|
-
disconnectedCallback() {
|
|
234
|
-
var e;
|
|
235
|
-
clearTimeout(t(this, R)), t(this, O).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, H)), t(this, r).removeEventListener("pause", t(this, N)), t(this, r).removeEventListener(
|
|
236
|
-
"loadedmetadata",
|
|
237
|
-
t(this, V)
|
|
238
|
-
), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, E, !1), s(this, b, !1), t(this, o).reset();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
f = new WeakMap(), r = new WeakMap(), k = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), B = new WeakMap(), A = new WeakMap(), o = new WeakMap(), O = new WeakMap(), R = new WeakMap(), v = new WeakMap(), P = new WeakMap(), T = new WeakSet(), _ = function(e) {
|
|
242
|
-
if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), t(this, o).set("playing", !1), t(this, o).set("metadata", !1), e) {
|
|
243
|
-
s(this, A, `${t(this, B)}-${e.url}`);
|
|
244
|
-
const n = this.hasAttribute("keep-source-parameters");
|
|
245
|
-
t(this, o).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, E) && J.add(t(this, A)), t(this, r).onloadeddata = () => {
|
|
246
|
-
t(this, D).call(this);
|
|
247
|
-
}, t(this, r).onload = () => {
|
|
248
|
-
t(this, D).call(this);
|
|
249
|
-
}, t(this, r).onerror = () => {
|
|
250
|
-
t(this, K).call(this, t(this, v));
|
|
251
|
-
};
|
|
252
|
-
} else
|
|
253
|
-
s(this, v, null), this.consumeSource(null);
|
|
254
|
-
}, G = new WeakMap(), D = new WeakMap(), K = new WeakMap(), H = new WeakMap(), N = new WeakMap(), V = new WeakMap();
|
|
255
|
-
export {
|
|
256
|
-
nt as S,
|
|
257
|
-
Lt as a,
|
|
258
|
-
tt as b,
|
|
259
|
-
ht as c
|
|
260
|
-
};
|