aptechka 0.78.6 → 0.78.8
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/{DragControls-B7q22wzw.js → DragControls-DyIrD3GV.js} +36 -36
- package/lib/DragControls-K67-diF5.cjs +1 -0
- package/lib/SourceElement-BnMxiOqY.js +265 -0
- package/lib/SourceElement-VVdVc1d-.cjs +5 -0
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- 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/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +5 -10
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +32 -38
- 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/DragControls-tVaq-vIe.cjs +0 -1
- package/lib/SourceElement-DE6khDs3.cjs +0 -5
- package/lib/SourceElement-DJxX7uN5.js +0 -260
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var _ = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var _ = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var G = (
|
|
5
|
-
var t = (
|
|
4
|
+
var G = (n, r, e) => r.has(n) || _("Cannot " + e);
|
|
5
|
+
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), s = (n, r, e) => r.has(n) ? _("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), i = (n, r, e, h) => (G(n, r, "write to private field"), h ? h.call(n, e) : r.set(n, e), e), A = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
6
|
import { i as b } from "./index-Bv9zgfdb.js";
|
|
7
7
|
import { g as Z } from "./dom-CVWzyXPH.js";
|
|
8
8
|
import "construct-style-sheets-polyfill";
|
|
@@ -13,49 +13,49 @@ import { T as te } from "./Tweened-BlZB0vl4.js";
|
|
|
13
13
|
import { s as ie } from "./gestures-CcXV6fCp.js";
|
|
14
14
|
import { p as se } from "./number-CumqY64S.js";
|
|
15
15
|
import { TICK_ORDER as he } from "./order/index.js";
|
|
16
|
-
import { Notifier as
|
|
16
|
+
import { Notifier as ne } from "./notifier/index.js";
|
|
17
17
|
var V;
|
|
18
18
|
class j {
|
|
19
19
|
constructor() {
|
|
20
|
-
s(this, V, new
|
|
20
|
+
s(this, V, new ne());
|
|
21
21
|
}
|
|
22
22
|
get changeEvent() {
|
|
23
23
|
return t(this, V);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
V = new WeakMap();
|
|
27
|
-
var
|
|
28
|
-
class
|
|
27
|
+
var y, c, u, X;
|
|
28
|
+
class ye extends j {
|
|
29
29
|
constructor(e) {
|
|
30
30
|
super();
|
|
31
|
-
s(this,
|
|
31
|
+
s(this, y, null);
|
|
32
32
|
s(this, c, null);
|
|
33
33
|
s(this, u, "offsetHeight");
|
|
34
34
|
s(this, X, (e) => {
|
|
35
35
|
const h = e.shiftKey ? -1 : 1;
|
|
36
|
-
let
|
|
37
|
-
e.code === "Space" ?
|
|
36
|
+
let a;
|
|
37
|
+
e.code === "Space" ? a = h * t(this, c)[t(this, u)] * 0.4 : e.code === "ArrowLeft" ? a = -1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowRight" ? a = 1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowUp" ? a = -1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowDown" ? a = 1 * t(this, c)[t(this, u)] * 0.2 : e.code === "PageUp" ? a = -1 * t(this, c)[t(this, u)] : e.code === "PageDown" ? a = 1 * t(this, c)[t(this, u)] : e.code === "Home" ? a = 0 : e.code === "End" && (a = t(this, u) === "offsetWidth" ? t(this, c).scrollWidth : t(this, c).scrollHeight), a && (e.stopPropagation(), this.changeEvent.notify("keyboard", a, e));
|
|
38
38
|
});
|
|
39
|
-
b && (i(this,
|
|
39
|
+
b && (i(this, y, e != null && e.element && Z(e.element) || window), i(this, c, t(this, y) instanceof HTMLElement ? t(this, y) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
40
40
|
}
|
|
41
41
|
set dimension(e) {
|
|
42
42
|
i(this, u, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
43
43
|
}
|
|
44
44
|
connect() {
|
|
45
|
-
b && t(this,
|
|
45
|
+
b && t(this, y).addEventListener(
|
|
46
46
|
"keydown",
|
|
47
47
|
t(this, X)
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
disconnect() {
|
|
51
|
-
b && t(this,
|
|
51
|
+
b && t(this, y).removeEventListener(
|
|
52
52
|
"keydown",
|
|
53
53
|
t(this, X)
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
var E, M, Y, O, d, I,
|
|
57
|
+
y = new WeakMap(), c = new WeakMap(), u = new WeakMap(), X = new WeakMap();
|
|
58
|
+
var E, M, Y, O, d, I, f, w, Q, J, H, S, q;
|
|
59
59
|
class Ee extends j {
|
|
60
60
|
constructor(e) {
|
|
61
61
|
super();
|
|
@@ -66,11 +66,11 @@ class Ee extends j {
|
|
|
66
66
|
s(this, O);
|
|
67
67
|
s(this, d);
|
|
68
68
|
s(this, I);
|
|
69
|
-
s(this,
|
|
69
|
+
s(this, f);
|
|
70
70
|
s(this, H);
|
|
71
71
|
s(this, S);
|
|
72
72
|
s(this, q);
|
|
73
|
-
this.direction = 1, i(this, d, new te(0, { easing: ee })), i(this,
|
|
73
|
+
this.direction = 1, i(this, d, new te(0, { easing: ee })), i(this, f, !1), i(this, H, (h) => {
|
|
74
74
|
t(this, d).current !== 1 && this.changeEvent.notify(
|
|
75
75
|
"autoplay",
|
|
76
76
|
h.timeBetweenFrames * t(this, E) * this.direction * (1 - t(this, d).current),
|
|
@@ -87,19 +87,19 @@ class Ee extends j {
|
|
|
87
87
|
}), i(this, E, (e == null ? void 0 : e.speed) || 1), i(this, M, (e == null ? void 0 : e.interval) || !1), i(this, Y, e);
|
|
88
88
|
}
|
|
89
89
|
set interval(e) {
|
|
90
|
-
i(this, M, e), t(this,
|
|
90
|
+
i(this, M, e), t(this, f) && A(this, w, Q).call(this);
|
|
91
91
|
}
|
|
92
92
|
set speed(e) {
|
|
93
|
-
i(this, E, e), t(this,
|
|
93
|
+
i(this, E, e), t(this, f) && A(this, w, Q).call(this);
|
|
94
94
|
}
|
|
95
95
|
connect() {
|
|
96
|
-
t(this,
|
|
96
|
+
t(this, f) || (i(this, f, !0), A(this, w, Q).call(this));
|
|
97
97
|
}
|
|
98
98
|
disconnect() {
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, f) && (i(this, f, !1), A(this, w, J).call(this));
|
|
100
100
|
}
|
|
101
101
|
pauseAndContinue(e, h) {
|
|
102
|
-
t(this,
|
|
102
|
+
t(this, f) && e && (clearTimeout(t(this, I)), t(this, d).set(1, {
|
|
103
103
|
duration: Math.min(e, 1e3),
|
|
104
104
|
equalize: h
|
|
105
105
|
}), i(this, I, setTimeout(() => {
|
|
@@ -110,7 +110,7 @@ class Ee extends j {
|
|
|
110
110
|
}, e)));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
E = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), d = new WeakMap(), I = new WeakMap(),
|
|
113
|
+
E = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), d = new WeakMap(), I = new WeakMap(), f = new WeakMap(), w = new WeakSet(), Q = function() {
|
|
114
114
|
A(this, w, J).call(this), t(this, M) ? i(this, O, setInterval(
|
|
115
115
|
t(this, S),
|
|
116
116
|
Math.abs(t(this, E))
|
|
@@ -133,9 +133,9 @@ class xe extends j {
|
|
|
133
133
|
s(this, P);
|
|
134
134
|
s(this, B, (e) => {
|
|
135
135
|
let h = 0;
|
|
136
|
-
const
|
|
137
|
-
if (!(this.axis === "x" &&
|
|
138
|
-
if (h = (this.axis === "max" ?
|
|
136
|
+
const a = Math.abs(e.deltaY), g = Math.abs(e.deltaX);
|
|
137
|
+
if (!(this.axis === "x" && a > g || this.axis === "y" && g > a) && (e.preventDefault(), !(this.debounce && this.axis === "x" && g < 5 || this.debounce && this.axis === "y" && a < 5)))
|
|
138
|
+
if (h = (this.axis === "max" ? g > a ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
|
|
139
139
|
const R = Date.now();
|
|
140
140
|
if (R - t(this, P) > 40 && (h = 100 * Math.sign(h)), i(this, P, R), Math.abs(h) < 100 || t(this, k))
|
|
141
141
|
return;
|
|
@@ -180,22 +180,22 @@ const v = class v extends j {
|
|
|
180
180
|
Math.abs(t(this, x)) > 2 && h.preventDefault();
|
|
181
181
|
}), i(this, N, (h) => {
|
|
182
182
|
if (i(this, x, 0), i(this, l, 0), h.button !== 0 || h.composedPath().find(
|
|
183
|
-
(
|
|
183
|
+
(m) => m instanceof HTMLElement && m.hasAttribute("drag-dead-zone")
|
|
184
184
|
))
|
|
185
185
|
return;
|
|
186
186
|
this.swipe || D.unsubscribe(t(this, L));
|
|
187
|
-
let
|
|
187
|
+
let a = h, g = !1;
|
|
188
188
|
document.documentElement.classList.add("grabbing");
|
|
189
189
|
let R = 0, $ = 0, F = 0, U = 0;
|
|
190
190
|
ie(
|
|
191
|
-
(
|
|
192
|
-
t(v, T) && t(v, T) !== t(this, o) || (R =
|
|
191
|
+
(m) => {
|
|
192
|
+
t(v, T) && t(v, T) !== t(this, o) || (R = a.x - m.x, $ = a.y - m.y, F = m.x - h.x, U = m.y - h.y, this.axis === "x" ? (i(this, x, F), i(this, l, R)) : (i(this, x, U), i(this, l, $)), a = m, g = this.axis === "x" && Math.abs(F) > Math.abs(U) || this.axis === "y" && Math.abs(U) > Math.abs(F), g && (document.documentElement.classList.add("dragging"), document.documentElement.classList.add("click-disabled"), i(v, T, t(this, o)), this.changeEvent.notify("drag", t(this, l), m)));
|
|
193
193
|
},
|
|
194
|
-
(
|
|
195
|
-
i(v, T, null),
|
|
194
|
+
(m) => {
|
|
195
|
+
i(v, T, null), g && (!this.swipe && this.inertion ? (i(this, l, t(this, l) * this.inertion), D.subscribe(t(this, L), {
|
|
196
196
|
order: he.CONTROLS - 1
|
|
197
|
-
})) : this.swipe && this.changeEvent.notify("drag-end", t(this, l),
|
|
198
|
-
document.documentElement.classList.remove("click-disabled");
|
|
197
|
+
})) : this.swipe && this.changeEvent.notify("drag-end", t(this, l), m)), setTimeout(() => {
|
|
198
|
+
document.documentElement.classList.remove("grabbing"), document.documentElement.classList.remove("dragging"), document.documentElement.classList.remove("click-disabled");
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
);
|
|
@@ -223,6 +223,6 @@ export {
|
|
|
223
223
|
Ee as A,
|
|
224
224
|
j as C,
|
|
225
225
|
p as D,
|
|
226
|
-
|
|
226
|
+
ye as K,
|
|
227
227
|
xe as W
|
|
228
228
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=n=>{throw TypeError(n)};var G=(n,a,e)=>a.has(n)||p("Cannot "+e);var t=(n,a,e)=>(G(n,a,"read from private field"),e?e.call(n):a.get(n)),s=(n,a,e)=>a.has(n)?p("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,e),i=(n,a,e,h)=>(G(n,a,"write to private field"),h?h.call(n,e):a.set(n,e),e),T=(n,a,e)=>(G(n,a,"access private method"),e);const w=require("./index-DekP7OZe.cjs"),_=require("./dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const B=require("./ticker/index.cjs");require("./Store-Cd1GlEmZ.cjs");const ee=require("./easings-GegIwET5.cjs"),te=require("./Tweened-mvHucL4Y.cjs"),ie=require("./gestures-C7gbKx11.cjs"),se=require("./number-ChAm68cm.cjs"),he=require("./order/index.cjs"),ne=require("./notifier/index.cjs");var j;class F{constructor(){s(this,j,new ne.Notifier)}get changeEvent(){return t(this,j)}}j=new WeakMap;var y,c,u,R;class re extends F{constructor(e){super();s(this,y,null);s(this,c,null);s(this,u,"offsetHeight");s(this,R,e=>{const h=e.shiftKey?-1:1;let r;e.code==="Space"?r=h*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?r=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?r=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?r=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?r=1*t(this,c)[t(this,u)]*.2:e.code==="PageUp"?r=-1*t(this,c)[t(this,u)]:e.code==="PageDown"?r=1*t(this,c)[t(this,u)]:e.code==="Home"?r=0:e.code==="End"&&(r=t(this,u)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),r&&(e.stopPropagation(),this.changeEvent.notify("keyboard",r,e))});w.isBrowser&&(i(this,y,e!=null&&e.element&&_.getElement(e.element)||window),i(this,c,t(this,y)instanceof HTMLElement?t(this,y):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){w.isBrowser&&t(this,y).addEventListener("keydown",t(this,R))}disconnect(){w.isBrowser&&t(this,y).removeEventListener("keydown",t(this,R))}}y=new WeakMap,c=new WeakMap,u=new WeakMap,R=new WeakMap;var E,v,X,Y,d,A,m,b,V,J,D,O,I;class ae extends F{constructor(e){super();s(this,b);s(this,E);s(this,v);s(this,X);s(this,Y);s(this,d);s(this,A);s(this,m);s(this,D);s(this,O);s(this,I);this.direction=1,i(this,d,new te.Tweened(0,{easing:ee.easeInQuad})),i(this,m,!1),i(this,D,h=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",h.timeBetweenFrames*t(this,E)*this.direction*(1-t(this,d).current),h)}),i(this,O,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,E))*this.direction*(1-t(this,d).current),null)}),i(this,I,()=>{t(this,v)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,E,(e==null?void 0:e.speed)||1),i(this,v,(e==null?void 0:e.interval)||!1),i(this,X,e)}set interval(e){i(this,v,e),t(this,m)&&T(this,b,V).call(this)}set speed(e){i(this,E,e),t(this,m)&&T(this,b,V).call(this)}connect(){t(this,m)||(i(this,m,!0),T(this,b,V).call(this))}disconnect(){t(this,m)&&(i(this,m,!1),T(this,b,J).call(this))}pauseAndContinue(e,h){t(this,m)&&e&&(clearTimeout(t(this,A)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:h}),i(this,A,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:h})},e)))}}E=new WeakMap,v=new WeakMap,X=new WeakMap,Y=new WeakMap,d=new WeakMap,A=new WeakMap,m=new WeakMap,b=new WeakSet,V=function(){T(this,b,J).call(this),t(this,v)?i(this,Y,setInterval(t(this,O),Math.abs(t(this,E)))):B.ticker.subscribe(t(this,D),t(this,X)),document.addEventListener("visibilitychange",t(this,I))},J=function(){clearInterval(t(this,Y)),B.ticker.unsubscribe(t(this,D)),clearTimeout(t(this,A)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,I))},D=new WeakMap,O=new WeakMap,I=new WeakMap;var H,M,z,S;class le extends F{constructor(e){super();s(this,H,null);s(this,M);s(this,z);s(this,S,e=>{let h=0;const r=Math.abs(e.deltaY),g=Math.abs(e.deltaX);if(!(this.axis==="x"&&r>g||this.axis==="y"&&g>r)&&(e.preventDefault(),!(this.debounce&&this.axis==="x"&&g<5||this.debounce&&this.axis==="y"&&r<5)))if(h=(this.axis==="max"?g>r?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const N=Date.now();if(N-t(this,z)>40&&(h=100*Math.sign(h)),i(this,z,N),Math.abs(h)<100||t(this,M))return;this.changeEvent.notify("wheel",h,e),i(this,M,setTimeout(()=>{i(this,M,void 0)},80))}else this.changeEvent.notify("wheel",h,e)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,z,Date.now()),w.isBrowser&&i(this,H,e!=null&&e.element&&_.getElement(e.element)||window)}connect(){w.isBrowser&&t(this,H).addEventListener("wheel",t(this,S),{passive:!1})}disconnect(){w.isBrowser&&(t(this,H).removeEventListener("wheel",t(this,S)),clearTimeout(t(this,M)))}}H=new WeakMap,M=new WeakMap,z=new WeakMap,S=new WeakMap;var q,P,o,l,C,x,W,K,L;const k=class k extends F{constructor(e){super();s(this,P);s(this,o);s(this,l);s(this,C);s(this,x);s(this,W);s(this,K);s(this,L);this.inertion=1,i(this,P,null),i(this,o,null),i(this,l,0),i(this,C,[]),i(this,x,0),i(this,W,h=>{Math.abs(t(this,x))>2&&h.preventDefault()}),i(this,K,h=>{if(i(this,x,0),i(this,l,0),h.button!==0||h.composedPath().find(f=>f instanceof HTMLElement&&f.hasAttribute("drag-dead-zone")))return;this.swipe||B.ticker.unsubscribe(t(this,L));let r=h,g=!1;document.documentElement.classList.add("grabbing");let N=0,$=0,U=0,Q=0;ie.setupDrag(f=>{t(k,q)&&t(k,q)!==t(this,o)||(N=r.x-f.x,$=r.y-f.y,U=f.x-h.x,Q=f.y-h.y,this.axis==="x"?(i(this,x,U),i(this,l,N)):(i(this,x,Q),i(this,l,$)),r=f,g=this.axis==="x"&&Math.abs(U)>Math.abs(Q)||this.axis==="y"&&Math.abs(Q)>Math.abs(U),g&&(document.documentElement.classList.add("dragging"),document.documentElement.classList.add("click-disabled"),i(k,q,t(this,o)),this.changeEvent.notify("drag",t(this,l),f)))},f=>{i(k,q,null),g&&(!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),B.ticker.subscribe(t(this,L),{order:he.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l),f)),setTimeout(()=>{document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging"),document.documentElement.classList.remove("click-disabled")})})}),i(this,L,()=>{Math.floor(Math.abs(t(this,l)))||B.ticker.unsubscribe(t(this,L)),i(this,l,t(this,l)*.95),i(this,l,se.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l),null)}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,w.isBrowser&&(i(this,o,e!=null&&e.element&&_.getElement(e.element)||document.documentElement),i(this,P,(e==null?void 0:e.rootElement)||t(this,o)))}connect(){w.isBrowser&&(i(this,C,[...t(this,P).querySelectorAll("a")]),t(this,C).forEach(e=>{e.addEventListener("click",t(this,W))}),t(this,o).addEventListener("pointerdown",t(this,K)))}disconnect(){w.isBrowser&&(t(this,C).forEach(e=>{e.removeEventListener("click",t(this,W))}),t(this,o).removeEventListener("pointerdown",t(this,K)),B.ticker.unsubscribe(t(this,L)))}};q=new WeakMap,P=new WeakMap,o=new WeakMap,l=new WeakMap,C=new WeakMap,x=new WeakMap,W=new WeakMap,K=new WeakMap,L=new WeakMap,s(k,q,null);let Z=k;exports.AutoplayControls=ae;exports.Controls=F;exports.DragControls=Z;exports.KeyboardControls=re;exports.WheelControls=le;
|
|
@@ -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/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../DragControls-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../DragControls-K67-diF5.cjs");exports.AutoplayControls=o.AutoplayControls;exports.Controls=o.Controls;exports.DragControls=o.DragControls;exports.KeyboardControls=o.KeyboardControls;exports.WheelControls=o.WheelControls;
|
package/lib/controls/index.js
CHANGED
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";
|