@flemo/core 1.22.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/engine/__tests__/emulationNotice.test.d.ts +1 -0
- package/dist/core/engine/__tests__/gpuPipelinePrewarm.test.d.ts +1 -0
- package/dist/core/engine/__tests__/imageDecodeHygiene.test.d.ts +1 -0
- package/dist/core/engine/__tests__/landingPixelSnap.test.d.ts +1 -0
- package/dist/core/engine/__tests__/layerSettleHold.test.d.ts +1 -0
- package/dist/core/engine/__tests__/responseHold.test.d.ts +1 -0
- package/dist/core/engine/driverPolicy.d.ts +1 -1
- package/dist/core/engine/emulationNotice.d.ts +3 -0
- package/dist/core/engine/gpuPipelinePrewarm.d.ts +4 -0
- package/dist/core/engine/imageDecodeHygiene.d.ts +1 -0
- package/dist/core/engine/landingPixelSnap.d.ts +5 -0
- package/dist/core/engine/layerSettleHold.d.ts +5 -0
- package/dist/core/engine/motionDriverKind.d.ts +1 -1
- package/dist/core/engine/nativeStallAnchor.d.ts +2 -0
- package/dist/core/engine/responseHold.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1379 -818
- package/dist/screen/computeScreenFreeze.d.ts +1 -0
- package/dist/transition/animateInline.d.ts +3 -3
- package/dist/transition/compileTransitionStyles.d.ts +1 -1
- package/dist/transition/settleScrub.d.ts +3 -3
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -274,10 +274,10 @@ function l(e, t) {
|
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region src/utils/getParams.ts
|
|
276
276
|
function u(e, t, r) {
|
|
277
|
-
let i =
|
|
278
|
-
return
|
|
279
|
-
...
|
|
280
|
-
...
|
|
277
|
+
let i = l(e, t), a = n(i)(t), o = new URLSearchParams(r), s = Object.fromEntries(o.entries());
|
|
278
|
+
return a ? {
|
|
279
|
+
...a.params,
|
|
280
|
+
...s
|
|
281
281
|
} : {};
|
|
282
282
|
}
|
|
283
283
|
//#endregion
|
|
@@ -377,7 +377,7 @@ function _() {
|
|
|
377
377
|
e += 1;
|
|
378
378
|
},
|
|
379
379
|
consume() {
|
|
380
|
-
return e > 0
|
|
380
|
+
return e > 0 && (--e, !0);
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
}
|
|
@@ -476,7 +476,7 @@ function x(e) {
|
|
|
476
476
|
}, _ = n.subscribe((e) => {
|
|
477
477
|
if (!i && (d = m(), h(), w(e.pathname), !r())) return c(e);
|
|
478
478
|
});
|
|
479
|
-
if (e.routerKey && e.zoneEntryId &&
|
|
479
|
+
if (e.routerKey && e.zoneEntryId && ee(n, e.zoneEntryId)) {
|
|
480
480
|
let n = t.history.getState().histories[t.history.getState().index]?.pathname, r = T(n);
|
|
481
481
|
for (let t of r) c({
|
|
482
482
|
state: t.raw?.[e.routerKey] ?? null,
|
|
@@ -498,18 +498,18 @@ var S = [], C = !1, w = (e) => {
|
|
|
498
498
|
if (!e) return [];
|
|
499
499
|
for (let t = S.length - 1; t >= 0; --t) if (S[t].pathname === e) return S.slice(t + 1);
|
|
500
500
|
return [];
|
|
501
|
-
},
|
|
501
|
+
}, ee = (e, t) => {
|
|
502
502
|
if (typeof window > "u") return !1;
|
|
503
503
|
let n = window.history.state;
|
|
504
504
|
return n ? Object.values(n).some((e) => !!e && typeof e == "object" && e.id === t) : !1;
|
|
505
505
|
};
|
|
506
|
-
function
|
|
506
|
+
function te(e, t) {
|
|
507
507
|
for (let n = S.length - 1; n >= 0; --n) if (S[n].pathname === t) return S[n].raw?.[e] ?? null;
|
|
508
508
|
return null;
|
|
509
509
|
}
|
|
510
|
-
var
|
|
511
|
-
function
|
|
512
|
-
|
|
510
|
+
var E = /* @__PURE__ */ new WeakMap();
|
|
511
|
+
function ne(e) {
|
|
512
|
+
E.has(e) || E.set(e, x({
|
|
513
513
|
stores: e,
|
|
514
514
|
driver: e.driver,
|
|
515
515
|
consume: e.consume,
|
|
@@ -518,12 +518,12 @@ function k(e) {
|
|
|
518
518
|
ownsPathname: e.ownsPathname
|
|
519
519
|
}));
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
e.persistent || (
|
|
521
|
+
function D(e) {
|
|
522
|
+
e.persistent || (E.get(e)?.(), E.delete(e));
|
|
523
523
|
}
|
|
524
524
|
//#endregion
|
|
525
525
|
//#region src/history/memoryHistoryDriver.ts
|
|
526
|
-
function
|
|
526
|
+
function re(e) {
|
|
527
527
|
let t = [{
|
|
528
528
|
state: e?.state ?? null,
|
|
529
529
|
url: e?.url ?? "/"
|
|
@@ -565,7 +565,7 @@ function ee(e) {
|
|
|
565
565
|
}
|
|
566
566
|
//#endregion
|
|
567
567
|
//#region src/navigate/store.ts
|
|
568
|
-
function
|
|
568
|
+
function O() {
|
|
569
569
|
return e((e) => ({
|
|
570
570
|
status: "IDLE",
|
|
571
571
|
transitionTaskId: null,
|
|
@@ -575,11 +575,11 @@ function te() {
|
|
|
575
575
|
}
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/navigate/createNavigationController.ts
|
|
578
|
-
var
|
|
578
|
+
var ie = (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
|
+
}, ae = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, oe = 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 j = (e, t, n) => {
|
|
|
587
587
|
let s = await Promise.race([a, o]);
|
|
588
588
|
i(), s && r();
|
|
589
589
|
};
|
|
590
|
-
function
|
|
590
|
+
function se(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;
|
|
@@ -613,10 +613,10 @@ function ne(e) {
|
|
|
613
613
|
}
|
|
614
614
|
let s = c(), { index: d, histories: f, addHistory: g, popHistories: _ } = t.history.getState(), v = (() => {
|
|
615
615
|
if (u?.until != null) {
|
|
616
|
-
let e =
|
|
616
|
+
let e = ie(u.until, d, f);
|
|
617
617
|
return e < 0 ? 0 : e;
|
|
618
618
|
}
|
|
619
|
-
return Math.min(
|
|
619
|
+
return Math.min(ae(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 oe(r, i, v, () => {
|
|
647
647
|
o(), r.pushState({
|
|
648
648
|
id: h,
|
|
649
649
|
index: T + 1,
|
|
@@ -682,10 +682,10 @@ function ne(e) {
|
|
|
682
682
|
}
|
|
683
683
|
let s = c(), { index: d, histories: f, addHistory: g, replaceHistory: _, popHistories: v } = t.history.getState(), y = (() => {
|
|
684
684
|
if (u?.until != null) {
|
|
685
|
-
let e =
|
|
685
|
+
let e = ie(u.until, d, f);
|
|
686
686
|
return e < 0 ? 0 : e + 1;
|
|
687
687
|
}
|
|
688
|
-
return Math.min(
|
|
688
|
+
return Math.min(ae(u?.skip, 0) + 1, d + 1);
|
|
689
689
|
})();
|
|
690
690
|
if (y <= 0) {
|
|
691
691
|
a.abort();
|
|
@@ -713,23 +713,23 @@ function ne(e) {
|
|
|
713
713
|
}), async () => {
|
|
714
714
|
_(d), b("COMPLETED");
|
|
715
715
|
};
|
|
716
|
-
let
|
|
716
|
+
let ee = y <= d ? (f[d - y]?.frameIndex ?? d - y) + 1 : f[0]?.frameIndex ?? 0;
|
|
717
717
|
return v(y - 1), g({
|
|
718
718
|
...w,
|
|
719
|
-
frameIndex:
|
|
720
|
-
}), y <= d ? await
|
|
719
|
+
frameIndex: ee
|
|
720
|
+
}), y <= d ? await oe(r, i, y, () => {
|
|
721
721
|
o(), r.pushState({
|
|
722
722
|
id: h,
|
|
723
|
-
index:
|
|
723
|
+
index: ee,
|
|
724
724
|
status: "REPLACING",
|
|
725
725
|
params: l,
|
|
726
726
|
transitionName: p,
|
|
727
727
|
layoutId: m
|
|
728
728
|
}, S);
|
|
729
|
-
}) : await
|
|
729
|
+
}) : await oe(r, i, d, () => {
|
|
730
730
|
o(), r.replaceState({
|
|
731
731
|
id: h,
|
|
732
|
-
index:
|
|
732
|
+
index: ee,
|
|
733
733
|
status: "REPLACING",
|
|
734
734
|
params: l,
|
|
735
735
|
transitionName: p,
|
|
@@ -782,10 +782,10 @@ function ne(e) {
|
|
|
782
782
|
pop: async (e) => {
|
|
783
783
|
await d((t, n) => {
|
|
784
784
|
if (e?.until != null) {
|
|
785
|
-
let r =
|
|
785
|
+
let r = ie(e.until, t, n);
|
|
786
786
|
return r < 0 ? 0 : r;
|
|
787
787
|
}
|
|
788
|
-
let r =
|
|
788
|
+
let r = ae(e?.skip, 1);
|
|
789
789
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
790
790
|
}, e?.transitionName);
|
|
791
791
|
}
|
|
@@ -793,14 +793,14 @@ function ne(e) {
|
|
|
793
793
|
}
|
|
794
794
|
//#endregion
|
|
795
795
|
//#region src/navigate/createStepController.ts
|
|
796
|
-
var
|
|
796
|
+
var k = (e) => {
|
|
797
797
|
let t = e;
|
|
798
798
|
return t?.step ? t.params ?? {} : null;
|
|
799
|
-
},
|
|
799
|
+
}, ce = (e, t) => {
|
|
800
800
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
801
801
|
return n ? `${e}?${n}` : e;
|
|
802
802
|
};
|
|
803
|
-
function
|
|
803
|
+
function le(e) {
|
|
804
804
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
805
805
|
return {
|
|
806
806
|
pushStep: async (e) => {
|
|
@@ -858,7 +858,7 @@ function ae(e) {
|
|
|
858
858
|
}
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function ue(e, t) {
|
|
862
862
|
return e.subscribe((e) => {
|
|
863
863
|
let n = e.state;
|
|
864
864
|
n?.step && s.addTask(async () => {
|
|
@@ -868,7 +868,7 @@ function oe(e, t) {
|
|
|
868
868
|
}
|
|
869
869
|
//#endregion
|
|
870
870
|
//#region src/transition/store.ts
|
|
871
|
-
function
|
|
871
|
+
function de(t = "cupertino") {
|
|
872
872
|
return e((e) => ({
|
|
873
873
|
defaultTransitionName: t,
|
|
874
874
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -876,12 +876,12 @@ function se(t = "cupertino") {
|
|
|
876
876
|
}
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region src/utils/matchesPathname.ts
|
|
879
|
-
function
|
|
879
|
+
function fe(e, t) {
|
|
880
880
|
return i(e).regexp.test(t);
|
|
881
881
|
}
|
|
882
882
|
//#endregion
|
|
883
883
|
//#region src/screen/store.ts
|
|
884
|
-
function
|
|
884
|
+
function pe() {
|
|
885
885
|
return e((e) => ({
|
|
886
886
|
dragStatus: "IDLE",
|
|
887
887
|
replaceTransitionStatus: "IDLE",
|
|
@@ -912,21 +912,21 @@ function P() {
|
|
|
912
912
|
}
|
|
913
913
|
//#endregion
|
|
914
914
|
//#region src/core/createRouterScope.ts
|
|
915
|
-
var
|
|
915
|
+
var me = {
|
|
916
916
|
mark: () => {},
|
|
917
917
|
consume: () => !1
|
|
918
|
-
},
|
|
919
|
-
function
|
|
918
|
+
}, he = /* @__PURE__ */ new Map();
|
|
919
|
+
function ge(e) {
|
|
920
920
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, s = f() ? void 0 : e.persistKey;
|
|
921
921
|
if (s) {
|
|
922
|
-
let e =
|
|
922
|
+
let e = he.get(s);
|
|
923
923
|
if (e) {
|
|
924
924
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
925
925
|
let t = e.history.getState();
|
|
926
926
|
return t.setPendingIndex(t.index), e;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
let l = d(t, n, r, i), u = (e.routerKey && !f() ?
|
|
929
|
+
let l = d(t, n, r, i), u = (e.routerKey && !f() ? te(e.routerKey, n) : null) ?? (o && !f() ? o.readState() : null), p = u?.id ? {
|
|
930
930
|
...l,
|
|
931
931
|
id: u.id,
|
|
932
932
|
params: u.params ?? l.params,
|
|
@@ -939,7 +939,7 @@ function ue(e) {
|
|
|
939
939
|
index: 0,
|
|
940
940
|
histories: [p]
|
|
941
941
|
}), e.hostedScope;
|
|
942
|
-
let m = a ?
|
|
942
|
+
let m = a ? re({
|
|
943
943
|
state: {
|
|
944
944
|
id: p.id,
|
|
945
945
|
index: 0,
|
|
@@ -949,25 +949,25 @@ function ue(e) {
|
|
|
949
949
|
layoutId: p.layoutId
|
|
950
950
|
},
|
|
951
951
|
url: p.pathname
|
|
952
|
-
}) : o, h = a ?
|
|
952
|
+
}) : o, h = a ? me : _(), g = {
|
|
953
953
|
history: c([p], 0),
|
|
954
|
-
navigate:
|
|
955
|
-
transition:
|
|
956
|
-
screen:
|
|
954
|
+
navigate: O(),
|
|
955
|
+
transition: de(i),
|
|
956
|
+
screen: pe(),
|
|
957
957
|
driver: m,
|
|
958
958
|
markSelfInduced: h.mark,
|
|
959
959
|
consume: h.consume,
|
|
960
960
|
routerKey: e.routerKey,
|
|
961
961
|
zoneEntryId: e.zoneEntryId,
|
|
962
|
-
ownsPathname: (e) =>
|
|
962
|
+
ownsPathname: (e) => fe(t, e),
|
|
963
963
|
persistent: !!s,
|
|
964
964
|
life: { alive: !0 }
|
|
965
965
|
};
|
|
966
|
-
return s &&
|
|
966
|
+
return s && he.set(s, g), g;
|
|
967
967
|
}
|
|
968
968
|
//#endregion
|
|
969
969
|
//#region src/screen/createScreenSelector.ts
|
|
970
|
-
function
|
|
970
|
+
function A(e, t) {
|
|
971
971
|
return e.map((n, r) => ({
|
|
972
972
|
...n,
|
|
973
973
|
isActive: r === t,
|
|
@@ -978,19 +978,32 @@ function de(e, t) {
|
|
|
978
978
|
prevTransitionName: e[t - 1]?.transitionName
|
|
979
979
|
}));
|
|
980
980
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
(() => {
|
|
982
|
+
try {
|
|
983
|
+
if (typeof location > "u" || typeof sessionStorage > "u") return;
|
|
984
|
+
/[?&]flemo-freeze=shallow\b/.test(location.search) ? sessionStorage.setItem("flemo:freeze", "shallow") : /[?&]flemo-freeze=off\b/.test(location.search) && sessionStorage.removeItem("flemo:freeze");
|
|
985
|
+
} catch {}
|
|
986
|
+
})();
|
|
987
|
+
var j, _e = () => {
|
|
988
|
+
if (j !== void 0) return j;
|
|
989
|
+
try {
|
|
990
|
+
j = typeof sessionStorage < "u" && sessionStorage.getItem("flemo:freeze") === "shallow";
|
|
991
|
+
} catch {
|
|
992
|
+
j = !1;
|
|
993
|
+
}
|
|
994
|
+
return j;
|
|
995
|
+
};
|
|
996
|
+
function ve(e) {
|
|
984
997
|
if (e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex) return "immediate";
|
|
985
998
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
986
|
-
return !e.isActive && t ? "deferred" : "live";
|
|
999
|
+
return !e.isActive && t ? _e() ? "live" : "deferred" : "live";
|
|
987
1000
|
}
|
|
988
|
-
function
|
|
989
|
-
return
|
|
1001
|
+
function ye(e) {
|
|
1002
|
+
return ve(e) !== "live";
|
|
990
1003
|
}
|
|
991
1004
|
//#endregion
|
|
992
1005
|
//#region src/transition/createTransition.ts
|
|
993
|
-
function
|
|
1006
|
+
function be({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
994
1007
|
return {
|
|
995
1008
|
name: e,
|
|
996
1009
|
initial: t,
|
|
@@ -1011,7 +1024,7 @@ function I({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
1011
1024
|
}
|
|
1012
1025
|
//#endregion
|
|
1013
1026
|
//#region src/transition/createRawTransition.ts
|
|
1014
|
-
function
|
|
1027
|
+
function xe({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
1015
1028
|
return {
|
|
1016
1029
|
name: e,
|
|
1017
1030
|
initial: t,
|
|
@@ -1032,15 +1045,15 @@ function me({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1032
1045
|
}
|
|
1033
1046
|
//#endregion
|
|
1034
1047
|
//#region src/transition/cupertino.ts
|
|
1035
|
-
var
|
|
1048
|
+
var Se = (e, t, n) => {
|
|
1036
1049
|
let [r, i] = t, [a, o] = n;
|
|
1037
1050
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1038
|
-
},
|
|
1051
|
+
}, Ce = 30, M = .7, N = [
|
|
1039
1052
|
.32,
|
|
1040
1053
|
.72,
|
|
1041
1054
|
0,
|
|
1042
1055
|
1
|
|
1043
|
-
],
|
|
1056
|
+
], P = be({
|
|
1044
1057
|
name: "cupertino",
|
|
1045
1058
|
initial: { x: "100%" },
|
|
1046
1059
|
idle: {
|
|
@@ -1050,29 +1063,29 @@ var he = (e, t, n) => {
|
|
|
1050
1063
|
enter: {
|
|
1051
1064
|
value: { x: 0 },
|
|
1052
1065
|
options: {
|
|
1053
|
-
duration:
|
|
1054
|
-
ease:
|
|
1066
|
+
duration: M,
|
|
1067
|
+
ease: N
|
|
1055
1068
|
}
|
|
1056
1069
|
},
|
|
1057
1070
|
enterBack: {
|
|
1058
1071
|
value: { x: "100%" },
|
|
1059
1072
|
options: {
|
|
1060
|
-
duration:
|
|
1061
|
-
ease:
|
|
1073
|
+
duration: M,
|
|
1074
|
+
ease: N
|
|
1062
1075
|
}
|
|
1063
1076
|
},
|
|
1064
1077
|
exit: {
|
|
1065
|
-
value: { x: `-${
|
|
1078
|
+
value: { x: `-${Ce}%` },
|
|
1066
1079
|
options: {
|
|
1067
|
-
duration:
|
|
1068
|
-
ease:
|
|
1080
|
+
duration: M,
|
|
1081
|
+
ease: N
|
|
1069
1082
|
}
|
|
1070
1083
|
},
|
|
1071
1084
|
exitBack: {
|
|
1072
1085
|
value: { x: 0 },
|
|
1073
1086
|
options: {
|
|
1074
|
-
duration:
|
|
1075
|
-
ease:
|
|
1087
|
+
duration: M,
|
|
1088
|
+
ease: N
|
|
1076
1089
|
}
|
|
1077
1090
|
},
|
|
1078
1091
|
options: {
|
|
@@ -1080,24 +1093,24 @@ var he = (e, t, n) => {
|
|
|
1080
1093
|
swipeDirection: "x",
|
|
1081
1094
|
onSwipeStart: async () => !0,
|
|
1082
1095
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1083
|
-
let { offset: o } = t, s = o.x, c =
|
|
1084
|
-
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 +
|
|
1096
|
+
let { offset: o } = t, s = o.x, c = Se(s, [0, window.innerWidth], [0, 100]);
|
|
1097
|
+
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-30 + Ce / 100 * c}%` }, { duration: 0 }), c;
|
|
1085
1098
|
},
|
|
1086
1099
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
1087
1100
|
let { offset: o, velocity: s } = t, c = o.x > 50 || s.x > 20;
|
|
1088
1101
|
return a?.(c), await Promise.all([n(r, { x: c ? "100%" : 0 }, {
|
|
1089
1102
|
duration: .3,
|
|
1090
|
-
ease:
|
|
1091
|
-
}), n(i, { x: c ? 0 : `-${
|
|
1103
|
+
ease: N
|
|
1104
|
+
}), n(i, { x: c ? 0 : `-${Ce}%` }, {
|
|
1092
1105
|
duration: .3,
|
|
1093
|
-
ease:
|
|
1106
|
+
ease: N
|
|
1094
1107
|
})]), c;
|
|
1095
1108
|
}
|
|
1096
1109
|
}
|
|
1097
|
-
}),
|
|
1110
|
+
}), we = (e, t, n) => {
|
|
1098
1111
|
let [r, i] = t, [a, o] = n;
|
|
1099
1112
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1100
|
-
},
|
|
1113
|
+
}, F = be({
|
|
1101
1114
|
name: "layout",
|
|
1102
1115
|
initial: { opacity: .97 },
|
|
1103
1116
|
idle: {
|
|
@@ -1125,7 +1138,7 @@ var he = (e, t, n) => {
|
|
|
1125
1138
|
swipeDirection: "y",
|
|
1126
1139
|
onSwipeStart: async () => !0,
|
|
1127
1140
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1128
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1141
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = we(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);
|
|
1129
1142
|
return i?.(!0, 100), n(r, {
|
|
1130
1143
|
y: f,
|
|
1131
1144
|
opacity: c
|
|
@@ -1142,7 +1155,7 @@ var he = (e, t, n) => {
|
|
|
1142
1155
|
}, { duration: .3 })]), c;
|
|
1143
1156
|
}
|
|
1144
1157
|
}
|
|
1145
|
-
}),
|
|
1158
|
+
}), Te = be({
|
|
1146
1159
|
name: "material",
|
|
1147
1160
|
initial: { y: "100%" },
|
|
1148
1161
|
idle: {
|
|
@@ -1250,7 +1263,7 @@ var he = (e, t, n) => {
|
|
|
1250
1263
|
})]), c;
|
|
1251
1264
|
}
|
|
1252
1265
|
}
|
|
1253
|
-
}),
|
|
1266
|
+
}), Ee = be({
|
|
1254
1267
|
name: "none",
|
|
1255
1268
|
initial: {},
|
|
1256
1269
|
idle: {
|
|
@@ -1273,20 +1286,20 @@ var he = (e, t, n) => {
|
|
|
1273
1286
|
value: {},
|
|
1274
1287
|
options: { duration: 0 }
|
|
1275
1288
|
}
|
|
1276
|
-
}),
|
|
1277
|
-
["none",
|
|
1278
|
-
["cupertino",
|
|
1279
|
-
["material",
|
|
1280
|
-
["layout",
|
|
1289
|
+
}), I = /* @__PURE__ */ new Map([
|
|
1290
|
+
["none", Ee],
|
|
1291
|
+
["cupertino", P],
|
|
1292
|
+
["material", Te],
|
|
1293
|
+
["layout", F]
|
|
1281
1294
|
]);
|
|
1282
1295
|
//#endregion
|
|
1283
1296
|
//#region src/transition/resolveTransition.ts
|
|
1284
|
-
function
|
|
1285
|
-
return
|
|
1297
|
+
function De(e) {
|
|
1298
|
+
return I.get(e) ?? I.get("none");
|
|
1286
1299
|
}
|
|
1287
1300
|
//#endregion
|
|
1288
1301
|
//#region src/transition/decorator/createDecorator.ts
|
|
1289
|
-
function
|
|
1302
|
+
function Oe({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1290
1303
|
return {
|
|
1291
1304
|
name: e,
|
|
1292
1305
|
initial: t,
|
|
@@ -1307,7 +1320,7 @@ function xe({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1307
1320
|
}
|
|
1308
1321
|
//#endregion
|
|
1309
1322
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1310
|
-
function
|
|
1323
|
+
function ke({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1311
1324
|
return {
|
|
1312
1325
|
name: e,
|
|
1313
1326
|
initial: t,
|
|
@@ -1328,30 +1341,30 @@ function Se({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1328
1341
|
}
|
|
1329
1342
|
//#endregion
|
|
1330
1343
|
//#region src/transition/decorator/overlay.ts
|
|
1331
|
-
var
|
|
1344
|
+
var L = "rgba(0, 0, 0, 0.1)", Ae = Oe({
|
|
1332
1345
|
name: "overlay",
|
|
1333
1346
|
initial: {
|
|
1334
1347
|
opacity: 0,
|
|
1335
|
-
backgroundColor:
|
|
1348
|
+
backgroundColor: L
|
|
1336
1349
|
},
|
|
1337
1350
|
idle: {
|
|
1338
1351
|
value: {
|
|
1339
1352
|
opacity: 0,
|
|
1340
|
-
backgroundColor:
|
|
1353
|
+
backgroundColor: L
|
|
1341
1354
|
},
|
|
1342
1355
|
options: { duration: 0 }
|
|
1343
1356
|
},
|
|
1344
1357
|
enter: {
|
|
1345
1358
|
value: {
|
|
1346
1359
|
opacity: 1,
|
|
1347
|
-
backgroundColor:
|
|
1360
|
+
backgroundColor: L
|
|
1348
1361
|
},
|
|
1349
1362
|
options: { duration: .7 }
|
|
1350
1363
|
},
|
|
1351
1364
|
exit: {
|
|
1352
1365
|
value: {
|
|
1353
1366
|
opacity: 0,
|
|
1354
|
-
backgroundColor:
|
|
1367
|
+
backgroundColor: L
|
|
1355
1368
|
},
|
|
1356
1369
|
options: { duration: .7 }
|
|
1357
1370
|
},
|
|
@@ -1360,10 +1373,10 @@ var Ce = "rgba(0, 0, 0, 0.1)", we = xe({
|
|
|
1360
1373
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1361
1374
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1362
1375
|
}
|
|
1363
|
-
}),
|
|
1376
|
+
}), R = /* @__PURE__ */ new Map([["overlay", Ae]]);
|
|
1364
1377
|
//#endregion
|
|
1365
1378
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1366
|
-
function
|
|
1379
|
+
function je({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1367
1380
|
return {
|
|
1368
1381
|
name: e,
|
|
1369
1382
|
initial: t,
|
|
@@ -1384,7 +1397,7 @@ function Ee({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1384
1397
|
}
|
|
1385
1398
|
//#endregion
|
|
1386
1399
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1387
|
-
function
|
|
1400
|
+
function Me({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1388
1401
|
return {
|
|
1389
1402
|
name: e,
|
|
1390
1403
|
initial: t,
|
|
@@ -1405,7 +1418,7 @@ function De({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1405
1418
|
}
|
|
1406
1419
|
//#endregion
|
|
1407
1420
|
//#region src/transition/partTransition/partTransition.ts
|
|
1408
|
-
var
|
|
1421
|
+
var z = /* @__PURE__ */ new Map(), Ne = {
|
|
1409
1422
|
"IDLE-true": "self",
|
|
1410
1423
|
"IDLE-false": "self",
|
|
1411
1424
|
"PUSHING-true": "initial",
|
|
@@ -1416,17 +1429,17 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1416
1429
|
"POPPING-false": "PUSHING-false",
|
|
1417
1430
|
"COMPLETED-true": "self",
|
|
1418
1431
|
"COMPLETED-false": "self"
|
|
1419
|
-
},
|
|
1432
|
+
}, Pe = Object.keys(Ne), Fe = (e) => {
|
|
1420
1433
|
if (!e) return 0;
|
|
1421
1434
|
let t = e.duration;
|
|
1422
1435
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1423
|
-
},
|
|
1424
|
-
let n =
|
|
1436
|
+
}, Ie = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Le = (e, t) => {
|
|
1437
|
+
let n = Ne[t];
|
|
1425
1438
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1426
|
-
},
|
|
1427
|
-
let n =
|
|
1439
|
+
}, B = (e, t) => {
|
|
1440
|
+
let n = Le(e, t);
|
|
1428
1441
|
if (n === null) return null;
|
|
1429
|
-
let r = e.variants[t], i =
|
|
1442
|
+
let r = e.variants[t], i = Fe(r.options), a = Ie(r.options);
|
|
1430
1443
|
return i <= 0 && a <= 0 ? null : {
|
|
1431
1444
|
from: n,
|
|
1432
1445
|
to: r.value,
|
|
@@ -1434,7 +1447,7 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1434
1447
|
delay: a,
|
|
1435
1448
|
ease: r.options?.ease
|
|
1436
1449
|
};
|
|
1437
|
-
},
|
|
1450
|
+
}, Re = Pe, ze = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Be = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ve = /* @__PURE__ */ new Set(/* @__PURE__ */ "opacity.scale.scaleX.scaleY.scaleZ.aspectRatio.columnCount.columns.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineHeight.lineClamp.order.orphans.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeWidth".split(".")), He = (e, t) => t.startsWith("--") || Ve.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Ue = (e, t) => typeof t == "number" ? He(t, e) : typeof t == "string" ? t : "", We = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Ge = /* @__PURE__ */ new Set([
|
|
1438
1451
|
"x",
|
|
1439
1452
|
"y",
|
|
1440
1453
|
"z",
|
|
@@ -1445,7 +1458,7 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1445
1458
|
"rotateX",
|
|
1446
1459
|
"rotateY",
|
|
1447
1460
|
"rotateZ"
|
|
1448
|
-
]),
|
|
1461
|
+
]), Ke = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, qe = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Je = /^1(\.0+)?$/, Ye = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 || typeof t == "string" && Je.test(t.trim()) : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 || typeof t == "string" && qe.test(t.trim()) : t === 0 || typeof t == "string" && Ke.test(t.trim()), Xe = (e, t) => {
|
|
1449
1462
|
switch (e) {
|
|
1450
1463
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1451
1464
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1459,16 +1472,16 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1459
1472
|
case "rotateY": return `rotateY(${t})`;
|
|
1460
1473
|
default: return "";
|
|
1461
1474
|
}
|
|
1462
|
-
},
|
|
1475
|
+
}, Ze = (e) => {
|
|
1463
1476
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1464
|
-
if (!
|
|
1477
|
+
if (!Be(e)) return;
|
|
1465
1478
|
let n = [];
|
|
1466
1479
|
for (let r of Object.keys(e)) {
|
|
1467
|
-
let i = e[r], a =
|
|
1468
|
-
if (a !== "") if (
|
|
1480
|
+
let i = e[r], a = Ue(r, i);
|
|
1481
|
+
if (a !== "") if (Ge.has(r)) n.push(`${r}:${a}`);
|
|
1469
1482
|
else {
|
|
1470
|
-
let e = t.get(
|
|
1471
|
-
e.add(a), t.set(
|
|
1483
|
+
let e = t.get(We(r)) ?? /* @__PURE__ */ new Set();
|
|
1484
|
+
e.add(a), t.set(We(r), e);
|
|
1472
1485
|
}
|
|
1473
1486
|
}
|
|
1474
1487
|
r.add(n.sort().join("|"));
|
|
@@ -1478,13 +1491,13 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1478
1491
|
n = r.size > 1;
|
|
1479
1492
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1480
1493
|
return n && a.push("transform"), a;
|
|
1481
|
-
},
|
|
1482
|
-
if (!
|
|
1494
|
+
}, V = (e) => {
|
|
1495
|
+
if (!Be(e)) return [];
|
|
1483
1496
|
let t = [], n = !0, r = [];
|
|
1484
1497
|
for (let i of Object.keys(e)) {
|
|
1485
|
-
let a = e[i], o =
|
|
1486
|
-
o !== "" && (
|
|
1487
|
-
property:
|
|
1498
|
+
let a = e[i], o = Ue(i, a);
|
|
1499
|
+
o !== "" && (Ge.has(i) ? (t.push(Xe(i, o)), Ye(i, a) || (n = !1)) : r.push({
|
|
1500
|
+
property: We(i),
|
|
1488
1501
|
value: o
|
|
1489
1502
|
}));
|
|
1490
1503
|
}
|
|
@@ -1492,7 +1505,7 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1492
1505
|
property: "transform",
|
|
1493
1506
|
value: n ? "none" : t.join(" ")
|
|
1494
1507
|
}), r;
|
|
1495
|
-
},
|
|
1508
|
+
}, Qe = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), $e = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1496
1509
|
linear: "linear",
|
|
1497
1510
|
easeIn: "ease-in",
|
|
1498
1511
|
easeOut: "ease-out",
|
|
@@ -1502,29 +1515,29 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1502
1515
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1503
1516
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1504
1517
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1505
|
-
}[e] ?? "ease" : "ease",
|
|
1518
|
+
}[e] ?? "ease" : "ease", et = (e, t) => {
|
|
1506
1519
|
let [n, r] = t.split("-");
|
|
1507
1520
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1508
|
-
},
|
|
1521
|
+
}, tt = (e, t) => {
|
|
1509
1522
|
let [n, r] = t.split("-");
|
|
1510
1523
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1511
|
-
},
|
|
1524
|
+
}, nt = (e, t) => {
|
|
1512
1525
|
let [n, r] = t.split("-");
|
|
1513
1526
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1514
|
-
},
|
|
1527
|
+
}, rt = (e, t) => {
|
|
1515
1528
|
let [n, r] = t.split("-");
|
|
1516
1529
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1517
|
-
},
|
|
1518
|
-
let o =
|
|
1530
|
+
}, it = (e, t, n) => `flemo-${e}-${ze(t)}-${n}`, at = (e, t, n, r, i, a) => {
|
|
1531
|
+
let o = V(r), s = V(i.value), c = Fe(i.options), l = Ie(i.options), u = $e(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${nt(t, n)}` : d;
|
|
1519
1532
|
if (s.length === 0 && o.length === 0) return "";
|
|
1520
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1521
|
-
let p =
|
|
1533
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${Qe(s)}\n animation: none;\n}`;
|
|
1534
|
+
let p = it(e, t, n), m = [
|
|
1522
1535
|
`@keyframes ${p} {`,
|
|
1523
1536
|
" from {",
|
|
1524
|
-
|
|
1537
|
+
Qe(o).replace(/^/gm, " "),
|
|
1525
1538
|
" }",
|
|
1526
1539
|
" to {",
|
|
1527
|
-
|
|
1540
|
+
Qe(s).replace(/^/gm, " "),
|
|
1528
1541
|
" }",
|
|
1529
1542
|
"}"
|
|
1530
1543
|
].join("\n"), h = [
|
|
@@ -1534,59 +1547,59 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1534
1547
|
l > 0 ? `${l}s` : null,
|
|
1535
1548
|
"both"
|
|
1536
1549
|
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(/* @__PURE__ */ new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1537
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") &&
|
|
1538
|
-
},
|
|
1550
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && ot(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${Qe(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && ot(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${Qe(s)}\n}` : ""}`;
|
|
1551
|
+
}, ot = (e) => {
|
|
1539
1552
|
if (!e) return !1;
|
|
1540
1553
|
if (e.opacity === 0) return !0;
|
|
1541
1554
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1542
1555
|
return t(e.x) || t(e.y);
|
|
1543
|
-
},
|
|
1544
|
-
let i =
|
|
1545
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1546
|
-
},
|
|
1556
|
+
}, st = (e, t, n, r) => {
|
|
1557
|
+
let i = V(r.value);
|
|
1558
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${Qe(i)}\n}`;
|
|
1559
|
+
}, ct = (e, t, n = []) => {
|
|
1547
1560
|
let r = [];
|
|
1548
1561
|
for (let t of e) {
|
|
1549
1562
|
let e = t.name;
|
|
1550
|
-
for (let n of
|
|
1551
|
-
let i = t.variants[n], a =
|
|
1563
|
+
for (let n of Pe) {
|
|
1564
|
+
let i = t.variants[n], a = Ne[n];
|
|
1552
1565
|
if (a === "self") {
|
|
1553
|
-
r.push(
|
|
1566
|
+
r.push(st(et, e, n, i));
|
|
1554
1567
|
continue;
|
|
1555
1568
|
}
|
|
1556
1569
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1557
|
-
r.push(
|
|
1570
|
+
r.push(at("screen", e, n, o, i, et));
|
|
1558
1571
|
}
|
|
1559
1572
|
}
|
|
1560
1573
|
for (let e of t) {
|
|
1561
1574
|
let t = e.name;
|
|
1562
|
-
for (let n of
|
|
1563
|
-
let i = e.variants[n], a =
|
|
1575
|
+
for (let n of Re) {
|
|
1576
|
+
let i = e.variants[n], a = Ne[n];
|
|
1564
1577
|
if (a === "self") {
|
|
1565
|
-
r.push(tt
|
|
1578
|
+
r.push(st(tt, t, n, i));
|
|
1566
1579
|
continue;
|
|
1567
1580
|
}
|
|
1568
1581
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1569
|
-
r.push(
|
|
1582
|
+
r.push(at("decorator", t, n, o, i, tt));
|
|
1570
1583
|
}
|
|
1571
1584
|
}
|
|
1572
1585
|
for (let e of n) {
|
|
1573
1586
|
let t = e.name;
|
|
1574
|
-
for (let n of
|
|
1575
|
-
let i = e.variants[n], a =
|
|
1587
|
+
for (let n of Re) {
|
|
1588
|
+
let i = e.variants[n], a = Ne[n];
|
|
1576
1589
|
if (a === "self") {
|
|
1577
|
-
r.push(
|
|
1590
|
+
r.push(st(rt, t, n, i));
|
|
1578
1591
|
continue;
|
|
1579
1592
|
}
|
|
1580
1593
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1581
|
-
r.push(
|
|
1594
|
+
r.push(at("part", t, n, o, i, rt));
|
|
1582
1595
|
}
|
|
1583
1596
|
}
|
|
1584
1597
|
return [
|
|
1585
1598
|
...r.filter((e) => e.length > 0),
|
|
1586
|
-
|
|
1587
|
-
|
|
1599
|
+
lt,
|
|
1600
|
+
ut
|
|
1588
1601
|
].join("\n\n");
|
|
1589
|
-
},
|
|
1602
|
+
}, lt = [
|
|
1590
1603
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1591
1604
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1592
1605
|
"[data-flemo-anim-hold=\"park-under\"],",
|
|
@@ -1595,45 +1608,45 @@ var H = /* @__PURE__ */ new Map(), Oe = {
|
|
|
1595
1608
|
"[data-flemo-anim-hold=\"park-under\"] [data-flemo-part-name] {",
|
|
1596
1609
|
" animation-play-state: paused !important;",
|
|
1597
1610
|
"}"
|
|
1598
|
-
].join("\n"),
|
|
1611
|
+
].join("\n"), ut = [
|
|
1599
1612
|
"[data-flemo-held-arrival] {",
|
|
1600
1613
|
" display: none !important;",
|
|
1601
1614
|
"}"
|
|
1602
|
-
].join("\n"),
|
|
1603
|
-
let n =
|
|
1615
|
+
].join("\n"), H = (e, t) => {
|
|
1616
|
+
let n = Ne[t];
|
|
1604
1617
|
if (n === "self") return !1;
|
|
1605
|
-
let r = e.variants[t], i =
|
|
1618
|
+
let r = e.variants[t], i = Fe(r.options), a = Ie(r.options);
|
|
1606
1619
|
if (i <= 0 && a <= 0) return !1;
|
|
1607
|
-
let o =
|
|
1620
|
+
let o = V(n === "initial" ? e.initial : e.variants[n].value), s = V(r.value);
|
|
1608
1621
|
return o.length > 0 || s.length > 0;
|
|
1609
|
-
},
|
|
1610
|
-
function
|
|
1622
|
+
}, dt = "data-flemo";
|
|
1623
|
+
function ft() {
|
|
1611
1624
|
if (f()) return;
|
|
1612
|
-
let e =
|
|
1613
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1625
|
+
let e = ct(I.values(), R.values(), z.values()), t = document.head.querySelector(`style[${dt}]`);
|
|
1626
|
+
t || (t = document.createElement("style"), t.setAttribute(dt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1614
1627
|
}
|
|
1615
1628
|
//#endregion
|
|
1616
1629
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1617
|
-
var
|
|
1630
|
+
var pt = /* @__PURE__ */ new Map(), mt = /* @__PURE__ */ new Map(), ht = /* @__PURE__ */ new Map(), gt = (e, t) => {
|
|
1618
1631
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1619
|
-
},
|
|
1632
|
+
}, _t = (e, t) => {
|
|
1620
1633
|
let n = (e.get(t) ?? 1) - 1;
|
|
1621
1634
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1622
1635
|
};
|
|
1623
|
-
function
|
|
1624
|
-
for (let t of e)
|
|
1625
|
-
for (let e of t)
|
|
1626
|
-
for (let e of n)
|
|
1627
|
-
return
|
|
1628
|
-
for (let t of e)
|
|
1629
|
-
for (let e of t)
|
|
1630
|
-
for (let e of n)
|
|
1631
|
-
|
|
1636
|
+
function vt(e, t, n = []) {
|
|
1637
|
+
for (let t of e) I.set(t.name, t), gt(pt, t.name);
|
|
1638
|
+
for (let e of t) R.set(e.name, e), gt(mt, e.name);
|
|
1639
|
+
for (let e of n) z.set(e.name, e), gt(ht, e.name);
|
|
1640
|
+
return ft(), () => {
|
|
1641
|
+
for (let t of e) _t(pt, t.name) && I.delete(t.name);
|
|
1642
|
+
for (let e of t) _t(mt, e.name) && R.delete(e.name);
|
|
1643
|
+
for (let e of n) _t(ht, e.name) && z.delete(e.name);
|
|
1644
|
+
ft();
|
|
1632
1645
|
};
|
|
1633
1646
|
}
|
|
1634
1647
|
//#endregion
|
|
1635
1648
|
//#region src/transition/enteringInitialStyle.ts
|
|
1636
|
-
function
|
|
1649
|
+
function yt(e) {
|
|
1637
1650
|
let { initial: t, isActive: n, status: r } = e;
|
|
1638
1651
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1639
1652
|
let i = {};
|
|
@@ -1641,10 +1654,10 @@ function pt(e) {
|
|
|
1641
1654
|
}
|
|
1642
1655
|
//#endregion
|
|
1643
1656
|
//#region src/transition/settleScrub.ts
|
|
1644
|
-
var
|
|
1657
|
+
var bt = () => ({
|
|
1645
1658
|
request: (e) => requestAnimationFrame(e),
|
|
1646
1659
|
cancel: (e) => cancelAnimationFrame(e)
|
|
1647
|
-
}),
|
|
1660
|
+
}), xt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), St = ((e = bt()) => {
|
|
1648
1661
|
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1649
1662
|
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1650
1663
|
}, i = (e, n) => {
|
|
@@ -1673,90 +1686,103 @@ var mt = () => ({
|
|
|
1673
1686
|
t.size > 0 && (n = e.request(a));
|
|
1674
1687
|
};
|
|
1675
1688
|
return {
|
|
1676
|
-
settle: (r, o, s, c) => {
|
|
1689
|
+
settle: (r, o, s, c, l) => {
|
|
1677
1690
|
if (typeof r.animate != "function") return null;
|
|
1678
1691
|
i(r, "current");
|
|
1679
|
-
let
|
|
1680
|
-
for (let e of o)
|
|
1681
|
-
let
|
|
1692
|
+
let u = {};
|
|
1693
|
+
for (let e of o) u[xt(e.property)] = e.value;
|
|
1694
|
+
let d;
|
|
1682
1695
|
try {
|
|
1683
|
-
|
|
1696
|
+
d = r.animate([u], {
|
|
1684
1697
|
duration: Math.max(0, s.durationMs),
|
|
1685
1698
|
delay: Math.max(0, s.delayMs),
|
|
1686
1699
|
easing: s.easing,
|
|
1687
1700
|
fill: "forwards"
|
|
1688
|
-
}),
|
|
1701
|
+
}), d.pause(), d.currentTime = 0;
|
|
1689
1702
|
} catch {
|
|
1690
1703
|
return null;
|
|
1691
1704
|
}
|
|
1692
|
-
let
|
|
1705
|
+
let f = Math.max(0, s.durationMs) + Math.max(0, s.delayMs);
|
|
1693
1706
|
return new Promise((s) => {
|
|
1694
|
-
let
|
|
1707
|
+
let u = {
|
|
1695
1708
|
element: r,
|
|
1696
|
-
animation:
|
|
1709
|
+
animation: d,
|
|
1697
1710
|
decls: o,
|
|
1698
|
-
totalMs:
|
|
1711
|
+
totalMs: f,
|
|
1699
1712
|
startTime: null,
|
|
1700
1713
|
writeFinal: c,
|
|
1701
1714
|
resolve: s,
|
|
1702
|
-
backstop: setTimeout(() => i(r, "end"),
|
|
1715
|
+
backstop: setTimeout(() => i(r, "end"), f + 60),
|
|
1716
|
+
owner: l
|
|
1703
1717
|
};
|
|
1704
|
-
t.set(r,
|
|
1718
|
+
t.set(r, u), n === null && (n = e.request(a));
|
|
1705
1719
|
});
|
|
1706
1720
|
},
|
|
1707
|
-
takeover: (e) =>
|
|
1708
|
-
|
|
1721
|
+
takeover: (e, n) => {
|
|
1722
|
+
let r = t.get(e);
|
|
1723
|
+
r && (n === void 0 || r.owner === n) && i(e, "current");
|
|
1724
|
+
},
|
|
1725
|
+
cancel: (e, n) => {
|
|
1726
|
+
let r = t.get(e);
|
|
1727
|
+
r && (n === void 0 || r.owner === n) && i(e, "drop");
|
|
1728
|
+
}
|
|
1709
1729
|
};
|
|
1710
|
-
})(),
|
|
1730
|
+
})(), Ct = "flemo:motion-driver", wt = "flemo:motion-driver-force", Tt = !1, Et = () => {
|
|
1711
1731
|
try {
|
|
1712
1732
|
try {
|
|
1713
|
-
typeof localStorage < "u" && localStorage.removeItem(
|
|
1733
|
+
typeof localStorage < "u" && localStorage.removeItem(wt);
|
|
1714
1734
|
} catch {}
|
|
1715
1735
|
if (typeof sessionStorage > "u") return null;
|
|
1716
|
-
let e = sessionStorage.getItem(
|
|
1736
|
+
let e = sessionStorage.getItem(wt);
|
|
1717
1737
|
if (e === null) return null;
|
|
1718
1738
|
let [t, n] = e.split("@"), r = Number(n);
|
|
1719
|
-
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!
|
|
1739
|
+
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!Tt && typeof console < "u" && (Tt = !0, console.warn(`[flemo] motion driver pinned to "${t}" via sessionStorage ${wt}; remove the key to restore automatic selection (pins expire after 24h).`)), t) : (sessionStorage.removeItem(wt), null);
|
|
1720
1740
|
} catch {
|
|
1721
1741
|
return null;
|
|
1722
1742
|
}
|
|
1723
|
-
},
|
|
1743
|
+
}, Dt = () => ({
|
|
1724
1744
|
read: () => {
|
|
1725
1745
|
try {
|
|
1726
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
1746
|
+
return typeof localStorage < "u" ? localStorage.getItem(Ct) : null;
|
|
1727
1747
|
} catch {
|
|
1728
1748
|
return null;
|
|
1729
1749
|
}
|
|
1730
1750
|
},
|
|
1731
1751
|
write: (e) => {
|
|
1732
1752
|
try {
|
|
1733
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
1753
|
+
typeof localStorage < "u" && localStorage.setItem(Ct, e);
|
|
1734
1754
|
} catch {}
|
|
1735
1755
|
}
|
|
1736
|
-
}),
|
|
1756
|
+
}), Ot = 30, kt = 2, At = 2, U = () => {
|
|
1757
|
+
if (typeof navigator > "u") return !1;
|
|
1758
|
+
let e = navigator.userAgentData?.brands;
|
|
1759
|
+
return Array.isArray(e) ? e.some((e) => /chromium/i.test(e?.brand ?? "")) : !1;
|
|
1760
|
+
}, jt = ((e = Dt(), t = !1, n = !0) => {
|
|
1737
1761
|
let r = n && e.read() === "css", i = r;
|
|
1738
1762
|
r &&= !1;
|
|
1739
1763
|
let a = 0, o = 0, s = [];
|
|
1740
1764
|
return {
|
|
1741
1765
|
playerAllowed: () => {
|
|
1742
|
-
let e =
|
|
1766
|
+
let e = Et();
|
|
1743
1767
|
return e ? e === "raf" : t && !r;
|
|
1744
1768
|
},
|
|
1745
|
-
pinnedDriver:
|
|
1769
|
+
pinnedDriver: Et,
|
|
1746
1770
|
beginRun: () => {
|
|
1747
1771
|
o = 0, s = [];
|
|
1748
1772
|
},
|
|
1749
1773
|
reportGap: (e) => {
|
|
1750
|
-
s.push(e)
|
|
1774
|
+
s.push(e);
|
|
1751
1775
|
},
|
|
1752
|
-
endRun: () => {
|
|
1753
|
-
let
|
|
1754
|
-
|
|
1776
|
+
endRun: (t) => {
|
|
1777
|
+
let c = Math.max(Ot, (t ?? 1e3 / 60) * 1.8);
|
|
1778
|
+
o = s.filter((e) => e >= c).length;
|
|
1779
|
+
let l = o >= kt;
|
|
1780
|
+
if (l && (a += 1), n) {
|
|
1755
1781
|
if (i) {
|
|
1756
|
-
i = !1,
|
|
1782
|
+
i = !1, l ? r = !0 : e.write("raf");
|
|
1757
1783
|
return;
|
|
1758
1784
|
}
|
|
1759
|
-
|
|
1785
|
+
l && a >= At && !r && (r = !0, e.write("css"));
|
|
1760
1786
|
}
|
|
1761
1787
|
},
|
|
1762
1788
|
stats: () => ({
|
|
@@ -1765,57 +1791,75 @@ var mt = () => ({
|
|
|
1765
1791
|
demoted: r
|
|
1766
1792
|
})
|
|
1767
1793
|
};
|
|
1768
|
-
}
|
|
1769
|
-
let
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1794
|
+
})(Dt(), !0, U()), Mt = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, Nt = /* @__PURE__ */ new WeakMap(), Pt = Symbol("flemo-inline-writer"), Ft = /* @__PURE__ */ new WeakMap(), W = (e, t, n = Pt) => {
|
|
1795
|
+
let r = Nt.get(e);
|
|
1796
|
+
r || (r = /* @__PURE__ */ new Map(), Nt.set(e, r));
|
|
1797
|
+
let i = r.get(t);
|
|
1798
|
+
i || (i = {
|
|
1799
|
+
original: e.style.getPropertyValue(t),
|
|
1800
|
+
owners: /* @__PURE__ */ new Set()
|
|
1801
|
+
}, r.set(t, i)), i.owners.add(n);
|
|
1802
|
+
}, G = (e, t, n) => {
|
|
1803
|
+
St.cancel(e, n);
|
|
1804
|
+
let r = Nt.get(e);
|
|
1805
|
+
(!n || Ft.get(e) === n) && (e.style.transition = "", Ft.delete(e));
|
|
1806
|
+
let i = (t) => {
|
|
1807
|
+
let i = r?.get(t);
|
|
1808
|
+
if (!i) {
|
|
1809
|
+
n || e.style.removeProperty(t);
|
|
1810
|
+
return;
|
|
1811
|
+
}
|
|
1812
|
+
n && (i.owners.delete(n), i.owners.size > 0) || (i.original ? e.style.setProperty(t, i.original) : e.style.removeProperty(t), r.delete(t));
|
|
1813
|
+
};
|
|
1814
|
+
if (t) {
|
|
1815
|
+
for (let e of t) i(e);
|
|
1775
1816
|
return;
|
|
1776
1817
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
for (let t of n) e.style.removeProperty(t);
|
|
1780
|
-
n.clear();
|
|
1818
|
+
if (r && r.size > 0) {
|
|
1819
|
+
for (let e of [...r.keys()]) i(e);
|
|
1781
1820
|
return;
|
|
1782
1821
|
}
|
|
1783
|
-
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1784
|
-
},
|
|
1785
|
-
if (!
|
|
1786
|
-
let
|
|
1787
|
-
if (
|
|
1788
|
-
let
|
|
1789
|
-
if (
|
|
1790
|
-
|
|
1791
|
-
for (let e of i)
|
|
1822
|
+
n || (e.style.removeProperty("transform"), e.style.removeProperty("opacity"));
|
|
1823
|
+
}, K = (e, t, n = {}, r) => {
|
|
1824
|
+
if (!Mt(e)) return Promise.resolve();
|
|
1825
|
+
let i = e, a = V(t);
|
|
1826
|
+
if (a.length === 0) return Promise.resolve();
|
|
1827
|
+
let o = typeof n.duration == "number" ? n.duration : 0, s = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, c = $e(n.ease);
|
|
1828
|
+
if (o <= 0 && s <= 0) {
|
|
1829
|
+
St.takeover(i, r), i.style.transition = "none", Ft.set(i, r);
|
|
1830
|
+
for (let e of a) W(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1792
1831
|
return Promise.resolve();
|
|
1793
1832
|
}
|
|
1794
|
-
let
|
|
1795
|
-
durationMs:
|
|
1796
|
-
delayMs:
|
|
1797
|
-
easing:
|
|
1833
|
+
let l = jt.playerAllowed() ? St.settle(i, a, {
|
|
1834
|
+
durationMs: o * 1e3,
|
|
1835
|
+
delayMs: s * 1e3,
|
|
1836
|
+
easing: c
|
|
1798
1837
|
}, (e) => {
|
|
1799
|
-
r.style.setProperty(e.property, e.value)
|
|
1800
|
-
}) : null;
|
|
1801
|
-
if (
|
|
1802
|
-
let
|
|
1803
|
-
|
|
1804
|
-
for (let e of i)
|
|
1838
|
+
W(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1839
|
+
}, r) : null;
|
|
1840
|
+
if (l) return l;
|
|
1841
|
+
let u = a.map((e) => `${e.property} ${o}s ${c} ${s}s`).join(", ");
|
|
1842
|
+
i.style.transition = u, Ft.set(i, r), i.offsetWidth;
|
|
1843
|
+
for (let e of a) W(i, e.property, r), i.style.setProperty(e.property, e.value);
|
|
1805
1844
|
return new Promise((e) => {
|
|
1806
1845
|
let t = !1, n = () => {
|
|
1807
|
-
t || (t = !0,
|
|
1808
|
-
},
|
|
1809
|
-
e.target ===
|
|
1846
|
+
t || (t = !0, i.removeEventListener("transitionend", r), e());
|
|
1847
|
+
}, r = (e) => {
|
|
1848
|
+
e.target === i && n();
|
|
1810
1849
|
};
|
|
1811
|
-
|
|
1850
|
+
i.addEventListener("transitionend", r), setTimeout(n, (o + s) * 1e3 + 60);
|
|
1812
1851
|
});
|
|
1813
|
-
},
|
|
1814
|
-
|
|
1852
|
+
}, It = (e) => {
|
|
1853
|
+
if (typeof e.querySelectorAll == "function") {
|
|
1854
|
+
e.tagName === "IMG" && !e.hasAttribute("decoding") && e.setAttribute("decoding", "async");
|
|
1855
|
+
for (let t of Array.from(e.querySelectorAll("img:not([decoding])"))) t.setAttribute("decoding", "async");
|
|
1856
|
+
}
|
|
1857
|
+
}, Lt = "data-flemo-held-arrival";
|
|
1858
|
+
function Rt(e) {
|
|
1815
1859
|
if (typeof MutationObserver > "u") return () => {};
|
|
1816
1860
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = (t) => {
|
|
1817
1861
|
let n = t instanceof Element ? t : t.parentElement;
|
|
1818
|
-
return !n || n === e || n.closest(`[data-flemo-part-name], [${
|
|
1862
|
+
return !n || n === e || n.closest(`[data-flemo-part-name], [${Lt}]`) !== null;
|
|
1819
1863
|
}, 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), {
|
|
1820
1864
|
glass: t,
|
|
1821
1865
|
latest: n,
|
|
@@ -1845,12 +1889,12 @@ function jt(e) {
|
|
|
1845
1889
|
if (i.type === "childList") {
|
|
1846
1890
|
for (let e of Array.from(i.removedNodes)) if (!n.has(e)) {
|
|
1847
1891
|
if (e instanceof Element && t.delete(e)) {
|
|
1848
|
-
e.removeAttribute(
|
|
1892
|
+
e.removeAttribute(Lt);
|
|
1849
1893
|
continue;
|
|
1850
1894
|
}
|
|
1851
1895
|
(e instanceof Element || e.nodeType === Node.TEXT_NODE) && l(i.target).removed.push(e);
|
|
1852
1896
|
}
|
|
1853
|
-
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(
|
|
1897
|
+
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(Lt, ""), t.add(e), l(i.target).added.push(e));
|
|
1854
1898
|
}
|
|
1855
1899
|
}
|
|
1856
1900
|
for (let [e, t] of u) {
|
|
@@ -1885,7 +1929,7 @@ function jt(e) {
|
|
|
1885
1929
|
c.disconnect();
|
|
1886
1930
|
for (let e of n) e.parentNode?.removeChild(e);
|
|
1887
1931
|
n.clear();
|
|
1888
|
-
for (let e of t) e.removeAttribute(
|
|
1932
|
+
for (let e of t) e instanceof HTMLElement && It(e), e.removeAttribute(Lt);
|
|
1889
1933
|
t.clear();
|
|
1890
1934
|
for (let [e, t] of i) e.isConnected && (e.nodeValue = t.latest);
|
|
1891
1935
|
i.clear();
|
|
@@ -1895,52 +1939,58 @@ function jt(e) {
|
|
|
1895
1939
|
}
|
|
1896
1940
|
//#endregion
|
|
1897
1941
|
//#region src/core/engine/compositorWarmUp.ts
|
|
1898
|
-
var
|
|
1942
|
+
var zt = "data-flemo-warm", Bt = 3e3, Vt = [{ transform: "translate3d(0, 0, 0)" }, { transform: "translate3d(1px, 0, 0)" }], Ht = {
|
|
1899
1943
|
duration: 500,
|
|
1900
1944
|
iterations: Infinity,
|
|
1901
1945
|
direction: "alternate",
|
|
1902
1946
|
easing: "linear"
|
|
1903
|
-
},
|
|
1904
|
-
|
|
1947
|
+
}, Ut = "position:fixed;top:0;left:0;width:1px;height:1px;pointer-events:none;opacity:0.02;background:#888;will-change:transform;", q = null, Wt = null, Gt = 0, Kt = () => {
|
|
1948
|
+
Gt = 0, Wt?.cancel(), Wt = null, q?.remove(), q = null;
|
|
1905
1949
|
};
|
|
1906
|
-
function
|
|
1950
|
+
function qt() {
|
|
1907
1951
|
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function") return () => {};
|
|
1908
|
-
if (
|
|
1909
|
-
|
|
1952
|
+
if (Gt += 1, !q) {
|
|
1953
|
+
q = document.createElement("div"), q.setAttribute(zt, ""), q.setAttribute("aria-hidden", "true"), q.setAttribute("style", Ut), document.body.appendChild(q);
|
|
1910
1954
|
try {
|
|
1911
|
-
|
|
1955
|
+
Wt = q.animate(Vt, Ht);
|
|
1912
1956
|
} catch {
|
|
1913
|
-
|
|
1957
|
+
Wt = null;
|
|
1914
1958
|
}
|
|
1915
1959
|
}
|
|
1916
1960
|
let e = !1, t = setTimeout(() => {
|
|
1917
|
-
e || (e = !0, --
|
|
1918
|
-
},
|
|
1961
|
+
e || (e = !0, --Gt, Gt <= 0 && Kt());
|
|
1962
|
+
}, Bt);
|
|
1919
1963
|
return () => {
|
|
1920
|
-
e || (e = !0, clearTimeout(t), --
|
|
1964
|
+
e || (e = !0, clearTimeout(t), --Gt, Gt <= 0 && Kt());
|
|
1921
1965
|
};
|
|
1922
1966
|
}
|
|
1923
1967
|
//#endregion
|
|
1924
|
-
//#region src/core/engine/
|
|
1925
|
-
var
|
|
1968
|
+
//#region src/core/engine/emulationNotice.ts
|
|
1969
|
+
var Jt = () => {
|
|
1970
|
+
if (typeof navigator > "u") return !1;
|
|
1971
|
+
let e = navigator.platform ?? "";
|
|
1972
|
+
return /Mac/i.test(e) ? (navigator.maxTouchPoints ?? 0) > 0 : !1;
|
|
1973
|
+
}, Yt = !1, Xt = () => {
|
|
1974
|
+
Yt || !U() || !Jt() || (Yt = !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."));
|
|
1975
|
+
}, Zt = () => {}, Qt = .004, $t = (e, t) => {
|
|
1926
1976
|
let n = e.ownerDocument?.defaultView;
|
|
1927
1977
|
if (!n) return !1;
|
|
1928
1978
|
let r = e;
|
|
1929
1979
|
for (; r;) {
|
|
1930
|
-
if (Number(n.getComputedStyle(r).opacity) <=
|
|
1980
|
+
if (Number(n.getComputedStyle(r).opacity) <= Qt) return !0;
|
|
1931
1981
|
if (r === t) break;
|
|
1932
1982
|
r = r.parentElement;
|
|
1933
1983
|
}
|
|
1934
1984
|
return !1;
|
|
1935
1985
|
};
|
|
1936
|
-
function
|
|
1937
|
-
if (typeof e.getAnimations != "function") return
|
|
1986
|
+
function en(e) {
|
|
1987
|
+
if (typeof e.getAnimations != "function") return Zt;
|
|
1938
1988
|
let t = /* @__PURE__ */ new Set(), n = () => {
|
|
1939
1989
|
for (let n of e.getAnimations({ subtree: !0 })) {
|
|
1940
1990
|
if (t.size >= 128) return;
|
|
1941
1991
|
if (t.has(n) || (n.animationName ?? "").startsWith("flemo-") || n.playState !== "running") continue;
|
|
1942
1992
|
let r = n.effect?.target;
|
|
1943
|
-
if (r instanceof Element &&
|
|
1993
|
+
if (r instanceof Element && $t(r, e)) try {
|
|
1944
1994
|
n.pause(), t.add(n);
|
|
1945
1995
|
} catch {}
|
|
1946
1996
|
}
|
|
@@ -1969,7 +2019,7 @@ function Wt(e) {
|
|
|
1969
2019
|
}
|
|
1970
2020
|
//#endregion
|
|
1971
2021
|
//#region src/transition/cubicBezier.ts
|
|
1972
|
-
var
|
|
2022
|
+
var tn = (e, t, n, r) => {
|
|
1973
2023
|
let i = (t) => 3 * (1 - t) * (1 - t) * t * e + 3 * (1 - t) * t * t * n + t ** 3, a = (e) => 3 * (1 - e) * (1 - e) * e * t + 3 * (1 - e) * e * e * r + e ** 3;
|
|
1974
2024
|
return (e) => {
|
|
1975
2025
|
if (e <= 0) return 0;
|
|
@@ -1981,7 +2031,7 @@ var Gt = (e, t, n, r) => {
|
|
|
1981
2031
|
}
|
|
1982
2032
|
return a((t + n) / 2);
|
|
1983
2033
|
};
|
|
1984
|
-
},
|
|
2034
|
+
}, nn = (e) => e, rn = {
|
|
1985
2035
|
ease: [
|
|
1986
2036
|
.25,
|
|
1987
2037
|
.1,
|
|
@@ -2036,20 +2086,20 @@ var Gt = (e, t, n, r) => {
|
|
|
2036
2086
|
.66,
|
|
2037
2087
|
-.56
|
|
2038
2088
|
]
|
|
2039
|
-
},
|
|
2089
|
+
}, an = (e) => {
|
|
2040
2090
|
if (Array.isArray(e)) {
|
|
2041
2091
|
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
2042
2092
|
let [t, n, r, i] = e;
|
|
2043
|
-
return
|
|
2093
|
+
return tn(t, n, r, i);
|
|
2044
2094
|
}
|
|
2045
|
-
return
|
|
2095
|
+
return nn;
|
|
2046
2096
|
}
|
|
2047
|
-
return typeof e == "string" ? e === "linear" ?
|
|
2048
|
-
},
|
|
2097
|
+
return typeof e == "string" ? e === "linear" ? nn : tn(...rn[e] ?? rn.ease) : tn(...rn.ease);
|
|
2098
|
+
}, on = 1 / 255, sn = 400, cn = 24, ln = /* @__PURE__ */ new Set([
|
|
2049
2099
|
"x",
|
|
2050
2100
|
"y",
|
|
2051
2101
|
"opacity"
|
|
2052
|
-
]),
|
|
2102
|
+
]), un = (e, t, n) => {
|
|
2053
2103
|
if (!e || typeof e != "object") return;
|
|
2054
2104
|
let r = e[t];
|
|
2055
2105
|
if (r === void 0) return;
|
|
@@ -2067,7 +2117,7 @@ var Gt = (e, t, n, r) => {
|
|
|
2067
2117
|
return Number.isNaN(e) ? null : e;
|
|
2068
2118
|
}
|
|
2069
2119
|
return null;
|
|
2070
|
-
},
|
|
2120
|
+
}, dn = (e, t, n) => {
|
|
2071
2121
|
let r = /* @__PURE__ */ new Set();
|
|
2072
2122
|
for (let t of [e.from, e.to]) if (!(!t || typeof t != "object")) for (let e of Object.keys(t)) r.add(e);
|
|
2073
2123
|
if (r.size === 0) return null;
|
|
@@ -2075,25 +2125,167 @@ var Gt = (e, t, n, r) => {
|
|
|
2075
2125
|
for (let a of r) {
|
|
2076
2126
|
let r = e.from && typeof e.from == "object" ? e.from[a] : void 0, o = e.to && typeof e.to == "object" ? e.to[a] : void 0;
|
|
2077
2127
|
if (r !== void 0 && r === o) continue;
|
|
2078
|
-
if (!
|
|
2079
|
-
let s =
|
|
2128
|
+
if (!ln.has(a)) return null;
|
|
2129
|
+
let s = un(e.from, a, t), c = un(e.to, a, t);
|
|
2080
2130
|
if (s === null || c === null || s === void 0 || c === void 0) return null;
|
|
2081
2131
|
let l = Math.abs(c - s);
|
|
2082
2132
|
if (l === 0) continue;
|
|
2083
|
-
let u = a === "opacity" ?
|
|
2133
|
+
let u = a === "opacity" ? on : 1 / Math.max(1, n);
|
|
2084
2134
|
i = Math.min(i, u / l);
|
|
2085
2135
|
}
|
|
2086
2136
|
return !Number.isFinite(i) || i <= 0 || i >= 1 ? null : i;
|
|
2087
|
-
},
|
|
2137
|
+
}, J = (e, t, n) => {
|
|
2088
2138
|
if (e.duration <= 0) return null;
|
|
2089
|
-
let r =
|
|
2139
|
+
let r = dn(e, t, n);
|
|
2090
2140
|
if (r === null) return null;
|
|
2091
|
-
let i =
|
|
2092
|
-
for (let e =
|
|
2141
|
+
let i = an(e.ease), a = sn;
|
|
2142
|
+
for (let e = sn; e >= 0 && !(Math.abs(1 - i(e / sn)) > r); --e) a = e;
|
|
2093
2143
|
if (a === 0) return null;
|
|
2094
|
-
let o = (e.delay + e.duration * (a /
|
|
2095
|
-
return (e.delay + e.duration) * 1e3 - o <
|
|
2096
|
-
},
|
|
2144
|
+
let o = (e.delay + e.duration * (a / sn)) * 1e3;
|
|
2145
|
+
return (e.delay + e.duration) * 1e3 - o < cn ? null : o;
|
|
2146
|
+
}, fn = 1e3 / 120, pn = 4, Y = 400, mn = 4, hn = (e) => {
|
|
2147
|
+
let t = +e.toFixed(5);
|
|
2148
|
+
return Object.is(t, -0) ? 0 : t;
|
|
2149
|
+
}, gn = (e, t, n) => {
|
|
2150
|
+
if (e.duration <= 0) return null;
|
|
2151
|
+
let r = Number.isFinite(n) && n > 0 ? n : 1, i = /* @__PURE__ */ new Set();
|
|
2152
|
+
for (let t of [e.from, e.to]) if (!(!t || typeof t != "object")) for (let e of Object.keys(t)) i.add(e);
|
|
2153
|
+
let a = 0;
|
|
2154
|
+
for (let n of i) {
|
|
2155
|
+
let i = e.from && typeof e.from == "object" ? e.from[n] : void 0, o = e.to && typeof e.to == "object" ? e.to[n] : void 0;
|
|
2156
|
+
if (i !== void 0 && i === o) continue;
|
|
2157
|
+
if (n !== "x" && n !== "y") return null;
|
|
2158
|
+
let s = un(e.from, n, t), c = un(e.to, n, t);
|
|
2159
|
+
if (s === null || c === null || s === void 0 || c === void 0) return null;
|
|
2160
|
+
a = Math.max(a, Math.abs(c - s) * r);
|
|
2161
|
+
}
|
|
2162
|
+
if (a < pn) return null;
|
|
2163
|
+
let o = an(e.ease), s = Array(401);
|
|
2164
|
+
for (let e = 0; e <= Y; e += 1) s[e] = o(e / Y);
|
|
2165
|
+
let c = e.duration * 1e3 / Y, l = 40 / a * c / fn, u = Y, d = 0;
|
|
2166
|
+
for (let e = 399; e >= 0 && (d = Math.max(d, Math.abs(s[e + 1] - s[e])), !(d > l)); --e) u = e;
|
|
2167
|
+
for (let e = u; e < Y; e += 1) if (s[e + 1] < s[e] || s[e] > 1) return null;
|
|
2168
|
+
let f = (1 - s[u]) * a;
|
|
2169
|
+
if (f <= 1) return null;
|
|
2170
|
+
let p = Math.min(480, Math.floor(f)), m = u, h = (e) => {
|
|
2171
|
+
let t = 1 - e / a;
|
|
2172
|
+
for (; m < Y && s[m] < t;) m += 1;
|
|
2173
|
+
if (m === 0) return 0;
|
|
2174
|
+
let n = s[m - 1], r = s[m], i = r === n ? 1 : Math.max(0, Math.min(1, (t - n) / (r - n)));
|
|
2175
|
+
return (m - 1 + i) / Y * 100;
|
|
2176
|
+
}, g = h(p), _ = [];
|
|
2177
|
+
for (let e = 0; 100 / Y * e < g; e += mn) _.push(`${hn(s[e])} ${hn(e / Y * 100)}%`);
|
|
2178
|
+
let v = g;
|
|
2179
|
+
for (let e = p; e >= 2; --e) {
|
|
2180
|
+
let t = h(e - 1);
|
|
2181
|
+
if (t > v) {
|
|
2182
|
+
let n = hn(1 - e / a);
|
|
2183
|
+
_.push(`${n} ${hn(v)}%`, `${n} ${hn(t)}%`);
|
|
2184
|
+
}
|
|
2185
|
+
v = t;
|
|
2186
|
+
}
|
|
2187
|
+
return _.push(`1 ${hn(v)}%`, "1 100%"), `linear(${_.join(", ")})`;
|
|
2188
|
+
};
|
|
2189
|
+
(() => {
|
|
2190
|
+
try {
|
|
2191
|
+
if (typeof location > "u" || typeof sessionStorage > "u") return;
|
|
2192
|
+
/[?&]flemo-layers=resident\b/.test(location.search) ? sessionStorage.setItem("flemo:layers", "resident") : /[?&]flemo-layers=off\b/.test(location.search) && sessionStorage.removeItem("flemo:layers");
|
|
2193
|
+
} catch {}
|
|
2194
|
+
})();
|
|
2195
|
+
var _n, vn = () => {
|
|
2196
|
+
if (_n !== void 0) return _n;
|
|
2197
|
+
try {
|
|
2198
|
+
_n = typeof sessionStorage < "u" && sessionStorage.getItem("flemo:layers") === "resident";
|
|
2199
|
+
} catch {
|
|
2200
|
+
_n = !1;
|
|
2201
|
+
}
|
|
2202
|
+
return _n;
|
|
2203
|
+
}, yn = /* @__PURE__ */ new WeakMap(), bn = Symbol("flemo-layer-owner"), xn = (e, t) => {
|
|
2204
|
+
t.willChange ? e.style.willChange = t.willChange : e.style.removeProperty("will-change"), t.contain ? e.style.contain = t.contain : e.style.removeProperty("contain");
|
|
2205
|
+
}, Sn = (e, t) => {
|
|
2206
|
+
let n = e.trim() === "none" ? "" : e.trim();
|
|
2207
|
+
return t ? n ? /\b(layout|strict|content)\b/.test(n) ? n : `${n} layout` : "layout" : n;
|
|
2208
|
+
}, Cn = (e, t) => {
|
|
2209
|
+
let n = /* @__PURE__ */ new Set(), r = !1;
|
|
2210
|
+
for (let e of t.willChange.split(",")) {
|
|
2211
|
+
let t = e.trim();
|
|
2212
|
+
t && t !== "auto" && n.add(t);
|
|
2213
|
+
}
|
|
2214
|
+
for (let e of t.owners.values()) {
|
|
2215
|
+
for (let t of e.properties) n.add(t);
|
|
2216
|
+
e.containment && (r = !0);
|
|
2217
|
+
}
|
|
2218
|
+
e.style.willChange = [...n].join(", ");
|
|
2219
|
+
let i = Sn(t.contain, r);
|
|
2220
|
+
i ? e.style.contain = i : e.style.removeProperty("contain");
|
|
2221
|
+
}, wn = (e, t, n = !1, r = bn) => {
|
|
2222
|
+
let i = Ze(t), a = yn.get(e);
|
|
2223
|
+
if (i.length === 0) {
|
|
2224
|
+
if (!a) return;
|
|
2225
|
+
a.owners.has(r) ? (a.owners.delete(r), a.owners.size === 0 ? (a.pending != null && clearTimeout(a.pending), xn(e, a), yn.delete(e)) : Cn(e, a)) : r === a.settleOwner && a.owners.size === 0 && (a.pending != null && clearTimeout(a.pending), xn(e, a), yn.delete(e));
|
|
2226
|
+
return;
|
|
2227
|
+
}
|
|
2228
|
+
a?.pending != null && (clearTimeout(a.pending), a.pending = null), a || (a = {
|
|
2229
|
+
owners: /* @__PURE__ */ new Map(),
|
|
2230
|
+
settleOwner: null,
|
|
2231
|
+
willChange: e.style.willChange,
|
|
2232
|
+
contain: e.style.contain,
|
|
2233
|
+
pending: null
|
|
2234
|
+
}, yn.set(e, a)), a.owners.set(r, {
|
|
2235
|
+
properties: i,
|
|
2236
|
+
containment: n
|
|
2237
|
+
}), a.settleOwner = null, Cn(e, a);
|
|
2238
|
+
}, X = (e, t = bn) => {
|
|
2239
|
+
let n = yn.get(e);
|
|
2240
|
+
if (!(!n || !n.owners.has(t))) {
|
|
2241
|
+
if (n.owners.delete(t), n.owners.size > 0) {
|
|
2242
|
+
Cn(e, n);
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
if (vn() && typeof e.closest == "function" && e.closest("[data-flemo-screen]")) {
|
|
2246
|
+
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");
|
|
2247
|
+
return;
|
|
2248
|
+
}
|
|
2249
|
+
/* v8 ignore next 5 -- setTimeout exists in every runtime under test; the
|
|
2250
|
+
guard shields exotic embedders, where an immediate demotion is simply
|
|
2251
|
+
the pre-hold behavior. */
|
|
2252
|
+
if (n.settleOwner = t, n.pending != null && clearTimeout(n.pending), typeof setTimeout != "function") {
|
|
2253
|
+
xn(e, n), yn.delete(e);
|
|
2254
|
+
return;
|
|
2255
|
+
}
|
|
2256
|
+
n.pending = setTimeout(() => {
|
|
2257
|
+
xn(e, n), yn.delete(e);
|
|
2258
|
+
}, 300);
|
|
2259
|
+
}
|
|
2260
|
+
}, Tn = !1, En = 0, Dn = [], On = () => {
|
|
2261
|
+
let e = Dn;
|
|
2262
|
+
Dn = [];
|
|
2263
|
+
for (let t of e) t();
|
|
2264
|
+
}, kn = (e) => /event-stream/i.test(e.headers.get("content-type") ?? ""), An = () => {
|
|
2265
|
+
if (Tn || typeof window > "u" || typeof window.fetch != "function") return;
|
|
2266
|
+
Tn = !0;
|
|
2267
|
+
let e = window.fetch.bind(window);
|
|
2268
|
+
window.fetch = (...t) => e(...t).then((e) => En <= 0 || kn(e) ? e : new Promise((t) => {
|
|
2269
|
+
Dn.push(() => t(e));
|
|
2270
|
+
}), (e) => {
|
|
2271
|
+
if (En <= 0) throw e;
|
|
2272
|
+
return new Promise((t, n) => {
|
|
2273
|
+
Dn.push(() => n(e));
|
|
2274
|
+
});
|
|
2275
|
+
});
|
|
2276
|
+
}, jn = 2e3;
|
|
2277
|
+
function Mn(e = jn) {
|
|
2278
|
+
/* v8 ignore next -- SSR guard: without fetch there is nothing to hold. */
|
|
2279
|
+
if (An(), !Tn) return () => {};
|
|
2280
|
+
En += 1;
|
|
2281
|
+
let t = !1, n = null, r = () => {
|
|
2282
|
+
t || (t = !0, n !== null && clearTimeout(n), En = Math.max(0, En - 1), En === 0 && On());
|
|
2283
|
+
};
|
|
2284
|
+
return typeof setTimeout == "function" && (n = setTimeout(r, Math.max(jn, e))), r;
|
|
2285
|
+
}
|
|
2286
|
+
//#endregion
|
|
2287
|
+
//#region src/core/engine/transitionPlayer.ts
|
|
2288
|
+
var Nn = [
|
|
2097
2289
|
"x",
|
|
2098
2290
|
"y",
|
|
2099
2291
|
"z",
|
|
@@ -2104,7 +2296,7 @@ var Gt = (e, t, n, r) => {
|
|
|
2104
2296
|
"rotateX",
|
|
2105
2297
|
"rotateY",
|
|
2106
2298
|
"rotateZ"
|
|
2107
|
-
],
|
|
2299
|
+
], Pn = new Set(Nn), Fn = {
|
|
2108
2300
|
x: 0,
|
|
2109
2301
|
y: 0,
|
|
2110
2302
|
z: 0,
|
|
@@ -2115,7 +2307,7 @@ var Gt = (e, t, n, r) => {
|
|
|
2115
2307
|
rotateX: 0,
|
|
2116
2308
|
rotateY: 0,
|
|
2117
2309
|
rotateZ: 0
|
|
2118
|
-
},
|
|
2310
|
+
}, In = (e, t) => {
|
|
2119
2311
|
if (typeof t == "number") return {
|
|
2120
2312
|
value: t,
|
|
2121
2313
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -2124,7 +2316,7 @@ var Gt = (e, t, n, r) => {
|
|
|
2124
2316
|
let n = t.trim(), r = /^(-?\d*\.?\d+)(px|%|deg)?$/.exec(n);
|
|
2125
2317
|
if (!r) return null;
|
|
2126
2318
|
let i = parseFloat(r[1]), a = r[2] ?? "";
|
|
2127
|
-
return e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? a !== "deg" &&
|
|
2319
|
+
return e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? a !== "deg" && (a !== "" || i !== 0) ? null : {
|
|
2128
2320
|
value: i,
|
|
2129
2321
|
unit: ""
|
|
2130
2322
|
} : e === "scale" || e === "scaleX" || e === "scaleY" ? a === "" ? {
|
|
@@ -2134,145 +2326,229 @@ var Gt = (e, t, n, r) => {
|
|
|
2134
2326
|
value: i,
|
|
2135
2327
|
unit: a === "" && i === 0 ? "px" : a
|
|
2136
2328
|
};
|
|
2137
|
-
},
|
|
2138
|
-
let n = e.match(
|
|
2139
|
-
if (n.length !== r.length || e.replace(
|
|
2329
|
+
}, Ln = /-?\d*\.?\d+/g, Rn = (e, t) => {
|
|
2330
|
+
let n = e.match(Ln) ?? [], r = t.match(Ln) ?? [];
|
|
2331
|
+
if (n.length !== r.length || e.replace(Ln, " ") !== t.replace(Ln, " ")) return null;
|
|
2140
2332
|
let i = n.map(Number), a = r.map(Number);
|
|
2141
2333
|
return (t) => {
|
|
2142
2334
|
let n = 0;
|
|
2143
|
-
return e.replace(
|
|
2335
|
+
return e.replace(Ln, () => {
|
|
2144
2336
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
2145
2337
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
2146
2338
|
});
|
|
2147
2339
|
};
|
|
2148
|
-
},
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2340
|
+
}, zn = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Bn = (e) => typeof e == "object" && !!e && !Array.isArray(e), Vn = (e) => Bn(e) ? Object.keys(e) : [], Hn = (e, t) => Bn(e) ? e[t] : void 0, Un = {
|
|
2341
|
+
x: 0,
|
|
2342
|
+
y: 0,
|
|
2343
|
+
z: 0,
|
|
2344
|
+
scale: 1,
|
|
2345
|
+
scaleX: 1,
|
|
2346
|
+
scaleY: 1,
|
|
2347
|
+
rotate: 2,
|
|
2348
|
+
rotateX: 2,
|
|
2349
|
+
rotateY: 2,
|
|
2350
|
+
rotateZ: 2
|
|
2351
|
+
}, Wn = (e) => {
|
|
2352
|
+
let t = 0, n = -1;
|
|
2353
|
+
for (let r of e) {
|
|
2354
|
+
if (!Pn.has(r)) continue;
|
|
2355
|
+
let e = Un[r];
|
|
2356
|
+
if (e < t) return !1;
|
|
2357
|
+
if (t = e, e === 2) {
|
|
2358
|
+
let e = Nn.indexOf(r);
|
|
2359
|
+
if (e < n) return !1;
|
|
2360
|
+
n = e;
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
return !0;
|
|
2364
|
+
}, Gn = (e) => {
|
|
2365
|
+
let t = [];
|
|
2366
|
+
for (let n of e) {
|
|
2367
|
+
if (!Pn.has(n)) continue;
|
|
2368
|
+
let e = Un[n] === 0 ? "T" : n;
|
|
2369
|
+
(e !== "T" || t[t.length - 1] !== "T") && t.push(e);
|
|
2370
|
+
}
|
|
2371
|
+
return t;
|
|
2372
|
+
}, Kn = (e, t) => {
|
|
2373
|
+
let n = Gn(e), r = Gn(t), [i, a] = n.length <= r.length ? [n, r] : [r, n];
|
|
2374
|
+
return i.every((e, t) => a[t] === e);
|
|
2375
|
+
}, qn = (e, t) => {
|
|
2376
|
+
let n = Vn(e.from), r = Vn(e.to);
|
|
2377
|
+
if (!Wn(n) || !Wn(r) || !Kn(n, r)) return null;
|
|
2378
|
+
let i = /* @__PURE__ */ new Set([...n, ...r]), a = [], o = null, s = [], c = [];
|
|
2379
|
+
for (let n of i) {
|
|
2380
|
+
let r = Hn(e.from, n), i = Hn(e.to, n);
|
|
2381
|
+
if (Pn.has(n)) {
|
|
2382
|
+
let e = n, o = {
|
|
2383
|
+
value: Fn[e],
|
|
2155
2384
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
2156
|
-
},
|
|
2157
|
-
if (!
|
|
2158
|
-
let l =
|
|
2159
|
-
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100),
|
|
2385
|
+
}, s = r === void 0 ? o : In(e, r), c = i === void 0 ? o : In(e, i);
|
|
2386
|
+
if (!s || !c || s.unit !== c.unit && s.value !== 0 && c.value !== 0) return null;
|
|
2387
|
+
let l = s.value === 0 && s.unit !== c.unit ? c.unit : s.unit, u = l === "%", d = 0;
|
|
2388
|
+
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), a.push({
|
|
2160
2389
|
prop: e,
|
|
2161
2390
|
from: {
|
|
2162
|
-
value:
|
|
2391
|
+
value: s.value,
|
|
2163
2392
|
unit: l
|
|
2164
2393
|
},
|
|
2165
2394
|
to: {
|
|
2166
|
-
value:
|
|
2395
|
+
value: c.value,
|
|
2167
2396
|
unit: l
|
|
2168
2397
|
},
|
|
2169
2398
|
percentBase: d
|
|
2170
2399
|
});
|
|
2171
2400
|
continue;
|
|
2172
2401
|
}
|
|
2173
|
-
if (
|
|
2174
|
-
let e =
|
|
2402
|
+
if (n === "opacity") {
|
|
2403
|
+
let e = r === void 0 ? 1 : r, t = i === void 0 ? 1 : i;
|
|
2175
2404
|
if (typeof e != "number" || typeof t != "number") return null;
|
|
2176
|
-
|
|
2405
|
+
o = {
|
|
2177
2406
|
from: e,
|
|
2178
2407
|
to: t
|
|
2179
2408
|
};
|
|
2180
2409
|
continue;
|
|
2181
2410
|
}
|
|
2182
|
-
if (
|
|
2183
|
-
let l = typeof
|
|
2411
|
+
if (r === void 0 || i === void 0) return null;
|
|
2412
|
+
let l = typeof r == "number" ? `${r}` : r, u = typeof i == "number" ? `${i}` : i;
|
|
2184
2413
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
2185
2414
|
if (l === u) {
|
|
2186
|
-
|
|
2187
|
-
property:
|
|
2415
|
+
c.push({
|
|
2416
|
+
property: zn(n),
|
|
2188
2417
|
value: l
|
|
2189
2418
|
});
|
|
2190
2419
|
continue;
|
|
2191
2420
|
}
|
|
2192
|
-
let d =
|
|
2421
|
+
let d = Rn(l, u);
|
|
2193
2422
|
if (!d) return null;
|
|
2194
|
-
|
|
2195
|
-
property:
|
|
2423
|
+
s.push({
|
|
2424
|
+
property: zn(n),
|
|
2196
2425
|
mix: d
|
|
2197
2426
|
});
|
|
2198
2427
|
}
|
|
2199
2428
|
return {
|
|
2200
|
-
transforms:
|
|
2201
|
-
opacity:
|
|
2202
|
-
strings:
|
|
2203
|
-
constants:
|
|
2429
|
+
transforms: a,
|
|
2430
|
+
opacity: o,
|
|
2431
|
+
strings: s,
|
|
2432
|
+
constants: c
|
|
2204
2433
|
};
|
|
2205
|
-
},
|
|
2206
|
-
if (
|
|
2434
|
+
}, Jn = 1, Yn, Xn = () => {
|
|
2435
|
+
if (Yn !== void 0) return Yn;
|
|
2207
2436
|
try {
|
|
2208
2437
|
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:apply") : null;
|
|
2209
|
-
|
|
2438
|
+
Yn = e === "scrub" ? e : null;
|
|
2210
2439
|
} catch {
|
|
2211
|
-
|
|
2440
|
+
Yn = null;
|
|
2212
2441
|
}
|
|
2213
|
-
return
|
|
2214
|
-
},
|
|
2215
|
-
if (
|
|
2442
|
+
return Yn;
|
|
2443
|
+
}, Zn, Qn = () => {
|
|
2444
|
+
if (Zn !== void 0) return Zn;
|
|
2445
|
+
try {
|
|
2446
|
+
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:handoff") : null;
|
|
2447
|
+
Zn = e === "on" ? e : null;
|
|
2448
|
+
} catch {
|
|
2449
|
+
Zn = null;
|
|
2450
|
+
}
|
|
2451
|
+
return Zn;
|
|
2452
|
+
}, $n, er = () => {
|
|
2453
|
+
if ($n !== void 0) return $n;
|
|
2216
2454
|
try {
|
|
2217
2455
|
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:snap") : null;
|
|
2218
|
-
|
|
2456
|
+
$n = e === "always" || e === "off" || e === "gate" ? e : null;
|
|
2219
2457
|
} catch {
|
|
2220
|
-
|
|
2458
|
+
$n = null;
|
|
2221
2459
|
}
|
|
2222
|
-
return
|
|
2223
|
-
},
|
|
2460
|
+
return $n;
|
|
2461
|
+
}, tr = (e) => !U() && e > 0 && e < 3, nr = (e, t, n, r) => {
|
|
2224
2462
|
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
2225
|
-
for (let l of
|
|
2463
|
+
for (let l of Nn) {
|
|
2226
2464
|
let u = e.find((e) => e.prop === l);
|
|
2227
2465
|
if (!u) continue;
|
|
2228
2466
|
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
2229
2467
|
if (u.from.unit === "%" && (d *= u.percentBase), l === "x" || l === "y") {
|
|
2230
|
-
let e = l === "x" ? r.x : r.y, t =
|
|
2468
|
+
let e = l === "x" ? r.x : r.y, t = er(), s = (t === "always" || t === null && tr(n) || t !== "off" && (e === null || Math.abs(d - e) * n >= Jn)) && n > 0 ? Math.round(d * n) / n : Math.round(d * 1e3) / 1e3;
|
|
2231
2469
|
l === "x" ? (r.x = d, i = s) : (r.y = d, a = s), o = !0, s !== 0 && (c = !1);
|
|
2232
2470
|
continue;
|
|
2233
2471
|
}
|
|
2234
|
-
let f =
|
|
2472
|
+
let f = Fn[l];
|
|
2235
2473
|
d !== f && (c = !1), l === "z" ? s.push(`translateZ(${d}px)`) : l === "scale" ? s.push(`scale(${d})`) : l === "scaleX" ? s.push(`scaleX(${d})`) : l === "scaleY" ? s.push(`scaleY(${d})`) : l === "rotate" || l === "rotateZ" ? s.push(`rotate(${d}deg)`) : l === "rotateX" ? s.push(`rotateX(${d}deg)`) : l === "rotateY" && s.push(`rotateY(${d}deg)`);
|
|
2236
2474
|
}
|
|
2237
2475
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
2238
|
-
},
|
|
2476
|
+
}, rr = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), ir = (e) => {
|
|
2239
2477
|
let t = {};
|
|
2240
|
-
for (let n of
|
|
2478
|
+
for (let n of V(e)) t[rr(n.property)] = n.value;
|
|
2241
2479
|
return t;
|
|
2242
|
-
},
|
|
2480
|
+
}, ar = (e, t) => {
|
|
2243
2481
|
if (typeof e.animate != "function") return null;
|
|
2244
2482
|
try {
|
|
2245
|
-
let n = e.animate([
|
|
2483
|
+
let n = e.animate([ir(t.from), ir(t.to)], {
|
|
2246
2484
|
duration: Math.max(0, t.duration * 1e3),
|
|
2247
2485
|
delay: Math.max(0, t.delay * 1e3),
|
|
2248
|
-
easing:
|
|
2486
|
+
easing: $e(t.ease),
|
|
2249
2487
|
fill: "both"
|
|
2250
2488
|
});
|
|
2251
2489
|
return n.pause(), n.currentTime = 0, n;
|
|
2252
2490
|
} catch {
|
|
2253
2491
|
return null;
|
|
2254
2492
|
}
|
|
2255
|
-
},
|
|
2493
|
+
}, or = 1e3 / 60, sr = 1.6, cr = 1e3 / 240, lr = 28, ur = 42, dr = or, fr = 6 * or, pr = 41, mr = (e) => Math.round(e * 1e4) / 1e4, hr = (e, t) => {
|
|
2494
|
+
let n = 0, r = 0, i = !1, a = [], o = !0;
|
|
2495
|
+
for (let s of Nn) {
|
|
2496
|
+
let c = e.find((e) => e.prop === s);
|
|
2497
|
+
if (!c) continue;
|
|
2498
|
+
let l = c.from.value + (c.to.value - c.from.value) * t;
|
|
2499
|
+
if (c.from.unit === "%" && (l *= c.percentBase), l = mr(l), s === "x" || s === "y") {
|
|
2500
|
+
s === "x" ? n = l : r = l, i = !0, l !== 0 && (o = !1);
|
|
2501
|
+
continue;
|
|
2502
|
+
}
|
|
2503
|
+
l !== Fn[s] && (o = !1), s === "z" ? a.push(`translateZ(${l}px)`) : s === "scale" ? a.push(`scale(${l})`) : s === "scaleX" ? a.push(`scaleX(${l})`) : s === "scaleY" ? a.push(`scaleY(${l})`) : s === "rotate" || s === "rotateZ" ? a.push(`rotate(${l}deg)`) : s === "rotateX" ? a.push(`rotateX(${l}deg)`) : s === "rotateY" && a.push(`rotateY(${l}deg)`);
|
|
2504
|
+
}
|
|
2505
|
+
return !i && a.length === 0 ? "" : o ? "none" : [...i ? [`translate3d(${n}px, ${r}px, 0)`] : [], ...a].join(" ");
|
|
2506
|
+
}, gr = (e, t, n) => {
|
|
2507
|
+
let r = [];
|
|
2508
|
+
for (let i = 0; i < pr; i += 1) {
|
|
2509
|
+
let a = t(n + i / 40 * (1 - n)), o = {};
|
|
2510
|
+
if (e.transforms.length > 0) {
|
|
2511
|
+
let t = hr(e.transforms, a);
|
|
2512
|
+
t !== "" && (o.transform = t);
|
|
2513
|
+
}
|
|
2514
|
+
e.opacity && (o.opacity = `${mr(e.opacity.from + (e.opacity.to - e.opacity.from) * a)}`);
|
|
2515
|
+
for (let t of e.strings) o[rr(t.property)] = t.mix(a);
|
|
2516
|
+
if (i === 0 || i === 40) for (let t of e.constants) o[rr(t.property)] = t.value;
|
|
2517
|
+
r.push(o);
|
|
2518
|
+
}
|
|
2519
|
+
return r;
|
|
2520
|
+
}, _r = () => ({
|
|
2256
2521
|
request: (e) => requestAnimationFrame(e),
|
|
2257
2522
|
cancel: (e) => cancelAnimationFrame(e),
|
|
2258
2523
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
2259
|
-
}),
|
|
2524
|
+
}), vr = ((e = _r()) => {
|
|
2260
2525
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
2261
2526
|
join: (n, r) => {
|
|
2262
|
-
let i =
|
|
2263
|
-
if (!
|
|
2264
|
-
let
|
|
2265
|
-
|
|
2527
|
+
let i = Xn() === "scrub", s = !i && !U() && Qn() === "on", c = i ? null : qn(r.motion, r.element), l = !c || s ? ar(r.element, r.motion) : null, u = l ? null : c;
|
|
2528
|
+
if (!u && !l) return null;
|
|
2529
|
+
let d = t.get(n);
|
|
2530
|
+
d || (d = {
|
|
2266
2531
|
tracks: [],
|
|
2532
|
+
frameIntervalMs: dr,
|
|
2533
|
+
recentGaps: [],
|
|
2534
|
+
navCutMs: null,
|
|
2535
|
+
navComplete: null,
|
|
2536
|
+
navCompleted: !1,
|
|
2267
2537
|
started: !1,
|
|
2538
|
+
ended: !1,
|
|
2268
2539
|
startTime: null,
|
|
2269
2540
|
lastTime: null,
|
|
2270
2541
|
frameHandle: null
|
|
2271
|
-
}, t.set(n,
|
|
2272
|
-
let
|
|
2542
|
+
}, t.set(n, d));
|
|
2543
|
+
let f = J(r.motion, r.element, e.devicePixelRatio() || 1), p = {
|
|
2273
2544
|
...r,
|
|
2274
|
-
|
|
2275
|
-
|
|
2545
|
+
onComplete: void 0,
|
|
2546
|
+
parsed: u,
|
|
2547
|
+
scrub: l,
|
|
2548
|
+
cutMs: f,
|
|
2549
|
+
handoff: s && l !== null && c !== null,
|
|
2550
|
+
handedOff: !1,
|
|
2551
|
+
remainderPlan: s && l !== null ? c : null,
|
|
2276
2552
|
completed: !1,
|
|
2277
2553
|
detached: !1,
|
|
2278
2554
|
snapMemory: {
|
|
@@ -2280,16 +2556,18 @@ var Gt = (e, t, n, r) => {
|
|
|
2280
2556
|
y: null
|
|
2281
2557
|
}
|
|
2282
2558
|
};
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2559
|
+
d.tracks.push(p), d.navCutMs = d.tracks.some((e) => e.cutMs === null) ? null : Math.max(...d.tracks.map((e) => e.cutMs));
|
|
2560
|
+
let m = Symbol("flemo-player-track");
|
|
2561
|
+
if (W(p.element, "animation", m), p.element.style.animation = "none", u) {
|
|
2562
|
+
u.transforms.length > 0 && W(p.element, "transform", m), u.opacity && W(p.element, "opacity", m);
|
|
2563
|
+
for (let e of u.strings) W(p.element, e.property, m);
|
|
2564
|
+
for (let e of u.constants) W(p.element, e.property, m);
|
|
2565
|
+
a(p, 0);
|
|
2566
|
+
}
|
|
2567
|
+
return r.role === "active" && (r.onComplete && (d.navComplete = r.onComplete), d.started || (d.started = !0, jt.beginRun(), o(n, d))), () => {
|
|
2568
|
+
p.detached = !0, p.scrub?.cancel(), G(p.element, void 0, m);
|
|
2291
2569
|
let r = t.get(n);
|
|
2292
|
-
r && (r.tracks = r.tracks.filter((e) => e !==
|
|
2570
|
+
r && (r.tracks = r.tracks.filter((e) => e !== p), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
2293
2571
|
};
|
|
2294
2572
|
},
|
|
2295
2573
|
dispose: (n) => {
|
|
@@ -2302,13 +2580,13 @@ var Gt = (e, t, n, r) => {
|
|
|
2302
2580
|
}
|
|
2303
2581
|
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
2304
2582
|
let t = r.get(e);
|
|
2305
|
-
return t || (t =
|
|
2583
|
+
return t || (t = an(e.motion.ease), r.set(e, t)), t;
|
|
2306
2584
|
};
|
|
2307
2585
|
function a(t, n) {
|
|
2308
2586
|
let { element: r, parsed: i } = t;
|
|
2309
2587
|
if (!(!i || !r.isConnected)) {
|
|
2310
2588
|
if (i.transforms.length > 0) {
|
|
2311
|
-
let a =
|
|
2589
|
+
let a = nr(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
2312
2590
|
a !== "" && (r.style.transform = a);
|
|
2313
2591
|
}
|
|
2314
2592
|
if (i.opacity) {
|
|
@@ -2321,37 +2599,87 @@ var Gt = (e, t, n, r) => {
|
|
|
2321
2599
|
}
|
|
2322
2600
|
function o(t, n) {
|
|
2323
2601
|
n.frameHandle = e.request((e) => {
|
|
2324
|
-
n.frameHandle = null,
|
|
2602
|
+
n.frameHandle = null, l(t, n, e);
|
|
2325
2603
|
});
|
|
2326
2604
|
}
|
|
2327
|
-
function s(e
|
|
2328
|
-
|
|
2605
|
+
function s(e) {
|
|
2606
|
+
e.ended || (e.ended = !0, jt.endRun(e.frameIntervalMs));
|
|
2607
|
+
}
|
|
2608
|
+
function c(e, n, r, a) {
|
|
2609
|
+
let o = r.element, c = Math.max(0, r.motion.delay * 1e3), l = Math.max(0, r.motion.duration * 1e3), u = Math.max(0, c - a), d = Math.max(0, a - c), f = l - d;
|
|
2610
|
+
if (f <= 0) return r.handoff = !1, !1;
|
|
2611
|
+
let p = r.remainderPlan;
|
|
2612
|
+
if (!p) return r.handoff = !1, !1;
|
|
2613
|
+
let m = i(r), h = l > 0 ? d / l : 0;
|
|
2614
|
+
if (!(1 - m(h) > .001)) return r.handoff = !1, !1;
|
|
2615
|
+
let g;
|
|
2616
|
+
try {
|
|
2617
|
+
g = o.animate(gr(p, m, h), {
|
|
2618
|
+
duration: f,
|
|
2619
|
+
delay: u,
|
|
2620
|
+
easing: "linear",
|
|
2621
|
+
fill: "both"
|
|
2622
|
+
});
|
|
2623
|
+
} catch {
|
|
2624
|
+
return r.handoff = !1, !1;
|
|
2625
|
+
}
|
|
2626
|
+
if (r.scrub.cancel(), r.scrub = g, r.handedOff = !0, g.onfinish = () => {
|
|
2627
|
+
r.completed || r.detached || (r.completed = !0, r.onComplete?.(), t.get(e) === n && n.tracks.every((e) => e.completed || e.detached) && (n.navCompleted || (n.navCompleted = !0, n.navComplete?.()), s(n), t.delete(e)));
|
|
2628
|
+
}, typeof window < "u") {
|
|
2629
|
+
let e = window.__flemoHandoffs ??= [];
|
|
2630
|
+
e.push(Math.round(a)), e.length > 100 && e.splice(0, e.length - 100);
|
|
2631
|
+
}
|
|
2632
|
+
return !0;
|
|
2633
|
+
}
|
|
2634
|
+
function l(e, r, l) {
|
|
2635
|
+
let u = r.startTime ?? l;
|
|
2329
2636
|
if (r.lastTime !== null) {
|
|
2330
|
-
let e =
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2637
|
+
let e = l - r.lastTime;
|
|
2638
|
+
if (jt.reportGap(e), n.onFrameGap?.(e), e >= cr && e <= ur) {
|
|
2639
|
+
r.recentGaps.push(e), r.recentGaps.length > 7 && r.recentGaps.shift();
|
|
2640
|
+
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 >= lr);
|
|
2641
|
+
r.frameIntervalMs = Math.min(i ? ur : or, Math.max(cr, n)), dr = r.frameIntervalMs;
|
|
2642
|
+
}
|
|
2643
|
+
e > sr * r.frameIntervalMs && (u += e - r.frameIntervalMs);
|
|
2644
|
+
}
|
|
2645
|
+
r.startTime = u, r.lastTime = l;
|
|
2646
|
+
let d = !0, f = !1;
|
|
2647
|
+
for (let t of r.tracks) {
|
|
2648
|
+
if (t.completed || t.detached) continue;
|
|
2649
|
+
let n = t.motion.duration * 1e3, o = t.motion.delay * 1e3, s = l - u;
|
|
2650
|
+
if (r.navCutMs !== null && s >= r.navCutMs) {
|
|
2651
|
+
t.completed = !0, t.onComplete?.();
|
|
2652
|
+
continue;
|
|
2653
|
+
}
|
|
2654
|
+
if (t.scrub) {
|
|
2655
|
+
if (t.handedOff) {
|
|
2656
|
+
d = !1;
|
|
2657
|
+
continue;
|
|
2658
|
+
}
|
|
2659
|
+
let i = o + n, a = Math.min(Math.max(0, s), i);
|
|
2660
|
+
if (t.handoff && s >= fr && s < i && c(e, r, t, a)) {
|
|
2661
|
+
d = !1;
|
|
2662
|
+
continue;
|
|
2663
|
+
}
|
|
2664
|
+
t.scrub.currentTime = a, s >= i ? (t.completed = !0, t.onComplete?.()) : (d = !1, f = !0);
|
|
2341
2665
|
continue;
|
|
2342
2666
|
}
|
|
2343
|
-
let
|
|
2344
|
-
a(
|
|
2667
|
+
let p = n <= 0 ? 1 : Math.min(1, Math.max(0, (s - o) / n));
|
|
2668
|
+
a(t, i(t)(p)), p >= 1 ? (t.completed = !0, t.onComplete?.()) : (d = !1, f = !0);
|
|
2669
|
+
}
|
|
2670
|
+
if (d) {
|
|
2671
|
+
r.navCompleted || (r.navCompleted = !0, r.navComplete?.()), s(r), t.delete(e);
|
|
2672
|
+
return;
|
|
2345
2673
|
}
|
|
2346
|
-
if (
|
|
2347
|
-
|
|
2674
|
+
if (!f) {
|
|
2675
|
+
s(r);
|
|
2348
2676
|
return;
|
|
2349
2677
|
}
|
|
2350
2678
|
o(e, r);
|
|
2351
2679
|
}
|
|
2352
2680
|
return n;
|
|
2353
2681
|
})();
|
|
2354
|
-
|
|
2682
|
+
vr.onFrameGap = (e) => {
|
|
2355
2683
|
if (typeof window < "u") {
|
|
2356
2684
|
let t = window.__flemoPlayerGaps ??= [];
|
|
2357
2685
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -2359,47 +2687,105 @@ Tn.onFrameGap = (e) => {
|
|
|
2359
2687
|
};
|
|
2360
2688
|
//#endregion
|
|
2361
2689
|
//#region src/core/engine/types.ts
|
|
2362
|
-
var
|
|
2363
|
-
let n = 0, r = !1;
|
|
2364
|
-
for (let i of ["x", "y"]) {
|
|
2365
|
-
let a = $t(e.from, i, t), o = $t(e.to, i, t);
|
|
2366
|
-
if (!(a === void 0 && o === void 0)) {
|
|
2367
|
-
if (a === null || o === null || a === void 0 || o === void 0) return null;
|
|
2368
|
-
r = !0, n = Math.max(n, Math.abs(o - a));
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
if (!r || n === 0) return 0;
|
|
2372
|
-
let i = e.duration * 1e3;
|
|
2373
|
-
/* v8 ignore next 2 -- resolveVariantMotion never yields duration<=0 with a
|
|
2374
|
-
distance; kept so a hand-built motion cannot divide by zero. */
|
|
2375
|
-
if (i <= 0) return 0;
|
|
2376
|
-
let a = i / Dn, o = Jt(e.ease), s = Math.max(1, Math.min(240, Math.ceil(a))), c = 0, l = o(0);
|
|
2377
|
-
for (let e = 1; e <= s; e++) {
|
|
2378
|
-
let t = o(e / s);
|
|
2379
|
-
c = Math.max(c, Math.abs(t - l)), l = t;
|
|
2380
|
-
}
|
|
2381
|
-
return n * c * (s / a);
|
|
2382
|
-
}, kn = (e, t, n) => {
|
|
2690
|
+
var yr = "data-flemo-skip-animation", br = (e, t, n) => {
|
|
2383
2691
|
let r = e.driver;
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
for (let r of ["true", "false"]) {
|
|
2387
|
-
let a = U(e, `${t}-${r}`);
|
|
2388
|
-
if (!a) continue;
|
|
2389
|
-
let o = On(a, n);
|
|
2390
|
-
if (o === null) return "player";
|
|
2391
|
-
i = Math.max(i, o);
|
|
2392
|
-
}
|
|
2393
|
-
return i >= 6 ? "native" : "player";
|
|
2394
|
-
}, An = 1e3 / 60 * 2, jn = "flemo-", Mn = /* @__PURE__ */ new WeakMap(), Nn = (e, t, n) => {
|
|
2692
|
+
return r === "native" || r === "player" ? r : "player";
|
|
2693
|
+
}, xr = 1e3 / 60 * 2, Sr = "flemo-", Cr = /* @__PURE__ */ new WeakMap(), wr = (e, t, n) => {
|
|
2395
2694
|
if (typeof e.getAnimations == "function") for (let r of e.getAnimations({ subtree: !0 })) {
|
|
2396
2695
|
let e = r.animationName;
|
|
2397
|
-
if (typeof e != "string" || !e.startsWith(
|
|
2696
|
+
if (typeof e != "string" || !e.startsWith(Sr) || r.playState !== "running" || Cr.get(r) === n) continue;
|
|
2398
2697
|
let i = r.startTime;
|
|
2399
|
-
typeof i == "number" && (r.startTime = i + t,
|
|
2698
|
+
typeof i == "number" && (r.startTime = i + t, Cr.set(r, n));
|
|
2400
2699
|
}
|
|
2401
|
-
};
|
|
2402
|
-
function
|
|
2700
|
+
}, Tr = /* @__PURE__ */ new WeakSet(), Er = 1e3, Dr = 3e3;
|
|
2701
|
+
function Or(e, t, n) {
|
|
2702
|
+
if (typeof MutationObserver > "u" || typeof requestAnimationFrame != "function") return () => {};
|
|
2703
|
+
let r = 0, i = !1, a = !1, o = !1, s = null, c = [], l = null, u = () => {
|
|
2704
|
+
s !== null && (clearTimeout(s), s = null);
|
|
2705
|
+
}, d = () => {
|
|
2706
|
+
for (let e of c) try {
|
|
2707
|
+
e.playState === "paused" && e.play();
|
|
2708
|
+
} catch {}
|
|
2709
|
+
}, f = () => {
|
|
2710
|
+
a || o || (o = !0, u(), r &&= (cancelAnimationFrame(r), 0), d(), n?.());
|
|
2711
|
+
}, p = () => {
|
|
2712
|
+
i = !0, m.disconnect();
|
|
2713
|
+
for (let e of t()) if (!(!e || typeof e.getAnimations != "function")) for (let t of e.getAnimations({ subtree: !0 })) {
|
|
2714
|
+
let e = t.animationName;
|
|
2715
|
+
if (typeof e != "string" || !e.startsWith(Sr) || t.playState !== "running" || Tr.has(t)) continue;
|
|
2716
|
+
let n = t.currentTime;
|
|
2717
|
+
if (!(typeof n == "number" && n > 33.333333333333336)) {
|
|
2718
|
+
try {
|
|
2719
|
+
t.pause();
|
|
2720
|
+
} catch {
|
|
2721
|
+
continue;
|
|
2722
|
+
}
|
|
2723
|
+
Tr.add(t), c.push(t);
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
if (c.length === 0) return;
|
|
2727
|
+
r = requestAnimationFrame(f), typeof setTimeout == "function" && (s = setTimeout(f, Er));
|
|
2728
|
+
let e = jr(t, () => {
|
|
2729
|
+
a || n?.();
|
|
2730
|
+
});
|
|
2731
|
+
if (l = e, typeof setTimeout == "function") {
|
|
2732
|
+
let t = setTimeout(() => {
|
|
2733
|
+
l === e && (l = null), e();
|
|
2734
|
+
}, Dr), n = e;
|
|
2735
|
+
l = () => {
|
|
2736
|
+
clearTimeout(t), n();
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
}, m = new MutationObserver(() => {
|
|
2740
|
+
i || e.getAttribute("data-flemo-anim-hold") === "false" && p();
|
|
2741
|
+
});
|
|
2742
|
+
return e.getAttribute("data-flemo-anim-hold") === "false" ? p() : m.observe(e, {
|
|
2743
|
+
attributes: !0,
|
|
2744
|
+
attributeFilter: ["data-flemo-anim-hold"]
|
|
2745
|
+
}), () => {
|
|
2746
|
+
a = !0, m.disconnect(), r &&= (cancelAnimationFrame(r), 0), u(), l?.(), l = null, i && !o && d();
|
|
2747
|
+
};
|
|
2748
|
+
}
|
|
2749
|
+
var kr = 150;
|
|
2750
|
+
function Ar(e, t) {
|
|
2751
|
+
/* v8 ignore next -- same rAF guard as the watcher below. */
|
|
2752
|
+
if (typeof requestAnimationFrame != "function") return () => {};
|
|
2753
|
+
let n = [], r = /* @__PURE__ */ new Map();
|
|
2754
|
+
for (let t of e()) if (!(!t || typeof t.getAnimations != "function")) for (let e of t.getAnimations({ subtree: !0 })) {
|
|
2755
|
+
let t = e.animationName;
|
|
2756
|
+
if (typeof t != "string" || !t.startsWith(Sr) || e.playState !== "running" || Tr.has(e)) continue;
|
|
2757
|
+
let i = e.currentTime;
|
|
2758
|
+
typeof i != "number" || i > 33.333333333333336 || (Tr.add(e), n.push(e), r.set(e, i));
|
|
2759
|
+
}
|
|
2760
|
+
if (n.length === 0) return () => {};
|
|
2761
|
+
let i = 0, a = !1, o = null, s = null, c = 0, l = (e) => {
|
|
2762
|
+
if (a) return;
|
|
2763
|
+
if (o === null && (o = e), s !== null) {
|
|
2764
|
+
let t = e - s;
|
|
2765
|
+
c += Math.min(Math.max(0, t), xr);
|
|
2766
|
+
}
|
|
2767
|
+
s = e;
|
|
2768
|
+
let u = 0;
|
|
2769
|
+
for (let e of n) {
|
|
2770
|
+
if (e.playState !== "running") continue;
|
|
2771
|
+
let t = e.currentTime, n = e.startTime;
|
|
2772
|
+
if (typeof t != "number" || typeof n != "number") continue;
|
|
2773
|
+
let i = r.get(e) ?? 0;
|
|
2774
|
+
if (t <= i + c + 33.333333333333336) continue;
|
|
2775
|
+
let a = t - (i + c);
|
|
2776
|
+
e.startTime = n + a, u = Math.max(u, a);
|
|
2777
|
+
}
|
|
2778
|
+
if (u > 0) {
|
|
2779
|
+
t?.(u);
|
|
2780
|
+
return;
|
|
2781
|
+
}
|
|
2782
|
+
e - o < kr && (i = requestAnimationFrame(l));
|
|
2783
|
+
};
|
|
2784
|
+
return i = requestAnimationFrame(l), () => {
|
|
2785
|
+
a = !0, cancelAnimationFrame(i);
|
|
2786
|
+
};
|
|
2787
|
+
}
|
|
2788
|
+
function jr(e, t) {
|
|
2403
2789
|
/* v8 ignore next -- every runtime under test has rAF; the guard shields
|
|
2404
2790
|
exotic embedders. */
|
|
2405
2791
|
if (typeof requestAnimationFrame != "function") return () => {};
|
|
@@ -2408,8 +2794,8 @@ function Pn(e, t) {
|
|
|
2408
2794
|
if (r !== null) {
|
|
2409
2795
|
let n = o - r;
|
|
2410
2796
|
if (n > 33.333333333333336) {
|
|
2411
|
-
let r = n -
|
|
2412
|
-
for (let t of e()) t &&
|
|
2797
|
+
let r = n - xr;
|
|
2798
|
+
for (let t of e()) t && wr(t, r, o);
|
|
2413
2799
|
t?.(r);
|
|
2414
2800
|
}
|
|
2415
2801
|
}
|
|
@@ -2422,58 +2808,117 @@ function Pn(e, t) {
|
|
|
2422
2808
|
}
|
|
2423
2809
|
//#endregion
|
|
2424
2810
|
//#region src/core/engine/createTransitionEngine.ts
|
|
2425
|
-
var Z = () => {},
|
|
2811
|
+
var Z = () => {}, Mr = 400, Nr = 4, Pr = 100, Fr = 1500, Ir = "data-flemo-part-name", Lr = /* @__PURE__ */ new WeakMap(), Rr = (e) => {
|
|
2426
2812
|
let t = e.parentElement ?? e;
|
|
2427
|
-
return Array.from(t.querySelectorAll(`[${
|
|
2813
|
+
return Array.from(t.querySelectorAll(`[${Ir}]`)).filter((n) => {
|
|
2428
2814
|
let r = n.closest("[data-flemo-screen]");
|
|
2429
2815
|
return !r || r === e || !t.contains(r);
|
|
2430
2816
|
});
|
|
2431
|
-
},
|
|
2817
|
+
}, zr = (e, t) => {
|
|
2432
2818
|
let [n, r] = t.split("-");
|
|
2433
|
-
return
|
|
2434
|
-
},
|
|
2435
|
-
let
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2819
|
+
return Rr(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2820
|
+
}, Br = (e, t) => {
|
|
2821
|
+
let n = e.closest("[data-flemo-router]")?.getAttribute("data-flemo-router") ?? null;
|
|
2822
|
+
return Array.from(e.ownerDocument.querySelectorAll(`[${Ir}][data-flemo-status="${t}"]`)).filter((e) => {
|
|
2823
|
+
if (n === null) return !0;
|
|
2824
|
+
let t = e.closest("[data-flemo-router]");
|
|
2825
|
+
return !t || t.getAttribute("data-flemo-router") === n;
|
|
2826
|
+
});
|
|
2827
|
+
}, Vr = (e, t, n) => {
|
|
2828
|
+
let r = 0;
|
|
2829
|
+
for (let e of [`${n}-true`, `${n}-false`]) {
|
|
2830
|
+
if (!H(t, e)) continue;
|
|
2831
|
+
let n = B(t, e);
|
|
2832
|
+
n && (r = Math.max(r, (n.delay + n.duration) * 1e3));
|
|
2833
|
+
}
|
|
2834
|
+
for (let t of Br(e, n)) {
|
|
2835
|
+
let e = z.get(t.getAttribute(Ir)), i = `${n}-${t.getAttribute("data-flemo-active")}`;
|
|
2836
|
+
if (!e || !H(e, i)) continue;
|
|
2837
|
+
let a = B(e, i);
|
|
2838
|
+
a && (r = Math.max(r, (a.delay + a.duration) * 1e3));
|
|
2839
|
+
}
|
|
2840
|
+
let i = t.decoratorName ? R.get(t.decoratorName) : void 0;
|
|
2841
|
+
if (i) for (let e of [`${n}-true`, `${n}-false`]) {
|
|
2842
|
+
if (!H(i, e)) continue;
|
|
2843
|
+
let t = B(i, e);
|
|
2844
|
+
t && (r = Math.max(r, (t.delay + t.duration) * 1e3));
|
|
2845
|
+
}
|
|
2846
|
+
return r;
|
|
2847
|
+
}, Hr = () => {
|
|
2848
|
+
try {
|
|
2849
|
+
return typeof sessionStorage < "u" && sessionStorage.getItem("flemo:landing-snap") === "on";
|
|
2850
|
+
} catch {
|
|
2851
|
+
return !1;
|
|
2852
|
+
}
|
|
2853
|
+
}, Ur = (e, t, n, r) => {
|
|
2854
|
+
let { scope: i, decorator: a, bars: o } = e, s = n.split("-")[0], c = s === "PUSHING" || s === "REPLACING", l = U() && Hr(), u = l && typeof window < "u" && window.devicePixelRatio || 1;
|
|
2855
|
+
if (H(t, n)) {
|
|
2856
|
+
wn(i, t, c, r);
|
|
2857
|
+
let e = l ? gn(B(t, n), i, u) : null;
|
|
2858
|
+
e && (W(i, "animation-timing-function", r), i.style.animationTimingFunction = e);
|
|
2859
|
+
for (let n of o ?? []) n?.getAttribute("data-flemo-bar-riding") === "true" && (wn(n, t, c, r), e && (W(n, "animation-timing-function", r), n.style.animationTimingFunction = e));
|
|
2860
|
+
}
|
|
2861
|
+
if (a && t.decoratorName) {
|
|
2862
|
+
let e = R.get(t.decoratorName);
|
|
2863
|
+
e && H(e, n) && wn(a, e, c, r);
|
|
2864
|
+
}
|
|
2865
|
+
for (let e of zr(i, n)) {
|
|
2866
|
+
let t = z.get(e.getAttribute(Ir));
|
|
2867
|
+
if (t && H(t, n)) {
|
|
2868
|
+
wn(e, t, c, r);
|
|
2869
|
+
let i = l ? gn(B(t, n), e, u) : null;
|
|
2870
|
+
i && (W(e, "animation-timing-function", r), e.style.animationTimingFunction = i);
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
}, Wr = (e, t) => {
|
|
2874
|
+
let { scope: n, decorator: r, bars: i } = e;
|
|
2875
|
+
if (n) {
|
|
2876
|
+
X(n, t);
|
|
2877
|
+
for (let e of Rr(n)) X(e, t);
|
|
2878
|
+
}
|
|
2879
|
+
r && X(r, t);
|
|
2880
|
+
for (let e of i ?? []) e && X(e, t);
|
|
2881
|
+
}, Gr = 4, Kr = (e) => `${Math.round(e * 1e3) / 1e3}s`, qr = (e) => {
|
|
2882
|
+
let { element: t, expectedName: n, motion: r } = e, i = !1, a = !1, o = (n) => {
|
|
2883
|
+
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" && (W(t, "animation-delay", e.writer), t.style.animationDelay = Kr(n.seconds), a = !0), i = !1;
|
|
2884
|
+
}, s = (a) => {
|
|
2885
|
+
if (i || a.target !== t || a.animationName !== n) return;
|
|
2886
|
+
if (!e.isLive() || e.budgetUsed() >= Gr) {
|
|
2442
2887
|
e.onTerminal();
|
|
2443
2888
|
return;
|
|
2444
2889
|
}
|
|
2445
|
-
|
|
2446
|
-
|
|
2890
|
+
let s = Math.max(0, a.elapsedTime * 1e3), c = r.duration * 1e3;
|
|
2891
|
+
if (c > 0 && s >= c) {
|
|
2892
|
+
e.onTerminal();
|
|
2447
2893
|
return;
|
|
2448
2894
|
}
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
e.onTerminal();
|
|
2895
|
+
if (e.spendBudget(), s <= 0) {
|
|
2896
|
+
o({ mode: "keep" });
|
|
2452
2897
|
return;
|
|
2453
2898
|
}
|
|
2454
|
-
|
|
2899
|
+
o({
|
|
2455
2900
|
mode: "set",
|
|
2456
|
-
seconds:
|
|
2901
|
+
seconds: -s / 1e3
|
|
2457
2902
|
});
|
|
2458
2903
|
};
|
|
2459
2904
|
return {
|
|
2460
2905
|
attach: () => {
|
|
2461
|
-
t.addEventListener("
|
|
2906
|
+
t.addEventListener("animationcancel", s);
|
|
2462
2907
|
},
|
|
2463
2908
|
detach: () => {
|
|
2464
|
-
t.removeEventListener("
|
|
2909
|
+
t.removeEventListener("animationcancel", s), a &&= (G(t, ["animation-delay"], e.writer), !1);
|
|
2465
2910
|
},
|
|
2466
2911
|
fullRestart: () => {
|
|
2467
|
-
|
|
2912
|
+
o({ mode: "clear" });
|
|
2468
2913
|
}
|
|
2469
2914
|
};
|
|
2470
2915
|
};
|
|
2471
|
-
function
|
|
2472
|
-
let t = /* @__PURE__ */ new Map(),
|
|
2473
|
-
if (!
|
|
2474
|
-
let { land: e, cancel: t } =
|
|
2475
|
-
|
|
2476
|
-
},
|
|
2916
|
+
function Jr(e) {
|
|
2917
|
+
let t = Symbol("flemo-engine-layer"), n = /* @__PURE__ */ new Map(), r = null, i = null, a = null, o = null, c = () => {
|
|
2918
|
+
if (!o) return;
|
|
2919
|
+
let { land: e, cancel: t } = o;
|
|
2920
|
+
o = null, t(), e();
|
|
2921
|
+
}, l = (e) => {
|
|
2477
2922
|
if (typeof requestAnimationFrame != "function") {
|
|
2478
2923
|
e();
|
|
2479
2924
|
return;
|
|
@@ -2481,47 +2926,55 @@ function Gn(e) {
|
|
|
2481
2926
|
let t = 0;
|
|
2482
2927
|
t = requestAnimationFrame(() => {
|
|
2483
2928
|
t = requestAnimationFrame(() => {
|
|
2484
|
-
|
|
2929
|
+
o = null, e();
|
|
2485
2930
|
});
|
|
2486
|
-
}),
|
|
2931
|
+
}), o = {
|
|
2487
2932
|
land: e,
|
|
2488
2933
|
cancel: () => cancelAnimationFrame(t)
|
|
2489
2934
|
};
|
|
2490
2935
|
};
|
|
2491
2936
|
return {
|
|
2492
|
-
driveScreenLifecycle: (
|
|
2493
|
-
let { getElements:
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2937
|
+
driveScreenLifecycle: (o) => {
|
|
2938
|
+
let { getElements: u, transitionName: d, prevTransitionName: f, status: p, isActive: m, animHoldReleased: h } = o, g = p === "PUSHING" || p === "POPPING" || p === "REPLACING";
|
|
2939
|
+
if (g) {
|
|
2940
|
+
let { scope: e, bars: n } = u();
|
|
2941
|
+
if (e) {
|
|
2942
|
+
It(e), G(e, ["animation-timing-function"], t);
|
|
2943
|
+
for (let n of Rr(e)) G(n, ["animation-timing-function"], t);
|
|
2944
|
+
for (let e of n ?? []) e && G(e, ["animation-timing-function"], t);
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
g && (Xt(), a &&= (clearTimeout(a), null), i ||= qt()), !g && i && !a && (typeof setTimeout == "function" ? a = setTimeout(() => {
|
|
2948
|
+
a = null, i?.(), i = null;
|
|
2949
|
+
}, Mr) : (i(), i = null));
|
|
2950
|
+
let _ = g && (m ? p === "PUSHING" || p === "REPLACING" : p === "POPPING");
|
|
2951
|
+
if (!_ && r) {
|
|
2952
|
+
let e = r;
|
|
2953
|
+
r = null, g ? e() : l(e);
|
|
2954
|
+
}
|
|
2955
|
+
if (_ && !r) {
|
|
2956
|
+
c();
|
|
2957
|
+
let { scope: e } = u();
|
|
2505
2958
|
if (e) {
|
|
2506
|
-
let t =
|
|
2507
|
-
|
|
2508
|
-
|
|
2959
|
+
let t = Rt(e), n = en(e), i = Mn(Vr(e, De(d), p) + Fr);
|
|
2960
|
+
r = () => {
|
|
2961
|
+
i(), n(), t();
|
|
2509
2962
|
};
|
|
2510
2963
|
}
|
|
2511
2964
|
}
|
|
2512
|
-
let
|
|
2965
|
+
let v = (t, n, r) => {
|
|
2513
2966
|
let i = e.getTransitionTaskId();
|
|
2514
|
-
if (!i || s.pendingTaskIds.some((e) => e !== i) || !
|
|
2515
|
-
let { scope: a, decorator: o, bars: c } =
|
|
2967
|
+
if (!i || U() && s.pendingTaskIds.some((e) => e !== i) || !jt.playerAllowed()) return null;
|
|
2968
|
+
let { scope: a, decorator: o, bars: c } = u();
|
|
2516
2969
|
if (!a) return null;
|
|
2517
|
-
let
|
|
2518
|
-
if (
|
|
2970
|
+
let l = De(d);
|
|
2971
|
+
if (jt.pinnedDriver() !== "raf") {
|
|
2519
2972
|
let e = t.split("-")[0];
|
|
2520
|
-
if (
|
|
2973
|
+
if (br(l, e, a) === "native") return null;
|
|
2521
2974
|
}
|
|
2522
|
-
let f =
|
|
2975
|
+
let f = B(l, t);
|
|
2523
2976
|
if (!f) return null;
|
|
2524
|
-
let p = [], m =
|
|
2977
|
+
let p = [], m = vr.join(i, {
|
|
2525
2978
|
element: a,
|
|
2526
2979
|
motion: f,
|
|
2527
2980
|
role: n,
|
|
@@ -2531,17 +2984,17 @@ function Gn(e) {
|
|
|
2531
2984
|
p.push(m);
|
|
2532
2985
|
for (let e of c ?? []) {
|
|
2533
2986
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2534
|
-
let t =
|
|
2987
|
+
let t = vr.join(i, {
|
|
2535
2988
|
element: e,
|
|
2536
2989
|
motion: f,
|
|
2537
2990
|
role: "passive"
|
|
2538
2991
|
});
|
|
2539
2992
|
t && p.push(t);
|
|
2540
2993
|
}
|
|
2541
|
-
if (o &&
|
|
2542
|
-
let e =
|
|
2994
|
+
if (o && l.decoratorName) {
|
|
2995
|
+
let e = R.get(l.decoratorName), n = e ? B(e, t) : null;
|
|
2543
2996
|
if (n) {
|
|
2544
|
-
let e =
|
|
2997
|
+
let e = vr.join(i, {
|
|
2545
2998
|
element: o,
|
|
2546
2999
|
motion: n,
|
|
2547
3000
|
role: "passive"
|
|
@@ -2549,10 +3002,10 @@ function Gn(e) {
|
|
|
2549
3002
|
e && p.push(e);
|
|
2550
3003
|
}
|
|
2551
3004
|
}
|
|
2552
|
-
for (let e of
|
|
2553
|
-
let n =
|
|
3005
|
+
for (let e of zr(a, t)) {
|
|
3006
|
+
let n = z.get(e.getAttribute(Ir)), r = n ? B(n, t) : null;
|
|
2554
3007
|
if (!r) continue;
|
|
2555
|
-
let a =
|
|
3008
|
+
let a = vr.join(i, {
|
|
2556
3009
|
element: e,
|
|
2557
3010
|
motion: r,
|
|
2558
3011
|
role: "passive"
|
|
@@ -2560,233 +3013,300 @@ function Gn(e) {
|
|
|
2560
3013
|
a && p.push(a);
|
|
2561
3014
|
}
|
|
2562
3015
|
return () => p.forEach((e) => e());
|
|
2563
|
-
},
|
|
2564
|
-
let
|
|
2565
|
-
let
|
|
3016
|
+
}, y = (e, n) => {
|
|
3017
|
+
let r = [], { decorator: i, bars: a } = u(), o = De(d), s = (e, n, i) => {
|
|
3018
|
+
let a = 0, o = qr({
|
|
2566
3019
|
element: e,
|
|
2567
|
-
expectedName:
|
|
2568
|
-
motion:
|
|
3020
|
+
expectedName: n,
|
|
3021
|
+
motion: i,
|
|
3022
|
+
writer: t,
|
|
2569
3023
|
isLive: () => e.isConnected,
|
|
2570
|
-
budgetUsed: () =>
|
|
3024
|
+
budgetUsed: () => a,
|
|
2571
3025
|
spendBudget: () => {
|
|
2572
|
-
|
|
3026
|
+
a += 1;
|
|
2573
3027
|
},
|
|
2574
3028
|
onTerminal: Z
|
|
2575
3029
|
});
|
|
2576
|
-
|
|
2577
|
-
},
|
|
2578
|
-
if (
|
|
2579
|
-
if (
|
|
2580
|
-
let e =
|
|
2581
|
-
|
|
3030
|
+
o.attach(), r.push(o.detach);
|
|
3031
|
+
}, c = it("screen", d, n), l = B(o, n);
|
|
3032
|
+
if (l) for (let e of a ?? []) !e || e.getAttribute("data-flemo-bar-riding") !== "true" || s(e, c, l);
|
|
3033
|
+
if (i && o.decoratorName) {
|
|
3034
|
+
let e = R.get(o.decoratorName), t = e ? B(e, n) : null;
|
|
3035
|
+
t && s(i, it("decorator", o.decoratorName, n), t);
|
|
2582
3036
|
}
|
|
2583
|
-
for (let
|
|
2584
|
-
let e =
|
|
2585
|
-
i &&
|
|
3037
|
+
for (let t of zr(e, n)) {
|
|
3038
|
+
let e = t.getAttribute(Ir), r = z.get(e), i = r ? B(r, n) : null;
|
|
3039
|
+
i && s(t, it("part", e, n), i);
|
|
2586
3040
|
}
|
|
2587
|
-
return
|
|
3041
|
+
return r;
|
|
2588
3042
|
};
|
|
2589
|
-
if (!
|
|
2590
|
-
if (
|
|
2591
|
-
let { scope: e, decorator:
|
|
3043
|
+
if (!m) {
|
|
3044
|
+
if (p === "COMPLETED") {
|
|
3045
|
+
let { scope: e, decorator: n, bars: r } = u();
|
|
2592
3046
|
if (e) {
|
|
2593
|
-
|
|
2594
|
-
for (let t of
|
|
3047
|
+
G(e);
|
|
3048
|
+
for (let t of Rr(e)) G(t);
|
|
2595
3049
|
}
|
|
2596
|
-
|
|
2597
|
-
for (let e of
|
|
2598
|
-
return
|
|
3050
|
+
n && G(n);
|
|
3051
|
+
for (let e of r ?? []) e && G(e, void 0, t);
|
|
3052
|
+
return Wr({
|
|
3053
|
+
scope: e,
|
|
3054
|
+
decorator: n,
|
|
3055
|
+
bars: r ?? []
|
|
3056
|
+
}, t), Z;
|
|
2599
3057
|
}
|
|
2600
|
-
if (
|
|
2601
|
-
let e
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
3058
|
+
if (p === "REPLACING" && f !== d && e.setReplaceTransitionStatus("PENDING"), g) {
|
|
3059
|
+
let { scope: e, decorator: n, bars: r } = u();
|
|
3060
|
+
e && Ur({
|
|
3061
|
+
scope: e,
|
|
3062
|
+
decorator: n,
|
|
3063
|
+
bars: r ?? []
|
|
3064
|
+
}, De(d), `${p}-false`, t);
|
|
3065
|
+
}
|
|
3066
|
+
if (g && h) {
|
|
3067
|
+
let e = `${p}-false`, n = v(e, "passive");
|
|
3068
|
+
if (n) return n;
|
|
3069
|
+
let { scope: r } = u();
|
|
3070
|
+
if (r) {
|
|
3071
|
+
let n = De(d), i = [];
|
|
3072
|
+
if (H(n, e)) {
|
|
3073
|
+
let a = B(n, e), o = 0, s = qr({
|
|
3074
|
+
element: r,
|
|
3075
|
+
expectedName: it("screen", d, e),
|
|
3076
|
+
motion: a,
|
|
3077
|
+
writer: t,
|
|
3078
|
+
isLive: () => r.isConnected && r.getAttribute("data-flemo-skip-animation") !== "true",
|
|
3079
|
+
budgetUsed: () => o,
|
|
2613
3080
|
spendBudget: () => {
|
|
2614
|
-
|
|
3081
|
+
o += 1;
|
|
2615
3082
|
},
|
|
2616
3083
|
onTerminal: Z
|
|
2617
3084
|
});
|
|
2618
|
-
|
|
3085
|
+
s.attach(), i.push(s.detach);
|
|
2619
3086
|
}
|
|
2620
|
-
if (
|
|
3087
|
+
if (i.push(...y(r, e)), i.length > 0) return () => i.forEach((e) => e());
|
|
2621
3088
|
}
|
|
2622
3089
|
}
|
|
2623
3090
|
return Z;
|
|
2624
3091
|
}
|
|
2625
|
-
if (
|
|
3092
|
+
if (p === "COMPLETED") {
|
|
2626
3093
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2627
|
-
let { scope:
|
|
2628
|
-
if (
|
|
2629
|
-
|
|
2630
|
-
for (let e of
|
|
3094
|
+
let { scope: n, decorator: r, bars: i } = u();
|
|
3095
|
+
if (n) {
|
|
3096
|
+
G(n), n.removeAttribute(yr);
|
|
3097
|
+
for (let e of Rr(n)) G(e);
|
|
2631
3098
|
}
|
|
2632
|
-
|
|
2633
|
-
for (let e of
|
|
2634
|
-
return
|
|
3099
|
+
r && (G(r), r.removeAttribute(yr));
|
|
3100
|
+
for (let e of i ?? []) e && G(e, void 0, t);
|
|
3101
|
+
return Wr({
|
|
3102
|
+
scope: n,
|
|
3103
|
+
decorator: r,
|
|
3104
|
+
bars: i ?? []
|
|
3105
|
+
}, t), Z;
|
|
3106
|
+
}
|
|
3107
|
+
if (p === "IDLE") return Z;
|
|
3108
|
+
let { scope: b } = u();
|
|
3109
|
+
if (!b) return Z;
|
|
3110
|
+
let x = e.getTransitionTaskId(), S = () => {
|
|
3111
|
+
let t = e.getTransitionTaskId();
|
|
3112
|
+
t && s.resolveTask(t), x && n.delete(x);
|
|
3113
|
+
}, C = De(d), w = `${p}-true`, T = b.getAttribute(yr) === "true", ee = !T && H(C, w);
|
|
3114
|
+
if (!T) {
|
|
3115
|
+
let { decorator: e, bars: n } = u();
|
|
3116
|
+
Ur({
|
|
3117
|
+
scope: b,
|
|
3118
|
+
decorator: e,
|
|
3119
|
+
bars: n ?? []
|
|
3120
|
+
}, C, w, t);
|
|
2635
3121
|
}
|
|
2636
|
-
|
|
2637
|
-
let
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
let n = e.getTransitionTaskId();
|
|
2641
|
-
n && s.resolveTask(n), b && t.delete(b);
|
|
2642
|
-
}, S = be(u), C = `${f}-true`, w = y.getAttribute(En) === "true", T = !w && K(S, C), E = `${f}-false`, D = K(S, E) ? U(S, E) : null, O = [];
|
|
2643
|
-
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${zn}][data-flemo-status="${f}"]`))) {
|
|
2644
|
-
let t = H.get(e.getAttribute(zn)), n = `${f}-${e.getAttribute("data-flemo-active")}`, r = t && K(t, n) ? U(t, n) : null;
|
|
2645
|
-
r && O.push({
|
|
3122
|
+
let te = `${p}-false`, E = H(C, te) ? B(C, te) : null, ne = [];
|
|
3123
|
+
for (let e of Br(b, p)) {
|
|
3124
|
+
let t = z.get(e.getAttribute(Ir)), n = `${p}-${e.getAttribute("data-flemo-active")}`, r = t && H(t, n) ? B(t, n) : null;
|
|
3125
|
+
r && ne.push({
|
|
2646
3126
|
element: e,
|
|
2647
3127
|
motion: r
|
|
2648
3128
|
});
|
|
2649
3129
|
}
|
|
2650
|
-
let
|
|
2651
|
-
for (let { motion: e } of
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
let
|
|
3130
|
+
let D = E ? (E.delay + E.duration) * 1e3 : 0;
|
|
3131
|
+
for (let { motion: e } of ne) D = Math.max(D, (e.delay + e.duration) * 1e3);
|
|
3132
|
+
let re = [];
|
|
3133
|
+
{
|
|
3134
|
+
let e = C.decoratorName ? R.get(C.decoratorName) : void 0;
|
|
3135
|
+
if (e) for (let t of [`${p}-true`, `${p}-false`]) {
|
|
3136
|
+
if (!H(e, t)) continue;
|
|
3137
|
+
let n = B(e, t);
|
|
3138
|
+
n && (re.push(n), D = Math.max(D, (n.delay + n.duration) * 1e3));
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
if (!ee) {
|
|
3142
|
+
if (!T && D > 0) {
|
|
3143
|
+
if (!h) return x && s.markGateHeld(x), Z;
|
|
3144
|
+
let e = D + 50;
|
|
3145
|
+
x && s.anchorGate(x, e + Fr);
|
|
3146
|
+
let t = setTimeout(S, e);
|
|
2658
3147
|
return () => clearTimeout(t);
|
|
2659
3148
|
}
|
|
2660
|
-
return queueMicrotask(
|
|
2661
|
-
}
|
|
2662
|
-
let
|
|
2663
|
-
if (
|
|
2664
|
-
let e = (
|
|
2665
|
-
s.anchorGate(
|
|
2666
|
-
} else s.markGateHeld(
|
|
2667
|
-
let
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
},
|
|
3149
|
+
return queueMicrotask(S), Z;
|
|
3150
|
+
}
|
|
3151
|
+
let O = B(C, w);
|
|
3152
|
+
if (x) if (h) {
|
|
3153
|
+
let e = (O.delay + O.duration) * 1e3;
|
|
3154
|
+
s.anchorGate(x, Math.max(e, D) + Fr);
|
|
3155
|
+
} else s.markGateHeld(x);
|
|
3156
|
+
let ie = !T && !!O, ae = C.driver === "native" && !U(), oe = null;
|
|
3157
|
+
ie && ae && (oe = Or(b, () => [b.ownerDocument.documentElement], () => Lr.get(b)?.()));
|
|
3158
|
+
let se = it("screen", d, w), k, ce = () => {
|
|
3159
|
+
k !== void 0 && (clearTimeout(k), k = void 0);
|
|
3160
|
+
}, le = 0, ue, de = [], fe, pe = () => {
|
|
3161
|
+
de.forEach((e) => cancelAnimationFrame(e)), de = [], fe !== void 0 && clearTimeout(fe), fe = void 0;
|
|
3162
|
+
}, me = () => {
|
|
2672
3163
|
/* v8 ignore next 4 -- every runtime under test has rAF; the guard
|
|
2673
3164
|
shields exotic embedders. */
|
|
2674
3165
|
if (typeof requestAnimationFrame != "function") {
|
|
2675
|
-
|
|
3166
|
+
S();
|
|
2676
3167
|
return;
|
|
2677
3168
|
}
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
},
|
|
3169
|
+
fe = setTimeout(() => {
|
|
3170
|
+
pe(), S();
|
|
3171
|
+
}, Pr);
|
|
2681
3172
|
let e = (t) => {
|
|
2682
3173
|
if (t <= 0) {
|
|
2683
|
-
|
|
3174
|
+
pe(), S();
|
|
2684
3175
|
return;
|
|
2685
3176
|
}
|
|
2686
|
-
|
|
3177
|
+
de.push(requestAnimationFrame(() => e(t - 1)));
|
|
2687
3178
|
};
|
|
2688
|
-
e(
|
|
2689
|
-
},
|
|
2690
|
-
if (
|
|
2691
|
-
|
|
3179
|
+
e(Nr);
|
|
3180
|
+
}, he = () => {
|
|
3181
|
+
if (le <= 0) {
|
|
3182
|
+
me();
|
|
2692
3183
|
return;
|
|
2693
3184
|
}
|
|
2694
|
-
|
|
2695
|
-
},
|
|
2696
|
-
e.target ===
|
|
3185
|
+
ue = setTimeout(me, le);
|
|
3186
|
+
}, ge = Z, A = Z, j = Z, _e = (e) => {
|
|
3187
|
+
e.target === b && e.animationName === se && (b.removeEventListener("animationend", _e), ce(), ge(), he());
|
|
2697
3188
|
};
|
|
2698
|
-
|
|
2699
|
-
let
|
|
2700
|
-
|
|
2701
|
-
let
|
|
2702
|
-
element:
|
|
2703
|
-
expectedName:
|
|
2704
|
-
motion:
|
|
2705
|
-
|
|
2706
|
-
|
|
3189
|
+
b.addEventListener("animationend", _e);
|
|
3190
|
+
let ve = ie && h ? v(w, "active", me) : null, ye = (O.delay + O.duration) * 1e3, be = Math.max(ye, D) + 1500, xe = x ? setTimeout(() => void s.resolveTask(x), be) : void 0;
|
|
3191
|
+
le = Math.max(0, D - ye);
|
|
3192
|
+
let Se = ye + 250, Ce = () => x !== null && e.getTransitionTaskId() === x && b.isConnected && b.getAttribute("data-flemo-skip-animation") !== "true" && H(C, w), M = qr({
|
|
3193
|
+
element: b,
|
|
3194
|
+
expectedName: se,
|
|
3195
|
+
motion: O,
|
|
3196
|
+
writer: t,
|
|
3197
|
+
isLive: Ce,
|
|
3198
|
+
budgetUsed: () => n.get(x) ?? 0,
|
|
2707
3199
|
spendBudget: () => {
|
|
2708
|
-
|
|
3200
|
+
A(), j(), n.set(x, (n.get(x) ?? 0) + 1);
|
|
2709
3201
|
},
|
|
2710
|
-
onTerminal:
|
|
3202
|
+
onTerminal: S
|
|
2711
3203
|
});
|
|
2712
|
-
|
|
2713
|
-
let
|
|
2714
|
-
|
|
2715
|
-
},
|
|
2716
|
-
if (
|
|
2717
|
-
|
|
3204
|
+
ge = M.detach;
|
|
3205
|
+
let N = !1, P = () => {
|
|
3206
|
+
ce(), k = setTimeout(we, Se);
|
|
3207
|
+
}, we = () => {
|
|
3208
|
+
if (ce(), Ce() && !N) {
|
|
3209
|
+
N = !0, A(), j(), M.fullRestart(), P();
|
|
2718
3210
|
return;
|
|
2719
3211
|
}
|
|
2720
|
-
|
|
2721
|
-
},
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
3212
|
+
S();
|
|
3213
|
+
}, F = !ve && h, Te = F ? y(b, w) : [];
|
|
3214
|
+
F && (M.attach(), x && P()), F && ae && Lr.set(b, () => {
|
|
3215
|
+
A(), j(), x && k !== void 0 && P();
|
|
3216
|
+
});
|
|
3217
|
+
let Ee = F && !U() ? Ar(() => [b.ownerDocument.documentElement], () => {
|
|
3218
|
+
A(), j(), x && k !== void 0 && P();
|
|
3219
|
+
}) : null, I = F && ae ? jr(() => [b.ownerDocument.documentElement], () => {
|
|
3220
|
+
A(), j(), x && k !== void 0 && P();
|
|
3221
|
+
}) : null, Oe, ke = () => {
|
|
3222
|
+
Oe !== void 0 && (clearTimeout(Oe), Oe = void 0);
|
|
2727
3223
|
};
|
|
2728
|
-
if (
|
|
2729
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1, t =
|
|
2730
|
-
for (let { element: t, motion: n } of
|
|
2731
|
-
let i =
|
|
3224
|
+
if (A = ke, F && x) {
|
|
3225
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1, t = J(O, b, e), n = E ? J(E, b, e) : 0, r = 0;
|
|
3226
|
+
for (let { element: t, motion: n } of ne) {
|
|
3227
|
+
let i = J(n, t, e);
|
|
2732
3228
|
if (i === null) {
|
|
2733
3229
|
r = null;
|
|
2734
3230
|
break;
|
|
2735
3231
|
}
|
|
2736
3232
|
r = Math.max(r, i);
|
|
2737
3233
|
}
|
|
2738
|
-
let i =
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
3234
|
+
let i = 0;
|
|
3235
|
+
if (re.length > 0) {
|
|
3236
|
+
let t = u().decorator;
|
|
3237
|
+
if (t) for (let n of re) {
|
|
3238
|
+
let r = J(n, t, e);
|
|
3239
|
+
if (r === null) {
|
|
3240
|
+
i = null;
|
|
3241
|
+
break;
|
|
3242
|
+
}
|
|
3243
|
+
i = Math.max(i, r);
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
let a = t !== null && n !== null && r !== null && i !== null ? Math.max(t, n, r, i) : null;
|
|
3247
|
+
a !== null && a + 17 < ye + le && (Oe = setTimeout(() => {
|
|
3248
|
+
Oe = void 0, Ce() && (b.removeEventListener("animationend", _e), ce(), ge(), me());
|
|
3249
|
+
}, a + 17));
|
|
2742
3250
|
}
|
|
2743
|
-
let
|
|
2744
|
-
|
|
3251
|
+
let L, Ae = () => {
|
|
3252
|
+
L !== void 0 && (clearTimeout(L), L = void 0);
|
|
2745
3253
|
};
|
|
2746
|
-
if (
|
|
2747
|
-
let e =
|
|
2748
|
-
for (let { element: e, motion: t } of
|
|
2749
|
-
let
|
|
2750
|
-
if (
|
|
2751
|
-
|
|
3254
|
+
if (j = Ae, F && r) {
|
|
3255
|
+
let e = J(O, b, 1), t = E ? J(E, b, 1) : 0, n = 0;
|
|
3256
|
+
for (let { element: e, motion: t } of ne) {
|
|
3257
|
+
let r = J(t, e, 1);
|
|
3258
|
+
if (r === null) {
|
|
3259
|
+
n = null;
|
|
2752
3260
|
break;
|
|
2753
3261
|
}
|
|
2754
|
-
|
|
3262
|
+
n = Math.max(n, r);
|
|
2755
3263
|
}
|
|
2756
|
-
let i =
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
3264
|
+
let i = 0;
|
|
3265
|
+
if (re.length > 0) {
|
|
3266
|
+
let e = u().decorator;
|
|
3267
|
+
if (e) for (let t of re) {
|
|
3268
|
+
let n = J(t, e, 1);
|
|
3269
|
+
if (n === null) {
|
|
3270
|
+
i = null;
|
|
3271
|
+
break;
|
|
3272
|
+
}
|
|
3273
|
+
i = Math.max(i, n);
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
let a = e !== null && t !== null && n !== null && i !== null ? Math.max(e, t, n, i) : null;
|
|
3277
|
+
a !== null && (L = setTimeout(() => {
|
|
3278
|
+
L = void 0;
|
|
3279
|
+
let e = r;
|
|
3280
|
+
e && (r = null, e());
|
|
3281
|
+
}, a));
|
|
2762
3282
|
}
|
|
2763
3283
|
return () => {
|
|
2764
|
-
if (
|
|
2765
|
-
|
|
2766
|
-
for (let e of
|
|
3284
|
+
if (xe !== void 0 && clearTimeout(xe), ue !== void 0 && clearTimeout(ue), pe(), oe?.(), Ee?.(), I?.(), ke(), Ae(), b.removeEventListener("animationend", _e), F) {
|
|
3285
|
+
M.detach();
|
|
3286
|
+
for (let e of Te) e();
|
|
2767
3287
|
}
|
|
2768
|
-
|
|
3288
|
+
ce(), ve?.(), x && e.getTransitionTaskId() !== x && n.delete(x);
|
|
2769
3289
|
};
|
|
2770
3290
|
},
|
|
2771
|
-
activeResumeEntryCount: () =>
|
|
3291
|
+
activeResumeEntryCount: () => n.size
|
|
2772
3292
|
};
|
|
2773
3293
|
}
|
|
2774
3294
|
//#endregion
|
|
2775
3295
|
//#region src/utils/findScrollable.ts
|
|
2776
|
-
function
|
|
2777
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
3296
|
+
function Yr(e, t) {
|
|
3297
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Xr(e);
|
|
2778
3298
|
if (!o) return {
|
|
2779
3299
|
element: null,
|
|
2780
3300
|
hasMarker: !1
|
|
2781
3301
|
};
|
|
2782
3302
|
let s = o.closest?.(r);
|
|
2783
|
-
if (s instanceof HTMLElement &&
|
|
3303
|
+
if (s instanceof HTMLElement && Zr(s, n) && (!a || Qr(s, n))) return {
|
|
2784
3304
|
element: s,
|
|
2785
3305
|
hasMarker: !0
|
|
2786
3306
|
};
|
|
2787
3307
|
let c = o, l = 0;
|
|
2788
3308
|
for (; c && l < i;) {
|
|
2789
|
-
if (
|
|
3309
|
+
if (Zr(c, n) && (!a || Qr(c, n))) return {
|
|
2790
3310
|
element: c,
|
|
2791
3311
|
hasMarker: !1
|
|
2792
3312
|
};
|
|
@@ -2797,7 +3317,7 @@ function Kn(e, t) {
|
|
|
2797
3317
|
hasMarker: !1
|
|
2798
3318
|
};
|
|
2799
3319
|
}
|
|
2800
|
-
function
|
|
3320
|
+
function Xr(e) {
|
|
2801
3321
|
if (!e) return null;
|
|
2802
3322
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2803
3323
|
if (n && n.length) {
|
|
@@ -2805,228 +3325,227 @@ function qn(e) {
|
|
|
2805
3325
|
}
|
|
2806
3326
|
return e instanceof HTMLElement ? e : null;
|
|
2807
3327
|
}
|
|
2808
|
-
function
|
|
3328
|
+
function Zr(e, t) {
|
|
2809
3329
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2810
3330
|
}
|
|
2811
|
-
function
|
|
2812
|
-
if (!
|
|
3331
|
+
function Qr(e, t) {
|
|
3332
|
+
if (!Zr(e, t) || typeof window > "u") return !1;
|
|
2813
3333
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2814
3334
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2815
3335
|
}
|
|
2816
3336
|
//#endregion
|
|
2817
3337
|
//#region src/core/engine/createSwipeController.ts
|
|
2818
|
-
var
|
|
2819
|
-
function
|
|
2820
|
-
let t =
|
|
3338
|
+
var $r = "data-flemo-skip-animation";
|
|
3339
|
+
function ei(e) {
|
|
3340
|
+
let t = Symbol("flemo-swipe-layer"), n = null, r = null, i = {
|
|
2821
3341
|
current: [],
|
|
2822
3342
|
prev: []
|
|
2823
|
-
},
|
|
3343
|
+
}, a = {
|
|
2824
3344
|
current: [],
|
|
2825
3345
|
prev: []
|
|
2826
|
-
},
|
|
3346
|
+
}, o = !1, s = !1, c = !1, l = {
|
|
2827
3347
|
x: 0,
|
|
2828
3348
|
y: 0
|
|
2829
|
-
},
|
|
3349
|
+
}, u = {
|
|
2830
3350
|
x: 0,
|
|
2831
3351
|
y: 0
|
|
2832
|
-
},
|
|
3352
|
+
}, d = 0, f = {
|
|
2833
3353
|
x: 0,
|
|
2834
3354
|
y: 0
|
|
2835
|
-
},
|
|
3355
|
+
}, p = {
|
|
2836
3356
|
element: null,
|
|
2837
3357
|
hasMarker: !1
|
|
2838
|
-
},
|
|
3358
|
+
}, m = {
|
|
2839
3359
|
element: null,
|
|
2840
3360
|
hasMarker: !1
|
|
2841
|
-
},
|
|
3361
|
+
}, h = 0, g = 0, _ = (e) => ({
|
|
2842
3362
|
point: {
|
|
2843
3363
|
x: e.clientX,
|
|
2844
3364
|
y: e.clientY
|
|
2845
3365
|
},
|
|
2846
3366
|
offset: {
|
|
2847
|
-
x: e.clientX - c.x,
|
|
2848
|
-
y: e.clientY - c.y
|
|
2849
|
-
},
|
|
2850
|
-
delta: {
|
|
2851
3367
|
x: e.clientX - l.x,
|
|
2852
3368
|
y: e.clientY - l.y
|
|
2853
3369
|
},
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
3370
|
+
delta: {
|
|
3371
|
+
x: e.clientX - u.x,
|
|
3372
|
+
y: e.clientY - u.y
|
|
3373
|
+
},
|
|
3374
|
+
velocity: f
|
|
3375
|
+
}), v = (e) => {
|
|
3376
|
+
let t = e.timeStamp, n = Math.max(1, t - d);
|
|
3377
|
+
f = {
|
|
3378
|
+
x: (e.clientX - u.x) / n * 1e3,
|
|
3379
|
+
y: (e.clientY - u.y) / n * 1e3
|
|
3380
|
+
}, u = {
|
|
2861
3381
|
x: e.clientX,
|
|
2862
3382
|
y: e.clientY
|
|
2863
|
-
},
|
|
2864
|
-
},
|
|
2865
|
-
let
|
|
2866
|
-
if (
|
|
2867
|
-
else if (
|
|
2868
|
-
return
|
|
2869
|
-
},
|
|
2870
|
-
let
|
|
2871
|
-
|
|
2872
|
-
let
|
|
2873
|
-
if (
|
|
2874
|
-
let
|
|
2875
|
-
|
|
2876
|
-
}
|
|
2877
|
-
|
|
2878
|
-
current:
|
|
2879
|
-
prev:
|
|
3383
|
+
}, d = t;
|
|
3384
|
+
}, y = (r, a, o) => {
|
|
3385
|
+
let s = K(r, a, o, t);
|
|
3386
|
+
if (r === e.getElements().scope) for (let e of i.current) K(e, a, o, t);
|
|
3387
|
+
else if (r === n) for (let e of i.prev) K(e, a, o, t);
|
|
3388
|
+
return s;
|
|
3389
|
+
}, b = (n) => {
|
|
3390
|
+
let r = e.getPartnerBars(), a = [], { sharedTopBar: o, sharedBottomBar: s } = e.getElements();
|
|
3391
|
+
o && e.hasSharedTopBar() && !r?.topBar && a.push(o), s && e.hasSharedBottomBar() && !r?.bottomBar && a.push(s);
|
|
3392
|
+
let c = [];
|
|
3393
|
+
if (n) {
|
|
3394
|
+
let t = n.querySelector("[data-flemo-bar=\"app\"]"), r = n.querySelector("[data-flemo-bar=\"nav\"]");
|
|
3395
|
+
t && !e.hasSharedTopBar() && c.push(t), r && !e.hasSharedBottomBar() && c.push(r);
|
|
3396
|
+
}
|
|
3397
|
+
i = {
|
|
3398
|
+
current: a,
|
|
3399
|
+
prev: c
|
|
2880
3400
|
};
|
|
2881
|
-
let
|
|
2882
|
-
for (let
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
for (let e of
|
|
2886
|
-
|
|
2887
|
-
r = {
|
|
3401
|
+
for (let n of a) wn(n, e.getTransition(), !1, t);
|
|
3402
|
+
for (let n of c) wn(n, e.getTransition(), !1, t);
|
|
3403
|
+
}, x = () => {
|
|
3404
|
+
for (let e of i.current) G(e, void 0, t), X(e, t);
|
|
3405
|
+
for (let e of i.prev) G(e, void 0, t), X(e, t);
|
|
3406
|
+
i = {
|
|
2888
3407
|
current: [],
|
|
2889
3408
|
prev: []
|
|
2890
3409
|
};
|
|
2891
|
-
},
|
|
3410
|
+
}, S = (t) => {
|
|
2892
3411
|
let { screenContainer: n } = e.getElements(), r = (e) => Array.from(e.querySelectorAll("[data-flemo-part-name]"));
|
|
2893
|
-
|
|
3412
|
+
a = {
|
|
2894
3413
|
current: r(n),
|
|
2895
3414
|
prev: r(t)
|
|
2896
3415
|
};
|
|
2897
|
-
},
|
|
2898
|
-
let
|
|
2899
|
-
let
|
|
2900
|
-
if (!
|
|
2901
|
-
let
|
|
2902
|
-
animate:
|
|
2903
|
-
element:
|
|
2904
|
-
active:
|
|
3416
|
+
}, C = (e, n, r) => {
|
|
3417
|
+
let i = (i, a) => {
|
|
3418
|
+
let o = z.get(i.getAttribute("data-flemo-part-name"));
|
|
3419
|
+
if (!o) return;
|
|
3420
|
+
let s = {
|
|
3421
|
+
animate: (e, n, r) => K(e, n, r, t),
|
|
3422
|
+
element: i,
|
|
3423
|
+
active: a
|
|
2905
3424
|
};
|
|
2906
|
-
e === "swipe" ?
|
|
3425
|
+
e === "swipe" ? o.onSwipe?.(n, r, s) : e === "start" ? o.onSwipeStart?.(n, s) : o.onSwipeEnd?.(n, s);
|
|
2907
3426
|
};
|
|
2908
|
-
for (let e of
|
|
2909
|
-
for (let e of
|
|
2910
|
-
},
|
|
2911
|
-
for (let e of [...
|
|
2912
|
-
|
|
3427
|
+
for (let e of a.current) i(e, !0);
|
|
3428
|
+
for (let e of a.prev) i(e, !1);
|
|
3429
|
+
}, w = () => {
|
|
3430
|
+
for (let e of [...a.current, ...a.prev]) G(e, void 0, t);
|
|
3431
|
+
a = {
|
|
2913
3432
|
current: [],
|
|
2914
3433
|
prev: []
|
|
2915
3434
|
};
|
|
2916
|
-
},
|
|
3435
|
+
}, T = async (t) => {
|
|
2917
3436
|
let i = e.getTransition();
|
|
2918
3437
|
if (!i.swipeDirection || e.getViewportScrollHeight() > 10) return;
|
|
2919
|
-
let { scope: a, screenContainer: o, decorator:
|
|
3438
|
+
let { scope: a, screenContainer: o, decorator: s } = e.getElements();
|
|
2920
3439
|
if (!a) return;
|
|
2921
3440
|
let p = o?.previousElementSibling ?? null;
|
|
2922
|
-
if (
|
|
2923
|
-
|
|
2924
|
-
x:
|
|
2925
|
-
y:
|
|
2926
|
-
},
|
|
2927
|
-
x:
|
|
2928
|
-
y:
|
|
2929
|
-
},
|
|
3441
|
+
if (n = p?.querySelector("[data-flemo-screen]") ?? null, r = p?.querySelector("[data-flemo-decorator]") ?? null, !n) return;
|
|
3442
|
+
c = !0, l = {
|
|
3443
|
+
x: t.clientX,
|
|
3444
|
+
y: t.clientY
|
|
3445
|
+
}, u = {
|
|
3446
|
+
x: t.clientX,
|
|
3447
|
+
y: t.clientY
|
|
3448
|
+
}, d = t.timeStamp, f = {
|
|
2930
3449
|
x: 0,
|
|
2931
3450
|
y: 0
|
|
2932
|
-
}, a.setPointerCapture(
|
|
3451
|
+
}, a.setPointerCapture(t.pointerId), b(p), S(p);
|
|
2933
3452
|
let m = e.getDecorator();
|
|
2934
|
-
await i.onSwipeStart(
|
|
2935
|
-
animate:
|
|
3453
|
+
await i.onSwipeStart(t, _(t), {
|
|
3454
|
+
animate: y,
|
|
2936
3455
|
currentScreen: a,
|
|
2937
|
-
prevScreen:
|
|
3456
|
+
prevScreen: n,
|
|
2938
3457
|
onStart: (e) => {
|
|
2939
3458
|
m?.onSwipeStart?.(e, {
|
|
2940
|
-
animate:
|
|
2941
|
-
currentDecorator:
|
|
2942
|
-
prevDecorator:
|
|
2943
|
-
}),
|
|
3459
|
+
animate: K,
|
|
3460
|
+
currentDecorator: s,
|
|
3461
|
+
prevDecorator: r
|
|
3462
|
+
}), C("start", e, 0);
|
|
2944
3463
|
}
|
|
2945
|
-
}) ? e.setDragStatus("PENDING") : (e.setDragStatus("IDLE"),
|
|
2946
|
-
},
|
|
3464
|
+
}) ? e.setDragStatus("PENDING") : (e.setDragStatus("IDLE"), c = !1, x());
|
|
3465
|
+
}, ee = (t) => {
|
|
2947
3466
|
let i = e.getTransition();
|
|
2948
|
-
if (!i.swipeDirection || !
|
|
2949
|
-
|
|
2950
|
-
let { scope: a, decorator: o } = e.getElements(),
|
|
2951
|
-
i.onSwipe(
|
|
2952
|
-
animate:
|
|
3467
|
+
if (!i.swipeDirection || !c || e.getViewportScrollHeight() > 10) return;
|
|
3468
|
+
v(t);
|
|
3469
|
+
let { scope: a, decorator: o } = e.getElements(), s = e.getDecorator();
|
|
3470
|
+
i.onSwipe(t, _(t), {
|
|
3471
|
+
animate: y,
|
|
2953
3472
|
currentScreen: a,
|
|
2954
|
-
prevScreen:
|
|
3473
|
+
prevScreen: n,
|
|
2955
3474
|
onProgress: (e, t) => {
|
|
2956
|
-
|
|
2957
|
-
animate:
|
|
3475
|
+
s?.onSwipe?.(e, t, {
|
|
3476
|
+
animate: K,
|
|
2958
3477
|
currentDecorator: o,
|
|
2959
|
-
prevDecorator:
|
|
2960
|
-
}),
|
|
3478
|
+
prevDecorator: r
|
|
3479
|
+
}), C("swipe", e, t);
|
|
2961
3480
|
}
|
|
2962
3481
|
});
|
|
2963
|
-
},
|
|
2964
|
-
let
|
|
2965
|
-
if (!
|
|
2966
|
-
|
|
2967
|
-
let { scope:
|
|
2968
|
-
|
|
2969
|
-
let
|
|
2970
|
-
if (await
|
|
2971
|
-
animate:
|
|
2972
|
-
currentScreen:
|
|
2973
|
-
prevScreen:
|
|
3482
|
+
}, te = async (o) => {
|
|
3483
|
+
let s = e.getTransition();
|
|
3484
|
+
if (!s.swipeDirection || !c) return;
|
|
3485
|
+
c = !1;
|
|
3486
|
+
let { scope: l, decorator: u } = e.getElements();
|
|
3487
|
+
l && l.hasPointerCapture(o.pointerId) && l.releasePointerCapture(o.pointerId);
|
|
3488
|
+
let d = e.getDecorator();
|
|
3489
|
+
if (await s.onSwipeEnd(o, _(o), {
|
|
3490
|
+
animate: y,
|
|
3491
|
+
currentScreen: l,
|
|
3492
|
+
prevScreen: n,
|
|
2974
3493
|
onStart: (e) => {
|
|
2975
|
-
|
|
2976
|
-
animate:
|
|
2977
|
-
currentDecorator:
|
|
2978
|
-
prevDecorator:
|
|
2979
|
-
}),
|
|
3494
|
+
d?.onSwipeEnd?.(e, {
|
|
3495
|
+
animate: K,
|
|
3496
|
+
currentDecorator: u,
|
|
3497
|
+
prevDecorator: r
|
|
3498
|
+
}), C("end", e, 0);
|
|
2980
3499
|
}
|
|
2981
3500
|
})) {
|
|
2982
|
-
|
|
2983
|
-
for (let e of
|
|
2984
|
-
for (let e of
|
|
2985
|
-
|
|
3501
|
+
l?.setAttribute($r, "true"), u?.setAttribute($r, "true");
|
|
3502
|
+
for (let e of i.current) X(e, t);
|
|
3503
|
+
for (let e of i.prev) G(e, void 0, t), X(e, t);
|
|
3504
|
+
i = {
|
|
2986
3505
|
current: [],
|
|
2987
3506
|
prev: []
|
|
2988
|
-
},
|
|
3507
|
+
}, a = {
|
|
2989
3508
|
current: [],
|
|
2990
3509
|
prev: []
|
|
2991
3510
|
}, e.back();
|
|
2992
|
-
} else
|
|
3511
|
+
} else l && G(l, void 0, t), n && G(n, void 0, t), u && G(u), r && G(r), x(), w(), e.setDragStatus("IDLE");
|
|
2993
3512
|
};
|
|
2994
3513
|
return {
|
|
2995
3514
|
pointerDown: (t) => {
|
|
2996
|
-
e.isReadyForDrag() && (
|
|
3515
|
+
e.isReadyForDrag() && (p = Yr(t.target, {
|
|
2997
3516
|
direction: "x",
|
|
2998
3517
|
verifyByScroll: !0
|
|
2999
|
-
}),
|
|
3518
|
+
}), m = Yr(t.target, {
|
|
3000
3519
|
direction: "y",
|
|
3001
3520
|
verifyByScroll: !0
|
|
3002
|
-
}),
|
|
3521
|
+
}), h = t.clientX, g = t.clientY, (!p.element && !m.element || p.element || m.element) && (o = !0));
|
|
3003
3522
|
},
|
|
3004
3523
|
pointerMove: (t) => {
|
|
3005
3524
|
if (e.getViewportScrollHeight() > 10) return;
|
|
3006
|
-
if (
|
|
3007
|
-
|
|
3525
|
+
if (c) {
|
|
3526
|
+
ee(t);
|
|
3008
3527
|
return;
|
|
3009
3528
|
}
|
|
3010
|
-
let n = e.getTransition().swipeDirection, r = !
|
|
3011
|
-
if (
|
|
3012
|
-
|
|
3013
|
-
let e = t.clientY -
|
|
3014
|
-
(n === "y" && e > 0 || n === "x" && r > 0) &&
|
|
3015
|
-
} else if (
|
|
3016
|
-
let e = t.clientX -
|
|
3017
|
-
(n === "y" && (i ||
|
|
3529
|
+
let n = e.getTransition().swipeDirection, r = !p.element && !m.element;
|
|
3530
|
+
if (o && r) {
|
|
3531
|
+
o = !1, s = !0;
|
|
3532
|
+
let e = t.clientY - g, r = t.clientX - h;
|
|
3533
|
+
(n === "y" && e > 0 || n === "x" && r > 0) && T(t);
|
|
3534
|
+
} else if (o && !r) {
|
|
3535
|
+
let e = t.clientX - h, r = t.clientY - g, i = m.element && m.element.scrollTop <= 0, a = p.element && p.element.scrollLeft <= 0 && p.hasMarker;
|
|
3536
|
+
(n === "y" && (i || p.element) && r > 0 && Math.abs(e) < 2 || n === "x" && (a || m.element) && e > 0 && Math.abs(r) < 2) && (o = !1, s = !0, T(t));
|
|
3018
3537
|
}
|
|
3019
3538
|
},
|
|
3020
3539
|
pointerUp: (e) => {
|
|
3021
|
-
|
|
3540
|
+
o = !1, s = !1, c && te(e);
|
|
3022
3541
|
},
|
|
3023
|
-
shouldPreventTouch: () =>
|
|
3542
|
+
shouldPreventTouch: () => s
|
|
3024
3543
|
};
|
|
3025
3544
|
}
|
|
3026
3545
|
//#endregion
|
|
3027
3546
|
//#region src/screen/computeBarRiding.ts
|
|
3028
|
-
function
|
|
3029
|
-
return
|
|
3547
|
+
function ti(e) {
|
|
3548
|
+
return e.status !== "PUSHING" && e.status !== "POPPING" && e.status !== "REPLACING" || !e.isTopOrTopPrev ? {
|
|
3030
3549
|
app: !1,
|
|
3031
3550
|
nav: !1
|
|
3032
3551
|
} : {
|
|
@@ -3036,31 +3555,31 @@ function Qn(e) {
|
|
|
3036
3555
|
}
|
|
3037
3556
|
//#endregion
|
|
3038
3557
|
//#region src/screen/pendingNetwork.ts
|
|
3039
|
-
var
|
|
3040
|
-
|
|
3041
|
-
},
|
|
3042
|
-
if (!(
|
|
3043
|
-
if (
|
|
3558
|
+
var ni = 0, ri = !1, ii = () => {
|
|
3559
|
+
ni = Math.max(0, ni - 1);
|
|
3560
|
+
}, ai = () => {
|
|
3561
|
+
if (!(ri || typeof window > "u")) {
|
|
3562
|
+
if (ri = !0, typeof window.fetch == "function") {
|
|
3044
3563
|
let e = window.fetch.bind(window);
|
|
3045
3564
|
window.fetch = (...t) => {
|
|
3046
|
-
|
|
3565
|
+
ni += 1;
|
|
3047
3566
|
let n;
|
|
3048
3567
|
try {
|
|
3049
3568
|
n = e(...t);
|
|
3050
3569
|
} catch (e) {
|
|
3051
|
-
throw
|
|
3570
|
+
throw ii(), e;
|
|
3052
3571
|
}
|
|
3053
|
-
return n.then((e) => (
|
|
3054
|
-
throw
|
|
3572
|
+
return n.then((e) => (ii(), e), (e) => {
|
|
3573
|
+
throw ii(), e;
|
|
3055
3574
|
});
|
|
3056
3575
|
};
|
|
3057
3576
|
}
|
|
3058
3577
|
if (typeof XMLHttpRequest == "function") {
|
|
3059
3578
|
let e = XMLHttpRequest.prototype.send;
|
|
3060
3579
|
XMLHttpRequest.prototype.send = function(...t) {
|
|
3061
|
-
|
|
3580
|
+
ni += 1;
|
|
3062
3581
|
let n = !1, r = () => {
|
|
3063
|
-
n || (n = !0,
|
|
3582
|
+
n || (n = !0, ii());
|
|
3064
3583
|
};
|
|
3065
3584
|
this.addEventListener("loadend", r);
|
|
3066
3585
|
try {
|
|
@@ -3071,28 +3590,28 @@ var $n = 0, er = !1, tr = () => {
|
|
|
3071
3590
|
};
|
|
3072
3591
|
}
|
|
3073
3592
|
}
|
|
3074
|
-
},
|
|
3593
|
+
}, oi = () => (ai(), ni > 0);
|
|
3075
3594
|
//#endregion
|
|
3076
3595
|
//#region src/screen/animStartAnchor.ts
|
|
3077
|
-
function
|
|
3078
|
-
return
|
|
3596
|
+
function si(e) {
|
|
3597
|
+
return e.status !== "PUSHING" && e.status !== "POPPING" && e.status !== "REPLACING" || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
3079
3598
|
}
|
|
3080
|
-
var
|
|
3081
|
-
function
|
|
3082
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
3599
|
+
var ci = 300, li = 20;
|
|
3600
|
+
function ui(e) {
|
|
3601
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, li);
|
|
3083
3602
|
}
|
|
3084
|
-
function
|
|
3085
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
3603
|
+
function di(e) {
|
|
3604
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of ui(e)) t.decode().catch(() => {});
|
|
3086
3605
|
}
|
|
3087
|
-
var
|
|
3606
|
+
var fi = 3, pi = 40, mi = (e) => {
|
|
3088
3607
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
3089
|
-
let t = e.querySelectorAll("*").length;
|
|
3608
|
+
let t = Math.max(1, e.querySelectorAll("*").length);
|
|
3090
3609
|
/* v8 ignore stop */
|
|
3091
|
-
return
|
|
3092
|
-
},
|
|
3610
|
+
return ((e.textContent ?? "").trim().length + e.querySelectorAll("img").length * pi) / t < fi;
|
|
3611
|
+
}, hi = (e) => typeof e.getAnimations == "function" && e.getAnimations({ subtree: !0 }).some((e) => {
|
|
3093
3612
|
let t = e.animationName;
|
|
3094
3613
|
return typeof t != "string" || !t.startsWith("flemo-");
|
|
3095
|
-
}),
|
|
3614
|
+
}), gi = (e) => {
|
|
3096
3615
|
/* v8 ignore next -- the settle gate only runs a scope past looksLikeShell,
|
|
3097
3616
|
which already requires querySelectorAll. */
|
|
3098
3617
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
@@ -3100,12 +3619,12 @@ var lr = 3, ur = 40, dr = 24, fr = (e) => {
|
|
|
3100
3619
|
the guard shields exotic embedders. */
|
|
3101
3620
|
let t = typeof e.getBoundingClientRect == "function" ? e.getBoundingClientRect() : null, n = t && t.height > 0 ? t : null, r = 0;
|
|
3102
3621
|
for (let t of Array.from(e.querySelectorAll("img"))) {
|
|
3103
|
-
if (r >=
|
|
3622
|
+
if (r >= li) break;
|
|
3104
3623
|
if (!(t.loading === "lazy" && !t.currentSrc) && !(n && t.getBoundingClientRect().top - n.top >= n.height) && (r += 1, !t.complete)) return !0;
|
|
3105
3624
|
}
|
|
3106
3625
|
return !1;
|
|
3107
3626
|
};
|
|
3108
|
-
function
|
|
3627
|
+
function _i(e, t = {}) {
|
|
3109
3628
|
let n = !1, r = 0, i = [], a = [], o = () => {
|
|
3110
3629
|
if (n) return;
|
|
3111
3630
|
let r = t.scope;
|
|
@@ -3113,7 +3632,7 @@ function hr(e, t = {}) {
|
|
|
3113
3632
|
e();
|
|
3114
3633
|
return;
|
|
3115
3634
|
}
|
|
3116
|
-
let i =
|
|
3635
|
+
let i = ui(r);
|
|
3117
3636
|
if (i.length === 0) {
|
|
3118
3637
|
e();
|
|
3119
3638
|
return;
|
|
@@ -3130,15 +3649,15 @@ function hr(e, t = {}) {
|
|
|
3130
3649
|
e();
|
|
3131
3650
|
return;
|
|
3132
3651
|
}
|
|
3133
|
-
if (!
|
|
3652
|
+
if (!mi(r)) {
|
|
3134
3653
|
e();
|
|
3135
3654
|
return;
|
|
3136
3655
|
}
|
|
3137
3656
|
/* v8 ignore start -- performance exists in every runtime under test;
|
|
3138
3657
|
the fallback only shields exotic embedders. */
|
|
3139
|
-
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () =>
|
|
3658
|
+
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () => mi(r) && hi(r), d = () => oi() || gi(r), f = () => {
|
|
3140
3659
|
l || (l = !0, h.disconnect(), clearTimeout(g), clearTimeout(_), clearTimeout(v), s.forEach((e) => cancelAnimationFrame(e)), s = [], e());
|
|
3141
|
-
}, p = () => !
|
|
3660
|
+
}, p = () => !mi(r) && !d() ? 2 : 6, m = () => {
|
|
3142
3661
|
s.forEach((e) => cancelAnimationFrame(e)), s = [];
|
|
3143
3662
|
let e = (t) => {
|
|
3144
3663
|
if (t <= 0) {
|
|
@@ -3196,14 +3715,14 @@ function hr(e, t = {}) {
|
|
|
3196
3715
|
n = !0, cancelAnimationFrame(l), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), a.forEach((e) => e());
|
|
3197
3716
|
};
|
|
3198
3717
|
}
|
|
3199
|
-
function
|
|
3200
|
-
let n =
|
|
3718
|
+
function vi(e, t = {}) {
|
|
3719
|
+
let n = _i(e, t), r = t.contentSettle?.capMs ?? 0, i = setTimeout(e, 300 + r);
|
|
3201
3720
|
return () => {
|
|
3202
3721
|
n(), clearTimeout(i);
|
|
3203
3722
|
};
|
|
3204
3723
|
}
|
|
3205
|
-
var
|
|
3206
|
-
function
|
|
3724
|
+
var yi = (e) => 300 + (e?.contentSettle?.capMs ?? 0);
|
|
3725
|
+
function bi() {
|
|
3207
3726
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
3208
3727
|
clearTimeout(n.backstop), e.delete(t);
|
|
3209
3728
|
let r = [...n.members];
|
|
@@ -3213,14 +3732,14 @@ function vr() {
|
|
|
3213
3732
|
return { join: (r, i, a) => {
|
|
3214
3733
|
let o = e.get(r);
|
|
3215
3734
|
if (o) {
|
|
3216
|
-
let e =
|
|
3735
|
+
let e = yi(a);
|
|
3217
3736
|
if (e > o.backstopMs) {
|
|
3218
3737
|
clearTimeout(o.backstop);
|
|
3219
3738
|
let n = o;
|
|
3220
3739
|
n.backstopMs = e, n.backstop = setTimeout(() => t(r, n), e);
|
|
3221
3740
|
}
|
|
3222
3741
|
} else {
|
|
3223
|
-
let n =
|
|
3742
|
+
let n = yi(a), i = {
|
|
3224
3743
|
members: /* @__PURE__ */ new Set(),
|
|
3225
3744
|
backstop: setTimeout(() => t(r, i), n),
|
|
3226
3745
|
backstopMs: n
|
|
@@ -3230,7 +3749,7 @@ function vr() {
|
|
|
3230
3749
|
let s = o, c = {
|
|
3231
3750
|
release: i,
|
|
3232
3751
|
ready: !1,
|
|
3233
|
-
cancelReadiness:
|
|
3752
|
+
cancelReadiness: _i(() => {
|
|
3234
3753
|
c.ready = !0, n(s) && t(r, s);
|
|
3235
3754
|
}, a)
|
|
3236
3755
|
};
|
|
@@ -3247,7 +3766,7 @@ function vr() {
|
|
|
3247
3766
|
}
|
|
3248
3767
|
//#endregion
|
|
3249
3768
|
//#region src/screen/observeBarHeight.ts
|
|
3250
|
-
function
|
|
3769
|
+
function xi(e, t) {
|
|
3251
3770
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
3252
3771
|
let n = new ResizeObserver(([e]) => {
|
|
3253
3772
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -3258,14 +3777,14 @@ function yr(e, t) {
|
|
|
3258
3777
|
}
|
|
3259
3778
|
//#endregion
|
|
3260
3779
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
3261
|
-
var
|
|
3262
|
-
function
|
|
3780
|
+
var Si = 0;
|
|
3781
|
+
function Ci(e) {
|
|
3263
3782
|
let t = 0, n = () => {
|
|
3264
3783
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
3265
3784
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
3266
3785
|
t = t < 0 ? 0 : t;
|
|
3267
|
-
let n = t -
|
|
3268
|
-
n = n < 0 ? 0 : n,
|
|
3786
|
+
let n = t - Si;
|
|
3787
|
+
n = n < 0 ? 0 : n, Si ||= t, e(t, n);
|
|
3269
3788
|
});
|
|
3270
3789
|
};
|
|
3271
3790
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -3273,31 +3792,73 @@ function xr(e) {
|
|
|
3273
3792
|
};
|
|
3274
3793
|
}
|
|
3275
3794
|
//#endregion
|
|
3795
|
+
//#region src/core/engine/gpuPipelinePrewarm.ts
|
|
3796
|
+
var wi = () => {}, Ti = "data-flemo-gpu-prewarm", Ei = 2e3, Di = 1200, Oi = 120, ki = 3, Ai = "position:fixed;top:0;left:0;pointer-events:none;opacity:0.02;", ji = "width:64px;height:64px;background:#888;color:#000;font-size:10px;will-change:transform;transform:translate3d(1px,0,0);", Mi = "width:64px;height:64px;background:#000;will-change:opacity;opacity:0.5;", Ni = "cold", Pi = 0, Fi = null;
|
|
3797
|
+
function Ii() {
|
|
3798
|
+
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function" || !U()) return wi;
|
|
3799
|
+
if (Pi += 1, Ni === "cold") {
|
|
3800
|
+
Ni = "scheduled";
|
|
3801
|
+
let e = () => document.querySelector("[data-flemo-status=\"PUSHING\"],[data-flemo-status=\"POPPING\"],[data-flemo-status=\"REPLACING\"]") !== null, t = () => {
|
|
3802
|
+
let e = typeof requestIdleCallback == "function" ? requestIdleCallback(n, { timeout: Ei }) : null, t = e === null ? setTimeout(n, Di) : null;
|
|
3803
|
+
Fi = () => {
|
|
3804
|
+
e !== null && typeof cancelIdleCallback == "function" && cancelIdleCallback(e), t !== null && clearTimeout(t);
|
|
3805
|
+
};
|
|
3806
|
+
}, n = () => {
|
|
3807
|
+
if (e()) {
|
|
3808
|
+
t();
|
|
3809
|
+
return;
|
|
3810
|
+
}
|
|
3811
|
+
Fi = null, Ni = "done";
|
|
3812
|
+
let n = document.createElement("div");
|
|
3813
|
+
n.setAttribute(Ti, ""), n.setAttribute("aria-hidden", "true"), n.setAttribute("style", Ai);
|
|
3814
|
+
let r = document.createElement("div");
|
|
3815
|
+
r.setAttribute("style", ji), r.textContent = "flemo";
|
|
3816
|
+
let i = document.createElement("div");
|
|
3817
|
+
i.setAttribute("style", Mi), n.append(r, i), document.body.appendChild(n);
|
|
3818
|
+
try {
|
|
3819
|
+
r.animate([{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(2px,0,0)" }], {
|
|
3820
|
+
duration: Oi,
|
|
3821
|
+
iterations: ki
|
|
3822
|
+
}), i.animate([{ opacity: .4 }, { opacity: .6 }], {
|
|
3823
|
+
duration: Oi,
|
|
3824
|
+
iterations: ki
|
|
3825
|
+
});
|
|
3826
|
+
} catch {}
|
|
3827
|
+
setTimeout(() => n.remove(), 450);
|
|
3828
|
+
};
|
|
3829
|
+
t();
|
|
3830
|
+
}
|
|
3831
|
+
let e = !1;
|
|
3832
|
+
return () => {
|
|
3833
|
+
e || (e = !0, Pi = Math.max(0, Pi - 1), Pi === 0 && Ni === "scheduled" && (Fi?.(), Fi = null, Ni = "cold"));
|
|
3834
|
+
};
|
|
3835
|
+
}
|
|
3836
|
+
//#endregion
|
|
3276
3837
|
//#region src/core/engine/imageDecodeOffloader.ts
|
|
3277
|
-
var
|
|
3838
|
+
var Li = 8, Ri = 2, Q = 96, zi = 15e3, Bi = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", Vi = "data-flemo-image-src", Hi = "flemo-image-scale-v1", Ui = (e) => {
|
|
3278
3839
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0 || e.boxWidth <= 0 || e.boxHeight <= 0) return !1;
|
|
3279
3840
|
let t = e.boxWidth * e.boxHeight * e.devicePixelRatio * e.devicePixelRatio;
|
|
3280
3841
|
return e.naturalWidth * e.naturalHeight > t * 8;
|
|
3281
|
-
},
|
|
3842
|
+
}, Wi = "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};", Gi = () => typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap == "function" && typeof MutationObserver < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function", Ki = async (e, t) => {
|
|
3282
3843
|
try {
|
|
3283
3844
|
if (typeof caches > "u") return;
|
|
3284
|
-
await (await caches.open(
|
|
3845
|
+
await (await caches.open(Hi)).put(e, new Response(t, { headers: { "content-type": t.type } }));
|
|
3285
3846
|
} catch {}
|
|
3286
|
-
},
|
|
3847
|
+
}, qi = async (e) => {
|
|
3287
3848
|
try {
|
|
3288
3849
|
if (typeof caches > "u") return null;
|
|
3289
|
-
let t = await (await caches.open(
|
|
3850
|
+
let t = await (await caches.open(Hi)).match(e);
|
|
3290
3851
|
return t ? await t.blob() : null;
|
|
3291
3852
|
} catch {
|
|
3292
3853
|
return null;
|
|
3293
3854
|
}
|
|
3294
3855
|
};
|
|
3295
|
-
function
|
|
3296
|
-
if (!
|
|
3856
|
+
function Ji(e) {
|
|
3857
|
+
if (!Gi()) return () => {};
|
|
3297
3858
|
let t = null, n = !1, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakSet(), s = /* @__PURE__ */ new Set(), c = () => typeof devicePixelRatio == "number" ? devicePixelRatio : 1, l = () => {
|
|
3298
3859
|
if (t) return t;
|
|
3299
3860
|
try {
|
|
3300
|
-
t = new Worker(URL.createObjectURL(new Blob([
|
|
3861
|
+
t = new Worker(URL.createObjectURL(new Blob([Wi])));
|
|
3301
3862
|
} catch {
|
|
3302
3863
|
return null;
|
|
3303
3864
|
}
|
|
@@ -3308,7 +3869,7 @@ function Nr(e) {
|
|
|
3308
3869
|
return;
|
|
3309
3870
|
}
|
|
3310
3871
|
let o = URL.createObjectURL(n);
|
|
3311
|
-
s.add(o),
|
|
3872
|
+
s.add(o), Ki(t, n), u(t, o);
|
|
3312
3873
|
}, t;
|
|
3313
3874
|
}, u = (e, t) => {
|
|
3314
3875
|
r.has(e) || r.set(e, t);
|
|
@@ -3318,12 +3879,12 @@ function Nr(e) {
|
|
|
3318
3879
|
if (n) {
|
|
3319
3880
|
if (a.delete(e), clearTimeout(n.timeout), n.detachListeners?.(), n.responsive) {
|
|
3320
3881
|
if (t && t !== "skip") {
|
|
3321
|
-
e.setAttribute(
|
|
3882
|
+
e.setAttribute(Vi, n.url), e.removeAttribute("srcset"), e.removeAttribute("sizes");
|
|
3322
3883
|
let r = e.closest("picture");
|
|
3323
3884
|
if (r) for (let e of Array.from(r.querySelectorAll("source"))) e.removeAttribute("srcset");
|
|
3324
3885
|
e.src = t;
|
|
3325
3886
|
}
|
|
3326
|
-
} else e.getAttribute("src") ===
|
|
3887
|
+
} else e.getAttribute("src") === Bi && (t && t !== "skip" ? e.src = t : (e.removeAttribute(Vi), e.src = n.url));
|
|
3327
3888
|
n.previousVisibility ? e.style.visibility = n.previousVisibility : e.style.removeProperty("visibility");
|
|
3328
3889
|
}
|
|
3329
3890
|
}, f = (e, t, n) => {
|
|
@@ -3331,7 +3892,7 @@ function Nr(e) {
|
|
|
3331
3892
|
let a = l();
|
|
3332
3893
|
if (!a) return;
|
|
3333
3894
|
i.add(e);
|
|
3334
|
-
let o = Math.round(Math.max(Q, t * c()) *
|
|
3895
|
+
let o = Math.round(Math.max(Q, t * c()) * Ri), s = Math.max(t * n, 9216) * c() ** 2;
|
|
3335
3896
|
a.postMessage({
|
|
3336
3897
|
url: e,
|
|
3337
3898
|
targetWidth: o,
|
|
@@ -3343,13 +3904,13 @@ function Nr(e) {
|
|
|
3343
3904
|
let t = {
|
|
3344
3905
|
url: "",
|
|
3345
3906
|
previousVisibility: e.style.visibility,
|
|
3346
|
-
timeout: setTimeout(() => d(e, null),
|
|
3907
|
+
timeout: setTimeout(() => d(e, null), zi),
|
|
3347
3908
|
responsive: !0
|
|
3348
3909
|
}, i = () => {
|
|
3349
3910
|
/* v8 ignore next -- consider() only routes elements with an https src
|
|
3350
3911
|
here, so the final fallback arm is unreachable. */
|
|
3351
3912
|
let i = e.currentSrc || e.getAttribute("src") || "", o = e.getBoundingClientRect();
|
|
3352
|
-
if (!(/^https?:/.test(i) &&
|
|
3913
|
+
if (!(/^https?:/.test(i) && Ui({
|
|
3353
3914
|
naturalWidth: e.naturalWidth,
|
|
3354
3915
|
naturalHeight: e.naturalHeight,
|
|
3355
3916
|
boxWidth: o.width || Q,
|
|
@@ -3365,7 +3926,7 @@ function Nr(e) {
|
|
|
3365
3926
|
d(e, l);
|
|
3366
3927
|
return;
|
|
3367
3928
|
}
|
|
3368
|
-
|
|
3929
|
+
qi(i).then((t) => {
|
|
3369
3930
|
if (!(n || !a.has(e))) {
|
|
3370
3931
|
/* v8 ignore start -- a verdict can only appear via settle(), which
|
|
3371
3932
|
releases every held element of the url first, so a still-held
|
|
@@ -3404,14 +3965,14 @@ function Nr(e) {
|
|
|
3404
3965
|
let i = r.get(t);
|
|
3405
3966
|
if (i !== "skip") {
|
|
3406
3967
|
if (i) {
|
|
3407
|
-
e.setAttribute(
|
|
3968
|
+
e.setAttribute(Vi, t), e.src = i;
|
|
3408
3969
|
return;
|
|
3409
3970
|
}
|
|
3410
3971
|
a.set(e, {
|
|
3411
3972
|
url: t,
|
|
3412
3973
|
previousVisibility: e.style.visibility,
|
|
3413
|
-
timeout: setTimeout(() => d(e, null),
|
|
3414
|
-
}), e.style.visibility = "hidden", e.setAttribute(
|
|
3974
|
+
timeout: setTimeout(() => d(e, null), zi)
|
|
3975
|
+
}), e.style.visibility = "hidden", e.setAttribute(Vi, t), e.src = Bi, qi(t).then((i) => {
|
|
3415
3976
|
if (n || r.has(t)) return;
|
|
3416
3977
|
if (i) {
|
|
3417
3978
|
let e = URL.createObjectURL(i);
|
|
@@ -3443,9 +4004,9 @@ function Nr(e) {
|
|
|
3443
4004
|
};
|
|
3444
4005
|
}
|
|
3445
4006
|
var $ = null;
|
|
3446
|
-
function
|
|
4007
|
+
function Yi() {
|
|
3447
4008
|
return typeof document > "u" || !document.body ? () => {} : ($ ? $.count += 1 : $ = {
|
|
3448
|
-
dispose:
|
|
4009
|
+
dispose: Ji(document.body),
|
|
3449
4010
|
count: 1
|
|
3450
4011
|
}, () => {
|
|
3451
4012
|
$ && (--$.count, $.count <= 0 && ($.dispose(), $ = null));
|
|
@@ -3453,7 +4014,7 @@ function Pr() {
|
|
|
3453
4014
|
}
|
|
3454
4015
|
//#endregion
|
|
3455
4016
|
//#region src/utils/isOpaqueColor.ts
|
|
3456
|
-
function
|
|
4017
|
+
function Xi(e) {
|
|
3457
4018
|
let t = e.trim().toLowerCase();
|
|
3458
4019
|
if (t === "transparent" || t === "") return !1;
|
|
3459
4020
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -3464,7 +4025,7 @@ function Fr(e) {
|
|
|
3464
4025
|
}
|
|
3465
4026
|
//#endregion
|
|
3466
4027
|
//#region src/utils/buildRoutePath.ts
|
|
3467
|
-
function
|
|
4028
|
+
function Zi(e, n) {
|
|
3468
4029
|
let i = n ?? {}, a = t(e)(Object.fromEntries(Object.entries(i).map(([e, t]) => [e, String(t)]))), o = (typeof e == "string" ? r(e) : e).tokens.filter((e) => e.type === "param").map((e) => e.name), s = Object.fromEntries(Object.entries(i).filter(([e]) => !o.includes(e))), c = new URLSearchParams(s).toString();
|
|
3469
4030
|
return {
|
|
3470
4031
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -3472,4 +4033,4 @@ function Ir(e, n) {
|
|
|
3472
4033
|
};
|
|
3473
4034
|
}
|
|
3474
4035
|
//#endregion
|
|
3475
|
-
export {
|
|
4036
|
+
export { ci as ANIM_HOLD_RELEASE_BACKSTOP_MS, Vi as OFFLOADED_SRC_ATTR, Li as OVERSIZE_AREA_RATIO, yr as SKIP_ANIMATION_ATTR, s as TaskManger, si as animHoldKey, K as animateInline, it as animationName, ce as appendParamsQuery, ft as applyTransitionStyles, Zi as buildRoutePath, Qr as canProgrammaticallyScroll, G as clearInlineAnimation, Ze as collectAnimatedProperties, ct as compileTransitionStyles, ti as computeBarRiding, ye as computeScreenFreeze, ve as computeScreenFreezeMode, b as consumeSelfInducedPop, bi as createAnimHoldCoordinator, g as createBrowserHistoryDriver, Oe as createDecorator, c as createHistoryStore, x as createHistorySync, Ji as createImageDecodeOffloader, re as createMemoryHistoryDriver, O as createNavigateStore, se as createNavigationController, je as createPartTransition, ke as createRawDecorator, Me as createRawPartTransition, xe as createRawTransition, ge as createRouterScope, A as createScreenSelector, pe as createScreenStore, _ as createSelfPopGuard, le as createStepController, ei as createSwipeController, be as createTransition, Jr as createTransitionEngine, de as createTransitionStore, P as cupertino, R as decoratorMap, U as detectBlinkEngine, di as eagerlyDecodeImages, $e as easingToCss, Ii as ensureGpuPipelinePrewarm, Yi as ensureImageDecodeOffloader, ne as ensureScopeHistorySync, p as ensureWindowHistoryState, yt as enteringInitialStyle, Yr as findScrollable, l as getMatchedPathPattern, u as getParams, qt as holdCompositorWarm, Xi as isOpaqueColor, f as isServer, F as layout, y as markSelfInducedPop, fe as matchesPathname, Te as material, Ee as none, xi as observeBarHeight, Ci as observeViewportScrollHeight, Zr as overflowsAxis, Ae as overlay, z as partTransitionMap, k as readStepParams, vt as registerTransitionDefinitions, D as releaseScopeHistorySync, De as resolveTransition, vi as scheduleAnimHoldRelease, d as seedInitialHistory, m as seedRouterEntry, Ui as shouldOffloadImage, ue as subscribeStepParamsRestore, V as targetToDecls, I as transitionMap, H as variantHasAnimation };
|