@flemo/core 1.27.1 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/engine/__tests__/createSwipeController.releaseClock.test.d.ts +1 -0
- package/dist/core/engine/__tests__/createSwipeController.revealHold.test.d.ts +1 -0
- package/dist/core/engine/diagnosticFlags.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +755 -772
- package/dist/transition/__tests__/swipeSettle.test.d.ts +1 -0
- package/dist/transition/animateInline.d.ts +1 -0
- package/dist/transition/swipeSettle.d.ts +9 -0
- package/package.json +1 -1
- package/dist/transition/settleScrub.d.ts +0 -19
- /package/dist/{transition/__tests__/settleScrub.test.d.ts → core/engine/__tests__/createSwipeController.nestedRouter.test.d.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -579,7 +579,7 @@ var M = (e, t, n) => {
|
|
|
579
579
|
let { regexp: r } = i(e);
|
|
580
580
|
for (let e = t - 1; e >= 0; e--) if (r.test(n[e].pathname)) return t - e;
|
|
581
581
|
return -1;
|
|
582
|
-
},
|
|
582
|
+
}, N = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, P = async (e, t, n, r) => {
|
|
583
583
|
let i, a = new Promise((t) => {
|
|
584
584
|
i = e.subscribe(() => t(!0));
|
|
585
585
|
}), o = new Promise((e) => setTimeout(() => e(!1), 200));
|
|
@@ -587,7 +587,7 @@ var M = (e, t, n) => {
|
|
|
587
587
|
let s = await Promise.race([a, o]);
|
|
588
588
|
i(), s && r();
|
|
589
589
|
};
|
|
590
|
-
function
|
|
590
|
+
function F(e) {
|
|
591
591
|
let { stores: t, buildPathname: n, driver: r = g(), markSelfInduced: i = y } = e, o = () => t.history.getState().bumpTruncationEpoch(), c = () => {
|
|
592
592
|
let e = r.readState();
|
|
593
593
|
if (!e?.id) return null;
|
|
@@ -616,7 +616,7 @@ function ne(e) {
|
|
|
616
616
|
let e = M(u.until, d, f);
|
|
617
617
|
return e < 0 ? 0 : e;
|
|
618
618
|
}
|
|
619
|
-
return Math.min(
|
|
619
|
+
return Math.min(N(u?.skip, 0), Math.max(0, d));
|
|
620
620
|
})(), { setStatus: y, setTransitionTaskId: b } = t.navigate.getState();
|
|
621
621
|
y("PUSHING"), b(h);
|
|
622
622
|
let { pathname: x, toPathname: S } = n(e, l ?? {}), C = {
|
|
@@ -643,7 +643,7 @@ function ne(e) {
|
|
|
643
643
|
return g({
|
|
644
644
|
...C,
|
|
645
645
|
frameIndex: T + 1
|
|
646
|
-
}), await
|
|
646
|
+
}), await P(r, i, v, () => {
|
|
647
647
|
o(), r.pushState({
|
|
648
648
|
id: h,
|
|
649
649
|
index: T + 1,
|
|
@@ -676,7 +676,7 @@ function ne(e) {
|
|
|
676
676
|
let e = M(u.until, d, f);
|
|
677
677
|
return e < 0 ? 0 : e + 1;
|
|
678
678
|
}
|
|
679
|
-
return Math.min(
|
|
679
|
+
return Math.min(N(u?.skip, 0) + 1, d + 1);
|
|
680
680
|
})();
|
|
681
681
|
if (y <= 0) {
|
|
682
682
|
a.abort();
|
|
@@ -708,7 +708,7 @@ function ne(e) {
|
|
|
708
708
|
return v(y - 1), g({
|
|
709
709
|
...w,
|
|
710
710
|
frameIndex: E
|
|
711
|
-
}), y <= d ? await
|
|
711
|
+
}), y <= d ? await P(r, i, y, () => {
|
|
712
712
|
o(), r.pushState({
|
|
713
713
|
id: h,
|
|
714
714
|
index: E,
|
|
@@ -717,7 +717,7 @@ function ne(e) {
|
|
|
717
717
|
transitionName: p,
|
|
718
718
|
layoutId: m
|
|
719
719
|
}, S);
|
|
720
|
-
}) : await
|
|
720
|
+
}) : await P(r, i, d, () => {
|
|
721
721
|
o(), r.replaceState({
|
|
722
722
|
id: h,
|
|
723
723
|
index: E,
|
|
@@ -776,7 +776,7 @@ function ne(e) {
|
|
|
776
776
|
let r = M(e.until, t, n);
|
|
777
777
|
return r < 0 ? 0 : r;
|
|
778
778
|
}
|
|
779
|
-
let r =
|
|
779
|
+
let r = N(e?.skip, 1);
|
|
780
780
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
781
781
|
}, e?.transitionName);
|
|
782
782
|
}
|
|
@@ -784,14 +784,14 @@ function ne(e) {
|
|
|
784
784
|
}
|
|
785
785
|
//#endregion
|
|
786
786
|
//#region src/navigate/createStepController.ts
|
|
787
|
-
var
|
|
787
|
+
var te = (e) => {
|
|
788
788
|
let t = e;
|
|
789
789
|
return t?.step ? t.params ?? {} : null;
|
|
790
|
-
},
|
|
790
|
+
}, ne = (e, t) => {
|
|
791
791
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
792
792
|
return n ? `${e}?${n}` : e;
|
|
793
793
|
};
|
|
794
|
-
function
|
|
794
|
+
function re(e) {
|
|
795
795
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
796
796
|
return {
|
|
797
797
|
pushStep: async (e) => {
|
|
@@ -849,7 +849,7 @@ function ae(e) {
|
|
|
849
849
|
}
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function ie(e, t) {
|
|
853
853
|
return e.subscribe((e) => {
|
|
854
854
|
let n = e.state;
|
|
855
855
|
n?.step && s.addTask(async () => {
|
|
@@ -859,7 +859,7 @@ function oe(e, t) {
|
|
|
859
859
|
}
|
|
860
860
|
//#endregion
|
|
861
861
|
//#region src/transition/store.ts
|
|
862
|
-
function
|
|
862
|
+
function I(t = "cupertino") {
|
|
863
863
|
return e((e) => ({
|
|
864
864
|
defaultTransitionName: t,
|
|
865
865
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -867,18 +867,18 @@ function se(t = "cupertino") {
|
|
|
867
867
|
}
|
|
868
868
|
//#endregion
|
|
869
869
|
//#region src/utils/matchesPathname.ts
|
|
870
|
-
function
|
|
870
|
+
function ae(e, t) {
|
|
871
871
|
return i(e).regexp.test(t);
|
|
872
872
|
}
|
|
873
873
|
//#endregion
|
|
874
874
|
//#region src/screen/store.ts
|
|
875
|
-
var
|
|
875
|
+
var oe = (e, t) => {
|
|
876
876
|
if (e) return e.height !== void 0 || e.id !== t?.id ? e : {
|
|
877
877
|
...e,
|
|
878
878
|
height: t?.height
|
|
879
879
|
};
|
|
880
880
|
};
|
|
881
|
-
function
|
|
881
|
+
function se() {
|
|
882
882
|
return e((e) => ({
|
|
883
883
|
dragStatus: "IDLE",
|
|
884
884
|
replaceTransitionStatus: "IDLE",
|
|
@@ -892,8 +892,8 @@ function ue() {
|
|
|
892
892
|
topBar: n.topBar ? {} : void 0,
|
|
893
893
|
bottomBar: n.bottomBar ? {} : void 0
|
|
894
894
|
}, a = e.sharedBars[t], o = e.sharedBarMetadata[t], s = {
|
|
895
|
-
topBar:
|
|
896
|
-
bottomBar:
|
|
895
|
+
topBar: oe(i.topBar, o?.topBar),
|
|
896
|
+
bottomBar: oe(i.bottomBar, o?.bottomBar)
|
|
897
897
|
}, c = a?.topBar === n.topBar && a?.bottomBar === n.bottomBar, l = o?.topBar?.id === s.topBar?.id && o?.topBar?.height === s.topBar?.height && o?.bottomBar?.id === s.bottomBar?.id && o?.bottomBar?.height === s.bottomBar?.height && !!o?.topBar == !!s.topBar && !!o?.bottomBar == !!s.bottomBar;
|
|
898
898
|
return c && l ? e : {
|
|
899
899
|
sharedBars: {
|
|
@@ -942,14 +942,14 @@ function ue() {
|
|
|
942
942
|
}
|
|
943
943
|
//#endregion
|
|
944
944
|
//#region src/core/createRouterScope.ts
|
|
945
|
-
var
|
|
945
|
+
var ce = {
|
|
946
946
|
mark: () => {},
|
|
947
947
|
consume: () => !1
|
|
948
|
-
},
|
|
949
|
-
function
|
|
948
|
+
}, le = /* @__PURE__ */ new Map();
|
|
949
|
+
function ue(e) {
|
|
950
950
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, s = f() ? void 0 : e.persistKey;
|
|
951
951
|
if (s) {
|
|
952
|
-
let e =
|
|
952
|
+
let e = le.get(s);
|
|
953
953
|
if (e) {
|
|
954
954
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
955
955
|
let t = e.history.getState();
|
|
@@ -979,25 +979,25 @@ function pe(e) {
|
|
|
979
979
|
layoutId: p.layoutId
|
|
980
980
|
},
|
|
981
981
|
url: p.pathname
|
|
982
|
-
}) : o, h = a ?
|
|
982
|
+
}) : o, h = a ? ce : _(), g = {
|
|
983
983
|
history: c([p], 0),
|
|
984
984
|
navigate: ee(),
|
|
985
|
-
transition:
|
|
986
|
-
screen:
|
|
985
|
+
transition: I(i),
|
|
986
|
+
screen: se(),
|
|
987
987
|
driver: m,
|
|
988
988
|
markSelfInduced: h.mark,
|
|
989
989
|
consume: h.consume,
|
|
990
990
|
routerKey: e.routerKey,
|
|
991
991
|
zoneEntryId: e.zoneEntryId,
|
|
992
|
-
ownsPathname: (e) =>
|
|
992
|
+
ownsPathname: (e) => ae(t, e),
|
|
993
993
|
persistent: !!s,
|
|
994
994
|
life: { alive: !0 }
|
|
995
995
|
};
|
|
996
|
-
return s &&
|
|
996
|
+
return s && le.set(s, g), g;
|
|
997
997
|
}
|
|
998
998
|
//#endregion
|
|
999
999
|
//#region src/screen/createScreenSelector.ts
|
|
1000
|
-
function
|
|
1000
|
+
function de(e, t) {
|
|
1001
1001
|
return e.map((n, r) => ({
|
|
1002
1002
|
...n,
|
|
1003
1003
|
isActive: r === t,
|
|
@@ -1010,174 +1010,170 @@ function me(e, t) {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
//#endregion
|
|
1012
1012
|
//#region src/core/engine/driverPolicy.ts
|
|
1013
|
-
var
|
|
1013
|
+
var fe = "flemo:motion-driver-force", pe = !1, me = () => {
|
|
1014
1014
|
try {
|
|
1015
1015
|
try {
|
|
1016
|
-
typeof localStorage < "u" && localStorage.removeItem(
|
|
1016
|
+
typeof localStorage < "u" && localStorage.removeItem(fe);
|
|
1017
1017
|
} catch {}
|
|
1018
1018
|
if (typeof sessionStorage > "u") return null;
|
|
1019
|
-
let e = sessionStorage.getItem(
|
|
1019
|
+
let e = sessionStorage.getItem(fe);
|
|
1020
1020
|
if (e === null) return null;
|
|
1021
1021
|
let [t, n] = e.split("@"), r = Number(n);
|
|
1022
|
-
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!
|
|
1022
|
+
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!pe && typeof console < "u" && (pe = !0, console.warn(`[flemo] motion driver pinned to "${t}" via sessionStorage ${fe}; remove the key to restore automatic selection (pins expire after 24h).`)), t) : (sessionStorage.removeItem(fe), null);
|
|
1023
1023
|
} catch {
|
|
1024
1024
|
return null;
|
|
1025
1025
|
}
|
|
1026
|
-
},
|
|
1026
|
+
}, L = () => {
|
|
1027
1027
|
if (typeof navigator > "u") return !1;
|
|
1028
1028
|
let e = navigator.userAgentData?.brands;
|
|
1029
1029
|
if (Array.isArray(e)) return e.some((e) => /chromium/i.test(e?.brand ?? ""));
|
|
1030
1030
|
let t = navigator.userAgent ?? "";
|
|
1031
1031
|
return /Android/i.test(t) && !/Firefox|FxiOS/i.test(t);
|
|
1032
|
-
},
|
|
1032
|
+
}, he = () => {
|
|
1033
1033
|
if (typeof navigator > "u") return !1;
|
|
1034
1034
|
let e = navigator.userAgentData?.brands;
|
|
1035
1035
|
if (Array.isArray(e)) return !1;
|
|
1036
1036
|
let t = navigator.userAgent ?? "";
|
|
1037
1037
|
return /Android/i.test(t) && !/Firefox|FxiOS/i.test(t) && (navigator.maxTouchPoints ?? 0) > 0;
|
|
1038
|
-
},
|
|
1038
|
+
}, ge = () => typeof navigator > "u" ? !1 : !L() && navigator.maxTouchPoints === 0 && /Mac/.test(navigator.platform), _e = () => L() && typeof navigator < "u" && navigator.maxTouchPoints === 0, ve = ((e = !1) => ({
|
|
1039
1039
|
playerAllowed: () => {
|
|
1040
|
-
let t =
|
|
1040
|
+
let t = me();
|
|
1041
1041
|
return t ? t === "raf" : e;
|
|
1042
1042
|
},
|
|
1043
|
-
pinnedDriver:
|
|
1044
|
-
}))(!0),
|
|
1043
|
+
pinnedDriver: me
|
|
1044
|
+
}))(!0), ye = 28, be = 42, xe = 8, Se = 20, Ce = 6, we = 400, Te = 8, Ee = "flemo:lpm", De = () => !L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && typeof requestAnimationFrame == "function", Oe = () => {
|
|
1045
1045
|
try {
|
|
1046
|
-
return typeof sessionStorage < "u" && sessionStorage.getItem(
|
|
1046
|
+
return typeof sessionStorage < "u" && sessionStorage.getItem(Ee) === "1";
|
|
1047
1047
|
} catch {
|
|
1048
1048
|
return !1;
|
|
1049
1049
|
}
|
|
1050
|
-
},
|
|
1050
|
+
}, ke = (e) => {
|
|
1051
1051
|
try {
|
|
1052
|
-
typeof sessionStorage < "u" && sessionStorage.setItem(
|
|
1052
|
+
typeof sessionStorage < "u" && sessionStorage.setItem(Ee, e ? "1" : "0");
|
|
1053
1053
|
} catch {}
|
|
1054
|
-
},
|
|
1055
|
-
if (
|
|
1056
|
-
|
|
1054
|
+
}, Ae = !1, je = !1, Me = !1, Ne = 12, Pe = 8, Fe = [], Ie = null, Le = !1, Re = !1, ze = !1, Be = () => {
|
|
1055
|
+
if (Le || !De()) return;
|
|
1056
|
+
Le = !0;
|
|
1057
1057
|
let e = (t) => {
|
|
1058
|
-
if (
|
|
1059
|
-
let e = [...
|
|
1060
|
-
t[t.length - 1] - t[0] <=
|
|
1058
|
+
if (Ie !== null && (Fe.push(t - Ie), Fe.length > Ne && Fe.shift(), Fe.length >= Pe)) {
|
|
1059
|
+
let e = [...Fe].sort((e, t) => e - t), t = e.slice(1, e.length - 1), n = t[t.length >> 1];
|
|
1060
|
+
t[t.length - 1] - t[0] <= xe && (Re = n >= ye && n <= be, ze = !0);
|
|
1061
1061
|
}
|
|
1062
|
-
|
|
1062
|
+
Ie = t, requestAnimationFrame(e);
|
|
1063
1063
|
};
|
|
1064
1064
|
requestAnimationFrame(e);
|
|
1065
|
-
},
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1065
|
+
}, Ve = () => Ae || ze && Re, He = () => De(), Ue = (e = 0) => {
|
|
1066
|
+
if (je || !De()) return;
|
|
1067
|
+
je = !0;
|
|
1068
1068
|
let t = [], n = null, r = (i) => {
|
|
1069
|
-
if (n !== null && t.push(i - n), n = i, t.length <
|
|
1069
|
+
if (n !== null && t.push(i - n), n = i, t.length < Ce) {
|
|
1070
1070
|
requestAnimationFrame(r);
|
|
1071
1071
|
return;
|
|
1072
1072
|
}
|
|
1073
|
-
|
|
1074
|
-
let a = [...t].sort((e, t) => e - t), o = a.slice(0, a.length - 1), s = o[0] >=
|
|
1073
|
+
je = !1;
|
|
1074
|
+
let a = [...t].sort((e, t) => e - t), o = a.slice(0, a.length - 1), s = o[0] >= ye && o[o.length - 1] <= be && o[o.length - 1] - o[0] <= xe, c = o[o.length - 1] <= Se;
|
|
1075
1075
|
if (s || c) {
|
|
1076
|
-
|
|
1076
|
+
Ae = s, s && o[Math.floor(o.length / 2)], ke(Ae);
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
/* v8 ignore next 3 -- setTimeout exists in every runtime under test. */
|
|
1080
|
-
e + 1 <
|
|
1080
|
+
e + 1 < Te && typeof setTimeout == "function" && setTimeout(() => Ue(e + 1), we);
|
|
1081
1081
|
};
|
|
1082
1082
|
requestAnimationFrame(r);
|
|
1083
|
-
},
|
|
1084
|
-
|
|
1085
|
-
document.visibilityState === "visible" &&
|
|
1083
|
+
}, We = () => {
|
|
1084
|
+
Be(), Ue(), !(Me || typeof document > "u" || typeof document.addEventListener != "function") && (Me = !0, document.addEventListener("visibilitychange", () => {
|
|
1085
|
+
document.visibilityState === "visible" && Ue();
|
|
1086
1086
|
}));
|
|
1087
1087
|
};
|
|
1088
|
-
|
|
1089
|
-
var
|
|
1088
|
+
De() && (Ae = Oe(), Be(), Ue());
|
|
1089
|
+
var Ge = 14, Ke = 22, qe = 2, Je = 1.5, Ye = "flemo:sixty", Xe = () => {
|
|
1090
1090
|
try {
|
|
1091
|
-
return typeof sessionStorage < "u" ? sessionStorage.getItem(
|
|
1091
|
+
return typeof sessionStorage < "u" ? sessionStorage.getItem(Ye) : null;
|
|
1092
1092
|
} catch {
|
|
1093
1093
|
return null;
|
|
1094
1094
|
}
|
|
1095
|
-
},
|
|
1095
|
+
}, Ze = (e) => {
|
|
1096
1096
|
try {
|
|
1097
|
-
typeof sessionStorage < "u" && sessionStorage.setItem(
|
|
1097
|
+
typeof sessionStorage < "u" && sessionStorage.setItem(Ye, e);
|
|
1098
1098
|
} catch {}
|
|
1099
|
-
},
|
|
1100
|
-
if (!(!Number.isFinite(e) || e <= 0) &&
|
|
1099
|
+
}, Qe = Xe(), $e = Qe === "high", et = Qe !== null && Qe !== "high" ? Math.min(qe, Math.max(0, parseInt(Qe, 10) || 0)) : 0, tt = () => typeof navigator > "u" || (navigator.maxTouchPoints ?? 0) === 0, nt = (e, t) => {
|
|
1100
|
+
if (!(!Number.isFinite(e) || e <= 0) && tt()) {
|
|
1101
1101
|
if (e < 12) {
|
|
1102
1102
|
if (t !== void 0 && t > 24) return;
|
|
1103
|
-
|
|
1103
|
+
$e = !0, et = 0, Ze("high");
|
|
1104
1104
|
return;
|
|
1105
1105
|
}
|
|
1106
|
-
if (e >=
|
|
1107
|
-
|
|
1106
|
+
if (e >= Ge && e <= Ke) {
|
|
1107
|
+
et = Math.min(qe, et + 1), $e || Ze(String(et));
|
|
1108
1108
|
return;
|
|
1109
1109
|
}
|
|
1110
|
-
e <
|
|
1110
|
+
e < Ge && (et = 0, $e || Ze("0"));
|
|
1111
1111
|
}
|
|
1112
|
-
},
|
|
1112
|
+
}, rt = () => !$e && et >= qe, it = () => rt() && L() && typeof navigator < "u" && navigator.maxTouchPoints === 0 && typeof window < "u" && (window.devicePixelRatio || 1) >= Je, R = (e) => {
|
|
1113
1113
|
try {
|
|
1114
1114
|
return typeof sessionStorage < "u" ? sessionStorage.getItem(e) : null;
|
|
1115
1115
|
} catch {
|
|
1116
1116
|
return null;
|
|
1117
1117
|
}
|
|
1118
|
-
},
|
|
1119
|
-
let e =
|
|
1118
|
+
}, at = () => R("flemo:landing-snap") === "on", ot = () => {
|
|
1119
|
+
let e = R("flemo:imghold");
|
|
1120
1120
|
return e === "on" || e === "off" ? e : null;
|
|
1121
|
-
},
|
|
1121
|
+
}, st = () => L() && (navigator.maxTouchPoints ?? 0) > 0, ct = () => {
|
|
1122
1122
|
try {
|
|
1123
1123
|
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:settle-gate") : null;
|
|
1124
|
-
return e === "on" ? !0 : e === "off" ? !1 :
|
|
1124
|
+
return e === "on" ? !0 : e === "off" ? !1 : He() || it() || st() || ge();
|
|
1125
1125
|
} catch {
|
|
1126
1126
|
return !1;
|
|
1127
1127
|
}
|
|
1128
|
-
},
|
|
1129
|
-
let e =
|
|
1130
|
-
return e === "on" || e !== "off" &&
|
|
1128
|
+
}, lt = () => R("flemo:handoff") === "on", ut = () => R("flemo:arrivalhold") !== "off", dt = () => {
|
|
1129
|
+
let e = R("flemo:deskflip");
|
|
1130
|
+
return e === "on" || e !== "off" && ge();
|
|
1131
|
+
}, ft = () => {
|
|
1132
|
+
let e = R("flemo:creep");
|
|
1133
|
+
return e === "on" || e !== "off" && He();
|
|
1131
1134
|
}, pt = () => {
|
|
1132
|
-
let e =
|
|
1133
|
-
return e === "
|
|
1135
|
+
let e = R("flemo:relcommit");
|
|
1136
|
+
return e === "defer" || e !== "sync" && He();
|
|
1134
1137
|
}, mt = () => {
|
|
1135
|
-
let e =
|
|
1136
|
-
return e === "
|
|
1137
|
-
}, ht = () => {
|
|
1138
|
-
let e =
|
|
1139
|
-
return e === "on" || e !== "off" && ve();
|
|
1140
|
-
}, gt = () => L("flemo:preraster") === "on", _t = () => gt() || ye() || ve() || Ue(), vt = () => {
|
|
1141
|
-
let e = L("flemo:imgoffload");
|
|
1138
|
+
let e = R("flemo:deskhead");
|
|
1139
|
+
return e === "on" || e !== "off" && ge();
|
|
1140
|
+
}, ht = () => R("flemo:preraster") === "on", gt = () => ht(), _t = () => {
|
|
1141
|
+
let e = R("flemo:imgoffload");
|
|
1142
1142
|
return e === "on" || e === "off" ? e : null;
|
|
1143
|
-
},
|
|
1144
|
-
if (
|
|
1145
|
-
let e =
|
|
1146
|
-
return
|
|
1147
|
-
},
|
|
1148
|
-
if (
|
|
1149
|
-
let e =
|
|
1150
|
-
return
|
|
1151
|
-
},
|
|
1152
|
-
if (
|
|
1153
|
-
let e =
|
|
1154
|
-
return
|
|
1155
|
-
},
|
|
1156
|
-
if (
|
|
1157
|
-
let e =
|
|
1158
|
-
return
|
|
1159
|
-
},
|
|
1160
|
-
if (
|
|
1161
|
-
let e =
|
|
1162
|
-
return
|
|
1163
|
-
}, kt, At = () =>
|
|
1164
|
-
if (kt !== void 0) return kt;
|
|
1165
|
-
let e = L("flemo:layers");
|
|
1166
|
-
return kt = e === "resident" || e !== "off" && Ue(), kt;
|
|
1167
|
-
}, jt, Mt = () => (jt === void 0 && (jt = L("flemo:freeze") === "shallow"), jt);
|
|
1143
|
+
}, vt, yt = () => {
|
|
1144
|
+
if (vt !== void 0) return vt;
|
|
1145
|
+
let e = R("flemo:apply");
|
|
1146
|
+
return vt = e === "scrub" ? e : null, vt;
|
|
1147
|
+
}, bt, xt = () => {
|
|
1148
|
+
if (bt !== void 0) return bt;
|
|
1149
|
+
let e = R("flemo:handoff");
|
|
1150
|
+
return bt = e === "on" ? e : null, bt;
|
|
1151
|
+
}, St, Ct = () => {
|
|
1152
|
+
if (St !== void 0) return St;
|
|
1153
|
+
let e = R("flemo:snap");
|
|
1154
|
+
return St = e === "always" || e === "off" || e === "gate" || e === "hybrid" ? e : null, St;
|
|
1155
|
+
}, wt, Tt = () => {
|
|
1156
|
+
if (wt !== void 0) return wt;
|
|
1157
|
+
let e = R("flemo:snapband"), t = e === null ? NaN : Number(e);
|
|
1158
|
+
return wt = Number.isFinite(t) && t > 0 ? t : 4, wt;
|
|
1159
|
+
}, Et, Dt = () => {
|
|
1160
|
+
if (Et !== void 0) return Et;
|
|
1161
|
+
let e = R("flemo:handoffms"), t = e === null ? NaN : Number(e);
|
|
1162
|
+
return Et = Number.isFinite(t) && t >= 0 ? t : 100, Et;
|
|
1163
|
+
}, Ot, kt = () => (Ot === void 0 && (Ot = R("flemo:layers") === "resident"), Ot), At, jt = () => (At === void 0 && (At = R("flemo:freeze") === "shallow"), At);
|
|
1168
1164
|
//#endregion
|
|
1169
1165
|
//#region src/screen/computeScreenFreeze.ts
|
|
1170
|
-
function
|
|
1166
|
+
function Mt(e) {
|
|
1171
1167
|
if (e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex) return "immediate";
|
|
1172
1168
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
1173
|
-
return !e.isActive && t ?
|
|
1169
|
+
return !e.isActive && t ? jt() ? "live" : "deferred" : "live";
|
|
1174
1170
|
}
|
|
1175
|
-
function
|
|
1176
|
-
return
|
|
1171
|
+
function Nt(e) {
|
|
1172
|
+
return Mt(e) !== "live";
|
|
1177
1173
|
}
|
|
1178
1174
|
//#endregion
|
|
1179
1175
|
//#region src/transition/createTransition.ts
|
|
1180
|
-
function
|
|
1176
|
+
function Pt({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
1181
1177
|
return {
|
|
1182
1178
|
name: e,
|
|
1183
1179
|
initial: t,
|
|
@@ -1198,7 +1194,7 @@ function Ft({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exi
|
|
|
1198
1194
|
}
|
|
1199
1195
|
//#endregion
|
|
1200
1196
|
//#region src/transition/createRawTransition.ts
|
|
1201
|
-
function
|
|
1197
|
+
function Ft({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
1202
1198
|
return {
|
|
1203
1199
|
name: e,
|
|
1204
1200
|
initial: t,
|
|
@@ -1219,15 +1215,15 @@ function It({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1219
1215
|
}
|
|
1220
1216
|
//#endregion
|
|
1221
1217
|
//#region src/transition/cupertino.ts
|
|
1222
|
-
var
|
|
1218
|
+
var It = (e, t, n) => {
|
|
1223
1219
|
let [r, i] = t, [a, o] = n;
|
|
1224
1220
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1225
|
-
},
|
|
1221
|
+
}, Lt = 30, Rt = .7, zt = [
|
|
1226
1222
|
.32,
|
|
1227
1223
|
.72,
|
|
1228
1224
|
0,
|
|
1229
1225
|
1
|
|
1230
|
-
],
|
|
1226
|
+
], Bt = Pt({
|
|
1231
1227
|
name: "cupertino",
|
|
1232
1228
|
initial: { x: "100%" },
|
|
1233
1229
|
idle: {
|
|
@@ -1237,29 +1233,29 @@ var Lt = (e, t, n) => {
|
|
|
1237
1233
|
enter: {
|
|
1238
1234
|
value: { x: 0 },
|
|
1239
1235
|
options: {
|
|
1240
|
-
duration:
|
|
1241
|
-
ease:
|
|
1236
|
+
duration: Rt,
|
|
1237
|
+
ease: zt
|
|
1242
1238
|
}
|
|
1243
1239
|
},
|
|
1244
1240
|
enterBack: {
|
|
1245
1241
|
value: { x: "100%" },
|
|
1246
1242
|
options: {
|
|
1247
|
-
duration:
|
|
1248
|
-
ease:
|
|
1243
|
+
duration: Rt,
|
|
1244
|
+
ease: zt
|
|
1249
1245
|
}
|
|
1250
1246
|
},
|
|
1251
1247
|
exit: {
|
|
1252
|
-
value: { x: `-${
|
|
1248
|
+
value: { x: `-${Lt}%` },
|
|
1253
1249
|
options: {
|
|
1254
|
-
duration:
|
|
1255
|
-
ease:
|
|
1250
|
+
duration: Rt,
|
|
1251
|
+
ease: zt
|
|
1256
1252
|
}
|
|
1257
1253
|
},
|
|
1258
1254
|
exitBack: {
|
|
1259
1255
|
value: { x: 0 },
|
|
1260
1256
|
options: {
|
|
1261
|
-
duration:
|
|
1262
|
-
ease:
|
|
1257
|
+
duration: Rt,
|
|
1258
|
+
ease: zt
|
|
1263
1259
|
}
|
|
1264
1260
|
},
|
|
1265
1261
|
options: {
|
|
@@ -1267,24 +1263,24 @@ var Lt = (e, t, n) => {
|
|
|
1267
1263
|
swipeDirection: "x",
|
|
1268
1264
|
onSwipeStart: async () => !0,
|
|
1269
1265
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1270
|
-
let { offset: o } = t, s = o.x, c =
|
|
1271
|
-
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 +
|
|
1266
|
+
let { offset: o } = t, s = o.x, c = It(s, [0, window.innerWidth], [0, 100]);
|
|
1267
|
+
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + Lt / 100 * c}%` }, { duration: 0 }), c;
|
|
1272
1268
|
},
|
|
1273
1269
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
1274
1270
|
let { offset: o, velocity: s } = t, c = o.x > 50 || s.x > 20;
|
|
1275
1271
|
return a?.(c), await Promise.all([n(r, { x: c ? "100%" : 0 }, {
|
|
1276
|
-
duration:
|
|
1277
|
-
ease:
|
|
1278
|
-
}), n(i, { x: c ? 0 : `-${
|
|
1279
|
-
duration:
|
|
1280
|
-
ease:
|
|
1272
|
+
duration: Rt,
|
|
1273
|
+
ease: zt
|
|
1274
|
+
}), n(i, { x: c ? 0 : `-${Lt}%` }, {
|
|
1275
|
+
duration: Rt,
|
|
1276
|
+
ease: zt
|
|
1281
1277
|
})]), c;
|
|
1282
1278
|
}
|
|
1283
1279
|
}
|
|
1284
|
-
}),
|
|
1280
|
+
}), Vt = (e, t, n) => {
|
|
1285
1281
|
let [r, i] = t, [a, o] = n;
|
|
1286
1282
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1287
|
-
},
|
|
1283
|
+
}, Ht = Pt({
|
|
1288
1284
|
name: "layout",
|
|
1289
1285
|
initial: { opacity: .97 },
|
|
1290
1286
|
idle: {
|
|
@@ -1312,7 +1308,7 @@ var Lt = (e, t, n) => {
|
|
|
1312
1308
|
swipeDirection: "y",
|
|
1313
1309
|
onSwipeStart: async () => !0,
|
|
1314
1310
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1315
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1311
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = Vt(s, [0, 56], [1, .96]), l = Math.max(0, o - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, s + d), p = Math.min(56, f);
|
|
1316
1312
|
return i?.(!0, 100), n(r, {
|
|
1317
1313
|
y: f,
|
|
1318
1314
|
opacity: c
|
|
@@ -1329,7 +1325,7 @@ var Lt = (e, t, n) => {
|
|
|
1329
1325
|
}, { duration: .3 })]), c;
|
|
1330
1326
|
}
|
|
1331
1327
|
}
|
|
1332
|
-
}),
|
|
1328
|
+
}), Ut = Pt({
|
|
1333
1329
|
name: "material",
|
|
1334
1330
|
initial: { y: "100%" },
|
|
1335
1331
|
idle: {
|
|
@@ -1437,7 +1433,7 @@ var Lt = (e, t, n) => {
|
|
|
1437
1433
|
})]), c;
|
|
1438
1434
|
}
|
|
1439
1435
|
}
|
|
1440
|
-
}),
|
|
1436
|
+
}), Wt = Pt({
|
|
1441
1437
|
name: "none",
|
|
1442
1438
|
initial: {},
|
|
1443
1439
|
idle: {
|
|
@@ -1460,20 +1456,20 @@ var Lt = (e, t, n) => {
|
|
|
1460
1456
|
value: {},
|
|
1461
1457
|
options: { duration: 0 }
|
|
1462
1458
|
}
|
|
1463
|
-
}),
|
|
1464
|
-
["none",
|
|
1465
|
-
["cupertino",
|
|
1466
|
-
["material",
|
|
1467
|
-
["layout",
|
|
1459
|
+
}), Gt = /* @__PURE__ */ new Map([
|
|
1460
|
+
["none", Wt],
|
|
1461
|
+
["cupertino", Bt],
|
|
1462
|
+
["material", Ut],
|
|
1463
|
+
["layout", Ht]
|
|
1468
1464
|
]);
|
|
1469
1465
|
//#endregion
|
|
1470
1466
|
//#region src/transition/resolveTransition.ts
|
|
1471
|
-
function
|
|
1472
|
-
return
|
|
1467
|
+
function Kt(e) {
|
|
1468
|
+
return Gt.get(e) ?? Gt.get("none");
|
|
1473
1469
|
}
|
|
1474
1470
|
//#endregion
|
|
1475
1471
|
//#region src/transition/decorator/createDecorator.ts
|
|
1476
|
-
function
|
|
1472
|
+
function qt({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1477
1473
|
return {
|
|
1478
1474
|
name: e,
|
|
1479
1475
|
initial: t,
|
|
@@ -1494,7 +1490,7 @@ function Jt({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1494
1490
|
}
|
|
1495
1491
|
//#endregion
|
|
1496
1492
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1497
|
-
function
|
|
1493
|
+
function Jt({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1498
1494
|
return {
|
|
1499
1495
|
name: e,
|
|
1500
1496
|
initial: t,
|
|
@@ -1515,30 +1511,30 @@ function Yt({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1515
1511
|
}
|
|
1516
1512
|
//#endregion
|
|
1517
1513
|
//#region src/transition/decorator/overlay.ts
|
|
1518
|
-
var
|
|
1514
|
+
var Yt = "rgba(0, 0, 0, 0.1)", Xt = qt({
|
|
1519
1515
|
name: "overlay",
|
|
1520
1516
|
initial: {
|
|
1521
1517
|
opacity: 0,
|
|
1522
|
-
backgroundColor:
|
|
1518
|
+
backgroundColor: Yt
|
|
1523
1519
|
},
|
|
1524
1520
|
idle: {
|
|
1525
1521
|
value: {
|
|
1526
1522
|
opacity: 0,
|
|
1527
|
-
backgroundColor:
|
|
1523
|
+
backgroundColor: Yt
|
|
1528
1524
|
},
|
|
1529
1525
|
options: { duration: 0 }
|
|
1530
1526
|
},
|
|
1531
1527
|
enter: {
|
|
1532
1528
|
value: {
|
|
1533
1529
|
opacity: 1,
|
|
1534
|
-
backgroundColor:
|
|
1530
|
+
backgroundColor: Yt
|
|
1535
1531
|
},
|
|
1536
1532
|
options: { duration: .7 }
|
|
1537
1533
|
},
|
|
1538
1534
|
exit: {
|
|
1539
1535
|
value: {
|
|
1540
1536
|
opacity: 0,
|
|
1541
|
-
backgroundColor:
|
|
1537
|
+
backgroundColor: Yt
|
|
1542
1538
|
},
|
|
1543
1539
|
options: { duration: .7 }
|
|
1544
1540
|
},
|
|
@@ -1547,7 +1543,7 @@ var Xt = "rgba(0, 0, 0, 0.1)", Zt = Jt({
|
|
|
1547
1543
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1548
1544
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1549
1545
|
}
|
|
1550
|
-
}),
|
|
1546
|
+
}), Zt = /* @__PURE__ */ new Map([["overlay", Xt]]);
|
|
1551
1547
|
//#endregion
|
|
1552
1548
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1553
1549
|
function Qt({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
@@ -1665,7 +1661,7 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1665
1661
|
n = r.size > 1;
|
|
1666
1662
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1667
1663
|
return n && a.push("transform"), a;
|
|
1668
|
-
},
|
|
1664
|
+
}, xn = (e) => {
|
|
1669
1665
|
if (!ln(e)) return [];
|
|
1670
1666
|
let t = [], n = !0, r = [];
|
|
1671
1667
|
for (let i of Object.keys(e)) {
|
|
@@ -1679,7 +1675,7 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1679
1675
|
property: "transform",
|
|
1680
1676
|
value: n ? "none" : t.join(" ")
|
|
1681
1677
|
}), r;
|
|
1682
|
-
},
|
|
1678
|
+
}, V = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), Sn = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1683
1679
|
linear: "linear",
|
|
1684
1680
|
easeIn: "ease-in",
|
|
1685
1681
|
easeOut: "ease-out",
|
|
@@ -1689,33 +1685,33 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1689
1685
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1690
1686
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1691
1687
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1692
|
-
}[e] ?? "ease" : "ease",
|
|
1688
|
+
}[e] ?? "ease" : "ease", Cn = (e, t) => {
|
|
1693
1689
|
let [n, r] = t.split("-");
|
|
1694
1690
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1695
|
-
},
|
|
1691
|
+
}, wn = (e, t) => {
|
|
1696
1692
|
let [n, r] = t.split("-");
|
|
1697
1693
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1698
|
-
},
|
|
1694
|
+
}, Tn = (e, t) => {
|
|
1699
1695
|
let [n, r] = t.split("-");
|
|
1700
1696
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1701
|
-
},
|
|
1697
|
+
}, En = (e, t) => {
|
|
1702
1698
|
let [n, r] = t.split("-");
|
|
1703
1699
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1704
|
-
},
|
|
1700
|
+
}, Dn = (e, t, n) => `flemo-${e}-${cn(t)}-${n}`, On = [
|
|
1705
1701
|
"-lpm",
|
|
1706
1702
|
"-deskhead",
|
|
1707
1703
|
"-lpmcreep"
|
|
1708
|
-
],
|
|
1709
|
-
let o =
|
|
1704
|
+
], kn = (e, t) => e === t || On.some((n) => e === `${t}${n}`), An = (e, t, n, r, i, a) => {
|
|
1705
|
+
let o = xn(r), s = xn(i.value), c = new Set(o.filter((e) => s.some((t) => t.property === e.property && t.value === e.value)).map((e) => e.property)), l = o.filter((e) => c.has(e.property)), u = o.filter((e) => !c.has(e.property)), d = s.filter((e) => !c.has(e.property)), f = nn(i.options), p = rn(i.options), m = Sn(i.options?.ease), h = a(t, n), g = e === "screen" ? `${h},\n${Tn(t, n)}` : h;
|
|
1710
1706
|
if (s.length === 0 && o.length === 0) return "";
|
|
1711
|
-
if (f <= 0 && p <= 0) return s.length === 0 ? "" : `${g} {\n${
|
|
1712
|
-
let _ =
|
|
1707
|
+
if (f <= 0 && p <= 0) return s.length === 0 ? "" : `${g} {\n${V(s)}\n animation: none;\n}`;
|
|
1708
|
+
let _ = Dn(e, t, n), v = [
|
|
1713
1709
|
`@keyframes ${_} {`,
|
|
1714
1710
|
" from {",
|
|
1715
|
-
|
|
1711
|
+
V(u).replace(/^/gm, " "),
|
|
1716
1712
|
" }",
|
|
1717
1713
|
" to {",
|
|
1718
|
-
|
|
1714
|
+
V(d).replace(/^/gm, " "),
|
|
1719
1715
|
" }",
|
|
1720
1716
|
"}"
|
|
1721
1717
|
].join("\n"), y = [
|
|
@@ -1727,7 +1723,7 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1727
1723
|
].filter(Boolean).join(" "), b = (e) => e.startsWith("REPLACING") ? .18 : e.startsWith("PUSHING") ? .1 : e.startsWith("POPPING") ? .08 : 0, x = (e) => e.startsWith("REPLACING") || e.startsWith("PUSHING") ? .033 : e.startsWith("POPPING") ? .017 : 0, S = (t, n, r, i) => {
|
|
1728
1724
|
if (e === "part" || r <= 0 || f <= 0 || o.length === 0 && s.length === 0) return "";
|
|
1729
1725
|
let a = f + r, c = (r / a * 100).toFixed(3), l = `${_}-${n}`, m = g.split(",\n").map((e) => `:root[${t}] ${e}`).join(",\n");
|
|
1730
|
-
return `\n@keyframes ${l} {\n 0%, ${c}% {\n${
|
|
1726
|
+
return `\n@keyframes ${l} {\n 0%, ${c}% {\n${V(u).replace(/^/gm, " ")}\n }\n 100% {\n${V(d).replace(/^/gm, " ")}\n }\n}\n${m} {\n animation-name: ${l};\n animation-duration: ${a.toFixed(3)}s;\n animation-delay: ${(i ? p + r : p).toFixed(3)}s;\n}`;
|
|
1731
1727
|
}, C = (t, n) => e !== "part" || n <= 0 || f <= 0 ? "" : `\n${((e = "") => g.split(",\n").map((n) => `:root[${t}]${e} ${n}`).join(",\n"))()} {\n animation-delay: ${(p + n).toFixed(3)}s;\n}`, w = (() => {
|
|
1732
1728
|
/* v8 ignore next */
|
|
1733
1729
|
if (e === "part") return "";
|
|
@@ -1747,29 +1743,29 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1747
1743
|
value: `${t}${sn}`
|
|
1748
1744
|
} : e);
|
|
1749
1745
|
})(), i = f + t, a = (t / i * 100).toFixed(3), c = `${_}-lpmcreep`, l = g.split(",\n").map((e) => `:root[data-flemo-lpm][data-flemo-creep] ${e}`).join(",\n");
|
|
1750
|
-
return `\n@keyframes ${c} {\n 0% {\n${
|
|
1751
|
-
})(), T = S("data-flemo-lpm", "lpm", b(n), !0), E = C("data-flemo-lpm", b(n)), D = S("data-flemo-desk-head", "deskhead", x(n), !1), O = C("data-flemo-desk-head", x(n)), k = new Map(u.map((e) => [e.property, e.value])), A = new Map(d.map((e) => [e.property, e.value])), j = Array.from(/* @__PURE__ */ new Set([...k.keys(), ...A.keys()])).filter((e) => k.get(e) !== A.get(e)), ee = j.length > 0 ? ` will-change: ${j.join(", ")};\n` : "", M = n.split("-")[0],
|
|
1752
|
-
return `${v}\n${`${g} {\n animation: ${y};\n${l.length > 0 ? `${
|
|
1753
|
-
},
|
|
1746
|
+
return `\n@keyframes ${c} {\n 0% {\n${V(u).replace(/^/gm, " ")}\n }\n ${a}% {\n${V(r).replace(/^/gm, " ")}\n }\n 100% {\n${V(d).replace(/^/gm, " ")}\n }\n}\n${l} {\n animation-name: ${c};\n animation-duration: ${i.toFixed(3)}s;\n animation-delay: ${(p + t).toFixed(3)}s;\n}`;
|
|
1747
|
+
})(), T = S("data-flemo-lpm", "lpm", b(n), !0), E = C("data-flemo-lpm", b(n)), D = S("data-flemo-desk-head", "deskhead", x(n), !1), O = C("data-flemo-desk-head", x(n)), k = new Map(u.map((e) => [e.property, e.value])), A = new Map(d.map((e) => [e.property, e.value])), j = Array.from(/* @__PURE__ */ new Set([...k.keys(), ...A.keys()])).filter((e) => k.get(e) !== A.get(e)), ee = j.length > 0 ? ` will-change: ${j.join(", ")};\n` : "", M = n.split("-")[0], N = M === "PUSHING" || M === "REPLACING" ? " contain: layout;\n" : "";
|
|
1748
|
+
return `${v}\n${`${g} {\n animation: ${y};\n${l.length > 0 ? `${V(l)}\n` : ""}${ee}${N}}`}${T}${E}${w}${D}${O}${e === "screen" && n.endsWith("-false") && jn(r) && s.length > 0 ? `\n${h}[data-flemo-anim-hold="park"] {\n animation: none;\n${V(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && jn(r) && s.length > 0 ? `\n${h}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${V(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && jn(r) && s.length > 0 ? `\n${h}[data-flemo-anim-hold="park-over"] {\n animation: none;\n${V(s)}\n opacity: 0.02;\n}` : ""}`;
|
|
1749
|
+
}, jn = (e) => {
|
|
1754
1750
|
if (!e) return !1;
|
|
1755
1751
|
if (e.opacity === 0) return !0;
|
|
1756
1752
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1757
1753
|
return t(e.x) || t(e.y);
|
|
1758
|
-
},
|
|
1759
|
-
let i =
|
|
1760
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1761
|
-
},
|
|
1754
|
+
}, Mn = (e, t, n, r) => {
|
|
1755
|
+
let i = xn(r.value);
|
|
1756
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${V(i)}\n}`;
|
|
1757
|
+
}, Nn = (e, t, n = []) => {
|
|
1762
1758
|
let r = [];
|
|
1763
1759
|
for (let t of e) {
|
|
1764
1760
|
let e = t.name;
|
|
1765
1761
|
for (let n of tn) {
|
|
1766
1762
|
let i = t.variants[n], a = en[n];
|
|
1767
1763
|
if (a === "self") {
|
|
1768
|
-
r.push(
|
|
1764
|
+
r.push(Mn(Cn, e, n, i));
|
|
1769
1765
|
continue;
|
|
1770
1766
|
}
|
|
1771
1767
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1772
|
-
r.push(
|
|
1768
|
+
r.push(An("screen", e, n, o, i, Cn));
|
|
1773
1769
|
}
|
|
1774
1770
|
}
|
|
1775
1771
|
for (let e of t) {
|
|
@@ -1777,11 +1773,11 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1777
1773
|
for (let n of on) {
|
|
1778
1774
|
let i = e.variants[n], a = en[n];
|
|
1779
1775
|
if (a === "self") {
|
|
1780
|
-
r.push(
|
|
1776
|
+
r.push(Mn(wn, t, n, i));
|
|
1781
1777
|
continue;
|
|
1782
1778
|
}
|
|
1783
1779
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1784
|
-
r.push(
|
|
1780
|
+
r.push(An("decorator", t, n, o, i, wn));
|
|
1785
1781
|
}
|
|
1786
1782
|
}
|
|
1787
1783
|
for (let e of n) {
|
|
@@ -1789,19 +1785,19 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1789
1785
|
for (let n of on) {
|
|
1790
1786
|
let i = e.variants[n], a = en[n];
|
|
1791
1787
|
if (a === "self") {
|
|
1792
|
-
r.push(
|
|
1788
|
+
r.push(Mn(En, t, n, i));
|
|
1793
1789
|
continue;
|
|
1794
1790
|
}
|
|
1795
1791
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1796
|
-
r.push(
|
|
1792
|
+
r.push(An("part", t, n, o, i, En));
|
|
1797
1793
|
}
|
|
1798
1794
|
}
|
|
1799
1795
|
return [
|
|
1800
1796
|
...r.filter((e) => e.length > 0),
|
|
1801
|
-
|
|
1802
|
-
|
|
1797
|
+
Pn,
|
|
1798
|
+
Fn
|
|
1803
1799
|
].join("\n\n");
|
|
1804
|
-
},
|
|
1800
|
+
}, Pn = [
|
|
1805
1801
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1806
1802
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1807
1803
|
"[data-flemo-anim-hold=\"park-under\"],",
|
|
@@ -1812,145 +1808,73 @@ var z = /* @__PURE__ */ new Map(), en = {
|
|
|
1812
1808
|
"[data-flemo-anim-hold=\"park-over\"] [data-flemo-part-name] {",
|
|
1813
1809
|
" animation-play-state: paused !important;",
|
|
1814
1810
|
"}"
|
|
1815
|
-
].join("\n"),
|
|
1811
|
+
].join("\n"), Fn = [
|
|
1816
1812
|
"[data-flemo-held-arrival] {",
|
|
1817
1813
|
" display: none !important;",
|
|
1818
1814
|
"}"
|
|
1819
|
-
].join("\n"),
|
|
1815
|
+
].join("\n"), H = (e, t) => {
|
|
1820
1816
|
let n = en[t];
|
|
1821
1817
|
if (n === "self") return !1;
|
|
1822
1818
|
let r = e.variants[t], i = nn(r.options), a = rn(r.options);
|
|
1823
1819
|
if (i <= 0 && a <= 0) return !1;
|
|
1824
|
-
let o =
|
|
1820
|
+
let o = xn(n === "initial" ? e.initial : e.variants[n].value), s = xn(r.value);
|
|
1825
1821
|
return o.length > 0 || s.length > 0;
|
|
1826
|
-
},
|
|
1822
|
+
}, In = {
|
|
1827
1823
|
REPLACING: 33,
|
|
1828
1824
|
PUSHING: 33,
|
|
1829
1825
|
POPPING: 17
|
|
1830
|
-
},
|
|
1826
|
+
}, Ln = {
|
|
1831
1827
|
REPLACING: 180,
|
|
1832
1828
|
PUSHING: 100,
|
|
1833
1829
|
POPPING: 80
|
|
1834
|
-
},
|
|
1835
|
-
function
|
|
1830
|
+
}, Rn = "data-flemo";
|
|
1831
|
+
function zn() {
|
|
1836
1832
|
if (f()) return;
|
|
1837
|
-
let e =
|
|
1838
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1833
|
+
let e = Nn(Gt.values(), Zt.values(), z.values()), t = document.head.querySelector(`style[${Rn}]`);
|
|
1834
|
+
t || (t = document.createElement("style"), t.setAttribute(Rn, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1839
1835
|
}
|
|
1840
1836
|
//#endregion
|
|
1841
1837
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1842
|
-
var
|
|
1838
|
+
var Bn = /* @__PURE__ */ new Map(), Vn = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), Un = (e, t) => {
|
|
1843
1839
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1844
|
-
},
|
|
1840
|
+
}, Wn = (e, t) => {
|
|
1845
1841
|
let n = (e.get(t) ?? 1) - 1;
|
|
1846
1842
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1847
1843
|
};
|
|
1848
|
-
function
|
|
1849
|
-
for (let t of e)
|
|
1850
|
-
for (let e of t)
|
|
1851
|
-
for (let e of n) z.set(e.name, e), Hn
|
|
1852
|
-
return
|
|
1853
|
-
for (let t of e)
|
|
1854
|
-
for (let e of t)
|
|
1855
|
-
for (let e of n)
|
|
1856
|
-
|
|
1844
|
+
function Gn(e, t, n = []) {
|
|
1845
|
+
for (let t of e) Gt.set(t.name, t), Un(Bn, t.name);
|
|
1846
|
+
for (let e of t) Zt.set(e.name, e), Un(Vn, e.name);
|
|
1847
|
+
for (let e of n) z.set(e.name, e), Un(Hn, e.name);
|
|
1848
|
+
return zn(), () => {
|
|
1849
|
+
for (let t of e) Wn(Bn, t.name) && Gt.delete(t.name);
|
|
1850
|
+
for (let e of t) Wn(Vn, e.name) && Zt.delete(e.name);
|
|
1851
|
+
for (let e of n) Wn(Hn, e.name) && z.delete(e.name);
|
|
1852
|
+
zn();
|
|
1857
1853
|
};
|
|
1858
1854
|
}
|
|
1859
1855
|
//#endregion
|
|
1860
1856
|
//#region src/transition/enteringInitialStyle.ts
|
|
1861
|
-
function
|
|
1857
|
+
function Kn(e) {
|
|
1862
1858
|
let { initial: t, isActive: n, status: r } = e;
|
|
1863
1859
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1864
1860
|
let i = {};
|
|
1865
1861
|
return typeof t.x == "number" && (i.transform = `translate3d(${t.x}px, 0, 0)`), typeof t.x == "string" && (i.transform = `translate3d(${t.x}, 0, 0)`), typeof t.y == "number" && (i.transform = `translate3d(0, ${t.y}px, 0)`), typeof t.y == "string" && (i.transform = `translate3d(0, ${t.y}, 0)`), typeof t.opacity == "number" && (i.opacity = `${t.opacity}`), i;
|
|
1866
1862
|
}
|
|
1867
1863
|
//#endregion
|
|
1868
|
-
//#region src/transition/
|
|
1869
|
-
var
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
}), qn = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), Jn = ((e = Kn()) => {
|
|
1873
|
-
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1874
|
-
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1875
|
-
}, i = (e, n) => {
|
|
1876
|
-
let i = t.get(e);
|
|
1877
|
-
if (i) {
|
|
1878
|
-
if (t.delete(e), clearTimeout(i.backstop), e.isConnected && n !== "drop") if (n === "end") for (let e of i.decls) i.writeFinal(e);
|
|
1879
|
-
else {
|
|
1880
|
-
let t = getComputedStyle(e);
|
|
1881
|
-
for (let e of i.decls) {
|
|
1882
|
-
let n = t.getPropertyValue(e.property);
|
|
1883
|
-
n !== "" && i.writeFinal({
|
|
1884
|
-
property: e.property,
|
|
1885
|
-
value: n
|
|
1886
|
-
});
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
i.animation.cancel(), i.resolve(), r();
|
|
1890
|
-
}
|
|
1891
|
-
}, a = (r) => {
|
|
1892
|
-
n = null;
|
|
1893
|
-
for (let e of [...t.values()]) {
|
|
1894
|
-
e.startTime === null && (e.startTime = r);
|
|
1895
|
-
let t = r - e.startTime;
|
|
1896
|
-
t >= e.totalMs ? i(e.element, "end") : e.animation.currentTime = Math.max(0, t);
|
|
1897
|
-
}
|
|
1898
|
-
t.size > 0 && (n = e.request(a));
|
|
1899
|
-
};
|
|
1900
|
-
return {
|
|
1901
|
-
settle: (r, o, s, c, l) => {
|
|
1902
|
-
if (typeof r.animate != "function") return null;
|
|
1903
|
-
i(r, "current");
|
|
1904
|
-
let u = {};
|
|
1905
|
-
for (let e of o) u[qn(e.property)] = e.value;
|
|
1906
|
-
let d;
|
|
1907
|
-
try {
|
|
1908
|
-
d = r.animate([u], {
|
|
1909
|
-
duration: Math.max(0, s.durationMs),
|
|
1910
|
-
delay: Math.max(0, s.delayMs),
|
|
1911
|
-
easing: s.easing,
|
|
1912
|
-
fill: "forwards"
|
|
1913
|
-
}), d.pause(), d.currentTime = 0;
|
|
1914
|
-
} catch {
|
|
1915
|
-
return null;
|
|
1916
|
-
}
|
|
1917
|
-
let f = Math.max(0, s.durationMs) + Math.max(0, s.delayMs);
|
|
1918
|
-
return new Promise((s) => {
|
|
1919
|
-
let u = {
|
|
1920
|
-
element: r,
|
|
1921
|
-
animation: d,
|
|
1922
|
-
decls: o,
|
|
1923
|
-
totalMs: f,
|
|
1924
|
-
startTime: null,
|
|
1925
|
-
writeFinal: c,
|
|
1926
|
-
resolve: s,
|
|
1927
|
-
backstop: setTimeout(() => i(r, "end"), f + 60),
|
|
1928
|
-
owner: l
|
|
1929
|
-
};
|
|
1930
|
-
t.set(r, u), n === null && (n = e.request(a));
|
|
1931
|
-
});
|
|
1932
|
-
},
|
|
1933
|
-
takeover: (e, n) => {
|
|
1934
|
-
let r = t.get(e);
|
|
1935
|
-
r && (n === void 0 || r.owner === n) && i(e, "current");
|
|
1936
|
-
},
|
|
1937
|
-
cancel: (e, n) => {
|
|
1938
|
-
let r = t.get(e);
|
|
1939
|
-
r && (n === void 0 || r.owner === n) && i(e, "drop");
|
|
1940
|
-
}
|
|
1941
|
-
};
|
|
1942
|
-
})(), Yn = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, Xn = /* @__PURE__ */ new WeakMap(), Zn = Symbol("flemo-inline-writer"), Qn = /* @__PURE__ */ new WeakMap(), W = (e, t, n = Zn) => {
|
|
1943
|
-
let r = Xn.get(e);
|
|
1944
|
-
r || (r = /* @__PURE__ */ new Map(), Xn.set(e, r));
|
|
1864
|
+
//#region src/transition/animateInline.ts
|
|
1865
|
+
var qn = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, Jn = /* @__PURE__ */ new WeakMap(), Yn = Symbol("flemo-inline-writer"), Xn = /* @__PURE__ */ new WeakMap(), U = (e, t, n = Yn) => {
|
|
1866
|
+
let r = Jn.get(e);
|
|
1867
|
+
r || (r = /* @__PURE__ */ new Map(), Jn.set(e, r));
|
|
1945
1868
|
let i = r.get(t);
|
|
1946
1869
|
i || (i = {
|
|
1947
1870
|
original: e.style.getPropertyValue(t),
|
|
1948
1871
|
owners: /* @__PURE__ */ new Set()
|
|
1949
1872
|
}, r.set(t, i)), i.owners.add(n);
|
|
1950
|
-
},
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1873
|
+
}, Zn = (e, t) => {
|
|
1874
|
+
qn(e) && (U(e, "transition", t), e.style.transition = "none", Xn.set(e, t));
|
|
1875
|
+
}, W = (e, t, n) => {
|
|
1876
|
+
let r = Jn.get(e);
|
|
1877
|
+
(!n || Xn.get(e) === n) && (e.style.transition = "", Xn.delete(e));
|
|
1954
1878
|
let i = (t) => {
|
|
1955
1879
|
let i = r?.get(t);
|
|
1956
1880
|
if (!i) {
|
|
@@ -1968,27 +1892,19 @@ var Kn = () => ({
|
|
|
1968
1892
|
return;
|
|
1969
1893
|
}
|
|
1970
1894
|
n || (e.style.removeProperty("transform"), e.style.removeProperty("opacity"));
|
|
1971
|
-
},
|
|
1972
|
-
if (!
|
|
1973
|
-
let i = e, a =
|
|
1895
|
+
}, G = (e, t, n = {}, r) => {
|
|
1896
|
+
if (!qn(e)) return Promise.resolve();
|
|
1897
|
+
let i = e, a = xn(t);
|
|
1974
1898
|
if (a.length === 0) return Promise.resolve();
|
|
1975
|
-
let o = typeof n.duration == "number" ? n.duration : 0, s = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, c =
|
|
1899
|
+
let o = typeof n.duration == "number" ? n.duration : 0, s = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, c = Sn(n.ease);
|
|
1976
1900
|
if (o <= 0 && s <= 0) {
|
|
1977
|
-
|
|
1978
|
-
for (let e of a)
|
|
1901
|
+
i.style.transition = "none", Xn.set(i, r);
|
|
1902
|
+
for (let e of a) U(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1979
1903
|
return Promise.resolve();
|
|
1980
1904
|
}
|
|
1981
|
-
let l =
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
easing: c
|
|
1985
|
-
}, (e) => {
|
|
1986
|
-
W(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1987
|
-
}, r) : null;
|
|
1988
|
-
if (l) return l;
|
|
1989
|
-
let u = a.map((e) => `${e.property} ${o}s ${c} ${s}s`).join(", ");
|
|
1990
|
-
i.style.transition = u, Qn.set(i, r), i.offsetWidth;
|
|
1991
|
-
for (let e of a) W(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1905
|
+
let l = a.map((e) => `${e.property} ${o}s ${c} ${s}s`).join(", ");
|
|
1906
|
+
i.style.transition = l, Xn.set(i, r), i.offsetWidth;
|
|
1907
|
+
for (let e of a) U(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1992
1908
|
return new Promise((e) => {
|
|
1993
1909
|
let t = !1, n = () => {
|
|
1994
1910
|
t || (t = !0, i.removeEventListener("transitionend", r), e());
|
|
@@ -1997,65 +1913,65 @@ var Kn = () => ({
|
|
|
1997
1913
|
};
|
|
1998
1914
|
i.addEventListener("transitionend", r), setTimeout(n, (o + s) * 1e3 + 60);
|
|
1999
1915
|
});
|
|
2000
|
-
},
|
|
1916
|
+
}, Qn = (e) => {
|
|
2001
1917
|
if (typeof e.querySelectorAll == "function") {
|
|
2002
1918
|
e.tagName === "IMG" && !e.hasAttribute("decoding") && e.setAttribute("decoding", "async");
|
|
2003
1919
|
for (let t of Array.from(e.querySelectorAll("img:not([decoding])"))) t.setAttribute("decoding", "async");
|
|
2004
1920
|
}
|
|
2005
|
-
},
|
|
2006
|
-
function
|
|
2007
|
-
let e =
|
|
2008
|
-
if (
|
|
1921
|
+
}, $n = 0, er = [], tr = [];
|
|
1922
|
+
function nr() {
|
|
1923
|
+
let e = $n === 0;
|
|
1924
|
+
if ($n += 1, e) for (let e of tr) e();
|
|
2009
1925
|
let t = !1;
|
|
2010
1926
|
return () => {
|
|
2011
|
-
if (t || (t = !0,
|
|
2012
|
-
let e =
|
|
2013
|
-
|
|
1927
|
+
if (t || (t = !0, --$n, $n > 0)) return;
|
|
1928
|
+
let e = er;
|
|
1929
|
+
er = [];
|
|
2014
1930
|
for (let t of e) t();
|
|
2015
1931
|
};
|
|
2016
1932
|
}
|
|
2017
|
-
var
|
|
2018
|
-
function
|
|
2019
|
-
return
|
|
2020
|
-
|
|
1933
|
+
var rr = () => $n > 0;
|
|
1934
|
+
function ir(e) {
|
|
1935
|
+
return tr.push(e), () => {
|
|
1936
|
+
tr = tr.filter((t) => t !== e);
|
|
2021
1937
|
};
|
|
2022
1938
|
}
|
|
2023
|
-
function
|
|
2024
|
-
|
|
1939
|
+
function ar(e) {
|
|
1940
|
+
$n === 0 ? e() : er.push(e);
|
|
2025
1941
|
}
|
|
2026
1942
|
//#endregion
|
|
2027
1943
|
//#region src/core/engine/imageDecodeOffloader.ts
|
|
2028
|
-
var
|
|
1944
|
+
var or = 8, sr = 2, K = 96, cr = 15e3, lr = 3e3, ur = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", q = "data-flemo-image-src", dr = "flemo-image-scale-v1", fr = /* @__PURE__ */ new Set([
|
|
2029
1945
|
"PUSHING",
|
|
2030
1946
|
"POPPING",
|
|
2031
1947
|
"REPLACING"
|
|
2032
|
-
]),
|
|
1948
|
+
]), pr = (e) => {
|
|
2033
1949
|
let t = e.closest("[data-flemo-screen]");
|
|
2034
|
-
return !!t &&
|
|
2035
|
-
},
|
|
1950
|
+
return !!t && fr.has(t.getAttribute("data-flemo-status") ?? "");
|
|
1951
|
+
}, mr = (e) => {
|
|
2036
1952
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0 || e.boxWidth <= 0 || e.boxHeight <= 0) return !1;
|
|
2037
1953
|
let t = e.boxWidth * e.boxHeight * e.devicePixelRatio * e.devicePixelRatio;
|
|
2038
1954
|
return e.naturalWidth * e.naturalHeight > t * 8;
|
|
2039
|
-
},
|
|
1955
|
+
}, hr = "onmessage = async (e) => {\n const { url, targetWidth, neededArea, ratio } = e.data;\n try {\n const response = await fetch(url);\n if (!response.ok) throw new Error(\"http \" + response.status);\n const blob = await response.blob();\n const full = await createImageBitmap(blob);\n if (full.width * full.height <= neededArea * ratio) {\n full.close();\n postMessage({ url, skip: true });\n return;\n }\n const scale = targetWidth / full.width;\n const canvas = new OffscreenCanvas(targetWidth, Math.max(1, Math.round(full.height * scale)));\n const context = canvas.getContext(\"2d\");\n context.imageSmoothingQuality = \"high\";\n context.drawImage(full, 0, 0, canvas.width, canvas.height);\n full.close();\n const out = await canvas.convertToBlob({ type: \"image/jpeg\", quality: 0.85 });\n postMessage({ url, blob: out });\n } catch (error) {\n postMessage({ url, error: String(error) });\n }\n};", gr = () => typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap == "function" && typeof MutationObserver < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function", _r = async (e, t) => {
|
|
2040
1956
|
try {
|
|
2041
1957
|
if (typeof caches > "u") return;
|
|
2042
|
-
await (await caches.open(
|
|
1958
|
+
await (await caches.open(dr)).put(e, new Response(t, { headers: { "content-type": t.type } }));
|
|
2043
1959
|
} catch {}
|
|
2044
|
-
},
|
|
1960
|
+
}, vr = async (e) => {
|
|
2045
1961
|
try {
|
|
2046
1962
|
if (typeof caches > "u") return null;
|
|
2047
|
-
let t = await (await caches.open(
|
|
1963
|
+
let t = await (await caches.open(dr)).match(e);
|
|
2048
1964
|
return t ? await t.blob() : null;
|
|
2049
1965
|
} catch {
|
|
2050
1966
|
return null;
|
|
2051
1967
|
}
|
|
2052
1968
|
};
|
|
2053
|
-
function
|
|
2054
|
-
if (!
|
|
1969
|
+
function yr(e) {
|
|
1970
|
+
if (!gr()) return () => {};
|
|
2055
1971
|
let t = null, n = !1, r = /* @__PURE__ */ new Map(), i = (e) => !!e && e !== "skip" && e !== "opaque", a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new WeakSet(), l = /* @__PURE__ */ new Set(), u = () => typeof devicePixelRatio == "number" ? devicePixelRatio : 1, d = () => {
|
|
2056
1972
|
if (t) return t;
|
|
2057
1973
|
try {
|
|
2058
|
-
t = new Worker(URL.createObjectURL(new Blob([
|
|
1974
|
+
t = new Worker(URL.createObjectURL(new Blob([hr])));
|
|
2059
1975
|
} catch {
|
|
2060
1976
|
return null;
|
|
2061
1977
|
}
|
|
@@ -2070,7 +1986,7 @@ function br(e) {
|
|
|
2070
1986
|
return;
|
|
2071
1987
|
}
|
|
2072
1988
|
let a = URL.createObjectURL(n);
|
|
2073
|
-
l.add(a),
|
|
1989
|
+
l.add(a), _r(t, n), f(t, a);
|
|
2074
1990
|
}, t;
|
|
2075
1991
|
}, f = (e, t) => {
|
|
2076
1992
|
r.has(e) || r.set(e, t);
|
|
@@ -2079,21 +1995,21 @@ function br(e) {
|
|
|
2079
1995
|
let n = () => {
|
|
2080
1996
|
t ? e.style.visibility = t : e.style.removeProperty("visibility");
|
|
2081
1997
|
};
|
|
2082
|
-
if (!
|
|
1998
|
+
if (!rr()) {
|
|
2083
1999
|
n();
|
|
2084
2000
|
return;
|
|
2085
2001
|
}
|
|
2086
2002
|
let r = !1, i = () => {
|
|
2087
2003
|
r || (r = !0, clearTimeout(o), a.delete(i), n());
|
|
2088
|
-
}, o = setTimeout(i,
|
|
2089
|
-
a.add(i),
|
|
2004
|
+
}, o = setTimeout(i, lr);
|
|
2005
|
+
a.add(i), ar(i);
|
|
2090
2006
|
}, m = (e, t) => {
|
|
2091
2007
|
let n = () => {
|
|
2092
|
-
if (
|
|
2093
|
-
|
|
2008
|
+
if (rr()) {
|
|
2009
|
+
ar(t);
|
|
2094
2010
|
return;
|
|
2095
2011
|
}
|
|
2096
|
-
if (!
|
|
2012
|
+
if (!pr(e) || typeof requestAnimationFrame != "function") {
|
|
2097
2013
|
t();
|
|
2098
2014
|
return;
|
|
2099
2015
|
}
|
|
@@ -2105,10 +2021,10 @@ function br(e) {
|
|
|
2105
2021
|
e.style.visibility = "hidden";
|
|
2106
2022
|
let r = !1, i = () => {
|
|
2107
2023
|
r || (r = !0, clearTimeout(o), a.delete(i), t(), n ? e.style.visibility = n : e.style.removeProperty("visibility"));
|
|
2108
|
-
}, o = setTimeout(i,
|
|
2024
|
+
}, o = setTimeout(i, lr);
|
|
2109
2025
|
a.add(i), m(e, i);
|
|
2110
|
-
}, g = (e, t) => !
|
|
2111
|
-
e.setAttribute(
|
|
2026
|
+
}, g = (e, t) => !rr() && !pr(e) ? !1 : (e.setAttribute(q, t), h(e, () => {}), !0), _ = (e, t, a) => {
|
|
2027
|
+
e.setAttribute(q, t), e.src = a, h(e, () => {
|
|
2112
2028
|
/* v8 ignore next -- disposal runs pending reveals; nothing to repair. */
|
|
2113
2029
|
if (n) return;
|
|
2114
2030
|
let a = r.get(t);
|
|
@@ -2119,12 +2035,12 @@ function br(e) {
|
|
|
2119
2035
|
if (n) {
|
|
2120
2036
|
if (s.delete(e), clearTimeout(n.timeout), n.detachListeners?.(), n.responsive) {
|
|
2121
2037
|
if (i(t)) {
|
|
2122
|
-
e.setAttribute(
|
|
2038
|
+
e.setAttribute(q, n.url), e.removeAttribute("srcset"), e.removeAttribute("sizes");
|
|
2123
2039
|
let r = e.closest("picture");
|
|
2124
2040
|
if (r) for (let e of Array.from(r.querySelectorAll("source"))) e.removeAttribute("srcset");
|
|
2125
2041
|
e.src = t;
|
|
2126
2042
|
}
|
|
2127
|
-
} else e.getAttribute("src") ===
|
|
2043
|
+
} else e.getAttribute("src") === ur && (i(t) ? e.src = t : (e.removeAttribute(q), e.src = n.url));
|
|
2128
2044
|
p(e, n.previousVisibility);
|
|
2129
2045
|
}
|
|
2130
2046
|
}, y = /* @__PURE__ */ new Map(), b = !1, x = () => {
|
|
@@ -2133,14 +2049,14 @@ function br(e) {
|
|
|
2133
2049
|
y.clear();
|
|
2134
2050
|
for (let [t, n] of e) C(t, n.boxWidth, n.boxHeight);
|
|
2135
2051
|
}, S = () => {
|
|
2136
|
-
b || (b = !0,
|
|
2052
|
+
b || (b = !0, ar(() => {
|
|
2137
2053
|
if (n) return;
|
|
2138
2054
|
let e = globalThis.requestIdleCallback;
|
|
2139
2055
|
typeof e == "function" ? e(() => x()) : typeof setTimeout == "function" ? setTimeout(x, 400) : x();
|
|
2140
2056
|
}));
|
|
2141
2057
|
}, C = (e, t, n) => {
|
|
2142
2058
|
if (r.has(e) || o.has(e)) return;
|
|
2143
|
-
if (
|
|
2059
|
+
if (rr() && L()) {
|
|
2144
2060
|
y.has(e) || y.set(e, {
|
|
2145
2061
|
boxWidth: t,
|
|
2146
2062
|
boxHeight: n
|
|
@@ -2150,28 +2066,28 @@ function br(e) {
|
|
|
2150
2066
|
let i = d();
|
|
2151
2067
|
if (!i) return;
|
|
2152
2068
|
o.add(e);
|
|
2153
|
-
let a = Math.round(Math.max(
|
|
2069
|
+
let a = Math.round(Math.max(K, t * u()) * sr), s = Math.max(t * n, 9216) * u() ** 2;
|
|
2154
2070
|
i.postMessage({
|
|
2155
2071
|
url: e,
|
|
2156
2072
|
targetWidth: a,
|
|
2157
2073
|
neededArea: s,
|
|
2158
2074
|
ratio: 8
|
|
2159
2075
|
});
|
|
2160
|
-
}, w =
|
|
2161
|
-
if (
|
|
2076
|
+
}, w = ir(() => {
|
|
2077
|
+
if (L() && !(!t || o.size === 0)) {
|
|
2162
2078
|
t.terminate(), t = null;
|
|
2163
2079
|
for (let e of o) {
|
|
2164
2080
|
if (y.has(e)) continue;
|
|
2165
2081
|
let t = {
|
|
2166
|
-
boxWidth:
|
|
2167
|
-
boxHeight:
|
|
2082
|
+
boxWidth: K,
|
|
2083
|
+
boxHeight: K
|
|
2168
2084
|
};
|
|
2169
2085
|
for (let [n, r] of s) {
|
|
2170
2086
|
if (r.url !== e) continue;
|
|
2171
2087
|
let i = n.getBoundingClientRect();
|
|
2172
2088
|
t = {
|
|
2173
|
-
boxWidth: i.width ||
|
|
2174
|
-
boxHeight: i.height ||
|
|
2089
|
+
boxWidth: i.width || K,
|
|
2090
|
+
boxHeight: i.height || K
|
|
2175
2091
|
};
|
|
2176
2092
|
break;
|
|
2177
2093
|
}
|
|
@@ -2185,17 +2101,17 @@ function br(e) {
|
|
|
2185
2101
|
let a = {
|
|
2186
2102
|
url: "",
|
|
2187
2103
|
previousVisibility: e.style.visibility,
|
|
2188
|
-
timeout: setTimeout(() => v(e, null),
|
|
2104
|
+
timeout: setTimeout(() => v(e, null), cr),
|
|
2189
2105
|
responsive: !0
|
|
2190
2106
|
}, o = () => {
|
|
2191
2107
|
/* v8 ignore next -- consider() only routes elements with an https src
|
|
2192
2108
|
here, so the final fallback arm is unreachable. */
|
|
2193
2109
|
let t = e.currentSrc || e.getAttribute("src") || "", i = e.getBoundingClientRect();
|
|
2194
|
-
if (!(/^https?:/.test(t) &&
|
|
2110
|
+
if (!(/^https?:/.test(t) && mr({
|
|
2195
2111
|
naturalWidth: e.naturalWidth,
|
|
2196
2112
|
naturalHeight: e.naturalHeight,
|
|
2197
|
-
boxWidth: i.width ||
|
|
2198
|
-
boxHeight: i.height ||
|
|
2113
|
+
boxWidth: i.width || K,
|
|
2114
|
+
boxHeight: i.height || K,
|
|
2199
2115
|
devicePixelRatio: u()
|
|
2200
2116
|
}))) {
|
|
2201
2117
|
v(e, null);
|
|
@@ -2207,7 +2123,7 @@ function br(e) {
|
|
|
2207
2123
|
v(e, o);
|
|
2208
2124
|
return;
|
|
2209
2125
|
}
|
|
2210
|
-
|
|
2126
|
+
vr(t).then((a) => {
|
|
2211
2127
|
if (!(n || !s.has(e))) {
|
|
2212
2128
|
/* v8 ignore start -- a verdict can only appear via settle(), which
|
|
2213
2129
|
releases every held element of the url first, so a still-held
|
|
@@ -2223,7 +2139,7 @@ function br(e) {
|
|
|
2223
2139
|
l.add(e), f(t, e);
|
|
2224
2140
|
return;
|
|
2225
2141
|
}
|
|
2226
|
-
C(t, i.width ||
|
|
2142
|
+
C(t, i.width || K, i.height || K);
|
|
2227
2143
|
}
|
|
2228
2144
|
});
|
|
2229
2145
|
};
|
|
@@ -2246,20 +2162,20 @@ function br(e) {
|
|
|
2246
2162
|
if (c.add(e), e.complete && e.naturalWidth > 0) {
|
|
2247
2163
|
if (!t) {
|
|
2248
2164
|
let t = e.getBoundingClientRect();
|
|
2249
|
-
C(a, t.width ||
|
|
2165
|
+
C(a, t.width || K, t.height || K);
|
|
2250
2166
|
return;
|
|
2251
2167
|
}
|
|
2252
2168
|
let n = e.getBoundingClientRect();
|
|
2253
|
-
if (!
|
|
2169
|
+
if (!mr({
|
|
2254
2170
|
naturalWidth: e.naturalWidth,
|
|
2255
2171
|
naturalHeight: e.naturalHeight,
|
|
2256
|
-
boxWidth: n.width ||
|
|
2257
|
-
boxHeight: n.height ||
|
|
2172
|
+
boxWidth: n.width || K,
|
|
2173
|
+
boxHeight: n.height || K,
|
|
2258
2174
|
devicePixelRatio: u()
|
|
2259
2175
|
})) return;
|
|
2260
2176
|
let o = r.get(a);
|
|
2261
2177
|
if (i(o)) {
|
|
2262
|
-
|
|
2178
|
+
rr() || pr(e) ? _(e, a, o) : (e.setAttribute(q, a), e.src = o);
|
|
2263
2179
|
return;
|
|
2264
2180
|
}
|
|
2265
2181
|
if (o === "opaque") {
|
|
@@ -2275,14 +2191,14 @@ function br(e) {
|
|
|
2275
2191
|
return;
|
|
2276
2192
|
}
|
|
2277
2193
|
if (o) {
|
|
2278
|
-
|
|
2194
|
+
rr() || pr(e) ? _(e, a, o) : (e.setAttribute(q, a), e.src = o);
|
|
2279
2195
|
return;
|
|
2280
2196
|
}
|
|
2281
2197
|
s.set(e, {
|
|
2282
2198
|
url: a,
|
|
2283
2199
|
previousVisibility: e.style.visibility,
|
|
2284
|
-
timeout: setTimeout(() => v(e, null),
|
|
2285
|
-
}), e.style.visibility = "hidden", e.setAttribute(
|
|
2200
|
+
timeout: setTimeout(() => v(e, null), cr)
|
|
2201
|
+
}), e.style.visibility = "hidden", e.setAttribute(q, a), e.src = ur, vr(a).then((t) => {
|
|
2286
2202
|
if (n || r.has(a)) return;
|
|
2287
2203
|
if (t) {
|
|
2288
2204
|
let e = URL.createObjectURL(t);
|
|
@@ -2292,7 +2208,7 @@ function br(e) {
|
|
|
2292
2208
|
let i = () => {
|
|
2293
2209
|
if (n) return;
|
|
2294
2210
|
let t = e.getBoundingClientRect();
|
|
2295
|
-
C(a, t.width ||
|
|
2211
|
+
C(a, t.width || K, t.height || K);
|
|
2296
2212
|
};
|
|
2297
2213
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(i) : i();
|
|
2298
2214
|
});
|
|
@@ -2309,21 +2225,21 @@ function br(e) {
|
|
|
2309
2225
|
let k = (e) => {
|
|
2310
2226
|
let t = e.getAttribute("src") ?? "", n = s.get(e);
|
|
2311
2227
|
if (n && !n.responsive) {
|
|
2312
|
-
t === n.url && (e.src =
|
|
2228
|
+
t === n.url && (e.src = ur);
|
|
2313
2229
|
return;
|
|
2314
2230
|
}
|
|
2315
|
-
let a = e.getAttribute(
|
|
2231
|
+
let a = e.getAttribute(q);
|
|
2316
2232
|
if (a) if (t === a) {
|
|
2317
2233
|
let t = r.get(a);
|
|
2318
2234
|
i(t) && (e.src = t);
|
|
2319
|
-
} else t !==
|
|
2235
|
+
} else t !== ur && !t.startsWith("blob:") && e.removeAttribute(q);
|
|
2320
2236
|
}, A = !1, j = new MutationObserver((t) => {
|
|
2321
2237
|
if (!n) {
|
|
2322
|
-
if (
|
|
2238
|
+
if (rr()) {
|
|
2323
2239
|
if (A) return;
|
|
2324
|
-
A = !0,
|
|
2240
|
+
A = !0, ar(() => {
|
|
2325
2241
|
if (A = !1, !n) {
|
|
2326
|
-
for (let t of Array.from(e.querySelectorAll(`img[${
|
|
2242
|
+
for (let t of Array.from(e.querySelectorAll(`img[${q}]`))) k(t);
|
|
2327
2243
|
for (let e of [...s.keys()]) k(e);
|
|
2328
2244
|
}
|
|
2329
2245
|
});
|
|
@@ -2345,23 +2261,23 @@ function br(e) {
|
|
|
2345
2261
|
l.clear();
|
|
2346
2262
|
};
|
|
2347
2263
|
}
|
|
2348
|
-
var
|
|
2349
|
-
function
|
|
2350
|
-
return typeof document > "u" || !document.body ? () => {} : (
|
|
2351
|
-
dispose:
|
|
2264
|
+
var br = null;
|
|
2265
|
+
function xr() {
|
|
2266
|
+
return typeof document > "u" || !document.body ? () => {} : (br ? br.count += 1 : br = {
|
|
2267
|
+
dispose: yr(document.body),
|
|
2352
2268
|
count: 1
|
|
2353
2269
|
}, () => {
|
|
2354
|
-
|
|
2270
|
+
br && (--br.count, br.count <= 0 && (br.dispose(), br = null));
|
|
2355
2271
|
});
|
|
2356
2272
|
}
|
|
2357
2273
|
//#endregion
|
|
2358
2274
|
//#region src/core/engine/arrivalHold.ts
|
|
2359
|
-
var
|
|
2360
|
-
function
|
|
2275
|
+
var Sr = "data-flemo-held-arrival";
|
|
2276
|
+
function Cr(e) {
|
|
2361
2277
|
if (typeof MutationObserver > "u") return () => {};
|
|
2362
2278
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = (t) => {
|
|
2363
2279
|
let n = t instanceof Element ? t : t.parentElement;
|
|
2364
|
-
return !n || n === e || n.closest(`[data-flemo-part-name], [${
|
|
2280
|
+
return !n || n === e || n.closest(`[data-flemo-part-name], [${Sr}], [${q}]`) !== null;
|
|
2365
2281
|
}, s = (e, t, n, r) => e ? n === e.glass ? (e.pendingEcho ? e.pendingEcho = !1 : e.latest = n, e) : (e.latest = n, r(e.glass), e.pendingEcho = !0, e) : n === t ? null : (r(t), {
|
|
2366
2282
|
glass: t,
|
|
2367
2283
|
latest: n,
|
|
@@ -2391,12 +2307,12 @@ function wr(e) {
|
|
|
2391
2307
|
if (i.type === "childList") {
|
|
2392
2308
|
for (let e of Array.from(i.removedNodes)) if (!n.has(e)) {
|
|
2393
2309
|
if (e instanceof Element && t.delete(e)) {
|
|
2394
|
-
e.removeAttribute(
|
|
2310
|
+
e.removeAttribute(Sr);
|
|
2395
2311
|
continue;
|
|
2396
2312
|
}
|
|
2397
2313
|
(e instanceof Element || e.nodeType === Node.TEXT_NODE) && l(i.target).removed.push(e);
|
|
2398
2314
|
}
|
|
2399
|
-
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(
|
|
2315
|
+
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(Sr, ""), t.add(e), l(i.target).added.push(e));
|
|
2400
2316
|
}
|
|
2401
2317
|
}
|
|
2402
2318
|
for (let [e, t] of u) {
|
|
@@ -2431,7 +2347,7 @@ function wr(e) {
|
|
|
2431
2347
|
c.disconnect();
|
|
2432
2348
|
for (let e of n) e.parentNode?.removeChild(e);
|
|
2433
2349
|
n.clear();
|
|
2434
|
-
for (let e of t) e instanceof HTMLElement &&
|
|
2350
|
+
for (let e of t) e instanceof HTMLElement && Qn(e), e.removeAttribute(Sr);
|
|
2435
2351
|
t.clear();
|
|
2436
2352
|
for (let [e, t] of i) e.isConnected && (e.nodeValue = t.latest);
|
|
2437
2353
|
i.clear();
|
|
@@ -2441,36 +2357,36 @@ function wr(e) {
|
|
|
2441
2357
|
}
|
|
2442
2358
|
//#endregion
|
|
2443
2359
|
//#region src/core/engine/compositorWarmUp.ts
|
|
2444
|
-
var
|
|
2360
|
+
var wr = "data-flemo-warm", Tr = 3e3, Er = [{ backgroundPosition: "0px 0px" }, { backgroundPosition: "48px 0px" }], Dr = {
|
|
2445
2361
|
duration: 500,
|
|
2446
2362
|
iterations: Infinity,
|
|
2447
2363
|
direction: "alternate",
|
|
2448
2364
|
easing: "linear"
|
|
2449
|
-
},
|
|
2450
|
-
Nr = 0, Mr?.cancel(), Mr = null,
|
|
2365
|
+
}, Or = "position:fixed;top:0;left:0;width:48px;height:48px;pointer-events:none;opacity:0.02;background-image:linear-gradient(90deg,#808080 0 24px,#909090 24px 48px);background-repeat:repeat;background-size:48px 48px;", kr = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAeuEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHWTbuMU6uEElTDZ1OsggExTbuMU6uEHFO7a1Osggdg7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsCrXsYMPQkBNgIxMYXZmNjMuMS4xMDBXQYxMYXZmNjMuMS4xMDBEiYhAj0AAAAAAABZUrmvWrgEAAAAAAABN14EBc8WIPqUZMMrLeHecgQAitZyDdW5kiIEAhoVWX1ZQOIOBASPjg4P+UCrgkLCBCLqBCJqBAlWwhFW5gQFV7oEA7AEAAAAAAAACAAASVMNn+nNzn2PAgGfImUWjh0VOQ09ERVJEh4xMYXZmNjMuMS4xMDBzc9VjwItjxYg+pRkwyst4d2fIoEWjh0VOQ09ERVJEh5NMYXZjNjMuMS4xMDAgbGlidnB4Z8ihRaOIRFVSQVRJT05Eh5MwMDowMDowMS4wMDAwMDAwMDAAH0O2dUWq54EAo5+BAACAEAIAnQEqCAAIAABHCIWFiIWEiAICAAYZaAAAo5WBABEAsQEAARAQABgAGG/0DAAEAACjlYEAIQCxAQABEBAAGAAYb/QMAAQAAKOVgQAyALEBAAEQEAAYABhv9AwABAAAo5WBAEMAsQEAARAQABgAGG/0DAAEAACjlYEAUwCxAQABEBAAGAAYb/QMAAQAAKOVgQBkALEBAAEQEAAYABhv9AwABAAAo5SBAHUAkQEAARAQFGAAYb/QMAAQAKOXgQCFALEBAAEQEAAYADA/9AwAAAD+aACjlYEAlgCxAQABEBAAGAAYb/QMAAQAAKOXgQCnALEBAAEQEAAYADA/9AwAAAD+aACjlYEAtwCxAQABEBAAGAAYb/QMAAQAAKOXgQDIALEBAAEQEAAYADA/9AwAAAD+aACjl4EA2QCxAQABEBAAGAAwP/QMAAAA/mgAo5WBAOkAsQEAARAQFGAAYWC/0AAgAACjn4EA+oAQAgCdASoIAAgAAEcIhYWIhYSIAgIABhloAACjl4EBCwCxAQABEBAAGAAwP/QMAAAA/mgAo5WBARsAsQEAARAQABgAGG/0DAAEAACjl4EBLACxAQABEBAAGAAwP/QMAAAA/mgAo5WBAT0AsQEAARAQABgAGG/0DAAEAACjl4EBTQCxAQABEBAAGAAwP/QMAAAA/mgAo5eBAV4AsQEAARAQABgAMD/0DAAAAP5oAKOVgQFvALEBAAEQEBRgAGFgv9AAIAAAo5+BAX+AEAIAnQEqCAAIAABHCIWFiIWEiAICAAYZaAAAo5eBAZAAsQEAARAQABgAMD/0DAAAAP5oAKOVgQGhALEBAAEQEAAYABhv9AwABAAAo5WBAbEAsQEAARAQABgAGG/0DAAEAACjlYEBwgCxAQABEBAAGAAYb/QMAAQAAKOXgQHTALEBAAEQEAAYADA/9AwAAAD+aACjlYEB4wCxAQABEBAAGAAYb/QMAAQAAKOWgQH0AJEBAAEQEBRgAMD/0DAAAP5oAKOVgQIFALEBAAEQEAAYABhv9AwABAAAo5WBAhUAsQEAARAQABgAGFgYL+gMAACjlYECJgCxAQABEBAAGAAYWBgv6AwAAKOVgQI3ALEBAAEQEAAYABhYGC/oDAAAo5WBAkcAsQEAARAQABgAGFgYL+gMAACjlYECWACxAQABEBAAGAAYWBgv6AwAAKOfgQJpgBACAJ0BKggACAAARwiFhYiFhIgCAgAGGWgAAKOXgQJ5ALEBAAEQEAAYADA/9AwAAAD+aACjlYECigCxAQABEBAAGAAYb/QMAAQAAKOXgQKbALEBAAEQEAAYADA/9AwAAAD+aACjl4ECqwCxAQABEBAAGAAwP/QMAAAA/mgAo5WBArwAsQEAARAQABgAGG/0DAAEAACjlYECzQCxAQABEBAAGAAYb/QMAAQAAKOWgQLdAJEBAAEQEBRgAMD/0DAAAP5oAKOVgQLuALEBAAEQEAAYABhv9AwABAAAo5WBAv8AsQEAARAQABgAGFgYL+gMAACjlYEDDwCxAQABEBAAGAAYWBgv6AwAAKOVgQMgALEBAAEQEAAYABhYGC/oDAAAo5WBAzEAsQEAARAQABgAGFgYGBgQAACjlYEDQQCxAQABEBAAGAAYWC/0AAgAAKOVgQNSALEBAAEQEBRgAGFgv9AAIAAAo5WBA2MAsQEAARAQABgAGFgv9AAIAACjlYEDcwCxAQABEBAAGAAYWC/0AAgAAKOVgQOEALEBAAEQEAAYABhYGBgYEAAAo5WBA5UAsQEAARAQABgAGFgYL+gMAACjlYEDpQCxAQABEBAAGAAYWBgYGBAAAKOVgQO2ALEBAAEQEAAYABhYGC/oDAAAo5WBA8cAsQEAARAQABgAGFgYGBgQAACjlYED1wCxAQABEBAAGAAYWBgv6AwAABxTu2vJu4+zgQC3iveBAfGCAbDwgQO7kLOB+reL94EB8YIBsPCCAW27kbOCAX+3i/eBAfGCAbDwggI3u5GzggJpt4v3gQHxggGw8IIDiA==", J = null, Ar = null, jr = null, Mr = null, Nr = 0, Pr = () => {
|
|
2366
|
+
Nr = 0, Mr?.cancel(), Mr = null, jr?.remove(), jr = null;
|
|
2451
2367
|
};
|
|
2452
2368
|
function Fr() {
|
|
2453
2369
|
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function") return () => {};
|
|
2454
|
-
if (Nr += 1, !
|
|
2455
|
-
|
|
2370
|
+
if (Nr += 1, !jr) {
|
|
2371
|
+
jr = document.createElement("div"), jr.setAttribute(wr, ""), jr.setAttribute("aria-hidden", "true"), jr.setAttribute("style", Or), document.body.appendChild(jr);
|
|
2456
2372
|
try {
|
|
2457
|
-
Mr =
|
|
2373
|
+
Mr = jr.animate(Er, Dr);
|
|
2458
2374
|
} catch {
|
|
2459
2375
|
Mr = null;
|
|
2460
2376
|
}
|
|
2461
|
-
if (!
|
|
2462
|
-
|
|
2463
|
-
let e =
|
|
2464
|
-
|
|
2377
|
+
if (!J && it()) try {
|
|
2378
|
+
J = document.createElement("video"), J.muted = !0, J.loop = !0, J.playsInline = !0, J.setAttribute("aria-hidden", "true"), J.setAttribute("data-flemo-warm-video", ""), J.setAttribute("style", "position:fixed;top:0;left:52px;width:8px;height:8px;pointer-events:none;opacity:0.02;"), J.src = kr, document.body.appendChild(J), J.play()?.catch?.(() => {});
|
|
2379
|
+
let e = J;
|
|
2380
|
+
Ar = () => {
|
|
2465
2381
|
document.visibilityState === "hidden" ? e.pause() : e.play()?.catch?.(() => {});
|
|
2466
|
-
}, document.addEventListener("visibilitychange",
|
|
2382
|
+
}, document.addEventListener("visibilitychange", Ar);
|
|
2467
2383
|
} catch {
|
|
2468
|
-
|
|
2384
|
+
J = null;
|
|
2469
2385
|
}
|
|
2470
2386
|
}
|
|
2471
2387
|
let e = !1, t = setTimeout(() => {
|
|
2472
2388
|
e || (e = !0, --Nr, Nr <= 0 && Pr());
|
|
2473
|
-
},
|
|
2389
|
+
}, Tr);
|
|
2474
2390
|
return () => {
|
|
2475
2391
|
e || (e = !0, clearTimeout(t), --Nr, Nr <= 0 && Pr());
|
|
2476
2392
|
};
|
|
@@ -2482,7 +2398,7 @@ var Ir = () => {
|
|
|
2482
2398
|
let e = navigator.platform ?? "";
|
|
2483
2399
|
return /Mac/i.test(e) ? (navigator.maxTouchPoints ?? 0) > 0 : !1;
|
|
2484
2400
|
}, Lr = !1, Rr = () => {
|
|
2485
|
-
Lr || !
|
|
2401
|
+
Lr || !L() || !Ir() || (Lr = !0, console.warn("[flemo] DevTools device emulation detected. The emulated view is composited through an extra scaling pass, so transitions can show text shimmer and settle flashes that do NOT exist in a plain window or on a real device. Judge motion quality outside device emulation."));
|
|
2486
2402
|
}, zr = "data-flemo-img-hold", Br = (e) => !(e.complete && e.naturalWidth > 0), Vr = 4, Hr = (e) => {
|
|
2487
2403
|
if (!(e.complete && e.naturalWidth > 0)) return !1;
|
|
2488
2404
|
let t = e.getBoundingClientRect(), n = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, r = Math.max(1, t.width * n) * Math.max(1, t.height * n);
|
|
@@ -2686,7 +2602,7 @@ var Yr = (e, t, n, r) => {
|
|
|
2686
2602
|
if (a === 0) return null;
|
|
2687
2603
|
let o = (e.delay + e.duration * (a / ei)) * 1e3;
|
|
2688
2604
|
return (e.delay + e.duration) * 1e3 - o < ti ? null : o;
|
|
2689
|
-
}, oi = 1e3 / 120, si = 4,
|
|
2605
|
+
}, oi = 1e3 / 120, si = 4, Y = 400, ci = 4, X = (e) => {
|
|
2690
2606
|
let t = +e.toFixed(5);
|
|
2691
2607
|
return Object.is(t, -0) ? 0 : t;
|
|
2692
2608
|
}, li = (e, t, n) => {
|
|
@@ -2704,30 +2620,30 @@ var Yr = (e, t, n, r) => {
|
|
|
2704
2620
|
}
|
|
2705
2621
|
if (a < si) return null;
|
|
2706
2622
|
let o = Qr(e.ease), s = Array(401);
|
|
2707
|
-
for (let e = 0; e <=
|
|
2708
|
-
let c = e.duration * 1e3 /
|
|
2623
|
+
for (let e = 0; e <= Y; e += 1) s[e] = o(e / Y);
|
|
2624
|
+
let c = e.duration * 1e3 / Y, l = 40 / a * c / oi, u = Y, d = 0;
|
|
2709
2625
|
for (let e = 399; e >= 0 && (d = Math.max(d, Math.abs(s[e + 1] - s[e])), !(d > l)); --e) u = e;
|
|
2710
|
-
for (let e = u; e <
|
|
2626
|
+
for (let e = u; e < Y; e += 1) if (s[e + 1] < s[e] || s[e] > 1) return null;
|
|
2711
2627
|
let f = (1 - s[u]) * a;
|
|
2712
2628
|
if (f <= 1) return null;
|
|
2713
2629
|
let p = Math.min(480, Math.floor(f)), m = u, h = (e) => {
|
|
2714
2630
|
let t = 1 - e / a;
|
|
2715
|
-
for (; m <
|
|
2631
|
+
for (; m < Y && s[m] < t;) m += 1;
|
|
2716
2632
|
if (m === 0) return 0;
|
|
2717
2633
|
let n = s[m - 1], r = s[m], i = r === n ? 1 : Math.max(0, Math.min(1, (t - n) / (r - n)));
|
|
2718
|
-
return (m - 1 + i) /
|
|
2634
|
+
return (m - 1 + i) / Y * 100;
|
|
2719
2635
|
}, g = h(p), _ = [];
|
|
2720
|
-
for (let e = 0; 100 /
|
|
2636
|
+
for (let e = 0; 100 / Y * e < g; e += ci) _.push(`${X(s[e])} ${X(e / Y * 100)}%`);
|
|
2721
2637
|
let v = g;
|
|
2722
2638
|
for (let e = p; e >= 2; --e) {
|
|
2723
2639
|
let t = h(e - 1);
|
|
2724
2640
|
if (t > v) {
|
|
2725
|
-
let n =
|
|
2726
|
-
_.push(`${n} ${
|
|
2641
|
+
let n = X(1 - e / a);
|
|
2642
|
+
_.push(`${n} ${X(v)}%`, `${n} ${X(t)}%`);
|
|
2727
2643
|
}
|
|
2728
2644
|
v = t;
|
|
2729
2645
|
}
|
|
2730
|
-
return _.push(`1 ${
|
|
2646
|
+
return _.push(`1 ${X(v)}%`, "1 100%"), `linear(${_.join(", ")})`;
|
|
2731
2647
|
}, ui = 12, di = (e, t, n, r) => {
|
|
2732
2648
|
if (e.duration <= 0 || !Number.isFinite(r) || r <= 0) return null;
|
|
2733
2649
|
let i = Number.isFinite(n) && n > 0 ? n : 1, a = /* @__PURE__ */ new Set();
|
|
@@ -2743,18 +2659,18 @@ var Yr = (e, t, n, r) => {
|
|
|
2743
2659
|
}
|
|
2744
2660
|
if (o < ui) return null;
|
|
2745
2661
|
let s = Qr(e.ease), c = Array(401);
|
|
2746
|
-
for (let e = 0; e <=
|
|
2747
|
-
let l = e.duration * 1e3, u = l /
|
|
2662
|
+
for (let e = 0; e <= Y; e += 1) c[e] = s(e / Y);
|
|
2663
|
+
let l = e.duration * 1e3, u = l / Y, d = 1 / o * (u / r), f = Y, p = 0;
|
|
2748
2664
|
for (let e = 399; e >= 0 && (p = Math.max(p, Math.abs(c[e + 1] - c[e])), !(p > d)); --e) f = e;
|
|
2749
|
-
if (f === 0 || f >=
|
|
2750
|
-
for (let e = f; e <
|
|
2665
|
+
if (f === 0 || f >= Y) return null;
|
|
2666
|
+
for (let e = f; e < Y; e += 1) if (c[e + 1] < c[e] || c[e] > 1) return null;
|
|
2751
2667
|
let m = (1 - c[f]) * o;
|
|
2752
2668
|
if (m <= 1 || m > ui) return null;
|
|
2753
|
-
let h = f /
|
|
2669
|
+
let h = f / Y * 100, g = m * r / l * 100;
|
|
2754
2670
|
if (h + g >= 100) return null;
|
|
2755
2671
|
let _ = [];
|
|
2756
|
-
for (let e = 0; e <= f; e += ci) _.push(`${
|
|
2757
|
-
return _.push(`${
|
|
2672
|
+
for (let e = 0; e <= f; e += ci) _.push(`${X(c[e])} ${X(e / Y * 100)}%`);
|
|
2673
|
+
return _.push(`${X(c[f])} ${X(h)}%`), _.push(`1 ${X(h + g)}%`, "1 100%"), `linear(${_.join(", ")})`;
|
|
2758
2674
|
}, fi = /* @__PURE__ */ new WeakMap(), pi = Symbol("flemo-layer-owner"), mi = (e, t) => {
|
|
2759
2675
|
t.willChange ? e.style.willChange = t.willChange : e.style.removeProperty("will-change"), t.contain ? e.style.contain = t.contain : e.style.removeProperty("contain");
|
|
2760
2676
|
}, hi = (e, t) => {
|
|
@@ -2773,7 +2689,7 @@ var Yr = (e, t, n, r) => {
|
|
|
2773
2689
|
e.style.willChange = [...n].join(", ");
|
|
2774
2690
|
let i = hi(t.contain, r);
|
|
2775
2691
|
i ? e.style.contain = i : e.style.removeProperty("contain");
|
|
2776
|
-
},
|
|
2692
|
+
}, Z = (e, t, n = !1, r = pi) => {
|
|
2777
2693
|
let i = bn(t), a = fi.get(e);
|
|
2778
2694
|
if (i.length === 0) {
|
|
2779
2695
|
if (!a) return;
|
|
@@ -2790,14 +2706,14 @@ var Yr = (e, t, n, r) => {
|
|
|
2790
2706
|
properties: i,
|
|
2791
2707
|
containment: n
|
|
2792
2708
|
}), a.settleOwner = null, gi(e, a);
|
|
2793
|
-
},
|
|
2709
|
+
}, Q = (e, t = pi) => {
|
|
2794
2710
|
let n = fi.get(e);
|
|
2795
2711
|
if (!(!n || !n.owners.has(t))) {
|
|
2796
2712
|
if (n.owners.delete(t), n.owners.size > 0) {
|
|
2797
2713
|
gi(e, n);
|
|
2798
2714
|
return;
|
|
2799
2715
|
}
|
|
2800
|
-
if (
|
|
2716
|
+
if (kt() && typeof e.closest == "function" && e.closest("[data-flemo-screen]")) {
|
|
2801
2717
|
n.pending != null && clearTimeout(n.pending), n.pending = null, n.settleOwner = null, e.style.willChange = "transform", n.contain ? e.style.contain = n.contain : e.style.removeProperty("contain");
|
|
2802
2718
|
return;
|
|
2803
2719
|
}
|
|
@@ -2808,30 +2724,30 @@ var Yr = (e, t, n, r) => {
|
|
|
2808
2724
|
mi(e, n), fi.delete(e);
|
|
2809
2725
|
return;
|
|
2810
2726
|
}
|
|
2811
|
-
|
|
2727
|
+
_i(e, n);
|
|
2812
2728
|
}
|
|
2813
|
-
},
|
|
2729
|
+
}, _i = (e, t) => {
|
|
2814
2730
|
t.pending = setTimeout(() => {
|
|
2815
|
-
if (t.pending = null,
|
|
2816
|
-
|
|
2817
|
-
fi.get(e) === t && t.owners.size === 0 && t.settleOwner !== null && t.pending === null &&
|
|
2731
|
+
if (t.pending = null, rr()) {
|
|
2732
|
+
ar(() => {
|
|
2733
|
+
fi.get(e) === t && t.owners.size === 0 && t.settleOwner !== null && t.pending === null && _i(e, t);
|
|
2818
2734
|
});
|
|
2819
2735
|
return;
|
|
2820
2736
|
}
|
|
2821
2737
|
mi(e, t), fi.delete(e);
|
|
2822
2738
|
}, 300);
|
|
2823
|
-
},
|
|
2739
|
+
}, vi = (e, t, n) => {
|
|
2824
2740
|
let r = e.driver;
|
|
2825
2741
|
return r === "native" || r === "player" ? r : "player";
|
|
2826
|
-
},
|
|
2742
|
+
}, yi = 1e3 / 60 * 2, bi = "flemo-", xi = /* @__PURE__ */ new WeakMap(), Si = (e, t, n) => {
|
|
2827
2743
|
if (typeof e.getAnimations == "function") for (let r of e.getAnimations({ subtree: !0 })) {
|
|
2828
2744
|
let e = r.animationName;
|
|
2829
|
-
if (typeof e != "string" || !e.startsWith(
|
|
2745
|
+
if (typeof e != "string" || !e.startsWith(bi) || r.playState !== "running" || xi.get(r) === n) continue;
|
|
2830
2746
|
let i = r.startTime;
|
|
2831
|
-
typeof i == "number" && (r.startTime = i + t,
|
|
2747
|
+
typeof i == "number" && (r.startTime = i + t, xi.set(r, n));
|
|
2832
2748
|
}
|
|
2833
|
-
},
|
|
2834
|
-
function
|
|
2749
|
+
}, Ci = /* @__PURE__ */ new WeakSet(), wi = 1e3, Ti = 3e3;
|
|
2750
|
+
function Ei(e, t, n) {
|
|
2835
2751
|
if (typeof MutationObserver > "u" || typeof requestAnimationFrame != "function") return () => {};
|
|
2836
2752
|
let r = 0, i = !1, a = !1, o = !1, s = null, c = [], l = null, u = () => {
|
|
2837
2753
|
s !== null && (clearTimeout(s), s = null);
|
|
@@ -2845,7 +2761,7 @@ function Oi(e, t, n) {
|
|
|
2845
2761
|
i = !0, m.disconnect();
|
|
2846
2762
|
for (let e of t()) if (!(!e || typeof e.getAnimations != "function")) for (let t of e.getAnimations({ subtree: !0 })) {
|
|
2847
2763
|
let e = t.animationName;
|
|
2848
|
-
if (typeof e != "string" || !e.startsWith(
|
|
2764
|
+
if (typeof e != "string" || !e.startsWith(bi) || t.playState !== "running" || Ci.has(t)) continue;
|
|
2849
2765
|
let n = t.currentTime;
|
|
2850
2766
|
if (!(typeof n == "number" && n > 33.333333333333336)) {
|
|
2851
2767
|
try {
|
|
@@ -2853,18 +2769,18 @@ function Oi(e, t, n) {
|
|
|
2853
2769
|
} catch {
|
|
2854
2770
|
continue;
|
|
2855
2771
|
}
|
|
2856
|
-
|
|
2772
|
+
Ci.add(t), c.push(t);
|
|
2857
2773
|
}
|
|
2858
2774
|
}
|
|
2859
2775
|
if (c.length === 0) return;
|
|
2860
|
-
r = requestAnimationFrame(f), typeof setTimeout == "function" && (s = setTimeout(f,
|
|
2861
|
-
let e =
|
|
2776
|
+
r = requestAnimationFrame(f), typeof setTimeout == "function" && (s = setTimeout(f, wi));
|
|
2777
|
+
let e = ji(t, () => {
|
|
2862
2778
|
a || n?.();
|
|
2863
2779
|
});
|
|
2864
2780
|
if (l = e, typeof setTimeout == "function") {
|
|
2865
2781
|
let t = setTimeout(() => {
|
|
2866
2782
|
l === e && (l = null), e();
|
|
2867
|
-
},
|
|
2783
|
+
}, Ti), n = e;
|
|
2868
2784
|
l = () => {
|
|
2869
2785
|
clearTimeout(t), n();
|
|
2870
2786
|
};
|
|
@@ -2879,16 +2795,16 @@ function Oi(e, t, n) {
|
|
|
2879
2795
|
a = !0, m.disconnect(), r &&= (cancelAnimationFrame(r), 0), u(), l?.(), l = null, i && !o && d();
|
|
2880
2796
|
};
|
|
2881
2797
|
}
|
|
2882
|
-
var
|
|
2883
|
-
function
|
|
2798
|
+
var Di = 150, Oi = 4e3, ki = 400;
|
|
2799
|
+
function Ai(e, t, n = !0, r = !1) {
|
|
2884
2800
|
/* v8 ignore next -- same rAF guard as the watcher below. */
|
|
2885
2801
|
if (typeof requestAnimationFrame != "function") return () => {};
|
|
2886
2802
|
let i = [], a = /* @__PURE__ */ new Map();
|
|
2887
2803
|
for (let t of e()) if (!(!t || typeof t.getAnimations != "function")) for (let e of t.getAnimations({ subtree: !0 })) {
|
|
2888
2804
|
let t = e.animationName;
|
|
2889
|
-
if (typeof t != "string" || !t.startsWith(
|
|
2805
|
+
if (typeof t != "string" || !t.startsWith(bi) || e.playState !== "running" || Ci.has(e)) continue;
|
|
2890
2806
|
let n = e.currentTime;
|
|
2891
|
-
typeof n == "number" && n > 33.333333333333336 || (n === null || typeof n == "number") && (
|
|
2807
|
+
typeof n == "number" && n > 33.333333333333336 || (n === null || typeof n == "number") && (Ci.add(e), i.push(e), a.set(e, typeof n == "number" ? n : 0));
|
|
2892
2808
|
}
|
|
2893
2809
|
if (i.length === 0) return () => {};
|
|
2894
2810
|
let o = 0, s = null, c = !1, l = !1, u = !1, d = null, f = null, p = 0, m = (e) => {
|
|
@@ -2901,7 +2817,7 @@ function Mi(e, t, n = !0, r = !1) {
|
|
|
2901
2817
|
if (typeof r != "number" || typeof i != "number") continue;
|
|
2902
2818
|
let o = (a.get(n) ?? 0) + e;
|
|
2903
2819
|
n.startTime = i + (r - o), a.set(n, o);
|
|
2904
|
-
let s = r +
|
|
2820
|
+
let s = r + Oi;
|
|
2905
2821
|
t = Math.max(t, s - o);
|
|
2906
2822
|
}
|
|
2907
2823
|
return t;
|
|
@@ -2909,7 +2825,7 @@ function Mi(e, t, n = !0, r = !1) {
|
|
|
2909
2825
|
if (c) return;
|
|
2910
2826
|
if (d === null && (d = e), f !== null) {
|
|
2911
2827
|
let t = e - f;
|
|
2912
|
-
p += Math.min(Math.max(0, t),
|
|
2828
|
+
p += Math.min(Math.max(0, t), yi);
|
|
2913
2829
|
}
|
|
2914
2830
|
if (f = e, !l) {
|
|
2915
2831
|
if (l = !0, r) {
|
|
@@ -2921,7 +2837,7 @@ function Mi(e, t, n = !0, r = !1) {
|
|
|
2921
2837
|
if (typeof n != "number" || typeof r != "number") continue;
|
|
2922
2838
|
let i = a.get(t) ?? 0;
|
|
2923
2839
|
if (n <= i + 33.333333333333336) continue;
|
|
2924
|
-
let o = n - (i +
|
|
2840
|
+
let o = n - (i + yi);
|
|
2925
2841
|
t.startTime = r + o, e = Math.max(e, o);
|
|
2926
2842
|
}
|
|
2927
2843
|
e > 0 && t?.(e);
|
|
@@ -2935,13 +2851,13 @@ function Mi(e, t, n = !0, r = !1) {
|
|
|
2935
2851
|
if (e.playState !== "running") continue;
|
|
2936
2852
|
let t = e.startTime;
|
|
2937
2853
|
if (typeof t == "number") {
|
|
2938
|
-
e.startTime = t +
|
|
2854
|
+
e.startTime = t + Oi;
|
|
2939
2855
|
continue;
|
|
2940
2856
|
}
|
|
2941
2857
|
let n = e.timeline?.currentTime;
|
|
2942
|
-
typeof n == "number" && (e.startTime = n +
|
|
2858
|
+
typeof n == "number" && (e.startTime = n + Oi);
|
|
2943
2859
|
}
|
|
2944
|
-
typeof setTimeout == "function" && (s = setTimeout(() => m(p +
|
|
2860
|
+
typeof setTimeout == "function" && (s = setTimeout(() => m(p + yi), ki)), o = requestAnimationFrame(h);
|
|
2945
2861
|
return;
|
|
2946
2862
|
}
|
|
2947
2863
|
if (!u) {
|
|
@@ -2964,13 +2880,13 @@ function Mi(e, t, n = !0, r = !1) {
|
|
|
2964
2880
|
t?.(g);
|
|
2965
2881
|
return;
|
|
2966
2882
|
}
|
|
2967
|
-
e - d <
|
|
2883
|
+
e - d < Di && (o = requestAnimationFrame(h));
|
|
2968
2884
|
};
|
|
2969
2885
|
return o = requestAnimationFrame(h), () => {
|
|
2970
|
-
c = !0, cancelAnimationFrame(o), s !== null && clearTimeout(s), l && !u && m(p +
|
|
2886
|
+
c = !0, cancelAnimationFrame(o), s !== null && clearTimeout(s), l && !u && m(p + yi);
|
|
2971
2887
|
};
|
|
2972
2888
|
}
|
|
2973
|
-
function
|
|
2889
|
+
function ji(e, t) {
|
|
2974
2890
|
/* v8 ignore next -- every runtime under test has rAF; the guard shields
|
|
2975
2891
|
exotic embedders. */
|
|
2976
2892
|
if (typeof requestAnimationFrame != "function") return () => {};
|
|
@@ -2979,8 +2895,8 @@ function Ni(e, t) {
|
|
|
2979
2895
|
if (r !== null) {
|
|
2980
2896
|
let n = o - r;
|
|
2981
2897
|
if (n > 33.333333333333336) {
|
|
2982
|
-
let r = n -
|
|
2983
|
-
for (let t of e()) t &&
|
|
2898
|
+
let r = n - yi;
|
|
2899
|
+
for (let t of e()) t && Si(t, r, o);
|
|
2984
2900
|
t?.(r);
|
|
2985
2901
|
}
|
|
2986
2902
|
}
|
|
@@ -2991,29 +2907,29 @@ function Ni(e, t) {
|
|
|
2991
2907
|
i = !0, cancelAnimationFrame(n);
|
|
2992
2908
|
};
|
|
2993
2909
|
}
|
|
2994
|
-
var
|
|
2995
|
-
function
|
|
2910
|
+
var Mi = /* @__PURE__ */ new WeakMap();
|
|
2911
|
+
function Ni(e, t, n, r = !0, i = !1) {
|
|
2996
2912
|
if (typeof MutationObserver > "u" || typeof requestAnimationFrame != "function") return () => {};
|
|
2997
|
-
let a =
|
|
2998
|
-
if (a) return a.refs += 1, a.pendingDrop !== null && (clearTimeout(a.pendingDrop), a.pendingDrop = null), () =>
|
|
2913
|
+
let a = Mi.get(e);
|
|
2914
|
+
if (a) return a.refs += 1, a.pendingDrop !== null && (clearTimeout(a.pendingDrop), a.pendingDrop = null), () => Pi(e);
|
|
2999
2915
|
let o = null, s = !1, c = !1, l = () => {
|
|
3000
|
-
s || c || (s = !0, u.disconnect(), o =
|
|
2916
|
+
s || c || (s = !0, u.disconnect(), o = Ai(t, n, r, i));
|
|
3001
2917
|
}, u = new MutationObserver(() => {
|
|
3002
2918
|
e.getAttribute("data-flemo-anim-hold") === "false" && l();
|
|
3003
2919
|
});
|
|
3004
2920
|
return e.getAttribute("data-flemo-anim-hold") === "false" ? l() : u.observe(e, {
|
|
3005
2921
|
attributes: !0,
|
|
3006
2922
|
attributeFilter: ["data-flemo-anim-hold"]
|
|
3007
|
-
}),
|
|
2923
|
+
}), Mi.set(e, {
|
|
3008
2924
|
refs: 1,
|
|
3009
2925
|
pendingDrop: null,
|
|
3010
2926
|
dispose: () => {
|
|
3011
|
-
c = !0, u.disconnect(), o?.(),
|
|
2927
|
+
c = !0, u.disconnect(), o?.(), Mi.delete(e);
|
|
3012
2928
|
}
|
|
3013
|
-
}), () =>
|
|
2929
|
+
}), () => Pi(e);
|
|
3014
2930
|
}
|
|
3015
|
-
var
|
|
3016
|
-
let t =
|
|
2931
|
+
var Pi = (e) => {
|
|
2932
|
+
let t = Mi.get(e);
|
|
3017
2933
|
if (t && (--t.refs, !(t.refs > 0))) {
|
|
3018
2934
|
/* v8 ignore next 4 -- setTimeout exists in every runtime under test. */
|
|
3019
2935
|
if (typeof setTimeout != "function") {
|
|
@@ -3022,36 +2938,36 @@ var Ii = (e) => {
|
|
|
3022
2938
|
}
|
|
3023
2939
|
t.pendingDrop !== null && clearTimeout(t.pendingDrop), t.pendingDrop = setTimeout(t.dispose, 0);
|
|
3024
2940
|
}
|
|
3025
|
-
},
|
|
3026
|
-
let e =
|
|
3027
|
-
|
|
2941
|
+
}, Fi = !1, Ii = 0, Li = [], Ri = () => {
|
|
2942
|
+
let e = Li;
|
|
2943
|
+
Li = [];
|
|
3028
2944
|
for (let t of e) t();
|
|
3029
|
-
},
|
|
3030
|
-
if (
|
|
3031
|
-
|
|
2945
|
+
}, zi = (e) => /event-stream/i.test(e.headers.get("content-type") ?? ""), Bi = () => {
|
|
2946
|
+
if (Fi || typeof window > "u" || typeof window.fetch != "function") return;
|
|
2947
|
+
Fi = !0;
|
|
3032
2948
|
let e = window.fetch.bind(window);
|
|
3033
|
-
window.fetch = (...t) => e(...t).then((e) =>
|
|
3034
|
-
|
|
2949
|
+
window.fetch = (...t) => e(...t).then((e) => Ii <= 0 || zi(e) ? e : new Promise((t) => {
|
|
2950
|
+
Li.push(() => t(e));
|
|
3035
2951
|
}), (e) => {
|
|
3036
|
-
if (
|
|
2952
|
+
if (Ii <= 0) throw e;
|
|
3037
2953
|
return new Promise((t, n) => {
|
|
3038
|
-
|
|
2954
|
+
Li.push(() => n(e));
|
|
3039
2955
|
});
|
|
3040
2956
|
});
|
|
3041
|
-
},
|
|
3042
|
-
function
|
|
2957
|
+
}, Vi = 2e3;
|
|
2958
|
+
function Hi(e = Vi) {
|
|
3043
2959
|
/* v8 ignore next -- SSR guard: without fetch there is nothing to hold. */
|
|
3044
|
-
if (
|
|
3045
|
-
|
|
2960
|
+
if (Bi(), !Fi) return () => {};
|
|
2961
|
+
Ii += 1;
|
|
3046
2962
|
let t = !1, n = null, r = () => {
|
|
3047
|
-
t || (t = !0, n !== null && clearTimeout(n),
|
|
2963
|
+
t || (t = !0, n !== null && clearTimeout(n), Ii = Math.max(0, Ii - 1), Ii === 0 && Ri());
|
|
3048
2964
|
};
|
|
3049
|
-
return typeof setTimeout == "function" && (n = setTimeout(r, Math.max(
|
|
2965
|
+
return typeof setTimeout == "function" && (n = setTimeout(r, Math.max(Vi, e))), r;
|
|
3050
2966
|
}
|
|
3051
|
-
|
|
2967
|
+
Bi();
|
|
3052
2968
|
//#endregion
|
|
3053
2969
|
//#region src/core/engine/transitionPlayer.ts
|
|
3054
|
-
var
|
|
2970
|
+
var Ui = [
|
|
3055
2971
|
"x",
|
|
3056
2972
|
"y",
|
|
3057
2973
|
"z",
|
|
@@ -3062,7 +2978,7 @@ var Gi = [
|
|
|
3062
2978
|
"rotateX",
|
|
3063
2979
|
"rotateY",
|
|
3064
2980
|
"rotateZ"
|
|
3065
|
-
],
|
|
2981
|
+
], Wi = new Set(Ui), Gi = {
|
|
3066
2982
|
x: 0,
|
|
3067
2983
|
y: 0,
|
|
3068
2984
|
z: 0,
|
|
@@ -3073,7 +2989,7 @@ var Gi = [
|
|
|
3073
2989
|
rotateX: 0,
|
|
3074
2990
|
rotateY: 0,
|
|
3075
2991
|
rotateZ: 0
|
|
3076
|
-
},
|
|
2992
|
+
}, Ki = (e, t) => {
|
|
3077
2993
|
if (typeof t == "number") return {
|
|
3078
2994
|
value: t,
|
|
3079
2995
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -3092,18 +3008,18 @@ var Gi = [
|
|
|
3092
3008
|
value: i,
|
|
3093
3009
|
unit: a === "" && i === 0 ? "px" : a
|
|
3094
3010
|
};
|
|
3095
|
-
},
|
|
3096
|
-
let n = e.match(
|
|
3097
|
-
if (n.length !== r.length || e.replace(
|
|
3011
|
+
}, qi = /-?\d*\.?\d+/g, Ji = (e, t) => {
|
|
3012
|
+
let n = e.match(qi) ?? [], r = t.match(qi) ?? [];
|
|
3013
|
+
if (n.length !== r.length || e.replace(qi, " ") !== t.replace(qi, " ")) return null;
|
|
3098
3014
|
let i = n.map(Number), a = r.map(Number);
|
|
3099
3015
|
return (t) => {
|
|
3100
3016
|
let n = 0;
|
|
3101
|
-
return e.replace(
|
|
3017
|
+
return e.replace(qi, () => {
|
|
3102
3018
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
3103
3019
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
3104
3020
|
});
|
|
3105
3021
|
};
|
|
3106
|
-
},
|
|
3022
|
+
}, Yi = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Xi = (e) => typeof e == "object" && !!e && !Array.isArray(e), Zi = (e) => Xi(e) ? Object.keys(e) : [], Qi = (e, t) => Xi(e) ? e[t] : void 0, $i = {
|
|
3107
3023
|
x: 0,
|
|
3108
3024
|
y: 0,
|
|
3109
3025
|
z: 0,
|
|
@@ -3114,41 +3030,41 @@ var Gi = [
|
|
|
3114
3030
|
rotateX: 2,
|
|
3115
3031
|
rotateY: 2,
|
|
3116
3032
|
rotateZ: 2
|
|
3117
|
-
},
|
|
3033
|
+
}, ea = (e) => {
|
|
3118
3034
|
let t = 0, n = -1;
|
|
3119
3035
|
for (let r of e) {
|
|
3120
|
-
if (!
|
|
3121
|
-
let e =
|
|
3036
|
+
if (!Wi.has(r)) continue;
|
|
3037
|
+
let e = $i[r];
|
|
3122
3038
|
if (e < t) return !1;
|
|
3123
3039
|
if (t = e, e === 2) {
|
|
3124
|
-
let e =
|
|
3040
|
+
let e = Ui.indexOf(r);
|
|
3125
3041
|
if (e < n) return !1;
|
|
3126
3042
|
n = e;
|
|
3127
3043
|
}
|
|
3128
3044
|
}
|
|
3129
3045
|
return !0;
|
|
3130
|
-
},
|
|
3046
|
+
}, ta = (e) => {
|
|
3131
3047
|
let t = [];
|
|
3132
3048
|
for (let n of e) {
|
|
3133
|
-
if (!
|
|
3134
|
-
let e =
|
|
3049
|
+
if (!Wi.has(n)) continue;
|
|
3050
|
+
let e = $i[n] === 0 ? "T" : n;
|
|
3135
3051
|
(e !== "T" || t[t.length - 1] !== "T") && t.push(e);
|
|
3136
3052
|
}
|
|
3137
3053
|
return t;
|
|
3138
|
-
},
|
|
3139
|
-
let n =
|
|
3054
|
+
}, na = (e, t) => {
|
|
3055
|
+
let n = ta(e), r = ta(t), [i, a] = n.length <= r.length ? [n, r] : [r, n];
|
|
3140
3056
|
return i.every((e, t) => a[t] === e);
|
|
3141
|
-
},
|
|
3142
|
-
let n =
|
|
3143
|
-
if (!
|
|
3057
|
+
}, ra = (e, t) => {
|
|
3058
|
+
let n = Zi(e.from), r = Zi(e.to);
|
|
3059
|
+
if (!ea(n) || !ea(r) || !na(n, r)) return null;
|
|
3144
3060
|
let i = /* @__PURE__ */ new Set([...n, ...r]), a = [], o = null, s = [], c = [];
|
|
3145
3061
|
for (let n of i) {
|
|
3146
|
-
let r =
|
|
3147
|
-
if (
|
|
3062
|
+
let r = Qi(e.from, n), i = Qi(e.to, n);
|
|
3063
|
+
if (Wi.has(n)) {
|
|
3148
3064
|
let e = n, o = {
|
|
3149
|
-
value:
|
|
3065
|
+
value: Gi[e],
|
|
3150
3066
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
3151
|
-
}, s = r === void 0 ? o :
|
|
3067
|
+
}, s = r === void 0 ? o : Ki(e, r), c = i === void 0 ? o : Ki(e, i);
|
|
3152
3068
|
if (!s || !c || s.unit !== c.unit && s.value !== 0 && c.value !== 0) return null;
|
|
3153
3069
|
let l = s.value === 0 && s.unit !== c.unit ? c.unit : s.unit, u = l === "%", d = 0;
|
|
3154
3070
|
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), a.push({
|
|
@@ -3179,15 +3095,15 @@ var Gi = [
|
|
|
3179
3095
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
3180
3096
|
if (l === u) {
|
|
3181
3097
|
c.push({
|
|
3182
|
-
property:
|
|
3098
|
+
property: Yi(n),
|
|
3183
3099
|
value: l
|
|
3184
3100
|
});
|
|
3185
3101
|
continue;
|
|
3186
3102
|
}
|
|
3187
|
-
let d =
|
|
3103
|
+
let d = Ji(l, u);
|
|
3188
3104
|
if (!d) return null;
|
|
3189
3105
|
s.push({
|
|
3190
|
-
property:
|
|
3106
|
+
property: Yi(n),
|
|
3191
3107
|
mix: d
|
|
3192
3108
|
});
|
|
3193
3109
|
}
|
|
@@ -3197,26 +3113,26 @@ var Gi = [
|
|
|
3197
3113
|
strings: s,
|
|
3198
3114
|
constants: c
|
|
3199
3115
|
};
|
|
3200
|
-
},
|
|
3201
|
-
if (!
|
|
3116
|
+
}, ia = 1, aa = 1e3 / 60, oa = (e) => !L() && e > 0 && e < 3, sa = .6, ca = 600, la = (e, t) => {
|
|
3117
|
+
if (!it()) return !1;
|
|
3202
3118
|
for (let n of e.transforms) {
|
|
3203
3119
|
if (n.prop !== "x" && n.prop !== "y") continue;
|
|
3204
3120
|
let e = Math.abs(n.to.value - n.from.value);
|
|
3205
3121
|
if (n.from.unit === "%") {
|
|
3206
|
-
if (e / 100 >=
|
|
3207
|
-
} else if (e * Math.max(1, t) >=
|
|
3122
|
+
if (e / 100 >= sa) return !1;
|
|
3123
|
+
} else if (e * Math.max(1, t) >= ca) return !1;
|
|
3208
3124
|
}
|
|
3209
3125
|
return !0;
|
|
3210
|
-
},
|
|
3126
|
+
}, ua = 12, da = (e, t, n, r, i = aa) => {
|
|
3211
3127
|
let a = 0, o = 0, s = !1, c = [], l = !0;
|
|
3212
|
-
for (let u of
|
|
3128
|
+
for (let u of Ui) {
|
|
3213
3129
|
let d = e.find((e) => e.prop === u);
|
|
3214
3130
|
if (!d) continue;
|
|
3215
3131
|
let f = d.from.value + (d.to.value - d.from.value) * t;
|
|
3216
3132
|
if (d.from.unit === "%" && (f *= d.percentBase), u === "x" || u === "y") {
|
|
3217
|
-
let e = u === "x" ? r.x : r.y, t =
|
|
3133
|
+
let e = u === "x" ? r.x : r.y, t = Ct(), c = e === null ? Infinity : Math.abs(f - e) * n, p = t === null && r.glide === !0, m = p ? !1 : t === "always" || t === null && oa(n) ? !0 : t === "off" ? !1 : t === "hybrid" ? c >= Tt() : e === null || c * aa / Math.max(1, i) >= ia, h = d.to.value;
|
|
3218
3134
|
d.from.unit === "%" && (h *= d.percentBase);
|
|
3219
|
-
let g = u === "x" ? "landingX" : "landingY", _ = r[g], v = Math.abs(f - h) * n, y = e === null ? Infinity : Math.abs(f - e) * n, b = !p && n > 0 && (_ != null || y < 1 && v <=
|
|
3135
|
+
let g = u === "x" ? "landingX" : "landingY", _ = r[g], v = Math.abs(f - h) * n, y = e === null ? Infinity : Math.abs(f - e) * n, b = !p && n > 0 && (_ != null || y < 1 && v <= ua), x = u === "x" ? "writtenX" : "writtenY", S;
|
|
3220
3136
|
if (b) {
|
|
3221
3137
|
let e = _ ?? r[x] ?? f, t = 1 / n, i = Math.abs(h - e) <= t + 1e-6 ? h : e + Math.sign(h - e) * t;
|
|
3222
3138
|
S = Math.round(i * 1e3) / 1e3, r[g] = i, r[x] = null, i !== h && (r.pendingLanding = !0);
|
|
@@ -3224,42 +3140,42 @@ var Gi = [
|
|
|
3224
3140
|
u === "x" ? (r.x = f, a = S) : (r.y = f, o = S), s = !0, S !== 0 && (l = !1);
|
|
3225
3141
|
continue;
|
|
3226
3142
|
}
|
|
3227
|
-
let p =
|
|
3143
|
+
let p = Gi[u];
|
|
3228
3144
|
f !== p && (l = !1), u === "z" ? c.push(`translateZ(${f}px)`) : u === "scale" ? c.push(`scale(${f})`) : u === "scaleX" ? c.push(`scaleX(${f})`) : u === "scaleY" ? c.push(`scaleY(${f})`) : u === "rotate" || u === "rotateZ" ? c.push(`rotate(${f}deg)`) : u === "rotateX" ? c.push(`rotateX(${f}deg)`) : u === "rotateY" && c.push(`rotateY(${f}deg)`);
|
|
3229
3145
|
}
|
|
3230
3146
|
return !s && c.length === 0 ? "" : l ? "none" : [...s ? [`translate3d(${a}px, ${o}px, 0)`] : [], ...c].join(" ");
|
|
3231
|
-
},
|
|
3147
|
+
}, fa = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), pa = (e) => {
|
|
3232
3148
|
let t = {};
|
|
3233
|
-
for (let n of
|
|
3149
|
+
for (let n of xn(e)) t[fa(n.property)] = n.value;
|
|
3234
3150
|
return t;
|
|
3235
|
-
},
|
|
3151
|
+
}, ma = (e, t) => {
|
|
3236
3152
|
if (typeof e.animate != "function") return null;
|
|
3237
3153
|
try {
|
|
3238
|
-
let n = e.animate([
|
|
3154
|
+
let n = e.animate([pa(t.from), pa(t.to)], {
|
|
3239
3155
|
duration: Math.max(0, t.duration * 1e3),
|
|
3240
3156
|
delay: Math.max(0, t.delay * 1e3),
|
|
3241
|
-
easing:
|
|
3157
|
+
easing: Sn(t.ease),
|
|
3242
3158
|
fill: "both"
|
|
3243
3159
|
});
|
|
3244
3160
|
return n.pause(), n.currentTime = 0, n;
|
|
3245
3161
|
} catch {
|
|
3246
3162
|
return null;
|
|
3247
3163
|
}
|
|
3248
|
-
},
|
|
3249
|
-
Number.isFinite(e) && (e <
|
|
3250
|
-
},
|
|
3164
|
+
}, ha = 1.6, ga = 1e3 / 600, _a = 28, va = 42, ya = aa, ba = () => ya, xa = (e) => {
|
|
3165
|
+
Number.isFinite(e) && (e < ga || e > va || (ya = Math.min(aa, Math.max(ga, e))));
|
|
3166
|
+
}, Sa = () => ({
|
|
3251
3167
|
request: (e) => requestAnimationFrame(e),
|
|
3252
3168
|
cancel: (e) => cancelAnimationFrame(e),
|
|
3253
3169
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
3254
|
-
}),
|
|
3170
|
+
}), Ca = ((e = Sa()) => {
|
|
3255
3171
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
3256
3172
|
join: (n, r) => {
|
|
3257
|
-
let i =
|
|
3173
|
+
let i = yt() === "scrub", s = !i && !L() && xt() === "on" && r.status !== "PUSHING" && r.status !== "REPLACING", c = i ? null : ra(r.motion, r.element), l = !c || s ? ma(r.element, r.motion) : null, u = l ? null : c;
|
|
3258
3174
|
if (!u && !l) return null;
|
|
3259
3175
|
let d = t.get(n);
|
|
3260
3176
|
d || (d = {
|
|
3261
3177
|
tracks: [],
|
|
3262
|
-
frameIntervalMs:
|
|
3178
|
+
frameIntervalMs: ya,
|
|
3263
3179
|
recentGaps: [],
|
|
3264
3180
|
navCutMs: null,
|
|
3265
3181
|
navComplete: null,
|
|
@@ -3283,19 +3199,19 @@ var Gi = [
|
|
|
3283
3199
|
snapMemory: {
|
|
3284
3200
|
x: null,
|
|
3285
3201
|
y: null,
|
|
3286
|
-
glide: u ?
|
|
3202
|
+
glide: u ? la(u, e.devicePixelRatio() || 1) : !1
|
|
3287
3203
|
}
|
|
3288
3204
|
};
|
|
3289
3205
|
d.tracks.push(p), d.navCutMs = d.tracks.some((e) => e.cutMs === null) ? null : Math.max(...d.tracks.map((e) => e.cutMs));
|
|
3290
3206
|
let m = Symbol("flemo-player-track");
|
|
3291
|
-
if (
|
|
3292
|
-
u.transforms.length > 0 &&
|
|
3293
|
-
for (let e of u.strings)
|
|
3294
|
-
for (let e of u.constants)
|
|
3207
|
+
if (Zn(p.element, m), U(p.element, "animation", m), p.element.style.animation = "none", u) {
|
|
3208
|
+
u.transforms.length > 0 && U(p.element, "transform", m), u.opacity && U(p.element, "opacity", m);
|
|
3209
|
+
for (let e of u.strings) U(p.element, e.property, m);
|
|
3210
|
+
for (let e of u.constants) U(p.element, e.property, m);
|
|
3295
3211
|
a(p, 0);
|
|
3296
3212
|
}
|
|
3297
3213
|
return r.role === "active" && (r.onComplete && (d.navComplete = r.onComplete), d.started || (d.started = !0, o(n, d))), () => {
|
|
3298
|
-
p.detached = !0, p.scrub?.cancel(),
|
|
3214
|
+
p.detached = !0, p.scrub?.cancel(), W(p.element, void 0, m);
|
|
3299
3215
|
let r = t.get(n);
|
|
3300
3216
|
r && (r.tracks = r.tracks.filter((e) => e !== p), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
3301
3217
|
};
|
|
@@ -3316,7 +3232,7 @@ var Gi = [
|
|
|
3316
3232
|
let { element: i, parsed: a } = t;
|
|
3317
3233
|
if (!(!a || !i.isConnected)) {
|
|
3318
3234
|
if (a.transforms.length > 0) {
|
|
3319
|
-
let o =
|
|
3235
|
+
let o = da(a.transforms, n, e.devicePixelRatio(), t.snapMemory, r);
|
|
3320
3236
|
o !== "" && (i.style.transform = o);
|
|
3321
3237
|
}
|
|
3322
3238
|
if (a.opacity) {
|
|
@@ -3337,10 +3253,10 @@ var Gi = [
|
|
|
3337
3253
|
if (c - u <= 0 || !r.remainderPlan || !(1 - i(r)(c > 0 ? u / c : 0) > .001)) return r.handoff = !1, !1;
|
|
3338
3254
|
let d;
|
|
3339
3255
|
try {
|
|
3340
|
-
d = o.animate([
|
|
3256
|
+
d = o.animate([pa(r.motion.from), pa(r.motion.to)], {
|
|
3341
3257
|
duration: c,
|
|
3342
3258
|
delay: -u,
|
|
3343
|
-
easing:
|
|
3259
|
+
easing: Sn(r.motion.ease),
|
|
3344
3260
|
fill: "both"
|
|
3345
3261
|
});
|
|
3346
3262
|
} catch {
|
|
@@ -3354,12 +3270,12 @@ var Gi = [
|
|
|
3354
3270
|
let l = r.startTime ?? c;
|
|
3355
3271
|
if (r.lastTime !== null) {
|
|
3356
3272
|
let e = c - r.lastTime;
|
|
3357
|
-
if (n.onFrameGap?.(e), e >=
|
|
3273
|
+
if (n.onFrameGap?.(e), e >= ga && e <= va) {
|
|
3358
3274
|
r.recentGaps.push(e), r.recentGaps.length > 7 && r.recentGaps.shift();
|
|
3359
|
-
let t = [...r.recentGaps].sort((e, t) => e - t), n = t[Math.floor(t.length / 2)], i = r.recentGaps.length >= 4 && r.recentGaps.every((e) => e >=
|
|
3360
|
-
r.frameIntervalMs = Math.min(i ?
|
|
3275
|
+
let t = [...r.recentGaps].sort((e, t) => e - t), n = t[Math.floor(t.length / 2)], i = r.recentGaps.length >= 4 && r.recentGaps.every((e) => e >= _a);
|
|
3276
|
+
r.frameIntervalMs = Math.min(i ? va : aa, Math.max(ga, n)), ya = r.frameIntervalMs, n < 12 && nt(n, t[t.length - 1]);
|
|
3361
3277
|
}
|
|
3362
|
-
e >
|
|
3278
|
+
e > ha * r.frameIntervalMs && (l += e - r.frameIntervalMs);
|
|
3363
3279
|
}
|
|
3364
3280
|
r.startTime = l, r.lastTime = c;
|
|
3365
3281
|
let u = !0, d = !1;
|
|
@@ -3380,7 +3296,7 @@ var Gi = [
|
|
|
3380
3296
|
continue;
|
|
3381
3297
|
}
|
|
3382
3298
|
let i = o + n, a = Math.min(Math.max(0, f), i);
|
|
3383
|
-
if (t.handoff && f >=
|
|
3299
|
+
if (t.handoff && f >= Dt() && f < i && s(e, r, t, a)) {
|
|
3384
3300
|
u = !1;
|
|
3385
3301
|
continue;
|
|
3386
3302
|
}
|
|
@@ -3398,7 +3314,7 @@ var Gi = [
|
|
|
3398
3314
|
}
|
|
3399
3315
|
return n;
|
|
3400
3316
|
})();
|
|
3401
|
-
|
|
3317
|
+
Ca.onFrameGap = (e) => {
|
|
3402
3318
|
if (typeof window < "u") {
|
|
3403
3319
|
let t = window.__flemoPlayerGaps ??= [];
|
|
3404
3320
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -3406,102 +3322,102 @@ Ta.onFrameGap = (e) => {
|
|
|
3406
3322
|
};
|
|
3407
3323
|
//#endregion
|
|
3408
3324
|
//#region src/core/engine/types.ts
|
|
3409
|
-
var
|
|
3325
|
+
var wa = "data-flemo-skip-animation", $ = () => {}, Ta = 400, Ea = 4, Da = 100, Oa = 1500, ka = "data-flemo-part-name", Aa = /* @__PURE__ */ new WeakMap(), ja = "data-flemo-anim-hold", Ma = (e) => {
|
|
3410
3326
|
let t = e.parentElement ?? e;
|
|
3411
|
-
return Array.from(t.querySelectorAll(`[${
|
|
3327
|
+
return Array.from(t.querySelectorAll(`[${ka}]`)).filter((n) => {
|
|
3412
3328
|
let r = n.closest("[data-flemo-screen]");
|
|
3413
3329
|
return !r || r === e || !t.contains(r);
|
|
3414
3330
|
});
|
|
3415
|
-
},
|
|
3331
|
+
}, Na = (e, t) => {
|
|
3416
3332
|
let [n, r] = t.split("-");
|
|
3417
|
-
return
|
|
3418
|
-
},
|
|
3333
|
+
return Ma(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
3334
|
+
}, Pa = (e, t) => {
|
|
3419
3335
|
let n = e.closest("[data-flemo-router]")?.getAttribute("data-flemo-router") ?? null;
|
|
3420
|
-
return Array.from(e.ownerDocument.querySelectorAll(`[${
|
|
3336
|
+
return Array.from(e.ownerDocument.querySelectorAll(`[${ka}][data-flemo-status="${t}"]`)).filter((e) => {
|
|
3421
3337
|
if (n === null) return !0;
|
|
3422
3338
|
let t = e.closest("[data-flemo-router]");
|
|
3423
3339
|
return !t || t.getAttribute("data-flemo-router") === n;
|
|
3424
3340
|
});
|
|
3425
|
-
},
|
|
3341
|
+
}, Fa = (e, t) => Pa(e, t).filter((e) => e.parentElement?.closest(`[${ja}]`) == null), Ia = (e) => {
|
|
3426
3342
|
let t = e.closest("[data-flemo-router]")?.getAttribute("data-flemo-router") ?? null;
|
|
3427
|
-
return Array.from(e.ownerDocument.querySelectorAll(`[${
|
|
3428
|
-
if (e.parentElement?.closest(`[${
|
|
3343
|
+
return Array.from(e.ownerDocument.querySelectorAll(`[${ka}][${ja}]`)).filter((e) => {
|
|
3344
|
+
if (e.parentElement?.closest(`[${ja}]`) != null) return !1;
|
|
3429
3345
|
if (t === null) return !0;
|
|
3430
3346
|
let n = e.closest("[data-flemo-router]");
|
|
3431
3347
|
return !n || n.getAttribute("data-flemo-router") === t;
|
|
3432
3348
|
});
|
|
3433
|
-
},
|
|
3349
|
+
}, La = (e, t, n) => {
|
|
3434
3350
|
let r = 0;
|
|
3435
3351
|
for (let e of [`${n}-true`, `${n}-false`]) {
|
|
3436
|
-
if (!
|
|
3352
|
+
if (!H(t, e)) continue;
|
|
3437
3353
|
let n = B(t, e);
|
|
3438
3354
|
n && (r = Math.max(r, (n.delay + n.duration) * 1e3));
|
|
3439
3355
|
}
|
|
3440
|
-
for (let t of
|
|
3441
|
-
let e = z.get(t.getAttribute(
|
|
3442
|
-
if (!e || !
|
|
3356
|
+
for (let t of Pa(e, n)) {
|
|
3357
|
+
let e = z.get(t.getAttribute(ka)), i = `${n}-${t.getAttribute("data-flemo-active")}`;
|
|
3358
|
+
if (!e || !H(e, i)) continue;
|
|
3443
3359
|
let a = B(e, i);
|
|
3444
3360
|
a && (r = Math.max(r, (a.delay + a.duration) * 1e3));
|
|
3445
3361
|
}
|
|
3446
|
-
let i = t.decoratorName ?
|
|
3362
|
+
let i = t.decoratorName ? Zt.get(t.decoratorName) : void 0;
|
|
3447
3363
|
if (i) for (let e of [`${n}-true`, `${n}-false`]) {
|
|
3448
|
-
if (!
|
|
3364
|
+
if (!H(i, e)) continue;
|
|
3449
3365
|
let t = B(i, e);
|
|
3450
3366
|
t && (r = Math.max(r, (t.delay + t.duration) * 1e3));
|
|
3451
3367
|
}
|
|
3452
3368
|
return r;
|
|
3453
|
-
},
|
|
3454
|
-
|
|
3455
|
-
},
|
|
3456
|
-
|
|
3457
|
-
},
|
|
3458
|
-
if (
|
|
3459
|
-
|
|
3460
|
-
let e = ++
|
|
3461
|
-
if (e !==
|
|
3462
|
-
if (r !== null && (n > 0 ? --n : t.push(a - r)), r = a, t.length <
|
|
3369
|
+
}, Ra = (e) => e === "POPPING" && !lt() || e === "PUSHING" && ct() && !lt(), za = 12, Ba = null, Va = () => {
|
|
3370
|
+
Ba = typeof requestAnimationFrame == "function" ? requestAnimationFrame(Va) : null;
|
|
3371
|
+
}, Ha = () => (Ba === null && typeof requestAnimationFrame == "function" && (Ba = requestAnimationFrame(Va)), $), Ua = !1, Wa = 0, Ga = () => {
|
|
3372
|
+
Ua &&= (Wa += 1, !1);
|
|
3373
|
+
}, Ka = 2, qa = 8, Ja = () => {
|
|
3374
|
+
if (Ua || typeof requestAnimationFrame != "function") return;
|
|
3375
|
+
Ua = !0;
|
|
3376
|
+
let e = ++Wa, t = [], n = Ka, r = null, i = (a) => {
|
|
3377
|
+
if (e !== Wa) return;
|
|
3378
|
+
if (r !== null && (n > 0 ? --n : t.push(a - r)), r = a, t.length < qa) {
|
|
3463
3379
|
requestAnimationFrame(i);
|
|
3464
3380
|
return;
|
|
3465
3381
|
}
|
|
3466
|
-
|
|
3382
|
+
Ua = !1;
|
|
3467
3383
|
let o = [...t].sort((e, t) => e - t), s = o[Math.floor(o.length / 2)];
|
|
3468
|
-
|
|
3384
|
+
xa(s), nt(s, o[o.length - 1]);
|
|
3469
3385
|
};
|
|
3470
3386
|
requestAnimationFrame(i);
|
|
3471
|
-
},
|
|
3472
|
-
let { scope: i, decorator: a, bars: o } = e, s = n.split("-")[0], c = s === "PUSHING" || s === "REPLACING", l =
|
|
3473
|
-
if (
|
|
3474
|
-
|
|
3387
|
+
}, Ya = (e, t, n, r) => {
|
|
3388
|
+
let { scope: i, decorator: a, bars: o } = e, s = n.split("-")[0], c = s === "PUSHING" || s === "REPLACING", l = L() && at(), u = !l && L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && ba() < za, d = (l || u) && typeof window < "u" && window.devicePixelRatio || 1, f = (e, t) => e ? l ? li(e, t, d) : u ? di(e, t, d, ba()) : null : null;
|
|
3389
|
+
if (H(t, n)) {
|
|
3390
|
+
Z(i, t, c, r);
|
|
3475
3391
|
let e = f(B(t, n) ?? null, i);
|
|
3476
|
-
e && (
|
|
3477
|
-
for (let n of o ?? []) n?.getAttribute("data-flemo-bar-riding") === "true" && (
|
|
3392
|
+
e && (U(i, "animation-timing-function", r), i.style.animationTimingFunction = e);
|
|
3393
|
+
for (let n of o ?? []) n?.getAttribute("data-flemo-bar-riding") === "true" && (Z(n, t, c, r), e && (U(n, "animation-timing-function", r), n.style.animationTimingFunction = e));
|
|
3478
3394
|
}
|
|
3479
3395
|
if (a && t.decoratorName) {
|
|
3480
|
-
let e =
|
|
3481
|
-
e &&
|
|
3396
|
+
let e = Zt.get(t.decoratorName);
|
|
3397
|
+
e && H(e, n) && Z(a, e, c, r);
|
|
3482
3398
|
}
|
|
3483
|
-
for (let e of
|
|
3484
|
-
let t = z.get(e.getAttribute(
|
|
3485
|
-
if (t &&
|
|
3486
|
-
|
|
3399
|
+
for (let e of Na(i, n)) {
|
|
3400
|
+
let t = z.get(e.getAttribute(ka));
|
|
3401
|
+
if (t && H(t, n)) {
|
|
3402
|
+
Z(e, t, c, r);
|
|
3487
3403
|
let i = f(B(t, n) ?? null, e);
|
|
3488
|
-
i && (
|
|
3404
|
+
i && (U(e, "animation-timing-function", r), e.style.animationTimingFunction = i);
|
|
3489
3405
|
}
|
|
3490
3406
|
}
|
|
3491
|
-
},
|
|
3407
|
+
}, Xa = (e, t) => {
|
|
3492
3408
|
let { scope: n, decorator: r, bars: i } = e;
|
|
3493
3409
|
if (n) {
|
|
3494
|
-
|
|
3495
|
-
for (let e of
|
|
3410
|
+
Q(n, t);
|
|
3411
|
+
for (let e of Ma(n)) Q(e, t);
|
|
3496
3412
|
}
|
|
3497
|
-
r &&
|
|
3498
|
-
for (let e of i ?? []) e &&
|
|
3499
|
-
},
|
|
3413
|
+
r && Q(r, t);
|
|
3414
|
+
for (let e of i ?? []) e && Q(e, t);
|
|
3415
|
+
}, Za = 4, Qa = (e) => `${Math.round(e * 1e3) / 1e3}s`, $a = (e) => {
|
|
3500
3416
|
let { element: t, expectedName: n, motion: r } = e, i = !1, a = !1, o = (n) => {
|
|
3501
|
-
i = !0, t.style.animation = "none", t.offsetWidth, t.style.removeProperty("animation"), n.mode === "clear" ? (t.style.removeProperty("animation-delay"), a = !1) : n.mode === "set" && (
|
|
3417
|
+
i = !0, t.style.animation = "none", t.offsetWidth, t.style.removeProperty("animation"), n.mode === "clear" ? (t.style.removeProperty("animation-delay"), a = !1) : n.mode === "set" && (U(t, "animation-delay", e.writer), t.style.animationDelay = Qa(n.seconds), a = !0), i = !1;
|
|
3502
3418
|
}, s = (a) => {
|
|
3503
|
-
if (i || a.target !== t || !
|
|
3504
|
-
if (!e.isLive() || e.budgetUsed() >=
|
|
3419
|
+
if (i || a.target !== t || !kn(a.animationName, n)) return;
|
|
3420
|
+
if (!e.isLive() || e.budgetUsed() >= Za) {
|
|
3505
3421
|
e.onTerminal();
|
|
3506
3422
|
return;
|
|
3507
3423
|
}
|
|
@@ -3524,15 +3440,15 @@ var Ea = "data-flemo-skip-animation", $ = () => {}, Da = 400, Oa = 4, ka = 100,
|
|
|
3524
3440
|
t.addEventListener("animationcancel", s);
|
|
3525
3441
|
},
|
|
3526
3442
|
detach: () => {
|
|
3527
|
-
t.removeEventListener("animationcancel", s), a &&= (
|
|
3443
|
+
t.removeEventListener("animationcancel", s), a &&= (W(t, ["animation-delay"], e.writer), !1);
|
|
3528
3444
|
},
|
|
3529
3445
|
fullRestart: () => {
|
|
3530
3446
|
o({ mode: "clear" });
|
|
3531
3447
|
}
|
|
3532
3448
|
};
|
|
3533
3449
|
};
|
|
3534
|
-
function
|
|
3535
|
-
|
|
3450
|
+
function eo(e) {
|
|
3451
|
+
We();
|
|
3536
3452
|
let t = Symbol("flemo-engine-layer"), n = /* @__PURE__ */ new Map(), r = null, i = null, a = null, o = null, c = null, l = () => {
|
|
3537
3453
|
if (!c) return;
|
|
3538
3454
|
let { land: e, cancel: t } = c;
|
|
@@ -3557,20 +3473,20 @@ function no(e) {
|
|
|
3557
3473
|
let { getElements: d, transitionName: f, prevTransitionName: p, status: m, isActive: h, animHoldReleased: g } = c, _ = m === "PUSHING" || m === "POPPING" || m === "REPLACING";
|
|
3558
3474
|
if (h) {
|
|
3559
3475
|
let { scope: e } = d();
|
|
3560
|
-
if (e) if (_ && !g) for (let t of
|
|
3561
|
-
else for (let t of
|
|
3476
|
+
if (e) if (_ && !g) for (let t of Fa(e, m)) t.setAttribute(ja, "true");
|
|
3477
|
+
else for (let t of Ia(e)) t.removeAttribute(ja);
|
|
3562
3478
|
}
|
|
3563
3479
|
if (_) {
|
|
3564
3480
|
let { scope: e, bars: n } = d();
|
|
3565
3481
|
if (e) {
|
|
3566
|
-
|
|
3567
|
-
for (let n of
|
|
3568
|
-
for (let e of n ?? []) e &&
|
|
3482
|
+
Qn(e), W(e, ["animation-timing-function", "animation-duration"], t);
|
|
3483
|
+
for (let n of Ma(e)) W(n, ["animation-timing-function", "animation-duration"], t);
|
|
3484
|
+
for (let e of n ?? []) e && W(e, ["animation-timing-function", "animation-duration"], t);
|
|
3569
3485
|
}
|
|
3570
3486
|
}
|
|
3571
3487
|
_ && (Rr(), o &&= (clearTimeout(o), null), a ||= Fr()), !_ && a && !o && (typeof setTimeout == "function" ? o = setTimeout(() => {
|
|
3572
3488
|
o = null, a?.(), a = null;
|
|
3573
|
-
},
|
|
3489
|
+
}, Ta) : (a(), a = null));
|
|
3574
3490
|
let v = _ && (h ? m === "PUSHING" || m === "REPLACING" : m === "POPPING"), y = _ && !v;
|
|
3575
3491
|
if (!y && i) {
|
|
3576
3492
|
let e = i;
|
|
@@ -3580,39 +3496,39 @@ function no(e) {
|
|
|
3580
3496
|
let e = r;
|
|
3581
3497
|
r = null, _ ? e() : u(e);
|
|
3582
3498
|
}
|
|
3583
|
-
if (v && !r &&
|
|
3499
|
+
if (v && !r && ut()) {
|
|
3584
3500
|
l();
|
|
3585
3501
|
let { scope: e } = d();
|
|
3586
3502
|
if (e) {
|
|
3587
|
-
|
|
3588
|
-
let t =
|
|
3503
|
+
Zn(e);
|
|
3504
|
+
let t = Cr(e), n = Jr(e), i = La(e, Kt(f), m), a = Hi(i + Oa), o = ot() === "on" ? Wr(e, i + Oa) : $, s = nr();
|
|
3589
3505
|
r = () => {
|
|
3590
3506
|
a(), o(), n(), t(), s();
|
|
3591
3507
|
};
|
|
3592
3508
|
}
|
|
3593
3509
|
}
|
|
3594
|
-
if (y && !i &&
|
|
3510
|
+
if (y && !i && ut()) {
|
|
3595
3511
|
l();
|
|
3596
3512
|
let { scope: e } = d();
|
|
3597
|
-
e &&
|
|
3513
|
+
e && ot() === "on" && (i = Wr(e, La(e, Kt(f), m) + Oa, !0));
|
|
3598
3514
|
}
|
|
3599
3515
|
let b = (t, n, r) => {
|
|
3600
3516
|
let i = e.getTransitionTaskId();
|
|
3601
|
-
if (!i || (
|
|
3602
|
-
if (
|
|
3603
|
-
if (
|
|
3604
|
-
if (!
|
|
3605
|
-
if (!
|
|
3517
|
+
if (!i || (ve.pinnedDriver(), L() && s.pendingTaskIds.some((e) => e !== i))) return null;
|
|
3518
|
+
if (L() && ve.pinnedDriver() !== "raf") return Ja(), null;
|
|
3519
|
+
if (ge() || !L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && Ra(t.split("-")[0])) return null;
|
|
3520
|
+
if (!L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && He() && (m === "REPLACING" || m === "POPPING" || m === "PUSHING")) return Ue(), null;
|
|
3521
|
+
if (!ve.playerAllowed()) return null;
|
|
3606
3522
|
let { scope: a, decorator: o, bars: c } = d();
|
|
3607
3523
|
if (!a) return null;
|
|
3608
|
-
let l =
|
|
3609
|
-
if (
|
|
3524
|
+
let l = Kt(f);
|
|
3525
|
+
if (ve.pinnedDriver() !== "raf") {
|
|
3610
3526
|
let e = t.split("-")[0];
|
|
3611
|
-
if (
|
|
3527
|
+
if (vi(l, e, a) === "native") return null;
|
|
3612
3528
|
}
|
|
3613
3529
|
let u = B(l, t);
|
|
3614
3530
|
if (!u) return null;
|
|
3615
|
-
let p = [], h =
|
|
3531
|
+
let p = [], h = Ca.join(i, {
|
|
3616
3532
|
element: a,
|
|
3617
3533
|
motion: u,
|
|
3618
3534
|
role: n,
|
|
@@ -3623,7 +3539,7 @@ function no(e) {
|
|
|
3623
3539
|
p.push(h);
|
|
3624
3540
|
for (let e of c ?? []) {
|
|
3625
3541
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
3626
|
-
let n =
|
|
3542
|
+
let n = Ca.join(i, {
|
|
3627
3543
|
element: e,
|
|
3628
3544
|
motion: u,
|
|
3629
3545
|
role: "passive",
|
|
@@ -3632,9 +3548,9 @@ function no(e) {
|
|
|
3632
3548
|
n && p.push(n);
|
|
3633
3549
|
}
|
|
3634
3550
|
if (o && l.decoratorName) {
|
|
3635
|
-
let e =
|
|
3551
|
+
let e = Zt.get(l.decoratorName), n = e ? B(e, t) : null;
|
|
3636
3552
|
if (n) {
|
|
3637
|
-
let e =
|
|
3553
|
+
let e = Ca.join(i, {
|
|
3638
3554
|
element: o,
|
|
3639
3555
|
motion: n,
|
|
3640
3556
|
role: "passive",
|
|
@@ -3643,10 +3559,10 @@ function no(e) {
|
|
|
3643
3559
|
e && p.push(e);
|
|
3644
3560
|
}
|
|
3645
3561
|
}
|
|
3646
|
-
for (let e of
|
|
3647
|
-
let n = z.get(e.getAttribute(
|
|
3562
|
+
for (let e of Na(a, t)) {
|
|
3563
|
+
let n = z.get(e.getAttribute(ka)), r = n ? B(n, t) : null;
|
|
3648
3564
|
if (!r) continue;
|
|
3649
|
-
let a =
|
|
3565
|
+
let a = Ca.join(i, {
|
|
3650
3566
|
element: e,
|
|
3651
3567
|
motion: r,
|
|
3652
3568
|
role: "passive"
|
|
@@ -3655,8 +3571,8 @@ function no(e) {
|
|
|
3655
3571
|
}
|
|
3656
3572
|
return () => p.forEach((e) => e());
|
|
3657
3573
|
}, x = (e, n) => {
|
|
3658
|
-
let r = [], { decorator: i, bars: a } = d(), o =
|
|
3659
|
-
let a = 0, o =
|
|
3574
|
+
let r = [], { decorator: i, bars: a } = d(), o = Kt(f), s = (e, n, i) => {
|
|
3575
|
+
let a = 0, o = $a({
|
|
3660
3576
|
element: e,
|
|
3661
3577
|
expectedName: n,
|
|
3662
3578
|
motion: i,
|
|
@@ -3669,15 +3585,15 @@ function no(e) {
|
|
|
3669
3585
|
onTerminal: $
|
|
3670
3586
|
});
|
|
3671
3587
|
o.attach(), r.push(o.detach);
|
|
3672
|
-
}, c =
|
|
3588
|
+
}, c = Dn("screen", f, n), l = B(o, n);
|
|
3673
3589
|
if (l) for (let e of a ?? []) !e || e.getAttribute("data-flemo-bar-riding") !== "true" || s(e, c, l);
|
|
3674
3590
|
if (i && o.decoratorName) {
|
|
3675
|
-
let e =
|
|
3676
|
-
t && s(i,
|
|
3591
|
+
let e = Zt.get(o.decoratorName), t = e ? B(e, n) : null;
|
|
3592
|
+
t && s(i, Dn("decorator", o.decoratorName, n), t);
|
|
3677
3593
|
}
|
|
3678
|
-
for (let t of
|
|
3679
|
-
let e = t.getAttribute(
|
|
3680
|
-
i && s(t,
|
|
3594
|
+
for (let t of Na(e, n)) {
|
|
3595
|
+
let e = t.getAttribute(ka), r = z.get(e), i = r ? B(r, n) : null;
|
|
3596
|
+
i && s(t, Dn("part", e, n), i);
|
|
3681
3597
|
}
|
|
3682
3598
|
return r;
|
|
3683
3599
|
};
|
|
@@ -3685,12 +3601,12 @@ function no(e) {
|
|
|
3685
3601
|
if (m === "COMPLETED") {
|
|
3686
3602
|
let { scope: e, decorator: n, bars: r } = d();
|
|
3687
3603
|
if (e) {
|
|
3688
|
-
|
|
3689
|
-
for (let t of
|
|
3604
|
+
W(e);
|
|
3605
|
+
for (let t of Ma(e)) W(t);
|
|
3690
3606
|
}
|
|
3691
|
-
n &&
|
|
3692
|
-
for (let e of r ?? []) e &&
|
|
3693
|
-
return
|
|
3607
|
+
n && W(n);
|
|
3608
|
+
for (let e of r ?? []) e && W(e, void 0, t);
|
|
3609
|
+
return Xa({
|
|
3694
3610
|
scope: e,
|
|
3695
3611
|
decorator: n,
|
|
3696
3612
|
bars: r ?? []
|
|
@@ -3698,22 +3614,22 @@ function no(e) {
|
|
|
3698
3614
|
}
|
|
3699
3615
|
if (m === "REPLACING" && p !== f && e.setReplaceTransitionStatus("PENDING"), _) {
|
|
3700
3616
|
let { scope: e, decorator: n, bars: r } = d();
|
|
3701
|
-
e &&
|
|
3617
|
+
e && Ya({
|
|
3702
3618
|
scope: e,
|
|
3703
3619
|
decorator: n,
|
|
3704
3620
|
bars: r ?? []
|
|
3705
|
-
},
|
|
3621
|
+
}, Kt(f), `${m}-false`, t);
|
|
3706
3622
|
}
|
|
3707
3623
|
if (_ && g) {
|
|
3708
3624
|
let e = `${m}-false`, n = b(e, "passive");
|
|
3709
3625
|
if (n) return n;
|
|
3710
3626
|
let { scope: r } = d();
|
|
3711
3627
|
if (r) {
|
|
3712
|
-
let n =
|
|
3713
|
-
if (
|
|
3714
|
-
let a = B(n, e), o = 0, s =
|
|
3628
|
+
let n = Kt(f), i = [];
|
|
3629
|
+
if (H(n, e)) {
|
|
3630
|
+
let a = B(n, e), o = 0, s = $a({
|
|
3715
3631
|
element: r,
|
|
3716
|
-
expectedName:
|
|
3632
|
+
expectedName: Dn("screen", f, e),
|
|
3717
3633
|
motion: a,
|
|
3718
3634
|
writer: t,
|
|
3719
3635
|
isLive: () => r.isConnected && r.getAttribute("data-flemo-skip-animation") !== "true",
|
|
@@ -3731,15 +3647,15 @@ function no(e) {
|
|
|
3731
3647
|
return $;
|
|
3732
3648
|
}
|
|
3733
3649
|
if (m === "COMPLETED") {
|
|
3734
|
-
|
|
3650
|
+
Ga(), e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
3735
3651
|
let { scope: n, decorator: r, bars: i } = d();
|
|
3736
3652
|
if (n) {
|
|
3737
|
-
|
|
3738
|
-
for (let e of
|
|
3653
|
+
W(n), W(n, ["transform", "opacity"]), n.removeAttribute(wa);
|
|
3654
|
+
for (let e of Ma(n)) W(e);
|
|
3739
3655
|
}
|
|
3740
|
-
r && (
|
|
3741
|
-
for (let e of i ?? []) e &&
|
|
3742
|
-
return
|
|
3656
|
+
r && (W(r), r.removeAttribute(wa));
|
|
3657
|
+
for (let e of i ?? []) e && W(e, void 0, t);
|
|
3658
|
+
return Xa({
|
|
3743
3659
|
scope: n,
|
|
3744
3660
|
decorator: r,
|
|
3745
3661
|
bars: i ?? []
|
|
@@ -3750,19 +3666,19 @@ function no(e) {
|
|
|
3750
3666
|
if (!S) return $;
|
|
3751
3667
|
let C = e.getTransitionTaskId(), w = $, T = () => {
|
|
3752
3668
|
w(), C && (s.resolveTask(C), n.delete(C));
|
|
3753
|
-
}, E =
|
|
3669
|
+
}, E = Kt(f), D = `${m}-true`, O = S.getAttribute(wa) === "true", k = !O && H(E, D);
|
|
3754
3670
|
if (!O) {
|
|
3755
3671
|
let { decorator: e, bars: n } = d();
|
|
3756
|
-
|
|
3672
|
+
Ya({
|
|
3757
3673
|
scope: S,
|
|
3758
3674
|
decorator: e,
|
|
3759
3675
|
bars: n ?? []
|
|
3760
3676
|
}, E, D, t);
|
|
3761
3677
|
}
|
|
3762
|
-
k &&
|
|
3763
|
-
let A = `${m}-false`, j =
|
|
3764
|
-
for (let e of
|
|
3765
|
-
let t = z.get(e.getAttribute(
|
|
3678
|
+
k && L() && (typeof navigator < "u" && navigator.maxTouchPoints === 0 || ba() < za) && (w = Ha());
|
|
3679
|
+
let A = `${m}-false`, j = H(E, A) ? B(E, A) : null, ee = [];
|
|
3680
|
+
for (let e of Pa(S, m)) {
|
|
3681
|
+
let t = z.get(e.getAttribute(ka)), n = `${m}-${e.getAttribute("data-flemo-active")}`, r = t && H(t, n) ? B(t, n) : null;
|
|
3766
3682
|
r && ee.push({
|
|
3767
3683
|
element: e,
|
|
3768
3684
|
motion: r
|
|
@@ -3770,105 +3686,105 @@ function no(e) {
|
|
|
3770
3686
|
}
|
|
3771
3687
|
let M = j ? (j.delay + j.duration) * 1e3 : 0;
|
|
3772
3688
|
for (let { motion: e } of ee) M = Math.max(M, (e.delay + e.duration) * 1e3);
|
|
3773
|
-
let
|
|
3689
|
+
let N = [];
|
|
3774
3690
|
{
|
|
3775
|
-
let e = E.decoratorName ?
|
|
3691
|
+
let e = E.decoratorName ? Zt.get(E.decoratorName) : void 0;
|
|
3776
3692
|
if (e) for (let t of [`${m}-true`, `${m}-false`]) {
|
|
3777
|
-
if (!
|
|
3693
|
+
if (!H(e, t)) continue;
|
|
3778
3694
|
let n = B(e, t);
|
|
3779
|
-
n && (
|
|
3695
|
+
n && (N.push(n), M = Math.max(M, (n.delay + n.duration) * 1e3));
|
|
3780
3696
|
}
|
|
3781
3697
|
}
|
|
3782
3698
|
if (!k) {
|
|
3783
3699
|
if (!O && M > 0) {
|
|
3784
3700
|
if (!g) return C && s.markGateHeld(C), $;
|
|
3785
3701
|
let e = M + 50;
|
|
3786
|
-
C && s.anchorGate(C, e +
|
|
3702
|
+
C && s.anchorGate(C, e + Oa);
|
|
3787
3703
|
let t = setTimeout(T, e);
|
|
3788
3704
|
return () => clearTimeout(t);
|
|
3789
3705
|
}
|
|
3790
3706
|
return queueMicrotask(T), $;
|
|
3791
3707
|
}
|
|
3792
|
-
let
|
|
3708
|
+
let P = B(E, D);
|
|
3793
3709
|
if (C) if (g) {
|
|
3794
|
-
let e = (
|
|
3795
|
-
s.anchorGate(C, Math.max(e, M) +
|
|
3710
|
+
let e = (P.delay + P.duration) * 1e3;
|
|
3711
|
+
s.anchorGate(C, Math.max(e, M) + Oa);
|
|
3796
3712
|
} else s.markGateHeld(C);
|
|
3797
|
-
let
|
|
3798
|
-
|
|
3799
|
-
let
|
|
3713
|
+
let F = !O && !!P, te = E.driver === "native" && !L(), ne = !L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && He(), re = L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && he(), ie = !L() && typeof navigator < "u" && navigator.maxTouchPoints > 0 && Ra(m), I = ne || re || ie, ae = ge() && mt(), oe = null;
|
|
3714
|
+
F && !L() && !te && !ne && !ie && !ae && (oe = Ni(S, () => [S.ownerDocument.documentElement], () => Aa.get(S)?.(), !1));
|
|
3715
|
+
let se = I ? Ln[m] ?? 0 : ae ? In[m] ?? 0 : 0, ce = ne && (m === "PUSHING" || m === "POPPING");
|
|
3800
3716
|
{
|
|
3801
3717
|
let e = S.ownerDocument.documentElement;
|
|
3802
|
-
|
|
3718
|
+
I && ft() ? e.setAttribute("data-flemo-creep", "true") : e.removeAttribute("data-flemo-creep"), I ? e.setAttribute("data-flemo-lpm", "true") : e.removeAttribute("data-flemo-lpm"), ae ? e.setAttribute("data-flemo-desk-head", "true") : e.removeAttribute("data-flemo-desk-head");
|
|
3803
3719
|
}
|
|
3804
|
-
let
|
|
3805
|
-
|
|
3806
|
-
let
|
|
3807
|
-
|
|
3808
|
-
},
|
|
3809
|
-
|
|
3810
|
-
},
|
|
3720
|
+
let le = null;
|
|
3721
|
+
F && te && (le = Ei(S, () => [S.ownerDocument.documentElement], () => Aa.get(S)?.()));
|
|
3722
|
+
let ue = Dn("screen", f, D), de, fe = () => {
|
|
3723
|
+
de !== void 0 && (clearTimeout(de), de = void 0);
|
|
3724
|
+
}, pe = 0, me, _e = [], ye, be = () => {
|
|
3725
|
+
_e.forEach((e) => cancelAnimationFrame(e)), _e = [], ye !== void 0 && clearTimeout(ye), ye = void 0;
|
|
3726
|
+
}, xe = () => {
|
|
3811
3727
|
/* v8 ignore next 4 -- every runtime under test has rAF; the guard
|
|
3812
3728
|
shields exotic embedders. */
|
|
3813
3729
|
if (typeof requestAnimationFrame != "function") {
|
|
3814
3730
|
T();
|
|
3815
3731
|
return;
|
|
3816
3732
|
}
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
},
|
|
3733
|
+
ye = setTimeout(() => {
|
|
3734
|
+
be(), T();
|
|
3735
|
+
}, Da);
|
|
3820
3736
|
let e = (t) => {
|
|
3821
3737
|
if (t <= 0) {
|
|
3822
|
-
|
|
3738
|
+
be(), T();
|
|
3823
3739
|
return;
|
|
3824
3740
|
}
|
|
3825
|
-
|
|
3741
|
+
_e.push(requestAnimationFrame(() => e(t - 1)));
|
|
3826
3742
|
};
|
|
3827
|
-
e(
|
|
3828
|
-
},
|
|
3829
|
-
if (
|
|
3830
|
-
|
|
3743
|
+
e(Ea);
|
|
3744
|
+
}, Se = () => {
|
|
3745
|
+
if (pe <= 0) {
|
|
3746
|
+
xe();
|
|
3831
3747
|
return;
|
|
3832
3748
|
}
|
|
3833
|
-
|
|
3834
|
-
},
|
|
3835
|
-
e.target === S &&
|
|
3749
|
+
me = setTimeout(xe, pe);
|
|
3750
|
+
}, Ce = $, we = $, Te = (e) => {
|
|
3751
|
+
e.target === S && kn(e.animationName, ue) && (S.removeEventListener("animationend", Te), fe(), Ce(), Se());
|
|
3836
3752
|
};
|
|
3837
|
-
S.addEventListener("animationend",
|
|
3838
|
-
let
|
|
3839
|
-
|
|
3840
|
-
let
|
|
3753
|
+
S.addEventListener("animationend", Te);
|
|
3754
|
+
let Ee = F && g ? b(D, "active", xe) : null, De = (P.delay + P.duration) * 1e3, Oe = Math.max(De, M) + 1500, ke = C ? setTimeout(() => void s.resolveTask(C), Oe) : void 0;
|
|
3755
|
+
pe = Math.max(0, M - De);
|
|
3756
|
+
let Ae = De * 1 + se + 250, je = () => C !== null && e.getTransitionTaskId() === C && S.isConnected && S.getAttribute("data-flemo-skip-animation") !== "true" && H(E, D), Me = $a({
|
|
3841
3757
|
element: S,
|
|
3842
|
-
expectedName:
|
|
3843
|
-
motion:
|
|
3758
|
+
expectedName: ue,
|
|
3759
|
+
motion: P,
|
|
3844
3760
|
writer: t,
|
|
3845
|
-
isLive:
|
|
3761
|
+
isLive: je,
|
|
3846
3762
|
budgetUsed: () => n.get(C) ?? 0,
|
|
3847
3763
|
spendBudget: () => {
|
|
3848
|
-
|
|
3764
|
+
we(), n.set(C, (n.get(C) ?? 0) + 1);
|
|
3849
3765
|
},
|
|
3850
3766
|
onTerminal: T
|
|
3851
3767
|
});
|
|
3852
|
-
|
|
3853
|
-
let
|
|
3854
|
-
|
|
3855
|
-
},
|
|
3856
|
-
if (
|
|
3857
|
-
|
|
3768
|
+
Ce = Me.detach;
|
|
3769
|
+
let Ne = !1, Pe = () => {
|
|
3770
|
+
fe(), de = setTimeout(Fe, Ae);
|
|
3771
|
+
}, Fe = () => {
|
|
3772
|
+
if (fe(), je() && !Ne) {
|
|
3773
|
+
Ne = !0, we(), Me.fullRestart(), Pe();
|
|
3858
3774
|
return;
|
|
3859
3775
|
}
|
|
3860
3776
|
T();
|
|
3861
|
-
},
|
|
3862
|
-
|
|
3863
|
-
|
|
3777
|
+
}, Ie = !Ee && g, Le = Ie ? x(S, D) : [];
|
|
3778
|
+
Ie && (Me.attach(), C && Pe()), Ie && (te || ne) && Aa.set(S, () => {
|
|
3779
|
+
we(), C && de !== void 0 && Pe();
|
|
3864
3780
|
});
|
|
3865
|
-
let
|
|
3866
|
-
|
|
3867
|
-
}) : null,
|
|
3868
|
-
|
|
3781
|
+
let Re = Ie && te ? ji(() => [S.ownerDocument.documentElement], () => {
|
|
3782
|
+
we(), C && de !== void 0 && Pe();
|
|
3783
|
+
}) : null, ze, Be = () => {
|
|
3784
|
+
ze !== void 0 && (clearTimeout(ze), ze = void 0);
|
|
3869
3785
|
};
|
|
3870
|
-
if (
|
|
3871
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1, t = ai(
|
|
3786
|
+
if (we = Be, Ie && C && !ce && !ie) {
|
|
3787
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1, t = ai(P, S, e), n = j ? ai(j, S, e) : 0, r = 0;
|
|
3872
3788
|
for (let { element: t, motion: n } of ee) {
|
|
3873
3789
|
let i = ai(n, t, e);
|
|
3874
3790
|
if (i === null) {
|
|
@@ -3878,9 +3794,9 @@ function no(e) {
|
|
|
3878
3794
|
r = Math.max(r, i);
|
|
3879
3795
|
}
|
|
3880
3796
|
let i = 0;
|
|
3881
|
-
if (
|
|
3797
|
+
if (N.length > 0) {
|
|
3882
3798
|
let t = d().decorator;
|
|
3883
|
-
if (t) for (let n of
|
|
3799
|
+
if (t) for (let n of N) {
|
|
3884
3800
|
let r = ai(n, t, e);
|
|
3885
3801
|
if (r === null) {
|
|
3886
3802
|
i = null;
|
|
@@ -3890,22 +3806,30 @@ function no(e) {
|
|
|
3890
3806
|
}
|
|
3891
3807
|
}
|
|
3892
3808
|
let a = t !== null && n !== null && r !== null && i !== null ? Math.max(t, n, r, i) : null;
|
|
3893
|
-
a !== null && a + 17 <
|
|
3894
|
-
|
|
3895
|
-
}, a * 1 + 17 +
|
|
3809
|
+
a !== null && a + 17 < De + pe && (ze = setTimeout(() => {
|
|
3810
|
+
ze = void 0, je() && (S.removeEventListener("animationend", Te), fe(), Ce(), xe());
|
|
3811
|
+
}, a * 1 + 17 + se));
|
|
3896
3812
|
}
|
|
3897
3813
|
return () => {
|
|
3898
|
-
if (w(),
|
|
3899
|
-
|
|
3900
|
-
for (let e of
|
|
3814
|
+
if (w(), ke !== void 0 && clearTimeout(ke), me !== void 0 && clearTimeout(me), be(), le?.(), oe?.(), Re?.(), Be(), S.removeEventListener("animationend", Te), Ie) {
|
|
3815
|
+
Me.detach();
|
|
3816
|
+
for (let e of Le) e();
|
|
3901
3817
|
}
|
|
3902
|
-
|
|
3818
|
+
fe(), Ee?.(), C && e.getTransitionTaskId() !== C && n.delete(C);
|
|
3903
3819
|
};
|
|
3904
3820
|
},
|
|
3905
3821
|
activeResumeEntryCount: () => n.size
|
|
3906
3822
|
};
|
|
3907
3823
|
}
|
|
3908
3824
|
//#endregion
|
|
3825
|
+
//#region src/transition/swipeSettle.ts
|
|
3826
|
+
var to = .12, no = ({ remainingPx: e, spanPx: t, velocityPxPerSecond: n, authoredSeconds: r, minSeconds: i = to }) => {
|
|
3827
|
+
let a = Math.abs(e);
|
|
3828
|
+
if (a <= .5) return 0;
|
|
3829
|
+
let o = Math.abs(t), s = o > 0 ? r * Math.min(1, a / o) : r, c = Math.abs(n), l = c > 0 ? a / c : Infinity;
|
|
3830
|
+
return Math.min(r, Math.max(i, Math.min(s, l)));
|
|
3831
|
+
};
|
|
3832
|
+
//#endregion
|
|
3909
3833
|
//#region src/utils/findScrollable.ts
|
|
3910
3834
|
function ro(e, t) {
|
|
3911
3835
|
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = io(e);
|
|
@@ -4015,12 +3939,19 @@ function uo(e) {
|
|
|
4015
3939
|
y: e.clientY
|
|
4016
3940
|
}, m = t, x = Math.max(x, Math.abs(e.clientX - f.x), Math.abs(e.clientY - f.y));
|
|
4017
3941
|
}, w = (r, a, o) => {
|
|
4018
|
-
let s =
|
|
4019
|
-
if (r === e.getElements().scope) for (let e of i.current)
|
|
4020
|
-
else if (r === n) for (let e of i.prev)
|
|
3942
|
+
let s = G(r, a, o, t);
|
|
3943
|
+
if (r === e.getElements().scope) for (let e of i.current) G(e, a, o, t);
|
|
3944
|
+
else if (r === n) for (let e of i.prev) G(e, a, o, t);
|
|
4021
3945
|
return s;
|
|
4022
|
-
}, T = (
|
|
4023
|
-
|
|
3946
|
+
}, T = (e, t) => {
|
|
3947
|
+
if (!e) return null;
|
|
3948
|
+
for (let n of Array.from(e.children)) {
|
|
3949
|
+
let e = n;
|
|
3950
|
+
if (typeof e.matches == "function" && e.matches(t)) return e;
|
|
3951
|
+
}
|
|
3952
|
+
return null;
|
|
3953
|
+
}, E = (n) => {
|
|
3954
|
+
let r = e.getPartnerBars(), a = e.getPartnerBarMetadata?.(), o = T(n, "[data-flemo-bar=\"app\"]"), s = T(n, "[data-flemo-bar=\"nav\"]"), c = (e) => {
|
|
4024
3955
|
if (!e) return;
|
|
4025
3956
|
let t = e.getAttribute("data-flemo-bar-id");
|
|
4026
3957
|
return t === null ? {} : { id: e.getAttribute("data-flemo-bar-id-type") === "number" ? Number(t) : t };
|
|
@@ -4031,41 +3962,55 @@ function uo(e) {
|
|
|
4031
3962
|
current: p,
|
|
4032
3963
|
prev: g
|
|
4033
3964
|
};
|
|
4034
|
-
for (let n of p)
|
|
4035
|
-
for (let n of g)
|
|
4036
|
-
},
|
|
4037
|
-
|
|
4038
|
-
|
|
3965
|
+
for (let n of p) Z(n, e.getTransition(), !1, t);
|
|
3966
|
+
for (let n of g) Z(n, e.getTransition(), !1, t);
|
|
3967
|
+
}, D = () => {
|
|
3968
|
+
let { scope: i, decorator: a } = e.getElements(), o = e.getTransition();
|
|
3969
|
+
i && Z(i, o, !1, t), n && Z(n, o, !1, t);
|
|
3970
|
+
let s = e.getDecorator();
|
|
3971
|
+
s && (a && Z(a, s, !1, t), r && Z(r, s, !1, t));
|
|
3972
|
+
}, O = () => {
|
|
3973
|
+
let { scope: i, decorator: a } = e.getElements();
|
|
3974
|
+
i && Q(i, t), n && Q(n, t), a && Q(a, t), r && Q(r, t);
|
|
3975
|
+
}, k = () => {
|
|
3976
|
+
for (let e of i.current) W(e, void 0, t), Q(e, t);
|
|
3977
|
+
for (let e of i.prev) W(e, void 0, t), Q(e, t);
|
|
4039
3978
|
i = {
|
|
4040
3979
|
current: [],
|
|
4041
3980
|
prev: []
|
|
4042
3981
|
};
|
|
4043
|
-
},
|
|
4044
|
-
let { screenContainer: n } = e.getElements(), r = (e) =>
|
|
3982
|
+
}, A = (t) => {
|
|
3983
|
+
let { screenContainer: n } = e.getElements(), r = (e) => {
|
|
3984
|
+
let t = T(e, "[data-flemo-screen]");
|
|
3985
|
+
return Array.from(e.querySelectorAll("[data-flemo-part-name]")).filter((e) => {
|
|
3986
|
+
let n = e.closest("[data-flemo-screen]");
|
|
3987
|
+
return n === null || n === t;
|
|
3988
|
+
});
|
|
3989
|
+
};
|
|
4045
3990
|
a = {
|
|
4046
3991
|
current: r(n),
|
|
4047
3992
|
prev: r(t)
|
|
4048
3993
|
};
|
|
4049
|
-
},
|
|
4050
|
-
let
|
|
4051
|
-
let
|
|
4052
|
-
if (!
|
|
4053
|
-
let
|
|
4054
|
-
animate: (e, n, r) =>
|
|
4055
|
-
element:
|
|
4056
|
-
active:
|
|
3994
|
+
}, j = (e, n, r, i) => {
|
|
3995
|
+
let o = (a, o) => {
|
|
3996
|
+
let s = z.get(a.getAttribute("data-flemo-part-name"));
|
|
3997
|
+
if (!s) return;
|
|
3998
|
+
let c = {
|
|
3999
|
+
animate: i ?? ((e, n, r) => G(e, n, r, t)),
|
|
4000
|
+
element: a,
|
|
4001
|
+
active: o
|
|
4057
4002
|
};
|
|
4058
|
-
e === "swipe" ?
|
|
4003
|
+
e === "swipe" ? s.onSwipe?.(n, r, c) : e === "start" ? s.onSwipeStart?.(n, c) : s.onSwipeEnd?.(n, c);
|
|
4059
4004
|
};
|
|
4060
|
-
for (let e of a.current)
|
|
4061
|
-
for (let e of a.prev)
|
|
4062
|
-
},
|
|
4063
|
-
for (let e of [...a.current, ...a.prev])
|
|
4005
|
+
for (let e of a.current) o(e, !0);
|
|
4006
|
+
for (let e of a.prev) o(e, !1);
|
|
4007
|
+
}, ee = () => {
|
|
4008
|
+
for (let e of [...a.current, ...a.prev]) W(e, void 0, t);
|
|
4064
4009
|
a = {
|
|
4065
4010
|
current: [],
|
|
4066
4011
|
prev: []
|
|
4067
4012
|
};
|
|
4068
|
-
},
|
|
4013
|
+
}, M = async (t) => {
|
|
4069
4014
|
let i = e.getTransition();
|
|
4070
4015
|
if (!i.swipeDirection || e.getViewportScrollHeight() > 10) {
|
|
4071
4016
|
s = !1;
|
|
@@ -4077,11 +4022,11 @@ function uo(e) {
|
|
|
4077
4022
|
return;
|
|
4078
4023
|
}
|
|
4079
4024
|
let u = o?.previousElementSibling ?? null;
|
|
4080
|
-
if (n = u
|
|
4025
|
+
if (n = T(u, "[data-flemo-screen]"), r = T(u, "[data-flemo-decorator]"), !n) {
|
|
4081
4026
|
s = !1;
|
|
4082
4027
|
return;
|
|
4083
4028
|
}
|
|
4084
|
-
c = !0, x = 0, f = {
|
|
4029
|
+
c = !0, re = ie(), I = 0, ne = (typeof performance > "u" ? Date.now() : performance.now()) + te, x = 0, f = {
|
|
4085
4030
|
x: t.clientX,
|
|
4086
4031
|
y: t.clientY
|
|
4087
4032
|
}, p = {
|
|
@@ -4090,29 +4035,50 @@ function uo(e) {
|
|
|
4090
4035
|
}, m = t.timeStamp, h = {
|
|
4091
4036
|
x: 0,
|
|
4092
4037
|
y: 0
|
|
4093
|
-
}, a.setPointerCapture(t.pointerId),
|
|
4038
|
+
}, a.setPointerCapture(t.pointerId), E(u), A(u), D();
|
|
4094
4039
|
let g = e.getDecorator(), _ = await i.onSwipeStart(t, b(t), {
|
|
4095
4040
|
animate: w,
|
|
4096
4041
|
currentScreen: a,
|
|
4097
4042
|
prevScreen: n,
|
|
4098
4043
|
onStart: (e) => {
|
|
4099
4044
|
g?.onSwipeStart?.(e, {
|
|
4100
|
-
animate:
|
|
4045
|
+
animate: G,
|
|
4101
4046
|
currentDecorator: l,
|
|
4102
4047
|
prevDecorator: r
|
|
4103
|
-
}),
|
|
4048
|
+
}), j("start", e, 0);
|
|
4104
4049
|
}
|
|
4105
4050
|
});
|
|
4106
|
-
_ && !d ? e.setDragStatus("PENDING") : _ || (e.setDragStatus("IDLE"), c = !1, s = !1, S(t),
|
|
4107
|
-
},
|
|
4108
|
-
let t =
|
|
4051
|
+
_ && !d ? e.setDragStatus("PENDING") : _ || (e.setDragStatus("IDLE"), c = !1, s = !1, S(t), k(), O(), ee());
|
|
4052
|
+
}, N = (e) => {
|
|
4053
|
+
let t = M(e);
|
|
4109
4054
|
u = t, t.finally(() => {
|
|
4110
4055
|
u = null;
|
|
4111
4056
|
});
|
|
4112
|
-
},
|
|
4057
|
+
}, P = null, F = 0, te = 200, ne = 0, re = !0, ie = () => {
|
|
4058
|
+
let e = n?.parentElement;
|
|
4059
|
+
return !e || !e.isConnected || typeof getComputedStyle != "function" || getComputedStyle(e).display !== "none";
|
|
4060
|
+
}, I = 0, ae = (e) => re ? !0 : e >= ne ? (re = !0, !0) : ie() ? I ? (re = !0, !0) : (I = e, !1) : (I = 0, !1), oe = () => {
|
|
4061
|
+
F && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(F), F = 0, re = !0;
|
|
4062
|
+
let e = P;
|
|
4063
|
+
P = null, e && le(e);
|
|
4064
|
+
}, se = (e = typeof performance > "u" ? Date.now() : performance.now()) => {
|
|
4065
|
+
if (F = 0, !ae(e)) {
|
|
4066
|
+
P && typeof requestAnimationFrame == "function" && (F = requestAnimationFrame(se));
|
|
4067
|
+
return;
|
|
4068
|
+
}
|
|
4069
|
+
let t = P;
|
|
4070
|
+
P = null, t && le(t);
|
|
4071
|
+
}, ce = (e) => {
|
|
4072
|
+
if (P = e, !F) {
|
|
4073
|
+
if (typeof requestAnimationFrame != "function") {
|
|
4074
|
+
se();
|
|
4075
|
+
return;
|
|
4076
|
+
}
|
|
4077
|
+
F = requestAnimationFrame(se);
|
|
4078
|
+
}
|
|
4079
|
+
}, le = (t) => {
|
|
4113
4080
|
let i = e.getTransition();
|
|
4114
4081
|
if (!i.swipeDirection || !c || u || e.getViewportScrollHeight() > 10) return;
|
|
4115
|
-
C(t);
|
|
4116
4082
|
let { scope: a, decorator: o } = e.getElements(), s = e.getDecorator();
|
|
4117
4083
|
i.onSwipe(t, b(t), {
|
|
4118
4084
|
animate: w,
|
|
@@ -4120,23 +4086,20 @@ function uo(e) {
|
|
|
4120
4086
|
prevScreen: n,
|
|
4121
4087
|
onProgress: (e, t) => {
|
|
4122
4088
|
s?.onSwipe?.(e, t, {
|
|
4123
|
-
animate:
|
|
4089
|
+
animate: G,
|
|
4124
4090
|
currentDecorator: o,
|
|
4125
4091
|
prevDecorator: r
|
|
4126
|
-
}),
|
|
4092
|
+
}), j("swipe", e, t);
|
|
4127
4093
|
}
|
|
4128
4094
|
});
|
|
4129
|
-
},
|
|
4095
|
+
}, ue = async (o, s = !1) => {
|
|
4130
4096
|
u && await u;
|
|
4131
4097
|
let l = e.getTransition();
|
|
4132
4098
|
if (!l.swipeDirection || !c) return;
|
|
4133
|
-
c = !1;
|
|
4099
|
+
oe(), c = !1;
|
|
4134
4100
|
let { scope: d, decorator: f } = e.getElements();
|
|
4135
4101
|
S(o);
|
|
4136
|
-
let p = e.getDecorator(), m = s || x < 6
|
|
4137
|
-
...n,
|
|
4138
|
-
duration: 0
|
|
4139
|
-
}) : w, h = s ? {
|
|
4102
|
+
let p = e.getDecorator(), m = s || x < 6, h = s ? {
|
|
4140
4103
|
point: {
|
|
4141
4104
|
x: o.clientX,
|
|
4142
4105
|
y: o.clientY
|
|
@@ -4153,23 +4116,43 @@ function uo(e) {
|
|
|
4153
4116
|
x: 0,
|
|
4154
4117
|
y: 0
|
|
4155
4118
|
}
|
|
4156
|
-
} : b(o), g =
|
|
4157
|
-
|
|
4119
|
+
} : b(o), g = l.swipeDirection, _ = d?.getBoundingClientRect(), v = (g === "y" ? _?.height : _?.width) || (typeof window > "u" ? 0 : g === "y" ? window.innerHeight : window.innerWidth), y = Math.abs(g === "y" ? h.offset.y : h.offset.x), C = Math.abs(g === "y" ? h.velocity.y : h.velocity.x), T = !1, E = (e) => ((t, n, r) => {
|
|
4120
|
+
let i = typeof r?.duration == "number" ? r.duration : 0;
|
|
4121
|
+
return i <= 0 ? e(t, n, r) : e(t, n, {
|
|
4122
|
+
...r,
|
|
4123
|
+
duration: no({
|
|
4124
|
+
remainingPx: T ? v - y : y,
|
|
4125
|
+
spanPx: v,
|
|
4126
|
+
velocityPxPerSecond: C,
|
|
4127
|
+
authoredSeconds: i
|
|
4128
|
+
})
|
|
4129
|
+
});
|
|
4130
|
+
}), D = m ? (e, t, n) => w(e, t, {
|
|
4131
|
+
...n,
|
|
4132
|
+
duration: 0
|
|
4133
|
+
}) : E(w), A = m ? (e, t, n) => G(e, t, {
|
|
4134
|
+
...n,
|
|
4135
|
+
duration: 0
|
|
4136
|
+
}) : E(G), M = m ? (e, n, r) => G(e, n, {
|
|
4137
|
+
...r,
|
|
4138
|
+
duration: 0
|
|
4139
|
+
}, t) : E((e, n, r) => G(e, n, r, t)), N = await l.onSwipeEnd(o, h, {
|
|
4140
|
+
animate: D,
|
|
4158
4141
|
currentScreen: d,
|
|
4159
4142
|
prevScreen: n,
|
|
4160
4143
|
onStart: (e) => {
|
|
4161
4144
|
let t = !s && e;
|
|
4162
|
-
p?.onSwipeEnd?.(t, {
|
|
4163
|
-
animate:
|
|
4145
|
+
T = t, p?.onSwipeEnd?.(t, {
|
|
4146
|
+
animate: A,
|
|
4164
4147
|
currentDecorator: f,
|
|
4165
4148
|
prevDecorator: r
|
|
4166
|
-
}),
|
|
4149
|
+
}), j("end", t, 0, M);
|
|
4167
4150
|
}
|
|
4168
4151
|
});
|
|
4169
|
-
if (!s &&
|
|
4152
|
+
if (!s && N) {
|
|
4170
4153
|
d?.setAttribute(lo, "true"), f?.setAttribute(lo, "true");
|
|
4171
|
-
for (let e of i.current)
|
|
4172
|
-
for (let e of i.prev)
|
|
4154
|
+
for (let e of i.current) Q(e, t);
|
|
4155
|
+
for (let e of i.prev) W(e, void 0, t), Q(e, t);
|
|
4173
4156
|
i = {
|
|
4174
4157
|
current: [],
|
|
4175
4158
|
prev: []
|
|
@@ -4177,7 +4160,7 @@ function uo(e) {
|
|
|
4177
4160
|
current: [],
|
|
4178
4161
|
prev: []
|
|
4179
4162
|
}, e.back();
|
|
4180
|
-
} else d &&
|
|
4163
|
+
} else d && W(d, void 0, t), n && W(n, void 0, t), f && W(f), r && W(r), k(), O(), ee(), e.setDragStatus("IDLE");
|
|
4181
4164
|
};
|
|
4182
4165
|
return {
|
|
4183
4166
|
pointerDown: (t) => {
|
|
@@ -4192,7 +4175,7 @@ function uo(e) {
|
|
|
4192
4175
|
pointerMove: (t) => {
|
|
4193
4176
|
if (t.pointerId !== l || e.getViewportScrollHeight() > 10) return;
|
|
4194
4177
|
if (c) {
|
|
4195
|
-
|
|
4178
|
+
C(t), ce(t);
|
|
4196
4179
|
return;
|
|
4197
4180
|
}
|
|
4198
4181
|
if (!o) return;
|
|
@@ -4206,17 +4189,17 @@ function uo(e) {
|
|
|
4206
4189
|
return;
|
|
4207
4190
|
}
|
|
4208
4191
|
let r = !g.element && !_.element, i = t.clientX - v, a = t.clientY - y, u = n === "x" ? i : a, d = n === "x" ? a : i;
|
|
4209
|
-
if (!(Math.max(Math.abs(u), Math.abs(d)) < 8) && (o = !1, !(u <= 0 || Math.abs(u) <= Math.abs(d) * 3))) if (r) s = !0,
|
|
4192
|
+
if (!(Math.max(Math.abs(u), Math.abs(d)) < 8) && (o = !1, !(u <= 0 || Math.abs(u) <= Math.abs(d) * 3))) if (r) s = !0, N(t);
|
|
4210
4193
|
else {
|
|
4211
4194
|
let e = _.element && _.element.scrollTop <= 0, r = g.element && g.element.scrollLeft <= 0 && g.hasMarker;
|
|
4212
|
-
(n === "y" && (e || g.element) || n === "x" && (r || _.element)) && (s = !0,
|
|
4195
|
+
(n === "y" && (e || g.element) || n === "x" && (r || _.element)) && (s = !0, N(t));
|
|
4213
4196
|
}
|
|
4214
4197
|
},
|
|
4215
4198
|
pointerUp: (e) => {
|
|
4216
|
-
e.pointerId === l && (o = !1, s = !1, l = null, c &&
|
|
4199
|
+
e.pointerId === l && (o = !1, s = !1, l = null, c && ue(e));
|
|
4217
4200
|
},
|
|
4218
4201
|
pointerCancel: (e) => {
|
|
4219
|
-
e.pointerId === l && (o = !1, s = !1, l = null, d = !0, c &&
|
|
4202
|
+
e.pointerId === l && (o = !1, s = !1, l = null, d = !0, c && ue(e, !0));
|
|
4220
4203
|
},
|
|
4221
4204
|
shouldPreventTouch: () => s
|
|
4222
4205
|
};
|
|
@@ -4486,7 +4469,7 @@ function Bo(e) {
|
|
|
4486
4469
|
//#region src/core/engine/gpuPipelinePrewarm.ts
|
|
4487
4470
|
var Vo = () => {}, Ho = "data-flemo-gpu-prewarm", Uo = 2e3, Wo = 1200, Go = 120, Ko = 3, qo = "position:fixed;top:0;left:0;pointer-events:none;opacity:0.02;", Jo = "width:64px;height:64px;background:#888;color:#000;font-size:10px;will-change:transform;transform:translate3d(1px,0,0);", Yo = "width:64px;height:64px;background:#000;will-change:opacity;opacity:0.5;", Xo = "cold", Zo = 0, Qo = null;
|
|
4488
4471
|
function $o() {
|
|
4489
|
-
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function" || !
|
|
4472
|
+
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function" || !L()) return Vo;
|
|
4490
4473
|
if (Zo += 1, Xo === "cold") {
|
|
4491
4474
|
Xo = "scheduled";
|
|
4492
4475
|
let e = () => document.querySelector("[data-flemo-status=\"PUSHING\"],[data-flemo-status=\"POPPING\"],[data-flemo-status=\"REPLACING\"]") !== null, t = () => {
|
|
@@ -4566,4 +4549,4 @@ function ts(e, n) {
|
|
|
4566
4549
|
};
|
|
4567
4550
|
}
|
|
4568
4551
|
//#endregion
|
|
4569
|
-
export { vo as ANIM_HOLD_RELEASE_BACKSTOP_MS,
|
|
4552
|
+
export { vo as ANIM_HOLD_RELEASE_BACKSTOP_MS, to as MIN_SETTLE_SECONDS, q as OFFLOADED_SRC_ATTR, or as OVERSIZE_AREA_RATIO, wa as SKIP_ANIMATION_ATTR, s as TaskManager, s as TaskManger, _o as animHoldKey, G as animateInline, Dn as animationName, ne as appendParamsQuery, zn as applyTransitionStyles, ts as buildRoutePath, oo as canProgrammaticallyScroll, W as clearInlineAnimation, bn as collectAnimatedProperties, Nn as compileTransitionStyles, co as computeBarRiding, Nt as computeScreenFreeze, Mt as computeScreenFreezeMode, b as consumeSelfInducedPop, Ao as createAnimHoldCoordinator, g as createBrowserHistoryDriver, qt as createDecorator, c as createHistoryStore, x as createHistorySync, yr as createImageDecodeOffloader, j as createMemoryHistoryDriver, ee as createNavigateStore, F as createNavigationController, Qt as createPartTransition, Jt as createRawDecorator, $t as createRawPartTransition, Ft as createRawTransition, ue as createRouterScope, de as createScreenSelector, se as createScreenStore, _ as createSelfPopGuard, re as createStepController, uo as createSwipeController, Pt as createTransition, eo as createTransitionEngine, I as createTransitionStore, Bt as cupertino, Zt as decoratorMap, L as detectBlinkEngine, xo as eagerlyDecodeImages, Sn as easingToCss, $o as ensureGpuPipelinePrewarm, xr as ensureImageDecodeOffloader, k as ensureScopeHistorySync, p as ensureWindowHistoryState, Kn as enteringInitialStyle, ro as findScrollable, l as getMatchedPathPattern, u as getParams, He as governedCompiledActive, Fr as holdCompositorWarm, _e as isDesktopBlink, he as isLegacyAndroidBlink, es as isOpaqueColor, f as isServer, Ht as layout, Ve as lowPowerCadenceActive, y as markSelfInducedPop, ae as matchesPathname, Ut as material, Wt as none, jo as observeBarHeight, Bo as observeViewportScrollHeight, ao as overflowsAxis, Xt as overlay, z as partTransitionMap, pt as readDeferReleaseCommitFlag, dt as readDesktopReleaseFlipFlag, _t as readImageOffloadOverride, ht as readPrerasterFlag, gt as readRestLayerPromotionFlag, ct as readSettleGateFlag, te as readStepParams, Gn as registerTransitionDefinitions, A as releaseScopeHistorySync, Kt as resolveTransition, Oo as scheduleAnimHoldRelease, d as seedInitialHistory, m as seedRouterEntry, so as sharedBarsMatch, mr as shouldOffloadImage, it as steadySixtyPlayerEligible, ie as subscribeStepParamsRestore, no as swipeSettleSeconds, xn as targetToDecls, Gt as transitionMap, H as variantHasAnimation };
|