aptechka 0.76.0 → 0.76.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/SourceElement-DE6khDs3.cjs +5 -0
- package/lib/{SourceElement-Cvtgjo07.js → SourceElement-DJxX7uN5.js} +91 -92
- 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/media/index.cjs +1 -1
- package/lib/media/index.js +21 -16
- package/lib/scroll-kit/ScrollRegionElement.d.ts +1 -1
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +4 -4
- 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 +1 -1
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +1 -1
- package/package.json +1 -1
- package/lib/SourceElement-0vRhCW3O.cjs +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
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,54 +1,54 @@
|
|
|
1
|
-
var X = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var X = (c) => {
|
|
2
|
+
throw TypeError(c);
|
|
3
3
|
};
|
|
4
|
-
var Z = (
|
|
5
|
-
var t = (
|
|
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
6
|
import { ElementLinkedStore as et } from "./element-linked-store/index.js";
|
|
7
7
|
import { i as st } from "./index-Bv9zgfdb.js";
|
|
8
|
-
import { d as
|
|
8
|
+
import { d as w } from "./events-CsVF98U6.js";
|
|
9
9
|
import { k as it } from "./string-BlMQbe8b.js";
|
|
10
10
|
import "construct-style-sheets-polyfill";
|
|
11
11
|
import { loading as J } from "./loading/index.js";
|
|
12
12
|
import { RESIZE_ORDER as rt } from "./order/index.js";
|
|
13
13
|
import { windowResizer as Y } from "./window-resizer/index.js";
|
|
14
14
|
import { S as at } from "./Store-0BVty6AZ.js";
|
|
15
|
-
var
|
|
15
|
+
var C, S, z, L, d, p, q;
|
|
16
16
|
class nt {
|
|
17
17
|
constructor(a) {
|
|
18
|
-
i(this,
|
|
18
|
+
i(this, C);
|
|
19
19
|
i(this, S);
|
|
20
|
-
i(this,
|
|
20
|
+
i(this, z);
|
|
21
21
|
i(this, L);
|
|
22
22
|
i(this, d);
|
|
23
23
|
i(this, p);
|
|
24
|
-
i(this,
|
|
25
|
-
s(this,
|
|
24
|
+
i(this, q);
|
|
25
|
+
s(this, C, a);
|
|
26
26
|
let e = a.split(".");
|
|
27
|
-
const n = /\b\d{1,2}x\b/g,
|
|
28
|
-
s(this,
|
|
29
|
-
const
|
|
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)`)) :
|
|
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
31
|
`.${t(this, d)}${t(this, p)}`,
|
|
32
32
|
""
|
|
33
|
-
)), s(this,
|
|
33
|
+
)), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
|
|
34
34
|
`.${t(this, d)}${t(this, p)}`,
|
|
35
35
|
""
|
|
36
36
|
));
|
|
37
37
|
}
|
|
38
38
|
get url() {
|
|
39
|
-
return t(this,
|
|
39
|
+
return t(this, C);
|
|
40
40
|
}
|
|
41
41
|
get name() {
|
|
42
42
|
return t(this, S);
|
|
43
43
|
}
|
|
44
44
|
get density() {
|
|
45
|
-
return t(this,
|
|
45
|
+
return t(this, z);
|
|
46
46
|
}
|
|
47
47
|
get query() {
|
|
48
48
|
return t(this, L);
|
|
49
49
|
}
|
|
50
50
|
get extension() {
|
|
51
|
-
return t(this,
|
|
51
|
+
return t(this, q);
|
|
52
52
|
}
|
|
53
53
|
get queryType() {
|
|
54
54
|
return t(this, p);
|
|
@@ -57,20 +57,20 @@ class nt {
|
|
|
57
57
|
return t(this, d);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), q = new WeakMap();
|
|
61
61
|
var M;
|
|
62
62
|
class tt {
|
|
63
63
|
constructor(a, e) {
|
|
64
64
|
i(this, M);
|
|
65
65
|
s(this, M, /* @__PURE__ */ new Map());
|
|
66
|
-
const n = (e == null ? void 0 : e.mediaBuckets) !== !1,
|
|
67
|
-
|
|
68
|
-
const x = new nt(
|
|
69
|
-
|
|
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
70
|
});
|
|
71
|
-
const m =
|
|
72
|
-
(F ? [...F, ...m, ...
|
|
73
|
-
t(this, M).has(
|
|
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
74
|
});
|
|
75
75
|
}
|
|
76
76
|
get mediaBuckets() {
|
|
@@ -78,60 +78,60 @@ class tt {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
M = new WeakMap();
|
|
81
|
-
var
|
|
81
|
+
var I, $;
|
|
82
82
|
class ht extends at {
|
|
83
83
|
constructor(e) {
|
|
84
84
|
super(void 0);
|
|
85
|
-
i(this,
|
|
86
|
-
i(this,
|
|
85
|
+
i(this, I);
|
|
86
|
+
i(this, $, () => {
|
|
87
87
|
let e;
|
|
88
|
-
t(this,
|
|
89
|
-
matchMedia(m).matches && (e =
|
|
88
|
+
t(this, I).mediaBuckets.forEach((u, m) => {
|
|
89
|
+
matchMedia(m).matches && (e = u);
|
|
90
90
|
});
|
|
91
|
-
let n,
|
|
92
|
-
e == null || e.forEach((
|
|
93
|
-
|
|
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
94
|
}), e != null && e.length && !n && (n = e[0]), this.current = n;
|
|
95
95
|
});
|
|
96
|
-
s(this,
|
|
96
|
+
s(this, I, new tt(e.srcset, e.sourceSetOptions));
|
|
97
97
|
}
|
|
98
98
|
updateSource(e) {
|
|
99
|
-
s(this,
|
|
99
|
+
s(this, I, new tt(e.srcset, e.sourceSetOptions)), t(this, $).call(this);
|
|
100
100
|
}
|
|
101
101
|
close() {
|
|
102
102
|
super.close(), this.disconnect();
|
|
103
103
|
}
|
|
104
104
|
connect() {
|
|
105
|
-
Y.subscribe(t(this,
|
|
105
|
+
Y.subscribe(t(this, $), rt.SOURCE_MANAGER), t(this, $).call(this);
|
|
106
106
|
}
|
|
107
107
|
disconnect() {
|
|
108
|
-
Y.unsubscribe(t(this,
|
|
108
|
+
Y.unsubscribe(t(this, $));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
function ot(
|
|
113
|
-
if (isNaN(
|
|
114
|
-
const a = Math.floor(Math.max(0,
|
|
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
115
|
if (e > 0) {
|
|
116
116
|
const m = n.toString().padStart(2, "0");
|
|
117
|
-
return `${e}:${m}:${
|
|
117
|
+
return `${e}:${m}:${u}`;
|
|
118
118
|
} else
|
|
119
|
-
return `${n}:${
|
|
119
|
+
return `${n}:${u}`;
|
|
120
120
|
}
|
|
121
|
-
let
|
|
122
|
-
var f, r,
|
|
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
123
|
class Lt extends HTMLElement {
|
|
124
124
|
constructor(e) {
|
|
125
125
|
super();
|
|
126
|
-
i(this,
|
|
126
|
+
i(this, T);
|
|
127
127
|
i(this, f, null);
|
|
128
128
|
i(this, r, null);
|
|
129
|
-
i(this,
|
|
129
|
+
i(this, k, this);
|
|
130
130
|
i(this, E, !1);
|
|
131
131
|
i(this, b, !1);
|
|
132
132
|
i(this, g, !1);
|
|
133
|
-
i(this,
|
|
134
|
-
i(this,
|
|
133
|
+
i(this, B, "");
|
|
134
|
+
i(this, A, "");
|
|
135
135
|
i(this, o, new et(this, {
|
|
136
136
|
loading: !1,
|
|
137
137
|
loaded: !1,
|
|
@@ -140,46 +140,46 @@ class Lt extends HTMLElement {
|
|
|
140
140
|
playing: !1,
|
|
141
141
|
metadata: !1
|
|
142
142
|
}));
|
|
143
|
-
i(this,
|
|
144
|
-
i(this,
|
|
143
|
+
i(this, O, null);
|
|
144
|
+
i(this, R);
|
|
145
145
|
i(this, v, null);
|
|
146
|
-
i(this,
|
|
146
|
+
i(this, P);
|
|
147
147
|
i(this, G, (e) => {
|
|
148
148
|
const n = e[0];
|
|
149
|
-
t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ?
|
|
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
150
|
});
|
|
151
|
-
i(this,
|
|
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,
|
|
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
153
|
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
154
|
-
e ? s(this,
|
|
154
|
+
e ? s(this, R, setTimeout(() => {
|
|
155
155
|
t(this, o).set("clear", !0);
|
|
156
156
|
}, parseFloat(e) * 1e3)) : t(this, o).set("clear", !0), s(this, E, !0);
|
|
157
157
|
});
|
|
158
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,
|
|
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
160
|
});
|
|
161
|
-
i(this,
|
|
162
|
-
t(this, o).set("playing", !0),
|
|
161
|
+
i(this, H, () => {
|
|
162
|
+
t(this, o).set("playing", !0), w(this, "sourcePlay", { custom: !0 });
|
|
163
163
|
});
|
|
164
|
-
i(this,
|
|
165
|
-
t(this, o).set("playing", !1),
|
|
164
|
+
i(this, N, () => {
|
|
165
|
+
t(this, o).set("playing", !1), w(this, "sourcePause", { custom: !0 });
|
|
166
166
|
});
|
|
167
|
-
i(this,
|
|
167
|
+
i(this, V, () => {
|
|
168
168
|
const e = t(this, r);
|
|
169
|
-
(e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0),
|
|
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
170
|
n.textContent = ot(e.duration);
|
|
171
171
|
}));
|
|
172
172
|
});
|
|
173
|
-
s(this,
|
|
173
|
+
s(this, P, e == null ? void 0 : e.sourceSetOptions), st && window.IntersectionObserver && s(this, O, new IntersectionObserver(
|
|
174
174
|
t(this, G)
|
|
175
175
|
)), t(this, o).subscribe((n) => {
|
|
176
|
-
var
|
|
177
|
-
const
|
|
176
|
+
var u;
|
|
177
|
+
const h = (u = this.getAttribute("data-global-play-class")) == null ? void 0 : u.split(
|
|
178
178
|
","
|
|
179
179
|
);
|
|
180
|
-
|
|
180
|
+
h != null && h.length && (n.current.playing ? h.forEach((m) => {
|
|
181
181
|
document.documentElement.classList.add(m.trim());
|
|
182
|
-
}) :
|
|
182
|
+
}) : h.forEach((m) => {
|
|
183
183
|
document.documentElement.classList.remove(m.trim());
|
|
184
184
|
}));
|
|
185
185
|
});
|
|
@@ -188,7 +188,7 @@ class Lt extends HTMLElement {
|
|
|
188
188
|
return t(this, r);
|
|
189
189
|
}
|
|
190
190
|
get consumerHolderElement() {
|
|
191
|
-
return t(this,
|
|
191
|
+
return t(this, k);
|
|
192
192
|
}
|
|
193
193
|
get sourceManager() {
|
|
194
194
|
return t(this, f);
|
|
@@ -206,53 +206,52 @@ class Lt extends HTMLElement {
|
|
|
206
206
|
return t(this, E);
|
|
207
207
|
}
|
|
208
208
|
triggerLazyLoad() {
|
|
209
|
-
!t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), j(this,
|
|
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
210
|
}
|
|
211
211
|
connectedCallback() {
|
|
212
|
-
|
|
213
|
-
s(this, P, `source-consumer-${++lt}`);
|
|
212
|
+
s(this, B, `source-consumer-${++ct}`);
|
|
214
213
|
const e = this.getAttribute("srcset") || "", n = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
215
|
-
n && t(this, o).addElement(n), s(this,
|
|
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 = `
|
|
216
215
|
display: block;
|
|
217
216
|
width: 100%;
|
|
218
217
|
height: 100%;
|
|
219
|
-
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this,
|
|
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(
|
|
220
219
|
"loadedmetadata",
|
|
221
|
-
t(this,
|
|
222
|
-
), t(this,
|
|
220
|
+
t(this, V)
|
|
221
|
+
), t(this, V).call(this), Array.from(this.attributes).forEach((h) => {
|
|
223
222
|
if (h.name !== "srcset") {
|
|
224
|
-
const
|
|
225
|
-
|
|
223
|
+
const u = h.nodeValue || "", m = it(h.name);
|
|
224
|
+
m in t(this, r) && (t(this, r)[m] = u || !0);
|
|
226
225
|
}
|
|
227
|
-
}), t(this,
|
|
226
|
+
}), t(this, k).appendChild(t(this, r)), s(this, f, new ht({
|
|
228
227
|
srcset: e,
|
|
229
|
-
sourceSetOptions: t(this,
|
|
228
|
+
sourceSetOptions: t(this, P)
|
|
230
229
|
})), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((h) => {
|
|
231
|
-
(!t(this, g) || t(this, g) && t(this, b)) && j(this,
|
|
232
|
-
}), t(this, f).connect(), t(this,
|
|
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);
|
|
233
232
|
}
|
|
234
233
|
disconnectedCallback() {
|
|
235
234
|
var e;
|
|
236
|
-
clearTimeout(t(this,
|
|
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(
|
|
237
236
|
"loadedmetadata",
|
|
238
|
-
t(this,
|
|
237
|
+
t(this, V)
|
|
239
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();
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
|
-
f = new WeakMap(), r = new WeakMap(),
|
|
243
|
-
if (clearTimeout(t(this,
|
|
244
|
-
s(this,
|
|
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}`);
|
|
245
244
|
const n = this.hasAttribute("keep-source-parameters");
|
|
246
|
-
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,
|
|
247
|
-
t(this,
|
|
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);
|
|
248
247
|
}, t(this, r).onload = () => {
|
|
249
|
-
t(this,
|
|
248
|
+
t(this, D).call(this);
|
|
250
249
|
}, t(this, r).onerror = () => {
|
|
251
250
|
t(this, K).call(this, t(this, v));
|
|
252
251
|
};
|
|
253
252
|
} else
|
|
254
253
|
s(this, v, null), this.consumeSource(null);
|
|
255
|
-
}, G = new WeakMap(),
|
|
254
|
+
}, G = new WeakMap(), D = new WeakMap(), K = new WeakMap(), H = new WeakMap(), N = new WeakMap(), V = new WeakMap();
|
|
256
255
|
export {
|
|
257
256
|
nt as S,
|
|
258
257
|
Lt as a,
|
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-DE6khDs3.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-DJxX7uN5.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-DE6khDs3.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-DJxX7uN5.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
4
|
import "../Store-0BVty6AZ.js";
|
|
5
5
|
import { i } from "../index-Bv9zgfdb.js";
|
package/lib/media/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=e=>{throw TypeError(e)};var d=(e,r,s)=>r.has(e)||a("Cannot "+s);var o=(e,r,s)=>(d(e,r,"read from private field"),s?s.call(e):r.get(e)),u=(e,r,s)=>r.has(e)?a("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),n=(e,r,s,i)=>(d(e,r,"write to private field"),i?i.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../order/index.cjs"),h=require("../window-resizer/index.cjs"),b=require("../Store-Cd1GlEmZ.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");var t,c;class q extends b.Store{constructor(s){super(!1);u(this,t);u(this,c);n(this,t,s);const i=()=>{matchMedia(o(this,t)).matches?this.current=!0:this.current=!1};n(this,c,h.windowResizer.subscribe(i,l.RESIZE_ORDER.MEDIA)),i()}close(){super.close(),o(this,c).call(this)}}t=new WeakMap,c=new WeakMap;exports.Media=q;
|
package/lib/media/index.js
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var u = (s) => {
|
|
2
|
+
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var h = (e, r
|
|
5
|
-
var
|
|
6
|
-
import { RESIZE_ORDER as
|
|
4
|
+
var h = (s, e, r) => e.has(s) || u("Cannot " + r);
|
|
5
|
+
var c = (s, e, r) => (h(s, e, "read from private field"), r ? r.call(s) : e.get(s)), m = (s, e, r) => e.has(s) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, r), a = (s, e, r, t) => (h(s, e, "write to private field"), t ? t.call(s, r) : e.set(s, r), r);
|
|
6
|
+
import { RESIZE_ORDER as l } from "../order/index.js";
|
|
7
7
|
import { windowResizer as n } from "../window-resizer/index.js";
|
|
8
|
-
import { S as
|
|
8
|
+
import { S as p } from "../Store-0BVty6AZ.js";
|
|
9
9
|
import "construct-style-sheets-polyfill";
|
|
10
10
|
import "../index-Bv9zgfdb.js";
|
|
11
|
-
var
|
|
12
|
-
class M extends
|
|
13
|
-
constructor(
|
|
11
|
+
var i, o;
|
|
12
|
+
class M extends p {
|
|
13
|
+
constructor(r) {
|
|
14
14
|
super(!1);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
m(this, i);
|
|
16
|
+
m(this, o);
|
|
17
|
+
a(this, i, r);
|
|
18
|
+
const t = () => {
|
|
19
|
+
matchMedia(c(this, i)).matches ? this.current = !0 : this.current = !1;
|
|
20
|
+
};
|
|
21
|
+
a(this, o, n.subscribe(
|
|
22
|
+
t,
|
|
23
|
+
l.MEDIA
|
|
24
|
+
)), t();
|
|
20
25
|
}
|
|
21
26
|
close() {
|
|
22
|
-
super.close(),
|
|
27
|
+
super.close(), c(this, o).call(this);
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
|
-
|
|
30
|
+
i = new WeakMap(), o = new WeakMap();
|
|
26
31
|
export {
|
|
27
32
|
M as Media
|
|
28
33
|
};
|
|
@@ -25,7 +25,7 @@ export declare class ScrollRegionElement extends HTMLElement {
|
|
|
25
25
|
tick(): void;
|
|
26
26
|
destroy(): void;
|
|
27
27
|
enable(): void;
|
|
28
|
-
disable(): void;
|
|
28
|
+
disable(resetStatus?: boolean): void;
|
|
29
29
|
protected connectedCallback(): void;
|
|
30
30
|
protected disconnectedCallback(): void;
|
|
31
31
|
}
|
package/lib/scroll-kit/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ft=n=>{throw TypeError(n)};var ot=(n,c,e)=>c.has(n)||ft("Cannot "+e);var t=(n,c,e)=>(ot(n,c,"read from private field"),e?e.call(n):c.get(n)),s=(n,c,e)=>c.has(n)?ft("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,e),r=(n,c,e,i)=>(ot(n,c,"write to private field"),i?i.call(n,e):c.set(n,e),e),d=(n,c,e)=>(ot(n,c,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=require("../index-DekP7OZe.cjs"),kt=require("../dom-JBOkFLTh.cjs"),zt=require("../gestures-C7gbKx11.cjs");require("construct-style-sheets-polyfill");const j=require("../ticker/index.cjs"),lt=require("../scroll-entries/index.cjs");require("../Store-Cd1GlEmZ.cjs");const Ht=require("../Damped-z9Uaw2MJ.cjs"),g=require("../css-property/index.cjs"),qt=require("../element-linked-store/index.cjs"),bt=require("../element-resizer/index.cjs"),ht=require("../events-KVanG9sR.cjs"),gt=require("../layout-Ctc2p3uz.cjs"),Mt=require("../math-GDWEqu7y.cjs"),pt=require("../window-resizer/index.cjs");var o,f,W,x,a,O,E,at,yt,Et,B,nt,K,k,J;class St extends HTMLElement{constructor(){super(...arguments);s(this,E);s(this,o,null);s(this,f,null);s(this,W,0);s(this,x,0);s(this,a,!1);s(this,O);s(this,B,()=>{this.classList.add("active"),clearTimeout(t(this,O));const i=t(this,E,at)/t(this,x)*t(this,W);t(this,a)?t(this,f).style.transform=`translate3d(${i}px, 0px, 0px)`:t(this,f).style.transform=`translate3d(0px, ${i}px, 0px)`,r(this,O,setTimeout(()=>{this.classList.remove("active")},1e3))});s(this,nt,()=>{const e=t(this,a)?this.offsetWidth:this.offsetHeight,i=t(this,E,yt),b=t(this,E,Et);r(this,x,i-b);let v=e*e/(t(this,x)+e);v=Math.max(v,30),t(this,a)?(t(this,f).style.width=v+"px",t(this,f).style.height="100%"):(t(this,f).style.width="100%",t(this,f).style.height=v+"px"),r(this,W,e-v),i<=b?this.style.display="none":this.style.display="block"});s(this,K,e=>{document.documentElement.classList.add("grabbing");const i=t(this,E,at),b=t(this,a)?e.x:e.y;zt.setupDrag(v=>{const xt=t(this,x)/t(this,W),mt=(t(this,a)?v.x-b:v.y-b)*xt;t(this,a)?t(this,o).scroll({left:i+mt,behavior:"instant"}):t(this,o).scroll({top:i+mt,behavior:"instant"})},()=>{document.documentElement.classList.remove("grabbing")})});s(this,k,()=>{t(this,nt).call(this)});s(this,J,e=>{e.isIntersecting?(j.ticker.subscribe(t(this,k),{maxFPS:5}),t(this,k).call(this)):j.ticker.unsubscribe(t(this,k))})}connectedCallback(){const e=this.getAttribute("data-scroll");let i=null;e&&(e==="parent"?i=this.parentElement:i=document.querySelector(e)),i||(i=kt.findScrollParentElement(this),i===document.body&&(i=window)),r(this,a,this.hasAttribute("horisontal"));const b=this.querySelector("[data-thumb]");i&&b&&(r(this,o,i),r(this,f,b),t(this,o).addEventListener("scroll",t(this,B)),t(this,f).addEventListener("pointerdown",t(this,K)),ct.intersector.subscribe(this.parentElement===document.body?this:this.parentElement,t(this,J)))}disconnectedCallback(){t(this,o).removeEventListener("scroll",t(this,B)),t(this,f).removeEventListener("pointerdown",t(this,K)),clearTimeout(t(this,O)),ct.intersector.unsubscribe(t(this,J)),j.ticker.unsubscribe(t(this,k))}}o=new WeakMap,f=new WeakMap,W=new WeakMap,x=new WeakMap,a=new WeakMap,O=new WeakMap,E=new WeakSet,at=function(){return t(this,o)instanceof HTMLElement?t(this,a)?t(this,o).scrollLeft:t(this,o).scrollTop:t(this,a)?t(this,o).scrollX:t(this,o).scrollY},yt=function(){return t(this,o)instanceof HTMLElement?t(this,a)?t(this,o).scrollWidth:t(this,o).scrollHeight:t(this,a)?Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth):Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},Et=function(){return t(this,o)instanceof HTMLElement?t(this,a)?t(this,o).offsetWidth:t(this,o).offsetHeight:t(this,a)?innerWidth:innerHeight},B=new WeakMap,nt=new WeakMap,K=new WeakMap,k=new WeakMap,J=new WeakMap;ct.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",St);const Vt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","Space"]);var D,_,l,N,Y,z,X,Q,Z,tt,et,st;class vt extends HTMLElement{constructor(){super(...arguments);s(this,z);s(this,D,new g.CSSProperty(this,"--smooth-scroll-disabled",!1));s(this,_,new g.CSSProperty(this,"--smooth-scroll-damping",10));s(this,l,new Ht.Damped(0));s(this,N,0);s(this,Y,!1);s(this,Q,e=>{if(!d(this,z,X).call(this)){if(Math.sign(e.deltaY)<0&&t(this,l).target===0&&t(this,l).direction<0||Math.sign(e.deltaY)>0&&t(this,l).target===t(this,l).max&&t(this,l).direction>0||e.stopPropagation(),e.target instanceof Element){const i=e.target.closest("[data-prevent-smooth-scroll]");if(i){const b=i.getAttribute("data-prevent-smooth-scroll");if(b){if(matchMedia(b).matches)return}else return}}Math.abs(e.deltaX)>Math.abs(e.deltaY)||(e.preventDefault(),this.shiftPosition(e.deltaY))}});s(this,Z,()=>{d(this,z,X).call(this)||this.stop()});s(this,tt,e=>{d(this,z,X).call(this)||e.target instanceof Element&&e.target.closest("a")&&this.stop()});s(this,et,()=>{this.resize()});s(this,st,e=>{d(this,z,X).call(this)||Vt.has(e.code)&&this.stop()})}resize(){t(this,l).min=0,t(this,l).max=this.scrollHeight-this.offsetHeight}stop(){t(this,l).unlistenAnimationFrame(),r(this,Y,!0)}sync(){const e=this.scrollTop;(t(this,Y)||Math.abs(e-t(this,l).current)>100)&&(r(this,Y,!1),t(this,l).set(e,{equalize:!0}))}shiftPosition(e){this.resize(),this.sync(),t(this,l).shift(e)}setPosition(e,i){this.resize(),this.sync(),t(this,l).set(e,i)}connectedCallback(){window.addEventListener("resize",t(this,et)),this.addEventListener("keydown",t(this,st)),this.addEventListener("pointerdown",t(this,tt)),this.addEventListener("touchstart",t(this,Z)),this.addEventListener("wheel",t(this,Q),{passive:!1}),t(this,l).subscribe(e=>{const i=Math.round(e.current);lt.scrollEntries.update(this,"y",e.current),i!==t(this,N)&&this.scroll({top:i,behavior:"instant"}),r(this,N,i)}),t(this,_).observe(),t(this,D).observe(),t(this,_).subscribe(e=>{t(this,l).damping=e.current}),lt.scrollEntries.register(this),this.resize()}disconnectedCallback(){t(this,l).close(),t(this,_).close(),t(this,D).close(),lt.scrollEntries.unregister(this),window.removeEventListener("resize",t(this,et)),this.removeEventListener("keydown",t(this,st)),this.removeEventListener("pointerdown",t(this,tt)),this.removeEventListener("touchstart",t(this,Z)),this.removeEventListener("wheel",t(this,Q))}}D=new WeakMap,_=new WeakMap,l=new WeakMap,N=new WeakMap,Y=new WeakMap,z=new WeakSet,X=function(){return t(this,D).current||getComputedStyle(this).getPropertyValue("overflow")==="hidden"},Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap;customElements.get("e-smooth-scroll")||customElements.define("e-smooth-scroll",vt);var S,H,F,w,q,M,$,L,G,y,V,u,it,m,p,T,A,P,I,h,Lt,dt,Pt,C,R,ut,Ct,rt,U;class wt extends HTMLElement{constructor(){super(...arguments);s(this,h);s(this,S,this);s(this,H,null);s(this,F,new g.CSSProperty(this,"--scroll-region-status-holder",!1));s(this,w,new g.CSSProperty(this,"--scroll-region-disabled",!1));s(this,q,new g.CSSProperty(this,"--scroll-region-start-offset",0,{rawValueCheck:!1}));s(this,M,new g.CSSProperty(this,"--scroll-region-start-offset-min",!1,{rawValueCheck:!1}));s(this,$,new g.CSSProperty(this,"--scroll-region-start-extra-offset",0,{rawValueCheck:!1}));s(this,L,new g.CSSProperty(this,"--scroll-region-distance",0,{rawValueCheck:!1}));s(this,G,new g.CSSProperty(this,"--scroll-region-distance-offset",0,{rawValueCheck:!1}));s(this,y,new g.CSSProperty(this,"--scroll-region-progress-var",""));s(this,V,new g.CSSProperty(this,"--scroll-region-enter-once",!1));s(this,u,new qt.ElementLinkedStore(this,{enabled:!1,entered:!1,enteredOnLoad:!1,activated:!1}));s(this,it,0);s(this,m,0);s(this,p,0);s(this,T,0);s(this,A,0);s(this,P,0);s(this,I,!1);s(this,C,()=>{this.resize()});s(this,R,()=>{this.tick()});s(this,U,()=>{document.readyState==="complete"&&d(this,h,Pt).call(this)})}get start(){return t(this,m)}get finish(){return t(this,p)}get distance(){return t(this,T)}get scrolled(){return t(this,A)}get progress(){return t(this,P)}get status(){return t(this,u)}get scrollValue(){return t(this,H)instanceof HTMLElement?t(this,H).scrollTop:t(this,H).scrollY}resize(){t(this,w).current||(r(this,it,gt.getCumulativeOffsetTop(this)),r(this,m,t(this,it)),typeof t(this,M).current=="number"?r(this,m,t(this,m)+Math.max(t(this,q).current,t(this,M).current)):r(this,m,t(this,m)+t(this,q).current),r(this,m,t(this,m)+t(this,$).current),r(this,m,t(this,m)-gt.getStickyOffset(this,"top")),r(this,p,t(this,m)),t(this,L).current?r(this,p,t(this,p)+t(this,L).current):r(this,p,t(this,p)+this.offsetHeight),r(this,p,t(this,p)+t(this,G).current),r(this,T,t(this,p)-t(this,m)),r(this,I,this.offsetWidth!==0&&this.offsetHeight!==0),this.tick())}tick(){if(t(this,w).current)return;const e=this.scrollValue;r(this,A,Mt.clamp(e-t(this,m),0,t(this,T))),r(this,P,t(this,A)/t(this,T)||0),t(this,y).current&&t(this,S).style.setProperty(d(this,h,rt).call(this,t(this,y).current),t(this,P).toFixed(6)),t(this,u).set("activated",e>=t(this,m)),t(this,I)&&t(this,u).isFalse("entered")&&e>=t(this,m)&&e<=t(this,p)?d(this,h,ut).call(this):t(this,I)&&!t(this,V).current&&t(this,u).isTrue("entered")&&(e<t(this,m)||e>t(this,p))&&d(this,h,Ct).call(this),t(this,V).current&&t(this,P)===1&&(t(this,u).current.entered||d(this,h,ut).call(this),this.destroy()),ht.dispatchEvent(this,"scrollRegionProgress",{detail:{progress:t(this,P),scrolled:t(this,A)}})}destroy(){document.removeEventListener("readystatechange",t(this,U)),this.disable(),t(this,F).close(),t(this,w).close(),t(this,q).close(),t(this,M).close(),t(this,$).close(),t(this,L).close(),t(this,G).close(),t(this,y).close(),t(this,V).close()}enable(){j.ticker.subscribe(t(this,R),{culling:this}),bt.elementResizer.subscribe(this,t(this,C)),pt.windowResizer.subscribe(t(this,C)),t(this,R).call(this),t(this,u).set("enabled",!0)}disable(){j.ticker.unsubscribe(t(this,R)),bt.elementResizer.unsubscribe(t(this,C)),pt.windowResizer.unsubscribe(t(this,C)),t(this,u).reset(),d(this,h,dt).call(this)}connectedCallback(){const e=this.getAttribute("data-scroll")||".page-scroll";r(this,H,document.querySelector(e)),document.readyState==="complete"?t(this,U).call(this):document.addEventListener("readystatechange",t(this,U))}disconnectedCallback(){this.destroy()}}S=new WeakMap,H=new WeakMap,F=new WeakMap,w=new WeakMap,q=new WeakMap,M=new WeakMap,$=new WeakMap,L=new WeakMap,G=new WeakMap,y=new WeakMap,V=new WeakMap,u=new WeakMap,it=new WeakMap,m=new WeakMap,p=new WeakMap,T=new WeakMap,A=new WeakMap,P=new WeakMap,I=new WeakMap,h=new WeakSet,Lt=function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.add(this.getAttribute("data-global-class"))},dt=function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.remove(this.getAttribute("data-global-class"))},Pt=function(){t(this,F).subscribe(e=>{t(this,S)&&(t(this,u).removeElement(t(this,S)),t(this,S).style.removeProperty(d(this,h,rt).call(this,t(this,y).current))),r(this,S,e.current?document.querySelector(e.current)||this:this),console.log(e.current),t(this,u).addElement(t(this,S))}),t(this,w).subscribe(e=>{e.current&&!e.previous?this.disable():this.enable()}),t(this,y).subscribe(e=>{e.current?t(this,R).call(this):e.previous&&t(this,S).style.removeProperty(d(this,h,rt).call(this,e.previous))}),t(this,L).subscribe(()=>{t(this,C).call(this)}),t(this,F).observe(),t(this,w).observe(),t(this,q).observe(),t(this,M).observe(),t(this,$).observe(),t(this,L).observe(),t(this,G).observe(),t(this,y).observe(),t(this,V).observe()},C=new WeakMap,R=new WeakMap,ut=function(){const e=this.scrollValue;t(this,u).set("entered",!0),e===0&&t(this,u).set("enteredOnLoad",!0),d(this,h,Lt).call(this),ht.dispatchEvent(this,"scrollRegionEnter")},Ct=function(){t(this,u).set("entered",!1),d(this,h,dt).call(this),ht.dispatchEvent(this,"scrollRegionExit")},rt=function(e){return`--${e}`},U=new WeakMap;customElements.get("e-scroll-region")||customElements.define("e-scroll-region",wt);exports.ScrollRegionElement=wt;exports.ScrollbarElement=St;exports.SmoothScrollElement=vt;
|
|
1
|
+
"use strict";var ft=n=>{throw TypeError(n)};var ot=(n,c,e)=>c.has(n)||ft("Cannot "+e);var t=(n,c,e)=>(ot(n,c,"read from private field"),e?e.call(n):c.get(n)),s=(n,c,e)=>c.has(n)?ft("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,e),r=(n,c,e,i)=>(ot(n,c,"write to private field"),i?i.call(n,e):c.set(n,e),e),d=(n,c,e)=>(ot(n,c,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=require("../index-DekP7OZe.cjs"),kt=require("../dom-JBOkFLTh.cjs"),zt=require("../gestures-C7gbKx11.cjs");require("construct-style-sheets-polyfill");const j=require("../ticker/index.cjs"),lt=require("../scroll-entries/index.cjs");require("../Store-Cd1GlEmZ.cjs");const Ht=require("../Damped-z9Uaw2MJ.cjs"),g=require("../css-property/index.cjs"),qt=require("../element-linked-store/index.cjs"),bt=require("../element-resizer/index.cjs"),ht=require("../events-KVanG9sR.cjs"),gt=require("../layout-Ctc2p3uz.cjs"),Mt=require("../math-GDWEqu7y.cjs"),pt=require("../window-resizer/index.cjs");var o,f,W,x,a,O,E,at,yt,Et,B,nt,K,k,J;class St extends HTMLElement{constructor(){super(...arguments);s(this,E);s(this,o,null);s(this,f,null);s(this,W,0);s(this,x,0);s(this,a,!1);s(this,O);s(this,B,()=>{this.classList.add("active"),clearTimeout(t(this,O));const i=t(this,E,at)/t(this,x)*t(this,W);t(this,a)?t(this,f).style.transform=`translate3d(${i}px, 0px, 0px)`:t(this,f).style.transform=`translate3d(0px, ${i}px, 0px)`,r(this,O,setTimeout(()=>{this.classList.remove("active")},1e3))});s(this,nt,()=>{const e=t(this,a)?this.offsetWidth:this.offsetHeight,i=t(this,E,yt),b=t(this,E,Et);r(this,x,i-b);let v=e*e/(t(this,x)+e);v=Math.max(v,30),t(this,a)?(t(this,f).style.width=v+"px",t(this,f).style.height="100%"):(t(this,f).style.width="100%",t(this,f).style.height=v+"px"),r(this,W,e-v),i<=b?this.style.display="none":this.style.display="block"});s(this,K,e=>{document.documentElement.classList.add("grabbing");const i=t(this,E,at),b=t(this,a)?e.x:e.y;zt.setupDrag(v=>{const xt=t(this,x)/t(this,W),mt=(t(this,a)?v.x-b:v.y-b)*xt;t(this,a)?t(this,o).scroll({left:i+mt,behavior:"instant"}):t(this,o).scroll({top:i+mt,behavior:"instant"})},()=>{document.documentElement.classList.remove("grabbing")})});s(this,k,()=>{t(this,nt).call(this)});s(this,J,e=>{e.isIntersecting?(j.ticker.subscribe(t(this,k),{maxFPS:5}),t(this,k).call(this)):j.ticker.unsubscribe(t(this,k))})}connectedCallback(){const e=this.getAttribute("data-scroll");let i=null;e&&(e==="parent"?i=this.parentElement:i=document.querySelector(e)),i||(i=kt.findScrollParentElement(this),i===document.body&&(i=window)),r(this,a,this.hasAttribute("horisontal"));const b=this.querySelector("[data-thumb]");i&&b&&(r(this,o,i),r(this,f,b),t(this,o).addEventListener("scroll",t(this,B)),t(this,f).addEventListener("pointerdown",t(this,K)),ct.intersector.subscribe(this.parentElement===document.body?this:this.parentElement,t(this,J)))}disconnectedCallback(){t(this,o).removeEventListener("scroll",t(this,B)),t(this,f).removeEventListener("pointerdown",t(this,K)),clearTimeout(t(this,O)),ct.intersector.unsubscribe(t(this,J)),j.ticker.unsubscribe(t(this,k))}}o=new WeakMap,f=new WeakMap,W=new WeakMap,x=new WeakMap,a=new WeakMap,O=new WeakMap,E=new WeakSet,at=function(){return t(this,o)instanceof HTMLElement?t(this,a)?t(this,o).scrollLeft:t(this,o).scrollTop:t(this,a)?t(this,o).scrollX:t(this,o).scrollY},yt=function(){return t(this,o)instanceof HTMLElement?t(this,a)?t(this,o).scrollWidth:t(this,o).scrollHeight:t(this,a)?Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth):Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},Et=function(){return t(this,o)instanceof HTMLElement?t(this,a)?t(this,o).offsetWidth:t(this,o).offsetHeight:t(this,a)?innerWidth:innerHeight},B=new WeakMap,nt=new WeakMap,K=new WeakMap,k=new WeakMap,J=new WeakMap;ct.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",St);const Vt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","Space"]);var D,_,l,N,Y,z,X,Q,Z,tt,et,st;class vt extends HTMLElement{constructor(){super(...arguments);s(this,z);s(this,D,new g.CSSProperty(this,"--smooth-scroll-disabled",!1));s(this,_,new g.CSSProperty(this,"--smooth-scroll-damping",10));s(this,l,new Ht.Damped(0));s(this,N,0);s(this,Y,!1);s(this,Q,e=>{if(!d(this,z,X).call(this)){if(Math.sign(e.deltaY)<0&&t(this,l).target===0&&t(this,l).direction<0||Math.sign(e.deltaY)>0&&t(this,l).target===t(this,l).max&&t(this,l).direction>0||e.stopPropagation(),e.target instanceof Element){const i=e.target.closest("[data-prevent-smooth-scroll]");if(i){const b=i.getAttribute("data-prevent-smooth-scroll");if(b){if(matchMedia(b).matches)return}else return}}Math.abs(e.deltaX)>Math.abs(e.deltaY)||(e.preventDefault(),this.shiftPosition(e.deltaY))}});s(this,Z,()=>{d(this,z,X).call(this)||this.stop()});s(this,tt,e=>{d(this,z,X).call(this)||e.target instanceof Element&&e.target.closest("a")&&this.stop()});s(this,et,()=>{this.resize()});s(this,st,e=>{d(this,z,X).call(this)||Vt.has(e.code)&&this.stop()})}resize(){t(this,l).min=0,t(this,l).max=this.scrollHeight-this.offsetHeight}stop(){t(this,l).unlistenAnimationFrame(),r(this,Y,!0)}sync(){const e=this.scrollTop;(t(this,Y)||Math.abs(e-t(this,l).current)>100)&&(r(this,Y,!1),t(this,l).set(e,{equalize:!0}))}shiftPosition(e){this.resize(),this.sync(),t(this,l).shift(e)}setPosition(e,i){this.resize(),this.sync(),t(this,l).set(e,i)}connectedCallback(){window.addEventListener("resize",t(this,et)),this.addEventListener("keydown",t(this,st)),this.addEventListener("pointerdown",t(this,tt)),this.addEventListener("touchstart",t(this,Z)),this.addEventListener("wheel",t(this,Q),{passive:!1}),t(this,l).subscribe(e=>{const i=Math.round(e.current);lt.scrollEntries.update(this,"y",e.current),i!==t(this,N)&&this.scroll({top:i,behavior:"instant"}),r(this,N,i)}),t(this,_).observe(),t(this,D).observe(),t(this,_).subscribe(e=>{t(this,l).damping=e.current}),lt.scrollEntries.register(this),this.resize()}disconnectedCallback(){t(this,l).close(),t(this,_).close(),t(this,D).close(),lt.scrollEntries.unregister(this),window.removeEventListener("resize",t(this,et)),this.removeEventListener("keydown",t(this,st)),this.removeEventListener("pointerdown",t(this,tt)),this.removeEventListener("touchstart",t(this,Z)),this.removeEventListener("wheel",t(this,Q))}}D=new WeakMap,_=new WeakMap,l=new WeakMap,N=new WeakMap,Y=new WeakMap,z=new WeakSet,X=function(){return t(this,D).current||getComputedStyle(this).getPropertyValue("overflow")==="hidden"},Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap;customElements.get("e-smooth-scroll")||customElements.define("e-smooth-scroll",vt);var S,H,F,w,q,M,$,L,G,y,V,u,it,m,p,T,A,P,I,h,Lt,dt,Pt,C,R,ut,Ct,rt,U;class wt extends HTMLElement{constructor(){super(...arguments);s(this,h);s(this,S,this);s(this,H,null);s(this,F,new g.CSSProperty(this,"--scroll-region-status-holder",!1));s(this,w,new g.CSSProperty(this,"--scroll-region-disabled",!1));s(this,q,new g.CSSProperty(this,"--scroll-region-start-offset",0,{rawValueCheck:!1}));s(this,M,new g.CSSProperty(this,"--scroll-region-start-offset-min",!1,{rawValueCheck:!1}));s(this,$,new g.CSSProperty(this,"--scroll-region-start-extra-offset",0,{rawValueCheck:!1}));s(this,L,new g.CSSProperty(this,"--scroll-region-distance",0,{rawValueCheck:!1}));s(this,G,new g.CSSProperty(this,"--scroll-region-distance-offset",0,{rawValueCheck:!1}));s(this,y,new g.CSSProperty(this,"--scroll-region-progress-var",""));s(this,V,new g.CSSProperty(this,"--scroll-region-enter-once",!1));s(this,u,new qt.ElementLinkedStore(this,{enabled:!1,entered:!1,enteredOnLoad:!1,activated:!1}));s(this,it,0);s(this,m,0);s(this,p,0);s(this,T,0);s(this,A,0);s(this,P,0);s(this,I,!1);s(this,C,()=>{this.resize()});s(this,R,()=>{this.tick()});s(this,U,()=>{document.readyState==="complete"&&d(this,h,Pt).call(this)})}get start(){return t(this,m)}get finish(){return t(this,p)}get distance(){return t(this,T)}get scrolled(){return t(this,A)}get progress(){return t(this,P)}get status(){return t(this,u)}get scrollValue(){return t(this,H)instanceof HTMLElement?t(this,H).scrollTop:t(this,H).scrollY}resize(){t(this,w).current||(r(this,it,gt.getCumulativeOffsetTop(this)),r(this,m,t(this,it)),typeof t(this,M).current=="number"?r(this,m,t(this,m)+Math.max(t(this,q).current,t(this,M).current)):r(this,m,t(this,m)+t(this,q).current),r(this,m,t(this,m)+t(this,$).current),r(this,m,t(this,m)-gt.getStickyOffset(this,"top")),r(this,p,t(this,m)),t(this,L).current?r(this,p,t(this,p)+t(this,L).current):r(this,p,t(this,p)+this.offsetHeight),r(this,p,t(this,p)+t(this,G).current),r(this,T,t(this,p)-t(this,m)),r(this,I,this.offsetWidth!==0&&this.offsetHeight!==0),this.tick())}tick(){if(t(this,w).current)return;const e=this.scrollValue;r(this,A,Mt.clamp(e-t(this,m),0,t(this,T))),r(this,P,t(this,A)/t(this,T)||0),t(this,y).current&&t(this,S).style.setProperty(d(this,h,rt).call(this,t(this,y).current),t(this,P).toFixed(6)),t(this,u).set("activated",e>=t(this,m)),t(this,I)&&t(this,u).isFalse("entered")&&e>=t(this,m)&&e<=t(this,p)?d(this,h,ut).call(this):t(this,I)&&!t(this,V).current&&t(this,u).isTrue("entered")&&(e<t(this,m)||e>t(this,p))&&d(this,h,Ct).call(this),t(this,V).current&&t(this,P)===1&&(t(this,u).current.entered||d(this,h,ut).call(this),this.destroy()),ht.dispatchEvent(this,"scrollRegionProgress",{detail:{progress:t(this,P),scrolled:t(this,A)}})}destroy(){document.removeEventListener("readystatechange",t(this,U)),this.disable(!1),t(this,F).close(),t(this,w).close(),t(this,q).close(),t(this,M).close(),t(this,$).close(),t(this,L).close(),t(this,G).close(),t(this,y).close(),t(this,V).close()}enable(){j.ticker.subscribe(t(this,R),{culling:this}),bt.elementResizer.subscribe(this,t(this,C)),pt.windowResizer.subscribe(t(this,C)),t(this,R).call(this),t(this,u).set("enabled",!0)}disable(e=!0){j.ticker.unsubscribe(t(this,R)),bt.elementResizer.unsubscribe(t(this,C)),pt.windowResizer.unsubscribe(t(this,C)),e&&t(this,u).reset(),d(this,h,dt).call(this)}connectedCallback(){const e=this.getAttribute("data-scroll")||".page-scroll";r(this,H,document.querySelector(e)),document.readyState==="complete"?t(this,U).call(this):document.addEventListener("readystatechange",t(this,U))}disconnectedCallback(){this.destroy()}}S=new WeakMap,H=new WeakMap,F=new WeakMap,w=new WeakMap,q=new WeakMap,M=new WeakMap,$=new WeakMap,L=new WeakMap,G=new WeakMap,y=new WeakMap,V=new WeakMap,u=new WeakMap,it=new WeakMap,m=new WeakMap,p=new WeakMap,T=new WeakMap,A=new WeakMap,P=new WeakMap,I=new WeakMap,h=new WeakSet,Lt=function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.add(this.getAttribute("data-global-class"))},dt=function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.remove(this.getAttribute("data-global-class"))},Pt=function(){t(this,F).subscribe(e=>{t(this,S)&&(t(this,u).removeElement(t(this,S)),t(this,S).style.removeProperty(d(this,h,rt).call(this,t(this,y).current))),r(this,S,e.current?document.querySelector(e.current)||this:this),t(this,u).addElement(t(this,S))}),t(this,w).subscribe(e=>{e.current&&!e.previous?this.disable():this.enable()}),t(this,y).subscribe(e=>{e.current?t(this,R).call(this):e.previous&&t(this,S).style.removeProperty(d(this,h,rt).call(this,e.previous))}),t(this,L).subscribe(()=>{t(this,C).call(this)}),t(this,F).observe(),t(this,w).observe(),t(this,q).observe(),t(this,M).observe(),t(this,$).observe(),t(this,L).observe(),t(this,G).observe(),t(this,y).observe(),t(this,V).observe()},C=new WeakMap,R=new WeakMap,ut=function(){const e=this.scrollValue;t(this,u).set("entered",!0),e===0&&t(this,u).set("enteredOnLoad",!0),d(this,h,Lt).call(this),ht.dispatchEvent(this,"scrollRegionEnter")},Ct=function(){t(this,u).set("entered",!1),d(this,h,dt).call(this),ht.dispatchEvent(this,"scrollRegionExit")},rt=function(e){return`--${e}`},U=new WeakMap;customElements.get("e-scroll-region")||customElements.define("e-scroll-region",wt);exports.ScrollRegionElement=wt;exports.ScrollbarElement=St;exports.SmoothScrollElement=vt;
|
package/lib/scroll-kit/index.js
CHANGED
|
@@ -327,13 +327,13 @@ class Wt extends HTMLElement {
|
|
|
327
327
|
document.removeEventListener(
|
|
328
328
|
"readystatechange",
|
|
329
329
|
t(this, X)
|
|
330
|
-
), this.disable(), t(this, $).close(), t(this, S).close(), t(this, M).close(), t(this, V).close(), t(this, G).close(), t(this, L).close(), t(this, I).close(), t(this, v).close(), t(this, T).close();
|
|
330
|
+
), this.disable(!1), t(this, $).close(), t(this, S).close(), t(this, M).close(), t(this, V).close(), t(this, G).close(), t(this, L).close(), t(this, I).close(), t(this, v).close(), t(this, T).close();
|
|
331
331
|
}
|
|
332
332
|
enable() {
|
|
333
333
|
K.subscribe(t(this, D), { culling: this }), bt.subscribe(this, t(this, P)), pt.subscribe(t(this, P)), t(this, D).call(this), t(this, u).set("enabled", !0);
|
|
334
334
|
}
|
|
335
|
-
disable() {
|
|
336
|
-
K.unsubscribe(t(this, D)), bt.unsubscribe(t(this, P)), pt.unsubscribe(t(this, P)), t(this, u).reset(), d(this, l, at).call(this);
|
|
335
|
+
disable(e = !0) {
|
|
336
|
+
K.unsubscribe(t(this, D)), bt.unsubscribe(t(this, P)), pt.unsubscribe(t(this, P)), e && t(this, u).reset(), d(this, l, at).call(this);
|
|
337
337
|
}
|
|
338
338
|
connectedCallback() {
|
|
339
339
|
const e = this.getAttribute("data-scroll") || ".page-scroll";
|
|
@@ -358,7 +358,7 @@ E = new WeakMap(), z = new WeakMap(), $ = new WeakMap(), S = new WeakMap(), M =
|
|
|
358
358
|
t(this, $).subscribe((e) => {
|
|
359
359
|
t(this, E) && (t(this, u).removeElement(t(this, E)), t(this, E).style.removeProperty(
|
|
360
360
|
d(this, l, rt).call(this, t(this, v).current)
|
|
361
|
-
)), r(this, E, e.current ? document.querySelector(e.current) || this : this),
|
|
361
|
+
)), r(this, E, e.current ? document.querySelector(e.current) || this : this), t(this, u).addElement(t(this, E));
|
|
362
362
|
}), t(this, S).subscribe((e) => {
|
|
363
363
|
e.current && !e.previous ? this.disable() : this.enable();
|
|
364
364
|
}), t(this, v).subscribe((e) => {
|
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-DE6khDs3.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-DJxX7uN5.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-DE6khDs3.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 h=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||h("Cannot "+e);var i=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),u=(t,s,e)=>s.has(t)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),c=(t,s,e,l)=>(m(t,s,"write to private field"),l?l.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-
|
|
1
|
+
"use strict";var h=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||h("Cannot "+e);var i=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),u=(t,s,e)=>s.has(t)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),c=(t,s,e,l)=>(m(t,s,"write to private field"),l?l.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-DE6khDs3.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const p=require("../index-DekP7OZe.cjs"),b=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const o=require("../ticker/index.cjs");var r,n,a;class d extends E.SourceElement{constructor(){super(...arguments);u(this,r,0);u(this,n,!1);u(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e!==i(this,r)&&b.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}}),e>i(this,r)&&c(this,r,e),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(i(this,a)),i(this,n)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,n,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,n,!0)),o.ticker.subscribe(i(this,a))}),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")}),this.addEventListener("click",()=>{this.hasAttribute("click-controls")&&(this.consumerElement.paused?this.consumerElement.play():this.hasAttribute("controls")||this.consumerElement.pause())})}disconnectedCallback(){super.disconnectedCallback(),o.ticker.unsubscribe(i(this,a)),c(this,r,0)}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,n=new WeakMap,a=new WeakMap;p.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",d);exports.VideoElement=d;
|
package/lib/video/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var h = (t) => {
|
|
|
3
3
|
};
|
|
4
4
|
var l = (t, s, e) => s.has(t) || h("Cannot " + e);
|
|
5
5
|
var i = (t, s, e) => (l(t, s, "read from private field"), e ? e.call(t) : s.get(t)), c = (t, s, e) => s.has(t) ? h("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), o = (t, s, e, m) => (l(t, s, "write to private field"), m ? m.call(t, e) : s.set(t, e), e);
|
|
6
|
-
import { a as d } from "../SourceElement-
|
|
6
|
+
import { a as d } from "../SourceElement-DJxX7uN5.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as p } from "../index-Bv9zgfdb.js";
|
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-DE6khDs3.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-DJxX7uN5.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"),M=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 C,b,B,S,d,p,$;class et{constructor(n){i(this,C);i(this,b);i(this,B);i(this,S);i(this,d);i(this,p);i(this,$);s(this,C,n);let e=n.split(".");const a=/\b\d{1,2}x\b/g,l=e.find(y=>y.match(a)&&parseInt(y));s(this,B,l?parseInt(l):1),l&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const h=/\d+max/g,m=/\d+min/g,w=/\d+mar/g,U=/\d+mir/g,W=e.find(y=>y.match(h)),u=e.find(y=>y.match(m)),x=e.find(y=>y.match(w)),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,$,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,$,t(this,$).replace(`.${t(this,d)}${t(this,p)}`,""))}get url(){return t(this,C)}get name(){return t(this,b)}get density(){return t(this,B)}get query(){return t(this,S)}get extension(){return t(this,$)}get queryType(){return t(this,p)}get queryValue(){return t(this,d)}}C=new WeakMap,b=new WeakMap,B=new WeakMap,S=new WeakMap,d=new WeakMap,p=new WeakMap,$=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,l=typeof n=="string"?a?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,h=[];l.forEach(u=>{const x=new et(u);h.push([x.query,x])});const m=h.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),w=h.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=h.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...m,...w]:[...m,...w]).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 R,A;class st extends ht.Store{constructor(e){super(void 0);i(this,R);i(this,A,()=>{let e;t(this,R).mediaBuckets.forEach((h,m)=>{matchMedia(m).matches&&(e=h)});let a,l=0;e==null||e.forEach(h=>{h.density>l&&h.density<=Math.max(devicePixelRatio,1)&&(l=h.density,a=h)}),e!=null&&e.length&&!a&&(a=e[0]),this.current=a});s(this,R,new Q(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,R,new Q(e.srcset,e.sourceSetOptions)),t(this,A).call(this)}close(){super.close(),this.disconnect()}connect(){tt.windowResizer.subscribe(t(this,A),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,A).call(this)}disconnect(){tt.windowResizer.unsubscribe(t(this,A))}}R=new WeakMap,A=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),h=(n%60).toString().padStart(2,"0");if(e>0){const m=a.toString().padStart(2,"0");return`${e}:${m}:${h}`}else return`${a}:${h}`}let ct=0;var f,r,k,E,L,g,P,I,o,O,T,v,_,z,j,G,D,K,H,N,V;class ut extends HTMLElement{constructor(e){super();i(this,z);i(this,f,null);i(this,r,null);i(this,k,this);i(this,E,!1);i(this,L,!1);i(this,g,!1);i(this,P,"");i(this,I,"");i(this,o,new it.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,O,null);i(this,T);i(this,v,null);i(this,_);i(this,G,e=>{const a=e[0];t(this,g)&&(!t(this,L)||this.hasAttribute("reload-source"))&&a.isIntersecting&&this.triggerLazyLoad(),a.isIntersecting?M.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,z,j).call(this,void 0),s(this,L,!1)),M.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,D,()=>{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,I)),M.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,T,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,I)),M.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,H,()=>{t(this,o).set("playing",!0),M.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,N,()=>{t(this,o).set("playing",!1),M.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,V,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,o).set("metadata",!0),M.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(a=>{a.textContent=ot(e.duration)}))});s(this,_,e==null?void 0:e.sourceSetOptions),rt.isBrowser&&window.IntersectionObserver&&s(this,O,new IntersectionObserver(t(this,G))),t(this,o).subscribe(a=>{var h;const l=(h=this.getAttribute("data-global-play-class"))==null?void 0:h.split(",");l!=null&&l.length&&(a.current.playing?l.forEach(m=>{document.documentElement.classList.add(m.trim())}):l.forEach(m=>{document.documentElement.classList.remove(m.trim())}))})}get consumerElement(){return t(this,r)}get consumerHolderElement(){return t(this,k)}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,z,j).call(this,t(this,f).current))}connectedCallback(){var l;s(this,P,`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,k,this.querySelector("[data-consumer-holder]")||this),(l=this.querySelector(".source-consumer"))==null||l.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,H)),t(this,r).addEventListener("pause",t(this,N)),t(this,r).addEventListener("loadedmetadata",t(this,V)),t(this,V).call(this),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const m=h.nodeValue||"",w=nt.kebabToCamel(h.name);w in t(this,r)&&(t(this,r)[w]=m||!0)}}),t(this,k).appendChild(t(this,r)),s(this,f,new st({srcset:e,sourceSetOptions:t(this,_)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(h=>{(!t(this,g)||t(this,g)&&t(this,L))&&F(this,z,j).call(this,h.current)}),t(this,f).connect(),t(this,O).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,T)),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("loadedmetadata",t(this,V)),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,k=new WeakMap,E=new WeakMap,L=new WeakMap,g=new WeakMap,P=new WeakMap,I=new WeakMap,o=new WeakMap,O=new WeakMap,T=new WeakMap,v=new WeakMap,_=new WeakMap,z=new WeakSet,j=function(e){if(clearTimeout(t(this,T)),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,I,`${t(this,P)}-${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,I)),t(this,r).onloadeddata=()=>{t(this,D).call(this)},t(this,r).onload=()=>{t(this,D).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,D=new WeakMap,K=new WeakMap,H=new WeakMap,N=new WeakMap,V=new WeakMap;exports.Source=et;exports.SourceElement=ut;exports.SourceManager=st;exports.SourceSet=Q;
|