@fluidattacks/design 3.1.12 → 3.1.13
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/components/@core/index.js +2 -2
- package/dist/components/accordion/accordion-content/index.js +18 -5
- package/dist/components/accordion/index.js +71 -14
- package/dist/components/alert/index.js +108 -57
- package/dist/components/button/index.js +64 -13
- package/dist/components/card/card-header/index.js +78 -9
- package/dist/components/card/card-with-image/index.js +88 -13
- package/dist/components/card/card-with-input/index.js +72 -23
- package/dist/components/card/card-with-selector/index.js +63 -8
- package/dist/components/card/card-with-switch/index.js +46 -8
- package/dist/components/carousel/index.js +54 -28
- package/dist/components/checkbox/index.js +66 -32
- package/dist/components/cloud-image/index.js +2 -2
- package/dist/components/code-snippet/index.js +64 -19
- package/dist/components/code-snippet/location-code/index.js +146 -100
- package/dist/components/colors/index.js +220 -5
- package/dist/components/confirm-dialog/index.js +41 -18
- package/dist/components/container/index.js +39 -15
- package/dist/components/content-card/category-tag/index.js +37 -8
- package/dist/components/content-card/event-date/index.js +53 -10
- package/dist/components/content-card/index.js +118 -13
- package/dist/components/content-card-carousel/index.js +87 -7
- package/dist/components/content-card-carousel/scroll-buttons/index.js +1 -1
- package/dist/components/divider/index.js +22 -7
- package/dist/components/empty-state/empty-button/index.js +4 -4
- package/dist/components/empty-state/index.js +52 -15
- package/dist/components/file-preview/index.js +28 -12
- package/dist/components/form/index.js +46 -9
- package/dist/components/grid-container/index.js +31 -11
- package/dist/components/group-selector/index.js +126 -17
- package/dist/components/group-selector/option-container/index.js +1 -1
- package/dist/components/icon/index.js +78 -18
- package/dist/components/icon-button/index.js +63 -14
- package/dist/components/indicator-card/index.js +70 -11
- package/dist/components/info-sidebar/index.js +107 -7
- package/dist/components/inputs/fields/combobox/index.js +141 -21
- package/dist/components/inputs/fields/combobox/option/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/cell/index.js +22 -11
- package/dist/components/inputs/fields/date/calendar/grid/index.js +21 -10
- package/dist/components/inputs/fields/date/calendar/header/index.js +35 -13
- package/dist/components/inputs/fields/date/calendar/index.js +26 -11
- package/dist/components/inputs/fields/date/index.js +65 -15
- package/dist/components/inputs/fields/date-range/calendar/index.js +29 -10
- package/dist/components/inputs/fields/date-range/index.js +98 -18
- package/dist/components/inputs/fields/date-time/calendar/index.js +44 -15
- package/dist/components/inputs/fields/date-time/index.js +65 -14
- package/dist/components/inputs/fields/editable/index.js +22 -10
- package/dist/components/inputs/fields/input/index.js +74 -10
- package/dist/components/inputs/fields/input-file/index.js +114 -21
- package/dist/components/inputs/fields/input-tags/index.js +60 -11
- package/dist/components/inputs/fields/number/index.js +54 -7
- package/dist/components/inputs/fields/number-range/index.js +46 -8
- package/dist/components/inputs/fields/phone/index.js +446 -286
- package/dist/components/inputs/fields/text-area/index.js +78 -10
- package/dist/components/inputs/label/index.js +34 -8
- package/dist/components/inputs/outline-container/index.js +98 -12
- package/dist/components/inputs/utils/action-button/index.js +28 -7
- package/dist/components/inputs/utils/calendar-button/index.js +34 -10
- package/dist/components/inputs/utils/date-selector/index.js +60 -6
- package/dist/components/inputs/utils/date-time-field/index.js +129 -28
- package/dist/components/inputs/utils/dialog/index.js +10 -7
- package/dist/components/inputs/utils/number-field/index.js +81 -8
- package/dist/components/inputs/utils/popover/index.js +41 -10
- package/dist/components/interactive-card/icon/index.js +1 -1
- package/dist/components/interactive-card/index.js +110 -7
- package/dist/components/language-selector/index.js +34 -10
- package/dist/components/language-selector/item-list/index.js +1 -1
- package/dist/components/link/index.js +71 -17
- package/dist/components/list-item/index.js +64 -13
- package/dist/components/little-flag/index.js +26 -9
- package/dist/components/loading/index.js +48 -21
- package/dist/components/logo/index.js +10 -4
- package/dist/components/logo-carousel/index.js +40 -5
- package/dist/components/lottie/index.js +12 -7
- package/dist/components/menu/index.js +53 -9
- package/dist/components/message-banner/index.js +79 -13
- package/dist/components/modal/index.js +59 -13
- package/dist/components/modal/modal-confirm/index.js +48 -7
- package/dist/components/modal/modal-footer/index.js +22 -13
- package/dist/components/modal/modal-header/index.js +45 -19
- package/dist/components/notification/index.js +65 -20
- package/dist/components/notification-sign/index.js +27 -10
- package/dist/components/number-input/index.js +58 -21
- package/dist/components/oauth-selector/index.js +97 -23
- package/dist/components/oauth-selector/option-container/index.js +68 -7
- package/dist/components/plan-card/index.js +99 -28
- package/dist/components/plan-card/recommended-tag/index.js +23 -2
- package/dist/components/pop-up/description/index.js +47 -9
- package/dist/components/pop-up/index.js +146 -17
- package/dist/components/premium-feature/index.js +56 -16
- package/dist/components/priority-score/index.js +24 -9
- package/dist/components/progress/index.js +30 -17
- package/dist/components/progress-bar/index.js +99 -41
- package/dist/components/radio-button/index.js +64 -27
- package/dist/components/scroll-button/index.js +33 -15
- package/dist/components/search/index.js +77 -35
- package/dist/components/search-bar/index.js +211 -24
- package/dist/components/search-bar/item-searching/index.js +1 -1
- package/dist/components/severity-badge/index.js +66 -6
- package/dist/components/severity-overview/badge/index.js +62 -11
- package/dist/components/severity-overview/index.js +15 -5
- package/dist/components/show-on-hover/index.js +16 -10
- package/dist/components/slide-out-menu/index.js +2611 -1164
- package/dist/components/slide-out-menu/menu-item/index.js +58 -6
- package/dist/components/slider/index.js +79 -48
- package/dist/components/slider/thumb/index.js +13 -6
- package/dist/components/step-lapse/index.js +81 -23
- package/dist/components/table-button/index.js +65 -24
- package/dist/components/tabs/fixed-tabs/index.js +24 -4
- package/dist/components/tabs/index.js +54 -11
- package/dist/components/tabs/tab/index.js +37 -6
- package/dist/components/tag/index.js +95 -27
- package/dist/components/timeline/card/index.js +1 -1
- package/dist/components/timeline/index.js +15 -5
- package/dist/components/toggle/index.js +65 -25
- package/dist/components/toggle-buttons/index.js +51 -22
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tour/index.js +3897 -1829
- package/dist/components/typography/heading/index.js +43 -5
- package/dist/components/typography/span/index.js +38 -6
- package/dist/components/typography/text/index.js +44 -6
- package/dist/components/web-form/index.js +28 -19
- package/dist/hooks/index.js +5 -5
- package/dist/index-BMHVi812.mjs +234 -0
- package/dist/index-BzAniA2J.mjs +135 -0
- package/dist/index-C6LbClYh.mjs +146 -0
- package/dist/index-CAIe8hBv.mjs +130 -0
- package/dist/index-CUQBAqt_.mjs +75 -0
- package/dist/index-CWlrSlUk.mjs +68 -0
- package/dist/index-Ckmu1TfV.mjs +86 -0
- package/dist/index-DwznImvK.mjs +1678 -0
- package/dist/index-maWH3JYC.mjs +3561 -0
- package/dist/index.js +11 -11
- package/dist/styles-B2N0JLw1.mjs +114 -0
- package/dist/styles-B64DVBIF.mjs +115 -0
- package/dist/{styles-lSVV9kjn.mjs → styles-BXFVwnWT.mjs} +28 -28
- package/dist/styles-BZQOqe8p.mjs +141 -0
- package/dist/styles-Bdque9TT.mjs +65 -0
- package/dist/{styles-CI-I6joH.mjs → styles-BlHspTrz.mjs} +18 -18
- package/dist/{styles-Cx93EcVo.mjs → styles-CROOwXEH.mjs} +5 -5
- package/dist/styles-CplEd2kw.mjs +228 -0
- package/dist/styles-D1eTIklB.mjs +110 -0
- package/dist/styles-ePGii_9g.mjs +74 -0
- package/dist/use-carousel-CgAF78h3.mjs +23 -0
- package/dist/use-click-outside-BUll8Ag-.mjs +18 -0
- package/dist/use-cloudinary-image-BCxwj15o.mjs +1176 -0
- package/dist/use-modal-CtgexKnf.mjs +14 -0
- package/dist/use-search-Dj47QDw9.mjs +15 -0
- package/dist/utils-V0EumEPM.mjs +6 -0
- package/package.json +1 -3
- package/dist/index-38JqtnAI.mjs +0 -122
- package/dist/index-B5yoGFs6.mjs +0 -54
- package/dist/index-BLbKylyw.mjs +0 -209
- package/dist/index-Bu448Tz2.mjs +0 -106
- package/dist/index-BwFnfaRh.mjs +0 -2310
- package/dist/index-Co_k0WFk.mjs +0 -75
- package/dist/index-Cu7uUMlx.mjs +0 -82
- package/dist/index-D-lcuEHY.mjs +0 -1018
- package/dist/index-DrfjITyT.mjs +0 -61
- package/dist/styles-7_q7nHce.mjs +0 -110
- package/dist/styles-BA0WIQL-.mjs +0 -74
- package/dist/styles-C3cZmKVJ.mjs +0 -131
- package/dist/styles-D85YYIjM.mjs +0 -131
- package/dist/styles-EIbGRPlk.mjs +0 -106
- package/dist/styles-Q1VXuWI7.mjs +0 -65
- package/dist/styles-fH2c4cfc.mjs +0 -77
- package/dist/use-carousel-CvRxi2FI.mjs +0 -17
- package/dist/use-click-outside-BtZLIoU1.mjs +0 -18
- package/dist/use-cloudinary-image-fG7ODNgr.mjs +0 -611
- package/dist/use-modal-CkrZ-_-M.mjs +0 -14
- package/dist/use-search-DpLNvt7Q.mjs +0 -12
- package/dist/utils-CQvBF-wY.mjs +0 -4
|
@@ -1,157 +1,319 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { styled as
|
|
4
|
-
import { MenuItem as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Container as
|
|
7
|
-
import { IconButton as
|
|
1
|
+
import { jsxs as Y, jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as te, useLayoutEffect as xs, useEffect as nt, useContext as O, useRef as Z, useInsertionEffect as As, useCallback as fn, useMemo as Ae, forwardRef as Ms, Fragment as hn, createElement as Cs, useState as Ps } from "react";
|
|
3
|
+
import { styled as Fs, useTheme as Ds } from "styled-components";
|
|
4
|
+
import { MenuItem as Rs } from "./menu-item/index.js";
|
|
5
|
+
import { Button as Rt } from "../button/index.js";
|
|
6
|
+
import { Container as q } from "../container/index.js";
|
|
7
|
+
import { IconButton as Is } from "../icon-button/index.js";
|
|
8
8
|
import "../typography/heading/index.js";
|
|
9
9
|
import "../typography/span/index.js";
|
|
10
|
-
import { Text as
|
|
11
|
-
import { u as
|
|
10
|
+
import { Text as Os } from "../typography/text/index.js";
|
|
11
|
+
import { u as Es } from "../../use-click-outside-BUll8Ag-.mjs";
|
|
12
12
|
import "lodash";
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
t ||
|
|
16
|
-
}
|
|
17
|
-
function
|
|
18
|
-
if (typeof Proxy > "u")
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const It = /* @__PURE__ */ new Set();
|
|
14
|
+
function Me(t, e, n) {
|
|
15
|
+
t || It.has(e) || (console.warn(e), It.add(e));
|
|
16
|
+
}
|
|
17
|
+
function ks(t) {
|
|
18
|
+
if (typeof Proxy > "u")
|
|
19
|
+
return t;
|
|
20
|
+
const e = /* @__PURE__ */ new Map(), n = (...s) => (process.env.NODE_ENV !== "production" && Me(!1, "motion() is deprecated. Use motion.create() instead."), t(...s));
|
|
21
|
+
return new Proxy(n, {
|
|
22
|
+
/**
|
|
23
|
+
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
24
|
+
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
25
|
+
* DOM component with that name.
|
|
26
|
+
*/
|
|
27
|
+
get: (s, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i))
|
|
28
|
+
});
|
|
21
29
|
}
|
|
22
30
|
function Ce(t) {
|
|
23
31
|
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
24
32
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
if (!Array.isArray(e))
|
|
33
|
+
const je = (t) => Array.isArray(t);
|
|
34
|
+
function pn(t, e) {
|
|
35
|
+
if (!Array.isArray(e))
|
|
36
|
+
return !1;
|
|
28
37
|
const n = e.length;
|
|
29
|
-
if (n !== t.length)
|
|
30
|
-
|
|
38
|
+
if (n !== t.length)
|
|
39
|
+
return !1;
|
|
40
|
+
for (let s = 0; s < n; s++)
|
|
41
|
+
if (e[s] !== t[s])
|
|
42
|
+
return !1;
|
|
31
43
|
return !0;
|
|
32
44
|
}
|
|
33
|
-
function
|
|
45
|
+
function ue(t) {
|
|
34
46
|
return typeof t == "string" || Array.isArray(t);
|
|
35
47
|
}
|
|
36
|
-
function
|
|
48
|
+
function Ot(t) {
|
|
37
49
|
const e = [{}, {}];
|
|
38
50
|
return t == null || t.values.forEach((n, s) => {
|
|
39
51
|
e[0][s] = n.get(), e[1][s] = n.getVelocity();
|
|
40
52
|
}), e;
|
|
41
53
|
}
|
|
42
|
-
function
|
|
54
|
+
function st(t, e, n, s) {
|
|
43
55
|
if (typeof e == "function") {
|
|
44
|
-
const [i, r] =
|
|
56
|
+
const [i, r] = Ot(s);
|
|
45
57
|
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
46
58
|
}
|
|
47
59
|
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
|
|
48
|
-
const [i, r] =
|
|
60
|
+
const [i, r] = Ot(s);
|
|
49
61
|
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
50
62
|
}
|
|
51
63
|
return e;
|
|
52
64
|
}
|
|
53
|
-
function
|
|
65
|
+
function Pe(t, e, n) {
|
|
54
66
|
const s = t.getProps();
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
const
|
|
58
|
-
|
|
67
|
+
return st(s, e, n !== void 0 ? n : s.custom, t);
|
|
68
|
+
}
|
|
69
|
+
const it = [
|
|
70
|
+
"animate",
|
|
71
|
+
"whileInView",
|
|
72
|
+
"whileFocus",
|
|
73
|
+
"whileHover",
|
|
74
|
+
"whileTap",
|
|
75
|
+
"whileDrag",
|
|
76
|
+
"exit"
|
|
77
|
+
], rt = ["initial", ...it], fe = [
|
|
78
|
+
"transformPerspective",
|
|
79
|
+
"x",
|
|
80
|
+
"y",
|
|
81
|
+
"z",
|
|
82
|
+
"translateX",
|
|
83
|
+
"translateY",
|
|
84
|
+
"translateZ",
|
|
85
|
+
"scale",
|
|
86
|
+
"scaleX",
|
|
87
|
+
"scaleY",
|
|
88
|
+
"rotate",
|
|
89
|
+
"rotateX",
|
|
90
|
+
"rotateY",
|
|
91
|
+
"rotateZ",
|
|
92
|
+
"skew",
|
|
93
|
+
"skewX",
|
|
94
|
+
"skewY"
|
|
95
|
+
], z = new Set(fe), L = (t) => t * 1e3, B = (t) => t / 1e3, Ls = {
|
|
96
|
+
type: "spring",
|
|
97
|
+
stiffness: 500,
|
|
98
|
+
damping: 25,
|
|
99
|
+
restSpeed: 10
|
|
100
|
+
}, Ns = (t) => ({
|
|
101
|
+
type: "spring",
|
|
102
|
+
stiffness: 550,
|
|
103
|
+
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
104
|
+
restSpeed: 10
|
|
105
|
+
}), Bs = {
|
|
106
|
+
type: "keyframes",
|
|
107
|
+
duration: 0.8
|
|
108
|
+
}, Ks = {
|
|
109
|
+
type: "keyframes",
|
|
110
|
+
ease: [0.25, 0.1, 0.35, 1],
|
|
111
|
+
duration: 0.3
|
|
112
|
+
}, _s = (t, { keyframes: e }) => e.length > 2 ? Bs : z.has(t) ? t.startsWith("scale") ? Ns(e[1]) : Ls : Ks;
|
|
113
|
+
function mn(t, e) {
|
|
59
114
|
return t ? t[e] || t.default || t : void 0;
|
|
60
115
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
116
|
+
const $s = {
|
|
117
|
+
skipAnimations: !1,
|
|
118
|
+
useManualTiming: !1
|
|
119
|
+
}, js = (t) => t !== null;
|
|
120
|
+
function Fe(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
121
|
+
const i = t.filter(js), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
122
|
+
return !r || s === void 0 ? i[r] : s;
|
|
123
|
+
}
|
|
124
|
+
const _ = (t) => t;
|
|
125
|
+
let ne = _, G = _;
|
|
126
|
+
process.env.NODE_ENV !== "production" && (ne = (t, e) => {
|
|
127
|
+
!t && typeof console < "u" && console.warn(e);
|
|
128
|
+
}, G = (t, e) => {
|
|
129
|
+
if (!t)
|
|
130
|
+
throw new Error(e);
|
|
72
131
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
132
|
+
function Ws(t) {
|
|
133
|
+
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, i = !1;
|
|
134
|
+
const r = /* @__PURE__ */ new WeakSet();
|
|
135
|
+
let o = {
|
|
136
|
+
delta: 0,
|
|
137
|
+
timestamp: 0,
|
|
138
|
+
isProcessing: !1
|
|
139
|
+
};
|
|
140
|
+
function a(u) {
|
|
141
|
+
r.has(u) && (l.schedule(u), t()), u(o);
|
|
142
|
+
}
|
|
143
|
+
const l = {
|
|
144
|
+
/**
|
|
145
|
+
* Schedule a process to run on the next frame.
|
|
146
|
+
*/
|
|
147
|
+
schedule: (u, c = !1, f = !1) => {
|
|
148
|
+
const h = f && s ? e : n;
|
|
149
|
+
return c && r.add(u), h.has(u) || h.add(u), u;
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* Cancel the provided callback from running on the next frame.
|
|
153
|
+
*/
|
|
154
|
+
cancel: (u) => {
|
|
155
|
+
n.delete(u), r.delete(u);
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Execute all schedule callbacks.
|
|
159
|
+
*/
|
|
160
|
+
process: (u) => {
|
|
161
|
+
if (o = u, s) {
|
|
162
|
+
i = !0;
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
s = !0, [e, n] = [n, e], e.forEach(a), e.clear(), s = !1, i && (i = !1, l.process(u));
|
|
82
166
|
}
|
|
83
|
-
const A = { schedule: (V, M = !1, Ie = !1) => {
|
|
84
|
-
const ie = Ie && x ? m : S;
|
|
85
|
-
return M && y.add(V), ie.has(V) || ie.add(V), V;
|
|
86
|
-
}, cancel: (V) => {
|
|
87
|
-
S.delete(V), y.delete(V);
|
|
88
|
-
}, process: (V) => {
|
|
89
|
-
w = V, x ? C = !0 : (x = !0, [m, S] = [S, m], m.forEach(T), m.clear(), x = !1, C && (C = !1, A.process(V)));
|
|
90
|
-
} };
|
|
91
|
-
return A;
|
|
92
|
-
}(r), v), {}), { read: a, resolveKeyframes: l, update: c, preRender: u, render: h, postRender: d } = o, f = () => {
|
|
93
|
-
const v = performance.now();
|
|
94
|
-
n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(v - i.timestamp, 40), 1), i.timestamp = v, i.isProcessing = !0, a.process(i), l.process(i), c.process(i), u.process(i), h.process(i), d.process(i), i.isProcessing = !1, n && e && (s = !1, t(f));
|
|
95
167
|
};
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
168
|
+
return l;
|
|
169
|
+
}
|
|
170
|
+
const me = [
|
|
171
|
+
"read",
|
|
172
|
+
// Read
|
|
173
|
+
"resolveKeyframes",
|
|
174
|
+
// Write/Read/Write/Read
|
|
175
|
+
"update",
|
|
176
|
+
// Compute
|
|
177
|
+
"preRender",
|
|
178
|
+
// Compute
|
|
179
|
+
"render",
|
|
180
|
+
// Write
|
|
181
|
+
"postRender"
|
|
182
|
+
// Compute
|
|
183
|
+
], Gs = 40;
|
|
184
|
+
function gn(t, e) {
|
|
185
|
+
let n = !1, s = !0;
|
|
186
|
+
const i = {
|
|
187
|
+
delta: 0,
|
|
188
|
+
timestamp: 0,
|
|
189
|
+
isProcessing: !1
|
|
190
|
+
}, r = () => n = !0, o = me.reduce((p, g) => (p[g] = Ws(r), p), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: f, postRender: d } = o, h = () => {
|
|
191
|
+
const p = performance.now();
|
|
192
|
+
n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(p - i.timestamp, Gs), 1), i.timestamp = p, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), f.process(i), d.process(i), i.isProcessing = !1, n && e && (s = !1, t(h));
|
|
193
|
+
}, y = () => {
|
|
194
|
+
n = !0, s = !0, i.isProcessing || t(h);
|
|
195
|
+
};
|
|
196
|
+
return { schedule: me.reduce((p, g) => {
|
|
197
|
+
const V = o[g];
|
|
198
|
+
return p[g] = (A, w = !1, S = !1) => (n || y(), V.schedule(A, w, S)), p;
|
|
199
|
+
}, {}), cancel: (p) => {
|
|
200
|
+
for (let g = 0; g < me.length; g++)
|
|
201
|
+
o[me[g]].cancel(p);
|
|
101
202
|
}, state: i, steps: o };
|
|
102
203
|
}
|
|
103
|
-
const { schedule:
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
204
|
+
const { schedule: R, cancel: We, state: ve, steps: Ca } = gn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : _, !0), yn = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, Us = 1e-7, zs = 12;
|
|
205
|
+
function Hs(t, e, n, s, i) {
|
|
206
|
+
let r, o, a = 0;
|
|
207
|
+
do
|
|
208
|
+
o = e + (n - e) / 2, r = yn(o, s, i) - t, r > 0 ? n = o : e = o;
|
|
209
|
+
while (Math.abs(r) > Us && ++a < zs);
|
|
210
|
+
return o;
|
|
211
|
+
}
|
|
212
|
+
function he(t, e, n, s) {
|
|
213
|
+
if (t === e && n === s)
|
|
214
|
+
return _;
|
|
215
|
+
const i = (r) => Hs(r, 0, 1, t, n);
|
|
216
|
+
return (r) => r === 0 || r === 1 ? r : yn(i(r), e, s);
|
|
217
|
+
}
|
|
218
|
+
const vn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, bn = (t) => (e) => 1 - t(1 - e), wn = /* @__PURE__ */ he(0.33, 1.53, 0.69, 0.99), ot = /* @__PURE__ */ bn(wn), Tn = /* @__PURE__ */ vn(ot), Vn = (t) => (t *= 2) < 1 ? 0.5 * ot(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), at = (t) => 1 - Math.sin(Math.acos(t)), qs = bn(at), Sn = vn(at), xn = (t) => /^0[^.\s]+$/u.test(t);
|
|
219
|
+
function Ys(t) {
|
|
220
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || xn(t) : !0;
|
|
221
|
+
}
|
|
222
|
+
const An = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Mn = (t) => (e) => typeof e == "string" && e.startsWith(t), Cn = /* @__PURE__ */ Mn("--"), Xs = /* @__PURE__ */ Mn("var(--"), lt = (t) => Xs(t) ? Zs.test(t.split("/*")[0].trim()) : !1, Zs = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Js = (
|
|
223
|
+
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
224
|
+
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
225
|
+
);
|
|
226
|
+
function Qs(t) {
|
|
227
|
+
const e = Js.exec(t);
|
|
228
|
+
if (!e)
|
|
229
|
+
return [,];
|
|
230
|
+
const [, n, s, i] = e;
|
|
231
|
+
return [`--${n ?? s}`, i];
|
|
232
|
+
}
|
|
233
|
+
const ei = 4;
|
|
234
|
+
function Pn(t, e, n = 1) {
|
|
235
|
+
G(n <= ei, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
236
|
+
const [s, i] = Qs(t);
|
|
237
|
+
if (!s)
|
|
238
|
+
return;
|
|
125
239
|
const r = window.getComputedStyle(e).getPropertyValue(s);
|
|
126
240
|
if (r) {
|
|
127
241
|
const o = r.trim();
|
|
128
|
-
return
|
|
129
|
-
}
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
const
|
|
133
|
-
|
|
242
|
+
return An(o) ? parseFloat(o) : o;
|
|
243
|
+
}
|
|
244
|
+
return lt(i) ? Pn(i, e, n + 1) : i;
|
|
245
|
+
}
|
|
246
|
+
const U = (t, e, n) => n > e ? e : n < t ? t : n, se = {
|
|
247
|
+
test: (t) => typeof t == "number",
|
|
248
|
+
parse: parseFloat,
|
|
249
|
+
transform: (t) => t
|
|
250
|
+
}, ce = {
|
|
251
|
+
...se,
|
|
252
|
+
transform: (t) => U(0, 1, t)
|
|
253
|
+
}, ge = {
|
|
254
|
+
...se,
|
|
255
|
+
default: 1
|
|
256
|
+
}, pe = (t) => ({
|
|
257
|
+
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
258
|
+
parse: parseFloat,
|
|
259
|
+
transform: (e) => `${e}${t}`
|
|
260
|
+
}), N = /* @__PURE__ */ pe("deg"), J = /* @__PURE__ */ pe("%"), m = /* @__PURE__ */ pe("px"), ti = /* @__PURE__ */ pe("vh"), ni = /* @__PURE__ */ pe("vw"), Et = {
|
|
261
|
+
...J,
|
|
262
|
+
parse: (t) => J.parse(t) / 100,
|
|
263
|
+
transform: (t) => J.transform(t * 100)
|
|
264
|
+
}, si = /* @__PURE__ */ new Set([
|
|
265
|
+
"width",
|
|
266
|
+
"height",
|
|
267
|
+
"top",
|
|
268
|
+
"left",
|
|
269
|
+
"right",
|
|
270
|
+
"bottom",
|
|
271
|
+
"x",
|
|
272
|
+
"y",
|
|
273
|
+
"translateX",
|
|
274
|
+
"translateY"
|
|
275
|
+
]), kt = (t) => t === se || t === m, Lt = (t, e) => parseFloat(t.split(", ")[e]), Nt = (t, e) => (n, { transform: s }) => {
|
|
276
|
+
if (s === "none" || !s)
|
|
277
|
+
return 0;
|
|
134
278
|
const i = s.match(/^matrix3d\((.+)\)$/u);
|
|
135
|
-
if (i)
|
|
279
|
+
if (i)
|
|
280
|
+
return Lt(i[1], e);
|
|
136
281
|
{
|
|
137
282
|
const r = s.match(/^matrix\((.+)\)$/u);
|
|
138
|
-
return r ?
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
283
|
+
return r ? Lt(r[1], t) : 0;
|
|
284
|
+
}
|
|
285
|
+
}, ii = /* @__PURE__ */ new Set(["x", "y", "z"]), ri = fe.filter((t) => !ii.has(t));
|
|
286
|
+
function oi(t) {
|
|
287
|
+
const e = [];
|
|
288
|
+
return ri.forEach((n) => {
|
|
289
|
+
const s = t.getValue(n);
|
|
290
|
+
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
291
|
+
}), e;
|
|
292
|
+
}
|
|
293
|
+
const Q = {
|
|
294
|
+
// Dimensions
|
|
295
|
+
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
296
|
+
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
297
|
+
top: (t, { top: e }) => parseFloat(e),
|
|
298
|
+
left: (t, { left: e }) => parseFloat(e),
|
|
299
|
+
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
300
|
+
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
301
|
+
// Transform
|
|
302
|
+
x: Nt(4, 13),
|
|
303
|
+
y: Nt(5, 14)
|
|
304
|
+
};
|
|
305
|
+
Q.translateX = Q.x;
|
|
306
|
+
Q.translateY = Q.y;
|
|
307
|
+
const Fn = (t) => (e) => e.test(t), ai = {
|
|
308
|
+
test: (t) => t === "auto",
|
|
309
|
+
parse: (t) => t
|
|
310
|
+
}, Dn = [se, m, J, N, ni, ti, ai], Bt = (t) => Dn.find(Fn(t)), W = /* @__PURE__ */ new Set();
|
|
311
|
+
let Ge = !1, Ue = !1;
|
|
312
|
+
function Rn() {
|
|
313
|
+
if (Ue) {
|
|
146
314
|
const t = Array.from(W).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
147
315
|
e.forEach((s) => {
|
|
148
|
-
const i =
|
|
149
|
-
const o = [];
|
|
150
|
-
return Xs.forEach((a) => {
|
|
151
|
-
const l = r.getValue(a);
|
|
152
|
-
l !== void 0 && (o.push([a, l.get()]), l.set(a.startsWith("scale") ? 1 : 0));
|
|
153
|
-
}), o;
|
|
154
|
-
}(s);
|
|
316
|
+
const i = oi(s);
|
|
155
317
|
i.length && (n.set(s, i), s.render());
|
|
156
318
|
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
157
319
|
s.render();
|
|
@@ -164,31 +326,38 @@ function In() {
|
|
|
164
326
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
165
327
|
});
|
|
166
328
|
}
|
|
167
|
-
|
|
329
|
+
Ue = !1, Ge = !1, W.forEach((t) => t.complete()), W.clear();
|
|
168
330
|
}
|
|
169
|
-
function
|
|
331
|
+
function In() {
|
|
170
332
|
W.forEach((t) => {
|
|
171
|
-
t.readKeyframes(), t.needsMeasurement && (
|
|
333
|
+
t.readKeyframes(), t.needsMeasurement && (Ue = !0);
|
|
172
334
|
});
|
|
173
335
|
}
|
|
174
|
-
|
|
336
|
+
function li() {
|
|
337
|
+
In(), Rn();
|
|
338
|
+
}
|
|
339
|
+
class ut {
|
|
175
340
|
constructor(e, n, s, i, r, o = !1) {
|
|
176
341
|
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
|
|
177
342
|
}
|
|
178
343
|
scheduleResolve() {
|
|
179
|
-
this.isScheduled = !0, this.isAsync ? (W.add(this),
|
|
344
|
+
this.isScheduled = !0, this.isAsync ? (W.add(this), Ge || (Ge = !0, R.read(In), R.resolveKeyframes(Rn))) : (this.readKeyframes(), this.complete());
|
|
180
345
|
}
|
|
181
346
|
readKeyframes() {
|
|
182
347
|
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
183
|
-
for (let r = 0; r < e.length; r++)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
348
|
+
for (let r = 0; r < e.length; r++)
|
|
349
|
+
if (e[r] === null)
|
|
350
|
+
if (r === 0) {
|
|
351
|
+
const o = i == null ? void 0 : i.get(), a = e[e.length - 1];
|
|
352
|
+
if (o !== void 0)
|
|
353
|
+
e[0] = o;
|
|
354
|
+
else if (s && n) {
|
|
355
|
+
const l = s.readValue(n, a);
|
|
356
|
+
l != null && (e[0] = l);
|
|
357
|
+
}
|
|
358
|
+
e[0] === void 0 && (e[0] = a), i && o === void 0 && i.set(e[0]);
|
|
359
|
+
} else
|
|
360
|
+
e[r] = e[r - 1];
|
|
192
361
|
}
|
|
193
362
|
setFinalKeyframe() {
|
|
194
363
|
}
|
|
@@ -208,159 +377,363 @@ class ct {
|
|
|
208
377
|
this.isComplete || this.scheduleResolve();
|
|
209
378
|
}
|
|
210
379
|
}
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
380
|
+
const le = (t) => Math.round(t * 1e5) / 1e5, ct = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
381
|
+
function ui(t) {
|
|
382
|
+
return t == null;
|
|
383
|
+
}
|
|
384
|
+
const ci = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, dt = (t, e) => (n) => !!(typeof n == "string" && ci.test(n) && n.startsWith(t) || e && !ui(n) && Object.prototype.hasOwnProperty.call(n, e)), On = (t, e, n) => (s) => {
|
|
385
|
+
if (typeof s != "string")
|
|
386
|
+
return s;
|
|
387
|
+
const [i, r, o, a] = s.match(ct);
|
|
388
|
+
return {
|
|
389
|
+
[t]: parseFloat(i),
|
|
390
|
+
[e]: parseFloat(r),
|
|
391
|
+
[n]: parseFloat(o),
|
|
392
|
+
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
393
|
+
};
|
|
394
|
+
}, di = (t) => U(0, 255, t), Le = {
|
|
395
|
+
...se,
|
|
396
|
+
transform: (t) => Math.round(di(t))
|
|
397
|
+
}, j = {
|
|
398
|
+
test: /* @__PURE__ */ dt("rgb", "red"),
|
|
399
|
+
parse: /* @__PURE__ */ On("red", "green", "blue"),
|
|
400
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Le.transform(t) + ", " + Le.transform(e) + ", " + Le.transform(n) + ", " + le(ce.transform(s)) + ")"
|
|
401
|
+
};
|
|
402
|
+
function fi(t) {
|
|
218
403
|
let e = "", n = "", s = "", i = "";
|
|
219
|
-
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
404
|
+
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
|
|
405
|
+
red: parseInt(e, 16),
|
|
406
|
+
green: parseInt(n, 16),
|
|
407
|
+
blue: parseInt(s, 16),
|
|
408
|
+
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
const ze = {
|
|
412
|
+
test: /* @__PURE__ */ dt("#"),
|
|
413
|
+
parse: fi,
|
|
414
|
+
transform: j.transform
|
|
415
|
+
}, X = {
|
|
416
|
+
test: /* @__PURE__ */ dt("hsl", "hue"),
|
|
417
|
+
parse: /* @__PURE__ */ On("hue", "saturation", "lightness"),
|
|
418
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + J.transform(le(e)) + ", " + J.transform(le(n)) + ", " + le(ce.transform(s)) + ")"
|
|
419
|
+
}, C = {
|
|
420
|
+
test: (t) => j.test(t) || ze.test(t) || X.test(t),
|
|
421
|
+
parse: (t) => j.test(t) ? j.parse(t) : X.test(t) ? X.parse(t) : ze.parse(t),
|
|
422
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? j.transform(t) : X.transform(t)
|
|
423
|
+
}, hi = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
424
|
+
function pi(t) {
|
|
425
|
+
var e, n;
|
|
426
|
+
return isNaN(t) && typeof t == "string" && (((e = t.match(ct)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(hi)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
427
|
+
}
|
|
428
|
+
const En = "number", kn = "color", mi = "var", gi = "var(", Kt = "${}", yi = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
429
|
+
function de(t) {
|
|
430
|
+
const e = t.toString(), n = [], s = {
|
|
431
|
+
color: [],
|
|
432
|
+
number: [],
|
|
433
|
+
var: []
|
|
434
|
+
}, i = [];
|
|
223
435
|
let r = 0;
|
|
224
|
-
const
|
|
225
|
-
return { values: n, split:
|
|
436
|
+
const a = e.replace(yi, (l) => (C.test(l) ? (s.color.push(r), i.push(kn), n.push(C.parse(l))) : l.startsWith(gi) ? (s.var.push(r), i.push(mi), n.push(l)) : (s.number.push(r), i.push(En), n.push(parseFloat(l))), ++r, Kt)).split(Kt);
|
|
437
|
+
return { values: n, split: a, indexes: s, types: i };
|
|
226
438
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
439
|
+
function Ln(t) {
|
|
440
|
+
return de(t).values;
|
|
229
441
|
}
|
|
230
|
-
function
|
|
231
|
-
const { split: e, types: n } =
|
|
442
|
+
function Nn(t) {
|
|
443
|
+
const { split: e, types: n } = de(t), s = e.length;
|
|
232
444
|
return (i) => {
|
|
233
445
|
let r = "";
|
|
234
|
-
for (let o = 0; o < s; o++)
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
446
|
+
for (let o = 0; o < s; o++)
|
|
447
|
+
if (r += e[o], i[o] !== void 0) {
|
|
448
|
+
const a = n[o];
|
|
449
|
+
a === En ? r += le(i[o]) : a === kn ? r += C.transform(i[o]) : r += i[o];
|
|
450
|
+
}
|
|
238
451
|
return r;
|
|
239
452
|
};
|
|
240
453
|
}
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
454
|
+
const vi = (t) => typeof t == "number" ? 0 : t;
|
|
455
|
+
function bi(t) {
|
|
456
|
+
const e = Ln(t);
|
|
457
|
+
return Nn(t)(e.map(vi));
|
|
458
|
+
}
|
|
459
|
+
const ie = {
|
|
460
|
+
test: pi,
|
|
461
|
+
parse: Ln,
|
|
462
|
+
createTransformer: Nn,
|
|
463
|
+
getAnimatableNone: bi
|
|
464
|
+
}, wi = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
465
|
+
function Ti(t) {
|
|
249
466
|
const [e, n] = t.slice(0, -1).split("(");
|
|
250
|
-
if (e === "drop-shadow")
|
|
251
|
-
|
|
252
|
-
|
|
467
|
+
if (e === "drop-shadow")
|
|
468
|
+
return t;
|
|
469
|
+
const [s] = n.match(ct) || [];
|
|
470
|
+
if (!s)
|
|
471
|
+
return t;
|
|
253
472
|
const i = n.replace(s, "");
|
|
254
|
-
let r =
|
|
473
|
+
let r = wi.has(e) ? 1 : 0;
|
|
255
474
|
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
256
475
|
}
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
476
|
+
const Vi = /\b([a-z-]*)\(.*?\)/gu, He = {
|
|
477
|
+
...ie,
|
|
478
|
+
getAnimatableNone: (t) => {
|
|
479
|
+
const e = t.match(Vi);
|
|
480
|
+
return e ? e.map(Ti).join(" ") : t;
|
|
481
|
+
}
|
|
482
|
+
}, Si = {
|
|
483
|
+
// Border props
|
|
484
|
+
borderWidth: m,
|
|
485
|
+
borderTopWidth: m,
|
|
486
|
+
borderRightWidth: m,
|
|
487
|
+
borderBottomWidth: m,
|
|
488
|
+
borderLeftWidth: m,
|
|
489
|
+
borderRadius: m,
|
|
490
|
+
radius: m,
|
|
491
|
+
borderTopLeftRadius: m,
|
|
492
|
+
borderTopRightRadius: m,
|
|
493
|
+
borderBottomRightRadius: m,
|
|
494
|
+
borderBottomLeftRadius: m,
|
|
495
|
+
// Positioning props
|
|
496
|
+
width: m,
|
|
497
|
+
maxWidth: m,
|
|
498
|
+
height: m,
|
|
499
|
+
maxHeight: m,
|
|
500
|
+
top: m,
|
|
501
|
+
right: m,
|
|
502
|
+
bottom: m,
|
|
503
|
+
left: m,
|
|
504
|
+
// Spacing props
|
|
505
|
+
padding: m,
|
|
506
|
+
paddingTop: m,
|
|
507
|
+
paddingRight: m,
|
|
508
|
+
paddingBottom: m,
|
|
509
|
+
paddingLeft: m,
|
|
510
|
+
margin: m,
|
|
511
|
+
marginTop: m,
|
|
512
|
+
marginRight: m,
|
|
513
|
+
marginBottom: m,
|
|
514
|
+
marginLeft: m,
|
|
515
|
+
// Misc
|
|
516
|
+
backgroundPositionX: m,
|
|
517
|
+
backgroundPositionY: m
|
|
518
|
+
}, xi = {
|
|
519
|
+
rotate: N,
|
|
520
|
+
rotateX: N,
|
|
521
|
+
rotateY: N,
|
|
522
|
+
rotateZ: N,
|
|
523
|
+
scale: ge,
|
|
524
|
+
scaleX: ge,
|
|
525
|
+
scaleY: ge,
|
|
526
|
+
scaleZ: ge,
|
|
527
|
+
skew: N,
|
|
528
|
+
skewX: N,
|
|
529
|
+
skewY: N,
|
|
530
|
+
distance: m,
|
|
531
|
+
translateX: m,
|
|
532
|
+
translateY: m,
|
|
533
|
+
translateZ: m,
|
|
534
|
+
x: m,
|
|
535
|
+
y: m,
|
|
536
|
+
z: m,
|
|
537
|
+
perspective: m,
|
|
538
|
+
transformPerspective: m,
|
|
539
|
+
opacity: ce,
|
|
540
|
+
originX: Et,
|
|
541
|
+
originY: Et,
|
|
542
|
+
originZ: m
|
|
543
|
+
}, _t = {
|
|
544
|
+
...se,
|
|
545
|
+
transform: Math.round
|
|
546
|
+
}, ft = {
|
|
547
|
+
...Si,
|
|
548
|
+
...xi,
|
|
549
|
+
zIndex: _t,
|
|
550
|
+
size: m,
|
|
551
|
+
// SVG
|
|
552
|
+
fillOpacity: ce,
|
|
553
|
+
strokeOpacity: ce,
|
|
554
|
+
numOctaves: _t
|
|
555
|
+
}, Ai = {
|
|
556
|
+
...ft,
|
|
557
|
+
// Color props
|
|
558
|
+
color: C,
|
|
559
|
+
backgroundColor: C,
|
|
560
|
+
outlineColor: C,
|
|
561
|
+
fill: C,
|
|
562
|
+
stroke: C,
|
|
563
|
+
// Border props
|
|
564
|
+
borderColor: C,
|
|
565
|
+
borderTopColor: C,
|
|
566
|
+
borderRightColor: C,
|
|
567
|
+
borderBottomColor: C,
|
|
568
|
+
borderLeftColor: C,
|
|
569
|
+
filter: He,
|
|
570
|
+
WebkitFilter: He
|
|
571
|
+
}, ht = (t) => Ai[t];
|
|
572
|
+
function Bn(t, e) {
|
|
573
|
+
let n = ht(t);
|
|
574
|
+
return n !== He && (n = ie), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
575
|
+
}
|
|
576
|
+
const Mi = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
577
|
+
function Ci(t, e, n) {
|
|
578
|
+
let s = 0, i;
|
|
579
|
+
for (; s < t.length && !i; ) {
|
|
580
|
+
const r = t[s];
|
|
581
|
+
typeof r == "string" && !Mi.has(r) && de(r).values.length && (i = t[s]), s++;
|
|
582
|
+
}
|
|
583
|
+
if (i && n)
|
|
584
|
+
for (const r of e)
|
|
585
|
+
t[r] = Bn(n, i);
|
|
586
|
+
}
|
|
587
|
+
class Kn extends ut {
|
|
267
588
|
constructor(e, n, s, i, r) {
|
|
268
589
|
super(e, n, s, i, r, !0);
|
|
269
590
|
}
|
|
270
591
|
readKeyframes() {
|
|
271
592
|
const { unresolvedKeyframes: e, element: n, name: s } = this;
|
|
272
|
-
if (!n || !n.current)
|
|
593
|
+
if (!n || !n.current)
|
|
594
|
+
return;
|
|
273
595
|
super.readKeyframes();
|
|
274
596
|
for (let l = 0; l < e.length; l++) {
|
|
275
|
-
let
|
|
276
|
-
if (typeof
|
|
277
|
-
const
|
|
278
|
-
|
|
597
|
+
let u = e[l];
|
|
598
|
+
if (typeof u == "string" && (u = u.trim(), lt(u))) {
|
|
599
|
+
const c = Pn(u, n.current);
|
|
600
|
+
c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
|
|
279
601
|
}
|
|
280
602
|
}
|
|
281
|
-
if (this.resolveNoneKeyframes(), !
|
|
603
|
+
if (this.resolveNoneKeyframes(), !si.has(s) || e.length !== 2)
|
|
604
|
+
return;
|
|
282
605
|
const [i, r] = e, o = Bt(i), a = Bt(r);
|
|
283
|
-
if (o !== a)
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
606
|
+
if (o !== a)
|
|
607
|
+
if (kt(o) && kt(a))
|
|
608
|
+
for (let l = 0; l < e.length; l++) {
|
|
609
|
+
const u = e[l];
|
|
610
|
+
typeof u == "string" && (e[l] = parseFloat(u));
|
|
611
|
+
}
|
|
612
|
+
else
|
|
613
|
+
this.needsMeasurement = !0;
|
|
288
614
|
}
|
|
289
615
|
resolveNoneKeyframes() {
|
|
290
616
|
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
291
|
-
for (let
|
|
292
|
-
|
|
293
|
-
s.length &&
|
|
294
|
-
let l, c = 0;
|
|
295
|
-
for (; c < r.length && !l; ) {
|
|
296
|
-
const u = r[c];
|
|
297
|
-
typeof u == "string" && !ri.has(u) && ce(u).values.length && (l = r[c]), c++;
|
|
298
|
-
}
|
|
299
|
-
if (l && a) for (const u of o) r[u] = Ln(a, l);
|
|
300
|
-
}(e, s, n);
|
|
617
|
+
for (let i = 0; i < e.length; i++)
|
|
618
|
+
Ys(e[i]) && s.push(i);
|
|
619
|
+
s.length && Ci(e, s, n);
|
|
301
620
|
}
|
|
302
621
|
measureInitialState() {
|
|
303
622
|
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
304
|
-
if (!e || !e.current)
|
|
305
|
-
|
|
623
|
+
if (!e || !e.current)
|
|
624
|
+
return;
|
|
625
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Q[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
306
626
|
const i = n[n.length - 1];
|
|
307
627
|
i !== void 0 && e.getValue(s, i).jump(i, !1);
|
|
308
628
|
}
|
|
309
629
|
measureEndState() {
|
|
310
630
|
var e;
|
|
311
631
|
const { element: n, name: s, unresolvedKeyframes: i } = this;
|
|
312
|
-
if (!n || !n.current)
|
|
632
|
+
if (!n || !n.current)
|
|
633
|
+
return;
|
|
313
634
|
const r = n.getValue(s);
|
|
314
635
|
r && r.jump(this.measuredOrigin, !1);
|
|
315
636
|
const o = i.length - 1, a = i[o];
|
|
316
|
-
i[o] =
|
|
317
|
-
n.getValue(l).set(
|
|
637
|
+
i[o] = Q[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, u]) => {
|
|
638
|
+
n.getValue(l).set(u);
|
|
318
639
|
}), this.resolveNoneKeyframes();
|
|
319
640
|
}
|
|
320
641
|
}
|
|
321
|
-
function
|
|
642
|
+
function pt(t) {
|
|
322
643
|
return typeof t == "function";
|
|
323
644
|
}
|
|
324
|
-
let
|
|
325
|
-
function
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
const
|
|
329
|
-
ve
|
|
330
|
-
|
|
331
|
-
|
|
645
|
+
let ye;
|
|
646
|
+
function Pi() {
|
|
647
|
+
ye = void 0;
|
|
648
|
+
}
|
|
649
|
+
const K = {
|
|
650
|
+
now: () => (ye === void 0 && K.set(ve.isProcessing || $s.useManualTiming ? ve.timestamp : performance.now()), ye),
|
|
651
|
+
set: (t) => {
|
|
652
|
+
ye = t, queueMicrotask(Pi);
|
|
653
|
+
}
|
|
654
|
+
}, $t = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
655
|
+
(ie.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
656
|
+
!t.startsWith("url("));
|
|
657
|
+
function Fi(t) {
|
|
658
|
+
const e = t[0];
|
|
659
|
+
if (t.length === 1)
|
|
660
|
+
return !0;
|
|
661
|
+
for (let n = 0; n < t.length; n++)
|
|
662
|
+
if (t[n] !== e)
|
|
663
|
+
return !0;
|
|
664
|
+
}
|
|
665
|
+
function Di(t, e, n, s) {
|
|
332
666
|
const i = t[0];
|
|
333
|
-
if (i === null)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
class jn {
|
|
667
|
+
if (i === null)
|
|
668
|
+
return !1;
|
|
669
|
+
if (e === "display" || e === "visibility")
|
|
670
|
+
return !0;
|
|
671
|
+
const r = t[t.length - 1], o = $t(i, e), a = $t(r, e);
|
|
672
|
+
return ne(o === a, `You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !a ? !1 : Fi(t) || (n === "spring" || pt(n)) && s;
|
|
673
|
+
}
|
|
674
|
+
const Ri = 40;
|
|
675
|
+
class _n {
|
|
343
676
|
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", ...a }) {
|
|
344
|
-
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt =
|
|
345
|
-
|
|
677
|
+
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = K.now(), this.options = {
|
|
678
|
+
autoplay: e,
|
|
679
|
+
delay: n,
|
|
680
|
+
type: s,
|
|
681
|
+
repeat: i,
|
|
682
|
+
repeatDelay: r,
|
|
683
|
+
repeatType: o,
|
|
684
|
+
...a
|
|
685
|
+
}, this.updateFinishedPromise();
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* This method uses the createdAt and resolvedAt to calculate the
|
|
689
|
+
* animation startTime. *Ideally*, we would use the createdAt time as t=0
|
|
690
|
+
* as the following frame would then be the first frame of the animation in
|
|
691
|
+
* progress, which would feel snappier.
|
|
692
|
+
*
|
|
693
|
+
* However, if there's a delay (main thread work) between the creation of
|
|
694
|
+
* the animation and the first commited frame, we prefer to use resolvedAt
|
|
695
|
+
* to avoid a sudden jump into the animation.
|
|
696
|
+
*/
|
|
346
697
|
calcStartTime() {
|
|
347
|
-
return this.resolvedAt
|
|
698
|
+
return this.resolvedAt ? this.resolvedAt - this.createdAt > Ri ? this.resolvedAt : this.createdAt : this.createdAt;
|
|
348
699
|
}
|
|
700
|
+
/**
|
|
701
|
+
* A getter for resolved data. If keyframes are not yet resolved, accessing
|
|
702
|
+
* this.resolved will synchronously flush all pending keyframe resolvers.
|
|
703
|
+
* This is a deoptimisation, but at its worst still batches read/writes.
|
|
704
|
+
*/
|
|
349
705
|
get resolved() {
|
|
350
|
-
return this._resolved
|
|
706
|
+
return !this._resolved && !this.hasAttemptedResolve && li(), this._resolved;
|
|
351
707
|
}
|
|
708
|
+
/**
|
|
709
|
+
* A method to be called when the keyframes resolver completes. This method
|
|
710
|
+
* will check if its possible to run the animation and, if not, skip it.
|
|
711
|
+
* Otherwise, it will call initPlayback on the implementing class.
|
|
712
|
+
*/
|
|
352
713
|
onKeyframesResolved(e, n) {
|
|
353
|
-
this.resolvedAt =
|
|
354
|
-
const { name: s, type: i, velocity: r, delay: o, onComplete: a, onUpdate: l, isGenerator:
|
|
355
|
-
if (!
|
|
356
|
-
if (
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
714
|
+
this.resolvedAt = K.now(), this.hasAttemptedResolve = !0;
|
|
715
|
+
const { name: s, type: i, velocity: r, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
|
|
716
|
+
if (!u && !Di(e, s, i, r))
|
|
717
|
+
if (o)
|
|
718
|
+
this.options.duration = 0;
|
|
719
|
+
else {
|
|
720
|
+
l == null || l(Fe(e, this.options, n)), a == null || a(), this.resolveFinishedPromise();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
const c = this.initPlayback(e, n);
|
|
724
|
+
c !== !1 && (this._resolved = {
|
|
725
|
+
keyframes: e,
|
|
726
|
+
finalKeyframe: n,
|
|
727
|
+
...c
|
|
728
|
+
}, this.onPostResolved());
|
|
361
729
|
}
|
|
362
730
|
onPostResolved() {
|
|
363
731
|
}
|
|
732
|
+
/**
|
|
733
|
+
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
734
|
+
* resolves when the animation finishes at all but in a future update could/should
|
|
735
|
+
* reject if its cancels.
|
|
736
|
+
*/
|
|
364
737
|
then(e, n) {
|
|
365
738
|
return this.currentFinishedPromise.then(e, n);
|
|
366
739
|
}
|
|
@@ -373,325 +746,504 @@ class jn {
|
|
|
373
746
|
});
|
|
374
747
|
}
|
|
375
748
|
}
|
|
376
|
-
const
|
|
749
|
+
const mt = (t, e, n) => {
|
|
377
750
|
const s = e - t;
|
|
378
751
|
return s === 0 ? 1 : (n - t) / s;
|
|
379
|
-
},
|
|
752
|
+
}, $n = (t, e, n = 10) => {
|
|
380
753
|
let s = "";
|
|
381
754
|
const i = Math.max(Math.round(e / n), 2);
|
|
382
|
-
for (let r = 0; r < i; r++)
|
|
755
|
+
for (let r = 0; r < i; r++)
|
|
756
|
+
s += t(mt(0, i - 1, r)) + ", ";
|
|
383
757
|
return `linear(${s.substring(0, s.length - 2)})`;
|
|
384
758
|
};
|
|
385
|
-
function
|
|
759
|
+
function jn(t, e) {
|
|
386
760
|
return e ? t * (1e3 / e) : 0;
|
|
387
761
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
762
|
+
const Ii = 5;
|
|
763
|
+
function Wn(t, e, n) {
|
|
764
|
+
const s = Math.max(e - Ii, 0);
|
|
765
|
+
return jn(n - t(s), e - s);
|
|
766
|
+
}
|
|
767
|
+
const x = {
|
|
768
|
+
// Default spring physics
|
|
769
|
+
stiffness: 100,
|
|
770
|
+
damping: 10,
|
|
771
|
+
mass: 1,
|
|
772
|
+
velocity: 0,
|
|
773
|
+
// Default duration/bounce-based options
|
|
774
|
+
duration: 800,
|
|
775
|
+
// in ms
|
|
776
|
+
bounce: 0.3,
|
|
777
|
+
visualDuration: 0.3,
|
|
778
|
+
// in seconds
|
|
779
|
+
// Rest thresholds
|
|
780
|
+
restSpeed: {
|
|
781
|
+
granular: 0.01,
|
|
782
|
+
default: 2
|
|
783
|
+
},
|
|
784
|
+
restDelta: {
|
|
785
|
+
granular: 5e-3,
|
|
786
|
+
default: 0.5
|
|
787
|
+
},
|
|
788
|
+
// Limits
|
|
789
|
+
minDuration: 0.01,
|
|
790
|
+
// in seconds
|
|
791
|
+
maxDuration: 10,
|
|
792
|
+
// in seconds
|
|
793
|
+
minDamping: 0.05,
|
|
794
|
+
maxDamping: 1
|
|
795
|
+
}, jt = 1e-3;
|
|
796
|
+
function Oi({ duration: t = x.duration, bounce: e = x.bounce, velocity: n = x.velocity, mass: s = x.mass }) {
|
|
394
797
|
let i, r;
|
|
395
|
-
|
|
798
|
+
ne(t <= L(x.maxDuration), "Spring duration must be 10 seconds or less");
|
|
396
799
|
let o = 1 - e;
|
|
397
|
-
o =
|
|
398
|
-
const c =
|
|
399
|
-
return
|
|
400
|
-
}, r = (
|
|
401
|
-
const
|
|
402
|
-
return (
|
|
403
|
-
}) : (i = (
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
800
|
+
o = U(x.minDamping, x.maxDamping, o), t = U(x.minDuration, x.maxDuration, B(t)), o < 1 ? (i = (u) => {
|
|
801
|
+
const c = u * o, f = c * t, d = c - n, h = qe(u, o), y = Math.exp(-f);
|
|
802
|
+
return jt - d / h * y;
|
|
803
|
+
}, r = (u) => {
|
|
804
|
+
const f = u * o * t, d = f * n + n, h = Math.pow(o, 2) * Math.pow(u, 2) * t, y = Math.exp(-f), v = qe(Math.pow(u, 2), o);
|
|
805
|
+
return (-i(u) + jt > 0 ? -1 : 1) * ((d - h) * y) / v;
|
|
806
|
+
}) : (i = (u) => {
|
|
807
|
+
const c = Math.exp(-u * t), f = (u - n) * t + 1;
|
|
808
|
+
return -1e-3 + c * f;
|
|
809
|
+
}, r = (u) => {
|
|
810
|
+
const c = Math.exp(-u * t), f = (n - u) * (t * t);
|
|
811
|
+
return c * f;
|
|
812
|
+
});
|
|
813
|
+
const a = 5 / t, l = ki(i, r, a);
|
|
814
|
+
if (t = L(t), isNaN(l))
|
|
815
|
+
return {
|
|
816
|
+
stiffness: x.stiffness,
|
|
817
|
+
damping: x.damping,
|
|
818
|
+
duration: t
|
|
819
|
+
};
|
|
410
820
|
{
|
|
411
|
-
const
|
|
412
|
-
return {
|
|
821
|
+
const u = Math.pow(l, 2) * s;
|
|
822
|
+
return {
|
|
823
|
+
stiffness: u,
|
|
824
|
+
damping: o * 2 * Math.sqrt(s * u),
|
|
825
|
+
duration: t
|
|
826
|
+
};
|
|
413
827
|
}
|
|
414
828
|
}
|
|
415
|
-
const
|
|
416
|
-
function
|
|
417
|
-
|
|
829
|
+
const Ei = 12;
|
|
830
|
+
function ki(t, e, n) {
|
|
831
|
+
let s = n;
|
|
832
|
+
for (let i = 1; i < Ei; i++)
|
|
833
|
+
s = s - t(s) / e(s);
|
|
834
|
+
return s;
|
|
418
835
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
let e = 0, n = t.next(e);
|
|
422
|
-
for (; !n.done && e < Ze; ) e += 50, n = t.next(e);
|
|
423
|
-
return e >= Ze ? 1 / 0 : e;
|
|
836
|
+
function qe(t, e) {
|
|
837
|
+
return t * Math.sqrt(1 - e * e);
|
|
424
838
|
}
|
|
425
|
-
const
|
|
426
|
-
function
|
|
839
|
+
const Ye = 2e4;
|
|
840
|
+
function Gn(t) {
|
|
841
|
+
let e = 0;
|
|
842
|
+
const n = 50;
|
|
843
|
+
let s = t.next(e);
|
|
844
|
+
for (; !s.done && e < Ye; )
|
|
845
|
+
e += n, s = t.next(e);
|
|
846
|
+
return e >= Ye ? 1 / 0 : e;
|
|
847
|
+
}
|
|
848
|
+
const Li = ["duration", "bounce"], Ni = ["stiffness", "damping", "mass"];
|
|
849
|
+
function Wt(t, e) {
|
|
427
850
|
return e.some((n) => t[n] !== void 0);
|
|
428
851
|
}
|
|
429
|
-
function
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
852
|
+
function Bi(t) {
|
|
853
|
+
let e = {
|
|
854
|
+
velocity: x.velocity,
|
|
855
|
+
stiffness: x.stiffness,
|
|
856
|
+
damping: x.damping,
|
|
857
|
+
mass: x.mass,
|
|
858
|
+
isResolvedFromDuration: !1,
|
|
859
|
+
...t
|
|
860
|
+
};
|
|
861
|
+
if (!Wt(t, Ni) && Wt(t, Li))
|
|
862
|
+
if (t.visualDuration) {
|
|
863
|
+
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * U(0.05, 1, 1 - t.bounce) * Math.sqrt(i);
|
|
864
|
+
e = {
|
|
865
|
+
...e,
|
|
866
|
+
mass: x.mass,
|
|
867
|
+
stiffness: i,
|
|
868
|
+
damping: r
|
|
869
|
+
};
|
|
437
870
|
} else {
|
|
438
|
-
const
|
|
439
|
-
|
|
871
|
+
const n = Oi(t);
|
|
872
|
+
e = {
|
|
873
|
+
...e,
|
|
874
|
+
...n,
|
|
875
|
+
mass: x.mass
|
|
876
|
+
}, e.isResolvedFromDuration = !0;
|
|
440
877
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
878
|
+
return e;
|
|
879
|
+
}
|
|
880
|
+
function Un(t = x.visualDuration, e = x.bounce) {
|
|
881
|
+
const n = typeof t != "object" ? {
|
|
882
|
+
visualDuration: t,
|
|
883
|
+
keyframes: [0, 1],
|
|
884
|
+
bounce: e
|
|
885
|
+
} : t;
|
|
886
|
+
let { restSpeed: s, restDelta: i } = n;
|
|
887
|
+
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: f, velocity: d, isResolvedFromDuration: h } = Bi({
|
|
888
|
+
...n,
|
|
889
|
+
velocity: -B(n.velocity || 0)
|
|
890
|
+
}), y = d || 0, v = u / (2 * Math.sqrt(l * c)), b = o - r, p = B(Math.sqrt(l / c)), g = Math.abs(b) < 5;
|
|
891
|
+
s || (s = g ? x.restSpeed.granular : x.restSpeed.default), i || (i = g ? x.restDelta.granular : x.restDelta.default);
|
|
892
|
+
let V;
|
|
893
|
+
if (v < 1) {
|
|
894
|
+
const w = qe(p, v);
|
|
895
|
+
V = (S) => {
|
|
896
|
+
const M = Math.exp(-v * p * S);
|
|
897
|
+
return o - M * ((y + v * p * b) / w * Math.sin(w * S) + b * Math.cos(w * S));
|
|
449
898
|
};
|
|
450
|
-
} else if (
|
|
899
|
+
} else if (v === 1)
|
|
900
|
+
V = (w) => o - Math.exp(-p * w) * (b + (y + p * b) * w);
|
|
451
901
|
else {
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
return o -
|
|
902
|
+
const w = p * Math.sqrt(v * v - 1);
|
|
903
|
+
V = (S) => {
|
|
904
|
+
const M = Math.exp(-v * p * S), T = Math.min(w * S, 300);
|
|
905
|
+
return o - M * ((y + v * p * b) * Math.sinh(T) + w * b * Math.cosh(T)) / w;
|
|
456
906
|
};
|
|
457
907
|
}
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
908
|
+
const A = {
|
|
909
|
+
calculatedDuration: h && f || null,
|
|
910
|
+
next: (w) => {
|
|
911
|
+
const S = V(w);
|
|
912
|
+
if (h)
|
|
913
|
+
a.done = w >= f;
|
|
914
|
+
else {
|
|
915
|
+
let M = 0;
|
|
916
|
+
v < 1 && (M = w === 0 ? L(y) : Wn(V, w, S));
|
|
917
|
+
const T = Math.abs(M) <= s, D = Math.abs(o - S) <= i;
|
|
918
|
+
a.done = T && D;
|
|
919
|
+
}
|
|
920
|
+
return a.value = a.done ? o : S, a;
|
|
921
|
+
},
|
|
922
|
+
toString: () => {
|
|
923
|
+
const w = Math.min(Gn(A), Ye), S = $n((M) => A.next(w * M).value, w, 30);
|
|
924
|
+
return w + "ms " + S;
|
|
466
925
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
const h = t[0], d = { done: !1, value: h }, f = (T) => a === void 0 ? l : l === void 0 || Math.abs(a - T) < Math.abs(l - T) ? a : l;
|
|
926
|
+
};
|
|
927
|
+
return A;
|
|
928
|
+
}
|
|
929
|
+
function Gt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
930
|
+
const f = t[0], d = {
|
|
931
|
+
done: !1,
|
|
932
|
+
value: f
|
|
933
|
+
}, h = (T) => a !== void 0 && T < a || l !== void 0 && T > l, y = (T) => a === void 0 ? l : l === void 0 || Math.abs(a - T) < Math.abs(l - T) ? a : l;
|
|
476
934
|
let v = n * e;
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
const
|
|
481
|
-
d.done = Math.abs(
|
|
935
|
+
const b = f + v, p = o === void 0 ? b : o(b);
|
|
936
|
+
p !== b && (v = p - f);
|
|
937
|
+
const g = (T) => -v * Math.exp(-T / s), V = (T) => p + g(T), A = (T) => {
|
|
938
|
+
const D = g(T), I = V(T);
|
|
939
|
+
d.done = Math.abs(D) <= u, d.value = d.done ? p : I;
|
|
482
940
|
};
|
|
483
|
-
let
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
941
|
+
let w, S;
|
|
942
|
+
const M = (T) => {
|
|
943
|
+
h(d.value) && (w = T, S = Un({
|
|
944
|
+
keyframes: [d.value, y(d.value)],
|
|
945
|
+
velocity: Wn(V, T, d.value),
|
|
946
|
+
// TODO: This should be passing * 1000
|
|
947
|
+
damping: i,
|
|
948
|
+
stiffness: r,
|
|
949
|
+
restDelta: u,
|
|
950
|
+
restSpeed: c
|
|
951
|
+
}));
|
|
952
|
+
};
|
|
953
|
+
return M(0), {
|
|
954
|
+
calculatedDuration: null,
|
|
955
|
+
next: (T) => {
|
|
956
|
+
let D = !1;
|
|
957
|
+
return !S && w === void 0 && (D = !0, A(T), M(T)), w !== void 0 && T >= w ? S.next(T - w) : (!D && A(T), d);
|
|
958
|
+
}
|
|
487
959
|
};
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
960
|
+
}
|
|
961
|
+
const Ki = /* @__PURE__ */ he(0.42, 0, 1, 1), _i = /* @__PURE__ */ he(0, 0, 0.58, 1), zn = /* @__PURE__ */ he(0.42, 0, 0.58, 1), $i = (t) => Array.isArray(t) && typeof t[0] != "number", gt = (t) => Array.isArray(t) && typeof t[0] == "number", Ut = {
|
|
962
|
+
linear: _,
|
|
963
|
+
easeIn: Ki,
|
|
964
|
+
easeInOut: zn,
|
|
965
|
+
easeOut: _i,
|
|
966
|
+
circIn: at,
|
|
967
|
+
circInOut: Sn,
|
|
968
|
+
circOut: qs,
|
|
969
|
+
backIn: ot,
|
|
970
|
+
backInOut: Tn,
|
|
971
|
+
backOut: wn,
|
|
972
|
+
anticipate: Vn
|
|
973
|
+
}, zt = (t) => {
|
|
974
|
+
if (gt(t)) {
|
|
975
|
+
G(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
496
976
|
const [e, n, s, i] = t;
|
|
497
|
-
return
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
977
|
+
return he(e, n, s, i);
|
|
978
|
+
} else if (typeof t == "string")
|
|
979
|
+
return G(Ut[t] !== void 0, `Invalid easing type '${t}'`), Ut[t];
|
|
980
|
+
return t;
|
|
981
|
+
}, ji = (t, e) => (n) => e(t(n)), De = (...t) => t.reduce(ji), Re = (t, e, n) => t + (e - t) * n;
|
|
982
|
+
function Ne(t, e, n) {
|
|
983
|
+
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
984
|
+
}
|
|
985
|
+
function Wi({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
986
|
+
t /= 360, e /= 100, n /= 100;
|
|
987
|
+
let i = 0, r = 0, o = 0;
|
|
988
|
+
if (!e)
|
|
989
|
+
i = r = o = n;
|
|
990
|
+
else {
|
|
991
|
+
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
992
|
+
i = Ne(l, a, t + 1 / 3), r = Ne(l, a, t), o = Ne(l, a, t - 1 / 3);
|
|
993
|
+
}
|
|
994
|
+
return {
|
|
995
|
+
red: Math.round(i * 255),
|
|
996
|
+
green: Math.round(r * 255),
|
|
997
|
+
blue: Math.round(o * 255),
|
|
998
|
+
alpha: s
|
|
999
|
+
};
|
|
503
1000
|
}
|
|
504
|
-
function
|
|
1001
|
+
function be(t, e) {
|
|
505
1002
|
return (n) => n > 0 ? e : t;
|
|
506
1003
|
}
|
|
507
|
-
const
|
|
1004
|
+
const Be = (t, e, n) => {
|
|
508
1005
|
const s = t * t, i = n * (e * e - s) + s;
|
|
509
1006
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
510
|
-
},
|
|
511
|
-
function
|
|
512
|
-
const e = (
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
let
|
|
516
|
-
return e ===
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
} else l = c = u = o;
|
|
523
|
-
return { red: Math.round(255 * l), green: Math.round(255 * c), blue: Math.round(255 * u), alpha: a };
|
|
524
|
-
}(s)), s;
|
|
525
|
-
}
|
|
526
|
-
const _t = (t, e) => {
|
|
527
|
-
const n = Xt(t), s = Xt(e);
|
|
528
|
-
if (!n || !s) return Se(t, e);
|
|
1007
|
+
}, Gi = [ze, j, X], Ui = (t) => Gi.find((e) => e.test(t));
|
|
1008
|
+
function Ht(t) {
|
|
1009
|
+
const e = Ui(t);
|
|
1010
|
+
if (ne(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
1011
|
+
return !1;
|
|
1012
|
+
let n = e.parse(t);
|
|
1013
|
+
return e === X && (n = Wi(n)), n;
|
|
1014
|
+
}
|
|
1015
|
+
const qt = (t, e) => {
|
|
1016
|
+
const n = Ht(t), s = Ht(e);
|
|
1017
|
+
if (!n || !s)
|
|
1018
|
+
return be(t, e);
|
|
529
1019
|
const i = { ...n };
|
|
530
|
-
return (r) => (i.red =
|
|
531
|
-
},
|
|
532
|
-
function
|
|
533
|
-
return (n) =>
|
|
1020
|
+
return (r) => (i.red = Be(n.red, s.red, r), i.green = Be(n.green, s.green, r), i.blue = Be(n.blue, s.blue, r), i.alpha = Re(n.alpha, s.alpha, r), j.transform(i));
|
|
1021
|
+
}, Xe = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
1022
|
+
function zi(t, e) {
|
|
1023
|
+
return Xe.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
534
1024
|
}
|
|
535
|
-
function
|
|
536
|
-
return
|
|
1025
|
+
function Hi(t, e) {
|
|
1026
|
+
return (n) => Re(t, e, n);
|
|
537
1027
|
}
|
|
538
|
-
function
|
|
539
|
-
|
|
1028
|
+
function yt(t) {
|
|
1029
|
+
return typeof t == "number" ? Hi : typeof t == "string" ? lt(t) ? be : C.test(t) ? qt : Xi : Array.isArray(t) ? Hn : typeof t == "object" ? C.test(t) ? qt : qi : be;
|
|
1030
|
+
}
|
|
1031
|
+
function Hn(t, e) {
|
|
1032
|
+
const n = [...t], s = n.length, i = t.map((r, o) => yt(r)(r, e[o]));
|
|
540
1033
|
return (r) => {
|
|
541
|
-
for (let o = 0; o < s; o++)
|
|
1034
|
+
for (let o = 0; o < s; o++)
|
|
1035
|
+
n[o] = i[o](r);
|
|
542
1036
|
return n;
|
|
543
1037
|
};
|
|
544
1038
|
}
|
|
545
|
-
function
|
|
1039
|
+
function qi(t, e) {
|
|
546
1040
|
const n = { ...t, ...e }, s = {};
|
|
547
|
-
for (const i in n)
|
|
1041
|
+
for (const i in n)
|
|
1042
|
+
t[i] !== void 0 && e[i] !== void 0 && (s[i] = yt(t[i])(t[i], e[i]));
|
|
548
1043
|
return (i) => {
|
|
549
|
-
for (const r in s)
|
|
1044
|
+
for (const r in s)
|
|
1045
|
+
n[r] = s[r](i);
|
|
550
1046
|
return n;
|
|
551
1047
|
};
|
|
552
1048
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}(s, i), i.values), n) : (te(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), Se(t, e));
|
|
1049
|
+
function Yi(t, e) {
|
|
1050
|
+
var n;
|
|
1051
|
+
const s = [], i = { color: 0, var: 0, number: 0 };
|
|
1052
|
+
for (let r = 0; r < e.values.length; r++) {
|
|
1053
|
+
const o = e.types[r], a = t.indexes[o][i[o]], l = (n = t.values[a]) !== null && n !== void 0 ? n : 0;
|
|
1054
|
+
s[r] = l, i[o]++;
|
|
1055
|
+
}
|
|
1056
|
+
return s;
|
|
1057
|
+
}
|
|
1058
|
+
const Xi = (t, e) => {
|
|
1059
|
+
const n = ie.createTransformer(e), s = de(t), i = de(e);
|
|
1060
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Xe.has(t) && !i.values.length || Xe.has(e) && !s.values.length ? zi(t, e) : De(Hn(Yi(s, i), i.values), n) : (ne(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), be(t, e));
|
|
566
1061
|
};
|
|
567
|
-
function
|
|
568
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ?
|
|
1062
|
+
function qn(t, e, n) {
|
|
1063
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? Re(t, e, n) : yt(t)(t, e);
|
|
1064
|
+
}
|
|
1065
|
+
function Zi(t, e, n) {
|
|
1066
|
+
const s = [], i = n || qn, r = t.length - 1;
|
|
1067
|
+
for (let o = 0; o < r; o++) {
|
|
1068
|
+
let a = i(t[o], t[o + 1]);
|
|
1069
|
+
if (e) {
|
|
1070
|
+
const l = Array.isArray(e) ? e[o] || _ : e;
|
|
1071
|
+
a = De(l, a);
|
|
1072
|
+
}
|
|
1073
|
+
s.push(a);
|
|
1074
|
+
}
|
|
1075
|
+
return s;
|
|
569
1076
|
}
|
|
570
|
-
function
|
|
1077
|
+
function Ji(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
571
1078
|
const r = t.length;
|
|
572
|
-
if (
|
|
573
|
-
|
|
1079
|
+
if (G(r === e.length, "Both input and output ranges must be the same length"), r === 1)
|
|
1080
|
+
return () => e[0];
|
|
1081
|
+
if (r === 2 && t[0] === t[1])
|
|
1082
|
+
return () => e[1];
|
|
574
1083
|
t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
575
|
-
const o =
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
d.push(g);
|
|
584
|
-
}
|
|
585
|
-
return d;
|
|
586
|
-
}(e, s, i), a = o.length, l = (c) => {
|
|
587
|
-
let u = 0;
|
|
588
|
-
if (a > 1) for (; u < t.length - 2 && !(c < t[u + 1]); u++) ;
|
|
589
|
-
const h = ft(t[u], t[u + 1], c);
|
|
590
|
-
return o[u](h);
|
|
1084
|
+
const o = Zi(e, s, i), a = o.length, l = (u) => {
|
|
1085
|
+
let c = 0;
|
|
1086
|
+
if (a > 1)
|
|
1087
|
+
for (; c < t.length - 2 && !(u < t[c + 1]); c++)
|
|
1088
|
+
;
|
|
1089
|
+
const f = mt(t[c], t[c + 1], u);
|
|
1090
|
+
return o[c](f);
|
|
591
1091
|
};
|
|
592
|
-
return n ? (
|
|
1092
|
+
return n ? (u) => l(U(t[0], t[r - 1], u)) : l;
|
|
593
1093
|
}
|
|
594
|
-
function
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
const i =
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
n.push(Ee(i, 1, o));
|
|
601
|
-
}
|
|
602
|
-
}(e, t.length - 1), e;
|
|
1094
|
+
function Qi(t, e) {
|
|
1095
|
+
const n = t[t.length - 1];
|
|
1096
|
+
for (let s = 1; s <= e; s++) {
|
|
1097
|
+
const i = mt(0, e, s);
|
|
1098
|
+
t.push(Re(n, 1, i));
|
|
1099
|
+
}
|
|
603
1100
|
}
|
|
604
|
-
function
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
return
|
|
1101
|
+
function er(t) {
|
|
1102
|
+
const e = [0];
|
|
1103
|
+
return Qi(e, t.length - 1), e;
|
|
1104
|
+
}
|
|
1105
|
+
function tr(t, e) {
|
|
1106
|
+
return t.map((n) => n * e);
|
|
1107
|
+
}
|
|
1108
|
+
function nr(t, e) {
|
|
1109
|
+
return t.map(() => e || zn).splice(0, t.length - 1);
|
|
1110
|
+
}
|
|
1111
|
+
function we({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
1112
|
+
const i = $i(s) ? s.map(zt) : zt(s), r = {
|
|
1113
|
+
done: !1,
|
|
1114
|
+
value: e[0]
|
|
1115
|
+
}, o = tr(
|
|
1116
|
+
// Only use the provided offsets if they're the correct length
|
|
1117
|
+
// TODO Maybe we should warn here if there's a length mismatch
|
|
1118
|
+
n && n.length === e.length ? n : er(e),
|
|
1119
|
+
t
|
|
1120
|
+
), a = Ji(o, e, {
|
|
1121
|
+
ease: Array.isArray(i) ? i : nr(e, i)
|
|
1122
|
+
});
|
|
1123
|
+
return {
|
|
1124
|
+
calculatedDuration: t,
|
|
1125
|
+
next: (l) => (r.value = a(l), r.done = l >= t, r)
|
|
1126
|
+
};
|
|
610
1127
|
}
|
|
611
|
-
const
|
|
1128
|
+
const sr = (t) => {
|
|
612
1129
|
const e = ({ timestamp: n }) => t(n);
|
|
613
|
-
return {
|
|
614
|
-
|
|
615
|
-
|
|
1130
|
+
return {
|
|
1131
|
+
start: () => R.update(e, !0),
|
|
1132
|
+
stop: () => We(e),
|
|
1133
|
+
/**
|
|
1134
|
+
* If we're processing this frame we can use the
|
|
1135
|
+
* framelocked timestamp to keep things in sync.
|
|
1136
|
+
*/
|
|
1137
|
+
now: () => ve.isProcessing ? ve.timestamp : K.now()
|
|
1138
|
+
};
|
|
1139
|
+
}, ir = {
|
|
1140
|
+
decay: Gt,
|
|
1141
|
+
inertia: Gt,
|
|
1142
|
+
tween: we,
|
|
1143
|
+
keyframes: we,
|
|
1144
|
+
spring: Un
|
|
1145
|
+
}, rr = (t) => t / 100;
|
|
1146
|
+
class vt extends _n {
|
|
616
1147
|
constructor(e) {
|
|
617
1148
|
super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
618
|
-
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1149
|
+
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1150
|
+
return;
|
|
619
1151
|
this.teardown();
|
|
620
|
-
const { onStop:
|
|
621
|
-
|
|
1152
|
+
const { onStop: l } = this.options;
|
|
1153
|
+
l && l();
|
|
622
1154
|
};
|
|
623
|
-
const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) ||
|
|
624
|
-
this.resolver = new o(r,
|
|
1155
|
+
const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) || ut, a = (l, u) => this.onKeyframesResolved(l, u);
|
|
1156
|
+
this.resolver = new o(r, a, n, s, i), this.resolver.scheduleResolve();
|
|
625
1157
|
}
|
|
626
1158
|
flatten() {
|
|
627
1159
|
super.flatten(), this._resolved && Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
|
|
628
1160
|
}
|
|
629
1161
|
initPlayback(e) {
|
|
630
|
-
const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a =
|
|
631
|
-
let l,
|
|
632
|
-
a !==
|
|
633
|
-
const
|
|
634
|
-
r === "mirror" && (
|
|
635
|
-
|
|
636
|
-
|
|
1162
|
+
const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a = pt(n) ? n : ir[n] || we;
|
|
1163
|
+
let l, u;
|
|
1164
|
+
a !== we && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && G(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = De(rr, qn(e[0], e[1])), e = [0, 100]);
|
|
1165
|
+
const c = a({ ...this.options, keyframes: e });
|
|
1166
|
+
r === "mirror" && (u = a({
|
|
1167
|
+
...this.options,
|
|
1168
|
+
keyframes: [...e].reverse(),
|
|
1169
|
+
velocity: -o
|
|
1170
|
+
})), c.calculatedDuration === null && (c.calculatedDuration = Gn(c));
|
|
1171
|
+
const { calculatedDuration: f } = c, d = f + i, h = d * (s + 1) - i;
|
|
1172
|
+
return {
|
|
1173
|
+
generator: c,
|
|
1174
|
+
mirroredGenerator: u,
|
|
1175
|
+
mapPercentToKeyframes: l,
|
|
1176
|
+
calculatedDuration: f,
|
|
1177
|
+
resolvedDuration: d,
|
|
1178
|
+
totalDuration: h
|
|
1179
|
+
};
|
|
637
1180
|
}
|
|
638
1181
|
onPostResolved() {
|
|
639
1182
|
const { autoplay: e = !0 } = this.options;
|
|
640
|
-
this.play(), this.pendingPlayState
|
|
1183
|
+
this.play(), this.pendingPlayState === "paused" || !e ? this.pause() : this.state = this.pendingPlayState;
|
|
641
1184
|
}
|
|
642
1185
|
tick(e, n = !1) {
|
|
643
1186
|
const { resolved: s } = this;
|
|
644
1187
|
if (!s) {
|
|
645
|
-
const { keyframes:
|
|
646
|
-
return { done: !0, value:
|
|
1188
|
+
const { keyframes: T } = this.options;
|
|
1189
|
+
return { done: !0, value: T[T.length - 1] };
|
|
647
1190
|
}
|
|
648
|
-
const { finalKeyframe: i, generator: r, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration:
|
|
649
|
-
if (this.startTime === null)
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
this.currentTime
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
1191
|
+
const { finalKeyframe: i, generator: r, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: u, totalDuration: c, resolvedDuration: f } = s;
|
|
1192
|
+
if (this.startTime === null)
|
|
1193
|
+
return r.next(0);
|
|
1194
|
+
const { delay: d, repeat: h, repeatType: y, repeatDelay: v, onUpdate: b } = this.options;
|
|
1195
|
+
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - c / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
1196
|
+
const p = this.currentTime - d * (this.speed >= 0 ? 1 : -1), g = this.speed >= 0 ? p < 0 : p > c;
|
|
1197
|
+
this.currentTime = Math.max(p, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
|
|
1198
|
+
let V = this.currentTime, A = r;
|
|
1199
|
+
if (h) {
|
|
1200
|
+
const T = Math.min(this.currentTime, c) / f;
|
|
1201
|
+
let D = Math.floor(T), I = T % 1;
|
|
1202
|
+
!I && T >= 1 && (I = 1), I === 1 && D--, D = Math.min(D, h + 1), !!(D % 2) && (y === "reverse" ? (I = 1 - I, v && (I -= v / f)) : y === "mirror" && (A = o)), V = U(0, 1, I) * f;
|
|
659
1203
|
}
|
|
660
|
-
const
|
|
661
|
-
a && (
|
|
662
|
-
let { done:
|
|
663
|
-
|
|
664
|
-
const
|
|
665
|
-
return
|
|
1204
|
+
const w = g ? { done: !1, value: l[0] } : A.next(V);
|
|
1205
|
+
a && (w.value = a(w.value));
|
|
1206
|
+
let { done: S } = w;
|
|
1207
|
+
!g && u !== null && (S = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
|
|
1208
|
+
const M = this.holdTime === null && (this.state === "finished" || this.state === "running" && S);
|
|
1209
|
+
return M && i !== void 0 && (w.value = Fe(l, this.options, i)), b && b(w.value), M && this.finish(), w;
|
|
666
1210
|
}
|
|
667
1211
|
get duration() {
|
|
668
1212
|
const { resolved: e } = this;
|
|
669
|
-
return e ?
|
|
1213
|
+
return e ? B(e.calculatedDuration) : 0;
|
|
670
1214
|
}
|
|
671
1215
|
get time() {
|
|
672
|
-
return
|
|
1216
|
+
return B(this.currentTime);
|
|
673
1217
|
}
|
|
674
1218
|
set time(e) {
|
|
675
|
-
e =
|
|
1219
|
+
e = L(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
|
|
676
1220
|
}
|
|
677
1221
|
get speed() {
|
|
678
1222
|
return this.playbackSpeed;
|
|
679
1223
|
}
|
|
680
1224
|
set speed(e) {
|
|
681
1225
|
const n = this.playbackSpeed !== e;
|
|
682
|
-
this.playbackSpeed = e, n && (this.time =
|
|
1226
|
+
this.playbackSpeed = e, n && (this.time = B(this.currentTime));
|
|
683
1227
|
}
|
|
684
1228
|
play() {
|
|
685
|
-
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved)
|
|
686
|
-
|
|
687
|
-
|
|
1229
|
+
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
1230
|
+
this.pendingPlayState = "running";
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
if (this.isStopped)
|
|
1234
|
+
return;
|
|
1235
|
+
const { driver: e = sr, onPlay: n, startTime: s } = this.options;
|
|
688
1236
|
this.driver || (this.driver = e((r) => this.tick(r))), n && n();
|
|
689
1237
|
const i = this.driver.now();
|
|
690
1238
|
this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
|
|
691
1239
|
}
|
|
692
1240
|
pause() {
|
|
693
1241
|
var e;
|
|
694
|
-
|
|
1242
|
+
if (!this._resolved) {
|
|
1243
|
+
this.pendingPlayState = "paused";
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
this.state = "paused", this.holdTime = (e = this.currentTime) !== null && e !== void 0 ? e : 0;
|
|
695
1247
|
}
|
|
696
1248
|
complete() {
|
|
697
1249
|
this.state !== "running" && this.play(), this.pendingPlayState = this.state = "finished", this.holdTime = null;
|
|
@@ -714,20 +1266,30 @@ class Je extends jn {
|
|
|
714
1266
|
return this.startTime = 0, this.tick(e, !0);
|
|
715
1267
|
}
|
|
716
1268
|
}
|
|
717
|
-
const
|
|
718
|
-
|
|
1269
|
+
const or = /* @__PURE__ */ new Set([
|
|
1270
|
+
"opacity",
|
|
1271
|
+
"clipPath",
|
|
1272
|
+
"filter",
|
|
1273
|
+
"transform"
|
|
1274
|
+
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
|
|
1275
|
+
// or until we implement support for linear() easing.
|
|
1276
|
+
// "background-color"
|
|
1277
|
+
]);
|
|
1278
|
+
function bt(t) {
|
|
719
1279
|
let e;
|
|
720
1280
|
return () => (e === void 0 && (e = t()), e);
|
|
721
1281
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
|
|
1282
|
+
const ar = {
|
|
1283
|
+
linearEasing: void 0
|
|
1284
|
+
};
|
|
1285
|
+
function lr(t, e) {
|
|
1286
|
+
const n = bt(t);
|
|
725
1287
|
return () => {
|
|
726
1288
|
var s;
|
|
727
|
-
return (s =
|
|
1289
|
+
return (s = ar[e]) !== null && s !== void 0 ? s : n();
|
|
728
1290
|
};
|
|
729
1291
|
}
|
|
730
|
-
const
|
|
1292
|
+
const Te = /* @__PURE__ */ lr(() => {
|
|
731
1293
|
try {
|
|
732
1294
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
733
1295
|
} catch {
|
|
@@ -735,125 +1297,202 @@ const xe = Fi(() => {
|
|
|
735
1297
|
}
|
|
736
1298
|
return !0;
|
|
737
1299
|
}, "linearEasing");
|
|
738
|
-
function
|
|
739
|
-
return !!(typeof t == "function" &&
|
|
1300
|
+
function Yn(t) {
|
|
1301
|
+
return !!(typeof t == "function" && Te() || !t || typeof t == "string" && (t in Ze || Te()) || gt(t) || Array.isArray(t) && t.every(Yn));
|
|
1302
|
+
}
|
|
1303
|
+
const oe = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, Ze = {
|
|
1304
|
+
linear: "linear",
|
|
1305
|
+
ease: "ease",
|
|
1306
|
+
easeIn: "ease-in",
|
|
1307
|
+
easeOut: "ease-out",
|
|
1308
|
+
easeInOut: "ease-in-out",
|
|
1309
|
+
circIn: /* @__PURE__ */ oe([0, 0.65, 0.55, 1]),
|
|
1310
|
+
circOut: /* @__PURE__ */ oe([0.55, 0, 1, 0.45]),
|
|
1311
|
+
backIn: /* @__PURE__ */ oe([0.31, 0.01, 0.66, -0.59]),
|
|
1312
|
+
backOut: /* @__PURE__ */ oe([0.33, 1.53, 0.69, 0.99])
|
|
1313
|
+
};
|
|
1314
|
+
function Xn(t, e) {
|
|
1315
|
+
if (t)
|
|
1316
|
+
return typeof t == "function" && Te() ? $n(t, e) : gt(t) ? oe(t) : Array.isArray(t) ? t.map((n) => Xn(n, e) || Ze.easeOut) : Ze[t];
|
|
1317
|
+
}
|
|
1318
|
+
function ur(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeInOut", times: l } = {}) {
|
|
1319
|
+
const u = { [e]: n };
|
|
1320
|
+
l && (u.offset = l);
|
|
1321
|
+
const c = Xn(a, i);
|
|
1322
|
+
return Array.isArray(c) && (u.easing = c), t.animate(u, {
|
|
1323
|
+
delay: s,
|
|
1324
|
+
duration: i,
|
|
1325
|
+
easing: Array.isArray(c) ? "linear" : c,
|
|
1326
|
+
fill: "both",
|
|
1327
|
+
iterations: r + 1,
|
|
1328
|
+
direction: o === "reverse" ? "alternate" : "normal"
|
|
1329
|
+
});
|
|
740
1330
|
}
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
return t ? typeof t == "function" && xe() ? Kn(t, e) : vt(t) ? oe(t) : Array.isArray(t) ? t.map((n) => es(n, e) || Qe.easeOut) : Qe[t] : void 0;
|
|
1331
|
+
function Yt(t, e) {
|
|
1332
|
+
t.timeline = e, t.onfinish = null;
|
|
744
1333
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
1334
|
+
const cr = /* @__PURE__ */ bt(() => Object.hasOwnProperty.call(Element.prototype, "animate")), Ve = 10, dr = 2e4;
|
|
1335
|
+
function fr(t) {
|
|
1336
|
+
return pt(t.type) || t.type === "spring" || !Yn(t.ease);
|
|
1337
|
+
}
|
|
1338
|
+
function hr(t, e) {
|
|
1339
|
+
const n = new vt({
|
|
1340
|
+
...e,
|
|
1341
|
+
keyframes: t,
|
|
1342
|
+
repeat: 0,
|
|
1343
|
+
delay: 0,
|
|
1344
|
+
isGenerator: !0
|
|
1345
|
+
});
|
|
1346
|
+
let s = { done: !1, value: t[0] };
|
|
1347
|
+
const i = [];
|
|
1348
|
+
let r = 0;
|
|
1349
|
+
for (; !s.done && r < dr; )
|
|
1350
|
+
s = n.sample(r), i.push(s.value), r += Ve;
|
|
1351
|
+
return {
|
|
1352
|
+
times: void 0,
|
|
1353
|
+
keyframes: i,
|
|
1354
|
+
duration: r - Ve,
|
|
1355
|
+
ease: "linear"
|
|
1356
|
+
};
|
|
750
1357
|
}
|
|
751
|
-
|
|
752
|
-
|
|
1358
|
+
const Zn = {
|
|
1359
|
+
anticipate: Vn,
|
|
1360
|
+
backInOut: Tn,
|
|
1361
|
+
circInOut: Sn
|
|
1362
|
+
};
|
|
1363
|
+
function pr(t) {
|
|
1364
|
+
return t in Zn;
|
|
753
1365
|
}
|
|
754
|
-
|
|
755
|
-
class Jt extends jn {
|
|
1366
|
+
class Xt extends _n {
|
|
756
1367
|
constructor(e) {
|
|
757
1368
|
super(e);
|
|
758
1369
|
const { name: n, motionValue: s, element: i, keyframes: r } = this.options;
|
|
759
|
-
this.resolver = new
|
|
1370
|
+
this.resolver = new Kn(r, (o, a) => this.onKeyframesResolved(o, a), n, s, i), this.resolver.scheduleResolve();
|
|
760
1371
|
}
|
|
761
1372
|
initPlayback(e, n) {
|
|
762
1373
|
var s;
|
|
763
|
-
let { duration: i = 300, times: r, ease: o, type: a, motionValue: l, name:
|
|
764
|
-
if (!(!((s = l.owner) === null || s === void 0) && s.current))
|
|
765
|
-
|
|
766
|
-
if (typeof o == "string" &&
|
|
767
|
-
const { onComplete:
|
|
768
|
-
|
|
769
|
-
let w = { done: !1, value: x[0] };
|
|
770
|
-
const T = [];
|
|
771
|
-
let A = 0;
|
|
772
|
-
for (; !w.done && A < 2e4; ) w = y.sample(A), T.push(w.value), A += 10;
|
|
773
|
-
return { times: void 0, keyframes: T, duration: A - 10, ease: "linear" };
|
|
774
|
-
}(e, m);
|
|
775
|
-
(e = S.keyframes).length === 1 && (e[1] = e[0]), i = S.duration, r = S.times, o = S.ease, a = "keyframes";
|
|
1374
|
+
let { duration: i = 300, times: r, ease: o, type: a, motionValue: l, name: u, startTime: c } = this.options;
|
|
1375
|
+
if (!(!((s = l.owner) === null || s === void 0) && s.current))
|
|
1376
|
+
return !1;
|
|
1377
|
+
if (typeof o == "string" && Te() && pr(o) && (o = Zn[o]), fr(this.options)) {
|
|
1378
|
+
const { onComplete: d, onUpdate: h, motionValue: y, element: v, ...b } = this.options, p = hr(e, b);
|
|
1379
|
+
e = p.keyframes, e.length === 1 && (e[1] = e[0]), i = p.duration, r = p.times, o = p.ease, a = "keyframes";
|
|
776
1380
|
}
|
|
777
|
-
const
|
|
778
|
-
return
|
|
779
|
-
const { onComplete:
|
|
780
|
-
l.set(
|
|
781
|
-
}, {
|
|
1381
|
+
const f = ur(l.owner.current, u, e, { ...this.options, duration: i, times: r, ease: o });
|
|
1382
|
+
return f.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (Yt(f, this.pendingTimeline), this.pendingTimeline = void 0) : f.onfinish = () => {
|
|
1383
|
+
const { onComplete: d } = this.options;
|
|
1384
|
+
l.set(Fe(e, this.options, n)), d && d(), this.cancel(), this.resolveFinishedPromise();
|
|
1385
|
+
}, {
|
|
1386
|
+
animation: f,
|
|
1387
|
+
duration: i,
|
|
1388
|
+
times: r,
|
|
1389
|
+
type: a,
|
|
1390
|
+
ease: o,
|
|
1391
|
+
keyframes: e
|
|
1392
|
+
};
|
|
782
1393
|
}
|
|
783
1394
|
get duration() {
|
|
784
1395
|
const { resolved: e } = this;
|
|
785
|
-
if (!e)
|
|
1396
|
+
if (!e)
|
|
1397
|
+
return 0;
|
|
786
1398
|
const { duration: n } = e;
|
|
787
|
-
return
|
|
1399
|
+
return B(n);
|
|
788
1400
|
}
|
|
789
1401
|
get time() {
|
|
790
1402
|
const { resolved: e } = this;
|
|
791
|
-
if (!e)
|
|
1403
|
+
if (!e)
|
|
1404
|
+
return 0;
|
|
792
1405
|
const { animation: n } = e;
|
|
793
|
-
return
|
|
1406
|
+
return B(n.currentTime || 0);
|
|
794
1407
|
}
|
|
795
1408
|
set time(e) {
|
|
796
1409
|
const { resolved: n } = this;
|
|
797
|
-
if (!n)
|
|
1410
|
+
if (!n)
|
|
1411
|
+
return;
|
|
798
1412
|
const { animation: s } = n;
|
|
799
|
-
s.currentTime =
|
|
1413
|
+
s.currentTime = L(e);
|
|
800
1414
|
}
|
|
801
1415
|
get speed() {
|
|
802
1416
|
const { resolved: e } = this;
|
|
803
|
-
if (!e)
|
|
1417
|
+
if (!e)
|
|
1418
|
+
return 1;
|
|
804
1419
|
const { animation: n } = e;
|
|
805
1420
|
return n.playbackRate;
|
|
806
1421
|
}
|
|
807
1422
|
set speed(e) {
|
|
808
1423
|
const { resolved: n } = this;
|
|
809
|
-
if (!n)
|
|
1424
|
+
if (!n)
|
|
1425
|
+
return;
|
|
810
1426
|
const { animation: s } = n;
|
|
811
1427
|
s.playbackRate = e;
|
|
812
1428
|
}
|
|
813
1429
|
get state() {
|
|
814
1430
|
const { resolved: e } = this;
|
|
815
|
-
if (!e)
|
|
1431
|
+
if (!e)
|
|
1432
|
+
return "idle";
|
|
816
1433
|
const { animation: n } = e;
|
|
817
1434
|
return n.playState;
|
|
818
1435
|
}
|
|
819
1436
|
get startTime() {
|
|
820
1437
|
const { resolved: e } = this;
|
|
821
|
-
if (!e)
|
|
1438
|
+
if (!e)
|
|
1439
|
+
return null;
|
|
822
1440
|
const { animation: n } = e;
|
|
823
1441
|
return n.startTime;
|
|
824
1442
|
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Replace the default DocumentTimeline with another AnimationTimeline.
|
|
1445
|
+
* Currently used for scroll animations.
|
|
1446
|
+
*/
|
|
825
1447
|
attachTimeline(e) {
|
|
826
|
-
if (this._resolved)
|
|
1448
|
+
if (!this._resolved)
|
|
1449
|
+
this.pendingTimeline = e;
|
|
1450
|
+
else {
|
|
827
1451
|
const { resolved: n } = this;
|
|
828
|
-
if (!n)
|
|
1452
|
+
if (!n)
|
|
1453
|
+
return _;
|
|
829
1454
|
const { animation: s } = n;
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
return
|
|
1455
|
+
Yt(s, e);
|
|
1456
|
+
}
|
|
1457
|
+
return _;
|
|
833
1458
|
}
|
|
834
1459
|
play() {
|
|
835
|
-
if (this.isStopped)
|
|
1460
|
+
if (this.isStopped)
|
|
1461
|
+
return;
|
|
836
1462
|
const { resolved: e } = this;
|
|
837
|
-
if (!e)
|
|
1463
|
+
if (!e)
|
|
1464
|
+
return;
|
|
838
1465
|
const { animation: n } = e;
|
|
839
1466
|
n.playState === "finished" && this.updateFinishedPromise(), n.play();
|
|
840
1467
|
}
|
|
841
1468
|
pause() {
|
|
842
1469
|
const { resolved: e } = this;
|
|
843
|
-
if (!e)
|
|
1470
|
+
if (!e)
|
|
1471
|
+
return;
|
|
844
1472
|
const { animation: n } = e;
|
|
845
1473
|
n.pause();
|
|
846
1474
|
}
|
|
847
1475
|
stop() {
|
|
848
|
-
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1476
|
+
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1477
|
+
return;
|
|
849
1478
|
this.resolveFinishedPromise(), this.updateFinishedPromise();
|
|
850
1479
|
const { resolved: e } = this;
|
|
851
|
-
if (!e)
|
|
1480
|
+
if (!e)
|
|
1481
|
+
return;
|
|
852
1482
|
const { animation: n, keyframes: s, duration: i, type: r, ease: o, times: a } = e;
|
|
853
|
-
if (n.playState === "idle" || n.playState === "finished")
|
|
1483
|
+
if (n.playState === "idle" || n.playState === "finished")
|
|
1484
|
+
return;
|
|
854
1485
|
if (this.time) {
|
|
855
|
-
const { motionValue:
|
|
856
|
-
|
|
1486
|
+
const { motionValue: u, onUpdate: c, onComplete: f, element: d, ...h } = this.options, y = new vt({
|
|
1487
|
+
...h,
|
|
1488
|
+
keyframes: s,
|
|
1489
|
+
duration: i,
|
|
1490
|
+
type: r,
|
|
1491
|
+
ease: o,
|
|
1492
|
+
times: a,
|
|
1493
|
+
isGenerator: !0
|
|
1494
|
+
}), v = L(this.time);
|
|
1495
|
+
u.setWithVelocity(y.sample(v - Ve).value, y.sample(v).value, Ve);
|
|
857
1496
|
}
|
|
858
1497
|
const { onStop: l } = this.options;
|
|
859
1498
|
l && l(), this.cancel();
|
|
@@ -868,25 +1507,33 @@ class Jt extends jn {
|
|
|
868
1507
|
}
|
|
869
1508
|
static supports(e) {
|
|
870
1509
|
const { motionValue: n, name: s, repeatDelay: i, repeatType: r, damping: o, type: a } = e;
|
|
871
|
-
return
|
|
1510
|
+
return cr() && s && or.has(s) && n && n.owner && n.owner.current instanceof HTMLElement && /**
|
|
1511
|
+
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1512
|
+
* no way to read the value from WAAPI every frame.
|
|
1513
|
+
*/
|
|
1514
|
+
!n.owner.getProps().onUpdate && !i && r !== "mirror" && o !== 0 && a !== "inertia";
|
|
872
1515
|
}
|
|
873
1516
|
}
|
|
874
|
-
const
|
|
875
|
-
class
|
|
1517
|
+
const mr = bt(() => window.ScrollTimeline !== void 0);
|
|
1518
|
+
class gr {
|
|
876
1519
|
constructor(e) {
|
|
877
1520
|
this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);
|
|
878
1521
|
}
|
|
879
1522
|
then(e, n) {
|
|
880
1523
|
return Promise.all(this.animations).then(e).catch(n);
|
|
881
1524
|
}
|
|
1525
|
+
/**
|
|
1526
|
+
* TODO: Filter out cancelled or stopped animations before returning
|
|
1527
|
+
*/
|
|
882
1528
|
getAll(e) {
|
|
883
1529
|
return this.animations[0][e];
|
|
884
1530
|
}
|
|
885
1531
|
setAll(e, n) {
|
|
886
|
-
for (let s = 0; s < this.animations.length; s++)
|
|
1532
|
+
for (let s = 0; s < this.animations.length; s++)
|
|
1533
|
+
this.animations[s][e] = n;
|
|
887
1534
|
}
|
|
888
1535
|
attachTimeline(e, n) {
|
|
889
|
-
const s = this.animations.map((i) =>
|
|
1536
|
+
const s = this.animations.map((i) => mr() && i.attachTimeline ? i.attachTimeline(e) : n(i));
|
|
890
1537
|
return () => {
|
|
891
1538
|
s.forEach((i, r) => {
|
|
892
1539
|
i && i(), this.animations[r].stop();
|
|
@@ -910,7 +1557,8 @@ class Di {
|
|
|
910
1557
|
}
|
|
911
1558
|
get duration() {
|
|
912
1559
|
let e = 0;
|
|
913
|
-
for (let n = 0; n < this.animations.length; n++)
|
|
1560
|
+
for (let n = 0; n < this.animations.length; n++)
|
|
1561
|
+
e = Math.max(e, this.animations[n].duration);
|
|
914
1562
|
return e;
|
|
915
1563
|
}
|
|
916
1564
|
runAll(e) {
|
|
@@ -932,45 +1580,67 @@ class Di {
|
|
|
932
1580
|
this.runAll("complete");
|
|
933
1581
|
}
|
|
934
1582
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1583
|
+
function yr({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
1584
|
+
return !!Object.keys(c).length;
|
|
1585
|
+
}
|
|
1586
|
+
const vr = (t, e, n, s = {}, i, r) => (o) => {
|
|
1587
|
+
const a = mn(s, t) || {}, l = a.delay || s.delay || 0;
|
|
1588
|
+
let { elapsed: u = 0 } = s;
|
|
1589
|
+
u = u - L(l);
|
|
1590
|
+
let c = {
|
|
1591
|
+
keyframes: Array.isArray(n) ? n : [null, n],
|
|
1592
|
+
ease: "easeOut",
|
|
1593
|
+
velocity: e.getVelocity(),
|
|
1594
|
+
...a,
|
|
1595
|
+
delay: -u,
|
|
1596
|
+
onUpdate: (d) => {
|
|
1597
|
+
e.set(d), a.onUpdate && a.onUpdate(d);
|
|
1598
|
+
},
|
|
1599
|
+
onComplete: () => {
|
|
1600
|
+
o(), a.onComplete && a.onComplete();
|
|
1601
|
+
},
|
|
1602
|
+
name: t,
|
|
1603
|
+
motionValue: e,
|
|
1604
|
+
element: r ? void 0 : i
|
|
1605
|
+
};
|
|
1606
|
+
yr(a) || (c = {
|
|
1607
|
+
...c,
|
|
1608
|
+
..._s(t, c)
|
|
1609
|
+
}), c.duration && (c.duration = L(c.duration)), c.repeatDelay && (c.repeatDelay = L(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
|
|
1610
|
+
let f = !1;
|
|
1611
|
+
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (f = !0)), f && !r && e.get() !== void 0) {
|
|
1612
|
+
const d = Fe(c.keyframes, a);
|
|
1613
|
+
if (d !== void 0)
|
|
1614
|
+
return R.update(() => {
|
|
1615
|
+
c.onUpdate(d), c.onComplete();
|
|
1616
|
+
}), new gr([]);
|
|
1617
|
+
}
|
|
1618
|
+
return !r && Xt.supports(c) ? new Xt(c) : new vt(c);
|
|
1619
|
+
}, br = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), wr = (t) => je(t) ? t[t.length - 1] || 0 : t;
|
|
1620
|
+
function Tr(t, e) {
|
|
1621
|
+
t.indexOf(e) === -1 && t.push(e);
|
|
1622
|
+
}
|
|
1623
|
+
function Vr(t, e) {
|
|
1624
|
+
const n = t.indexOf(e);
|
|
1625
|
+
n > -1 && t.splice(n, 1);
|
|
1626
|
+
}
|
|
1627
|
+
class Jn {
|
|
957
1628
|
constructor() {
|
|
958
1629
|
this.subscriptions = [];
|
|
959
1630
|
}
|
|
960
1631
|
add(e) {
|
|
961
|
-
|
|
962
|
-
return n = this.subscriptions, s = e, n.indexOf(s) === -1 && n.push(s), () => function(i, r) {
|
|
963
|
-
const o = i.indexOf(r);
|
|
964
|
-
o > -1 && i.splice(o, 1);
|
|
965
|
-
}(this.subscriptions, e);
|
|
1632
|
+
return Tr(this.subscriptions, e), () => Vr(this.subscriptions, e);
|
|
966
1633
|
}
|
|
967
1634
|
notify(e, n, s) {
|
|
968
1635
|
const i = this.subscriptions.length;
|
|
969
|
-
if (i)
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
1636
|
+
if (i)
|
|
1637
|
+
if (i === 1)
|
|
1638
|
+
this.subscriptions[0](e, n, s);
|
|
1639
|
+
else
|
|
1640
|
+
for (let r = 0; r < i; r++) {
|
|
1641
|
+
const o = this.subscriptions[r];
|
|
1642
|
+
o && o(e, n, s);
|
|
1643
|
+
}
|
|
974
1644
|
}
|
|
975
1645
|
getSize() {
|
|
976
1646
|
return this.subscriptions.length;
|
|
@@ -979,59 +1649,162 @@ class ts {
|
|
|
979
1649
|
this.subscriptions.length = 0;
|
|
980
1650
|
}
|
|
981
1651
|
}
|
|
982
|
-
|
|
1652
|
+
const Zt = 30, Sr = (t) => !isNaN(parseFloat(t));
|
|
1653
|
+
class xr {
|
|
1654
|
+
/**
|
|
1655
|
+
* @param init - The initiating value
|
|
1656
|
+
* @param config - Optional configuration options
|
|
1657
|
+
*
|
|
1658
|
+
* - `transformer`: A function to transform incoming values with.
|
|
1659
|
+
*
|
|
1660
|
+
* @internal
|
|
1661
|
+
*/
|
|
983
1662
|
constructor(e, n = {}) {
|
|
984
1663
|
this.version = "11.15.0", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
|
|
985
|
-
const r =
|
|
1664
|
+
const r = K.now();
|
|
986
1665
|
this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
987
1666
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
988
1667
|
}
|
|
989
1668
|
setCurrent(e) {
|
|
990
|
-
|
|
991
|
-
this.current = e, this.updatedAt = L.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = (n = this.current, !isNaN(parseFloat(n))));
|
|
1669
|
+
this.current = e, this.updatedAt = K.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Sr(this.current));
|
|
992
1670
|
}
|
|
993
1671
|
setPrevFrameValue(e = this.current) {
|
|
994
1672
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
995
1673
|
}
|
|
1674
|
+
/**
|
|
1675
|
+
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
1676
|
+
*
|
|
1677
|
+
* It returns a function that, when called, will cancel the subscription.
|
|
1678
|
+
*
|
|
1679
|
+
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
1680
|
+
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
1681
|
+
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
1682
|
+
*
|
|
1683
|
+
* ```jsx
|
|
1684
|
+
* export const MyComponent = () => {
|
|
1685
|
+
* const x = useMotionValue(0)
|
|
1686
|
+
* const y = useMotionValue(0)
|
|
1687
|
+
* const opacity = useMotionValue(1)
|
|
1688
|
+
*
|
|
1689
|
+
* useEffect(() => {
|
|
1690
|
+
* function updateOpacity() {
|
|
1691
|
+
* const maxXY = Math.max(x.get(), y.get())
|
|
1692
|
+
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
1693
|
+
* opacity.set(newOpacity)
|
|
1694
|
+
* }
|
|
1695
|
+
*
|
|
1696
|
+
* const unsubscribeX = x.on("change", updateOpacity)
|
|
1697
|
+
* const unsubscribeY = y.on("change", updateOpacity)
|
|
1698
|
+
*
|
|
1699
|
+
* return () => {
|
|
1700
|
+
* unsubscribeX()
|
|
1701
|
+
* unsubscribeY()
|
|
1702
|
+
* }
|
|
1703
|
+
* }, [])
|
|
1704
|
+
*
|
|
1705
|
+
* return <motion.div style={{ x }} />
|
|
1706
|
+
* }
|
|
1707
|
+
* ```
|
|
1708
|
+
*
|
|
1709
|
+
* @param subscriber - A function that receives the latest value.
|
|
1710
|
+
* @returns A function that, when called, will cancel this subscription.
|
|
1711
|
+
*
|
|
1712
|
+
* @deprecated
|
|
1713
|
+
*/
|
|
996
1714
|
onChange(e) {
|
|
997
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1715
|
+
return process.env.NODE_ENV !== "production" && Me(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
998
1716
|
}
|
|
999
1717
|
on(e, n) {
|
|
1000
|
-
this.events[e] || (this.events[e] = new
|
|
1718
|
+
this.events[e] || (this.events[e] = new Jn());
|
|
1001
1719
|
const s = this.events[e].add(n);
|
|
1002
1720
|
return e === "change" ? () => {
|
|
1003
|
-
s(),
|
|
1721
|
+
s(), R.read(() => {
|
|
1004
1722
|
this.events.change.getSize() || this.stop();
|
|
1005
1723
|
});
|
|
1006
1724
|
} : s;
|
|
1007
1725
|
}
|
|
1008
1726
|
clearListeners() {
|
|
1009
|
-
for (const e in this.events)
|
|
1010
|
-
|
|
1727
|
+
for (const e in this.events)
|
|
1728
|
+
this.events[e].clear();
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Attaches a passive effect to the `MotionValue`.
|
|
1732
|
+
*
|
|
1733
|
+
* @internal
|
|
1734
|
+
*/
|
|
1011
1735
|
attach(e, n) {
|
|
1012
1736
|
this.passiveEffect = e, this.stopPassiveEffect = n;
|
|
1013
1737
|
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Sets the state of the `MotionValue`.
|
|
1740
|
+
*
|
|
1741
|
+
* @remarks
|
|
1742
|
+
*
|
|
1743
|
+
* ```jsx
|
|
1744
|
+
* const x = useMotionValue(0)
|
|
1745
|
+
* x.set(10)
|
|
1746
|
+
* ```
|
|
1747
|
+
*
|
|
1748
|
+
* @param latest - Latest value to set.
|
|
1749
|
+
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
1750
|
+
*
|
|
1751
|
+
* @public
|
|
1752
|
+
*/
|
|
1014
1753
|
set(e, n = !0) {
|
|
1015
|
-
n
|
|
1754
|
+
!n || !this.passiveEffect ? this.updateAndNotify(e, n) : this.passiveEffect(e, this.updateAndNotify);
|
|
1016
1755
|
}
|
|
1017
1756
|
setWithVelocity(e, n, s) {
|
|
1018
1757
|
this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
|
|
1019
1758
|
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Set the state of the `MotionValue`, stopping any active animations,
|
|
1761
|
+
* effects, and resets velocity to `0`.
|
|
1762
|
+
*/
|
|
1020
1763
|
jump(e, n = !0) {
|
|
1021
1764
|
this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1022
1765
|
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Returns the latest state of `MotionValue`
|
|
1768
|
+
*
|
|
1769
|
+
* @returns - The latest state of `MotionValue`
|
|
1770
|
+
*
|
|
1771
|
+
* @public
|
|
1772
|
+
*/
|
|
1023
1773
|
get() {
|
|
1024
1774
|
return this.current;
|
|
1025
1775
|
}
|
|
1776
|
+
/**
|
|
1777
|
+
* @public
|
|
1778
|
+
*/
|
|
1026
1779
|
getPrevious() {
|
|
1027
1780
|
return this.prev;
|
|
1028
1781
|
}
|
|
1782
|
+
/**
|
|
1783
|
+
* Returns the latest velocity of `MotionValue`
|
|
1784
|
+
*
|
|
1785
|
+
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
1786
|
+
*
|
|
1787
|
+
* @public
|
|
1788
|
+
*/
|
|
1029
1789
|
getVelocity() {
|
|
1030
|
-
const e =
|
|
1031
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1790
|
+
const e = K.now();
|
|
1791
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Zt)
|
|
1792
|
+
return 0;
|
|
1793
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Zt);
|
|
1794
|
+
return jn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Registers a new animation to control this `MotionValue`. Only one
|
|
1798
|
+
* animation can drive a `MotionValue` at one time.
|
|
1799
|
+
*
|
|
1800
|
+
* ```jsx
|
|
1801
|
+
* value.start()
|
|
1802
|
+
* ```
|
|
1803
|
+
*
|
|
1804
|
+
* @param animation - A function that starts the provided animation
|
|
1805
|
+
*
|
|
1806
|
+
* @internal
|
|
1807
|
+
*/
|
|
1035
1808
|
start(e) {
|
|
1036
1809
|
return this.stop(), new Promise((n) => {
|
|
1037
1810
|
this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
|
|
@@ -1039,712 +1812,1206 @@ class Ni {
|
|
|
1039
1812
|
this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
|
|
1040
1813
|
});
|
|
1041
1814
|
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Stop the currently active animation.
|
|
1817
|
+
*
|
|
1818
|
+
* @public
|
|
1819
|
+
*/
|
|
1042
1820
|
stop() {
|
|
1043
1821
|
this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
|
|
1044
1822
|
}
|
|
1823
|
+
/**
|
|
1824
|
+
* Returns `true` if this value is currently animating.
|
|
1825
|
+
*
|
|
1826
|
+
* @public
|
|
1827
|
+
*/
|
|
1045
1828
|
isAnimating() {
|
|
1046
1829
|
return !!this.animation;
|
|
1047
1830
|
}
|
|
1048
1831
|
clearAnimation() {
|
|
1049
1832
|
delete this.animation;
|
|
1050
1833
|
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Destroy and clean up subscribers to this `MotionValue`.
|
|
1836
|
+
*
|
|
1837
|
+
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
1838
|
+
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
1839
|
+
* created a `MotionValue` via the `motionValue` function.
|
|
1840
|
+
*
|
|
1841
|
+
* @public
|
|
1842
|
+
*/
|
|
1051
1843
|
destroy() {
|
|
1052
1844
|
this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1053
1845
|
}
|
|
1054
1846
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return new
|
|
1847
|
+
function Se(t, e) {
|
|
1848
|
+
return new xr(t, e);
|
|
1849
|
+
}
|
|
1850
|
+
function Ar(t, e, n) {
|
|
1851
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, Se(n));
|
|
1852
|
+
}
|
|
1853
|
+
function Mr(t, e) {
|
|
1854
|
+
const n = Pe(t, e);
|
|
1855
|
+
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
1856
|
+
r = { ...r, ...s };
|
|
1857
|
+
for (const o in r) {
|
|
1858
|
+
const a = wr(r[o]);
|
|
1859
|
+
Ar(t, o, a);
|
|
1860
|
+
}
|
|
1057
1861
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1862
|
+
const wt = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Cr = "framerAppearId", Qn = "data-" + wt(Cr);
|
|
1863
|
+
function Pr(t) {
|
|
1864
|
+
return t.props[Qn];
|
|
1060
1865
|
}
|
|
1061
|
-
const
|
|
1062
|
-
function
|
|
1063
|
-
return t.
|
|
1866
|
+
const F = (t) => !!(t && t.getVelocity);
|
|
1867
|
+
function Fr(t) {
|
|
1868
|
+
return !!(F(t) && t.add);
|
|
1064
1869
|
}
|
|
1065
|
-
|
|
1066
|
-
function ji(t, e) {
|
|
1870
|
+
function Dr(t, e) {
|
|
1067
1871
|
const n = t.getValue("willChange");
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1872
|
+
if (Fr(n))
|
|
1873
|
+
return n.add(e);
|
|
1070
1874
|
}
|
|
1071
|
-
function
|
|
1875
|
+
function Rr({ protectedKeys: t, needsAnimating: e }, n) {
|
|
1072
1876
|
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
1073
1877
|
return e[n] = !1, s;
|
|
1074
1878
|
}
|
|
1075
|
-
function
|
|
1879
|
+
function es(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
1076
1880
|
var r;
|
|
1077
1881
|
let { transition: o = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
1078
1882
|
s && (o = s);
|
|
1079
|
-
const
|
|
1080
|
-
for (const
|
|
1081
|
-
const d = t.getValue(
|
|
1082
|
-
if (
|
|
1083
|
-
|
|
1084
|
-
|
|
1883
|
+
const u = [], c = i && t.animationState && t.animationState.getState()[i];
|
|
1884
|
+
for (const f in l) {
|
|
1885
|
+
const d = t.getValue(f, (r = t.latestValues[f]) !== null && r !== void 0 ? r : null), h = l[f];
|
|
1886
|
+
if (h === void 0 || c && Rr(c, f))
|
|
1887
|
+
continue;
|
|
1888
|
+
const y = {
|
|
1889
|
+
delay: n,
|
|
1890
|
+
...mn(o || {}, f)
|
|
1891
|
+
};
|
|
1892
|
+
let v = !1;
|
|
1085
1893
|
if (window.MotionHandoffAnimation) {
|
|
1086
|
-
const
|
|
1087
|
-
if (
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1894
|
+
const p = Pr(t);
|
|
1895
|
+
if (p) {
|
|
1896
|
+
const g = window.MotionHandoffAnimation(p, f, R);
|
|
1897
|
+
g !== null && (y.startTime = g, v = !0);
|
|
1090
1898
|
}
|
|
1091
1899
|
}
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
}
|
|
1096
|
-
return a && Promise.all(
|
|
1097
|
-
|
|
1098
|
-
a &&
|
|
1099
|
-
const f = Me(h, d);
|
|
1100
|
-
let { transitionEnd: v = {}, transition: p = {}, ...g } = f || {};
|
|
1101
|
-
g = { ...g, ...v };
|
|
1102
|
-
for (const S in g) Li(h, S, (m = g[S], Ue(m) ? m[m.length - 1] || 0 : m));
|
|
1103
|
-
var m;
|
|
1104
|
-
}(t, a);
|
|
1900
|
+
Dr(t, f), d.start(vr(f, d, h, t.shouldReduceMotion && z.has(f) ? { type: !1 } : y, t, v));
|
|
1901
|
+
const b = d.animation;
|
|
1902
|
+
b && u.push(b);
|
|
1903
|
+
}
|
|
1904
|
+
return a && Promise.all(u).then(() => {
|
|
1905
|
+
R.update(() => {
|
|
1906
|
+
a && Mr(t, a);
|
|
1105
1907
|
});
|
|
1106
|
-
}),
|
|
1908
|
+
}), u;
|
|
1107
1909
|
}
|
|
1108
|
-
function
|
|
1910
|
+
function Je(t, e, n = {}) {
|
|
1109
1911
|
var s;
|
|
1110
|
-
const i =
|
|
1912
|
+
const i = Pe(t, e, n.type === "exit" ? (s = t.presenceContext) === null || s === void 0 ? void 0 : s.custom : void 0);
|
|
1111
1913
|
let { transition: r = t.getDefaultTransition() || {} } = i || {};
|
|
1112
1914
|
n.transitionOverride && (r = n.transitionOverride);
|
|
1113
|
-
const o = i ? () => Promise.all(
|
|
1114
|
-
const { delayChildren:
|
|
1115
|
-
return
|
|
1116
|
-
const x = [], C = (f.variantChildren.size - 1) * g, y = m === 1 ? (w = 0) => w * g : (w = 0) => C - w * g;
|
|
1117
|
-
return Array.from(f.variantChildren).sort(Wi).forEach((w, T) => {
|
|
1118
|
-
w.notify("AnimationStart", v), x.push(et(w, v, { ...S, delay: p + y(T) }).then(() => w.notify("AnimationComplete", v)));
|
|
1119
|
-
}), Promise.all(x);
|
|
1120
|
-
}(t, e, u + c, h, d, n);
|
|
1915
|
+
const o = i ? () => Promise.all(es(t, i, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (u = 0) => {
|
|
1916
|
+
const { delayChildren: c = 0, staggerChildren: f, staggerDirection: d } = r;
|
|
1917
|
+
return Ir(t, e, c + u, f, d, n);
|
|
1121
1918
|
} : () => Promise.resolve(), { when: l } = r;
|
|
1122
1919
|
if (l) {
|
|
1123
|
-
const [
|
|
1124
|
-
return
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1128
|
-
function
|
|
1920
|
+
const [u, c] = l === "beforeChildren" ? [o, a] : [a, o];
|
|
1921
|
+
return u().then(() => c());
|
|
1922
|
+
} else
|
|
1923
|
+
return Promise.all([o(), a(n.delay)]);
|
|
1924
|
+
}
|
|
1925
|
+
function Ir(t, e, n = 0, s = 0, i = 1, r) {
|
|
1926
|
+
const o = [], a = (t.variantChildren.size - 1) * s, l = i === 1 ? (u = 0) => u * s : (u = 0) => a - u * s;
|
|
1927
|
+
return Array.from(t.variantChildren).sort(Or).forEach((u, c) => {
|
|
1928
|
+
u.notify("AnimationStart", e), o.push(Je(u, e, {
|
|
1929
|
+
...r,
|
|
1930
|
+
delay: n + l(c)
|
|
1931
|
+
}).then(() => u.notify("AnimationComplete", e)));
|
|
1932
|
+
}), Promise.all(o);
|
|
1933
|
+
}
|
|
1934
|
+
function Or(t, e) {
|
|
1129
1935
|
return t.sortNodePosition(e);
|
|
1130
1936
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1937
|
+
function Er(t, e, n = {}) {
|
|
1938
|
+
t.notify("AnimationStart", e);
|
|
1939
|
+
let s;
|
|
1940
|
+
if (Array.isArray(e)) {
|
|
1941
|
+
const i = e.map((r) => Je(t, r, n));
|
|
1942
|
+
s = Promise.all(i);
|
|
1943
|
+
} else if (typeof e == "string")
|
|
1944
|
+
s = Je(t, e, n);
|
|
1945
|
+
else {
|
|
1946
|
+
const i = typeof e == "function" ? Pe(t, e, n.custom) : e;
|
|
1947
|
+
s = Promise.all(es(t, i, n));
|
|
1948
|
+
}
|
|
1949
|
+
return s.then(() => {
|
|
1950
|
+
t.notify("AnimationComplete", e);
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
const kr = rt.length;
|
|
1954
|
+
function ts(t) {
|
|
1955
|
+
if (!t)
|
|
1956
|
+
return;
|
|
1134
1957
|
if (!t.isControllingVariants) {
|
|
1135
|
-
const n = t.parent
|
|
1958
|
+
const n = t.parent ? ts(t.parent) || {} : {};
|
|
1136
1959
|
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
1137
1960
|
}
|
|
1138
1961
|
const e = {};
|
|
1139
|
-
for (let n = 0; n <
|
|
1140
|
-
const s =
|
|
1141
|
-
(
|
|
1962
|
+
for (let n = 0; n < kr; n++) {
|
|
1963
|
+
const s = rt[n], i = t.props[s];
|
|
1964
|
+
(ue(i) || i === !1) && (e[s] = i);
|
|
1142
1965
|
}
|
|
1143
1966
|
return e;
|
|
1144
1967
|
}
|
|
1145
|
-
const
|
|
1146
|
-
function
|
|
1147
|
-
return (e) => Promise.all(e.map(({ animation: n, options: s }) =>
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1968
|
+
const Lr = [...it].reverse(), Nr = it.length;
|
|
1969
|
+
function Br(t) {
|
|
1970
|
+
return (e) => Promise.all(e.map(({ animation: n, options: s }) => Er(t, n, s)));
|
|
1971
|
+
}
|
|
1972
|
+
function Kr(t) {
|
|
1973
|
+
let e = Br(t), n = Jt(), s = !0;
|
|
1974
|
+
const i = (l) => (u, c) => {
|
|
1975
|
+
var f;
|
|
1976
|
+
const d = Pe(t, c, l === "exit" ? (f = t.presenceContext) === null || f === void 0 ? void 0 : f.custom : void 0);
|
|
1977
|
+
if (d) {
|
|
1978
|
+
const { transition: h, transitionEnd: y, ...v } = d;
|
|
1979
|
+
u = { ...u, ...v, ...y };
|
|
1156
1980
|
}
|
|
1157
|
-
return
|
|
1158
|
-
i.notify("AnimationComplete", r);
|
|
1159
|
-
});
|
|
1160
|
-
}(t, n, s)));
|
|
1161
|
-
}
|
|
1162
|
-
function Hi(t) {
|
|
1163
|
-
let e = zi(t), n = Qt(), s = !0;
|
|
1164
|
-
const i = (o) => (a, l) => {
|
|
1165
|
-
var c;
|
|
1166
|
-
const u = Me(t, l, o === "exit" ? (c = t.presenceContext) === null || c === void 0 ? void 0 : c.custom : void 0);
|
|
1167
|
-
if (u) {
|
|
1168
|
-
const { transition: h, transitionEnd: d, ...f } = u;
|
|
1169
|
-
a = { ...a, ...f, ...d };
|
|
1170
|
-
}
|
|
1171
|
-
return a;
|
|
1981
|
+
return u;
|
|
1172
1982
|
};
|
|
1173
|
-
function r(
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
let
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1983
|
+
function r(l) {
|
|
1984
|
+
e = l(t);
|
|
1985
|
+
}
|
|
1986
|
+
function o(l) {
|
|
1987
|
+
const { props: u } = t, c = ts(t.parent) || {}, f = [], d = /* @__PURE__ */ new Set();
|
|
1988
|
+
let h = {}, y = 1 / 0;
|
|
1989
|
+
for (let b = 0; b < Nr; b++) {
|
|
1990
|
+
const p = Lr[b], g = n[p], V = u[p] !== void 0 ? u[p] : c[p], A = ue(V), w = p === l ? g.isActive : null;
|
|
1991
|
+
w === !1 && (y = b);
|
|
1992
|
+
let S = V === c[p] && V !== u[p] && A;
|
|
1993
|
+
if (S && s && t.manuallyAnimateOnMount && (S = !1), g.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
|
|
1994
|
+
!g.isActive && w === null || // If we didn't and don't have any defined prop for this animation type
|
|
1995
|
+
!V && !g.prevProp || // Or if the prop doesn't define an animation
|
|
1996
|
+
Ce(V) || typeof V == "boolean")
|
|
1997
|
+
continue;
|
|
1998
|
+
const M = _r(g.prevProp, V);
|
|
1999
|
+
let T = M || // If we're making this variant active, we want to always make it active
|
|
2000
|
+
p === l && g.isActive && !S && A || // If we removed a higher-priority variant (i is in reverse order)
|
|
2001
|
+
b > y && A, D = !1;
|
|
2002
|
+
const I = Array.isArray(V) ? V : [V];
|
|
2003
|
+
let H = I.reduce(i(p), {});
|
|
2004
|
+
w === !1 && (H = {});
|
|
2005
|
+
const { prevResolvedValues: Ft = {} } = g, Ss = {
|
|
2006
|
+
...Ft,
|
|
2007
|
+
...H
|
|
2008
|
+
}, Dt = (P) => {
|
|
2009
|
+
T = !0, d.has(P) && (D = !0, d.delete(P)), g.needsAnimating[P] = !0;
|
|
2010
|
+
const k = t.getValue(P);
|
|
2011
|
+
k && (k.liveStyle = !1);
|
|
1190
2012
|
};
|
|
1191
|
-
for (const
|
|
1192
|
-
const
|
|
1193
|
-
if (h.hasOwnProperty(
|
|
1194
|
-
|
|
1195
|
-
|
|
2013
|
+
for (const P in Ss) {
|
|
2014
|
+
const k = H[P], Ee = Ft[P];
|
|
2015
|
+
if (h.hasOwnProperty(P))
|
|
2016
|
+
continue;
|
|
2017
|
+
let ke = !1;
|
|
2018
|
+
je(k) && je(Ee) ? ke = !pn(k, Ee) : ke = k !== Ee, ke ? k != null ? Dt(P) : d.add(P) : k !== void 0 && d.has(P) ? Dt(P) : g.protectedKeys[P] = !0;
|
|
1196
2019
|
}
|
|
1197
|
-
g.prevProp =
|
|
2020
|
+
g.prevProp = V, g.prevResolvedValues = H, g.isActive && (h = { ...h, ...H }), s && t.blockInitialAnimation && (T = !1), T && (!(S && M) || D) && f.push(...I.map((P) => ({
|
|
2021
|
+
animation: P,
|
|
2022
|
+
options: { type: p }
|
|
2023
|
+
})));
|
|
1198
2024
|
}
|
|
1199
|
-
if (
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1202
|
-
const g = t.getBaseTarget(p),
|
|
1203
|
-
|
|
1204
|
-
}),
|
|
2025
|
+
if (d.size) {
|
|
2026
|
+
const b = {};
|
|
2027
|
+
d.forEach((p) => {
|
|
2028
|
+
const g = t.getBaseTarget(p), V = t.getValue(p);
|
|
2029
|
+
V && (V.liveStyle = !0), b[p] = g ?? null;
|
|
2030
|
+
}), f.push({ animation: b });
|
|
1205
2031
|
}
|
|
1206
|
-
let
|
|
1207
|
-
return
|
|
2032
|
+
let v = !!f.length;
|
|
2033
|
+
return s && (u.initial === !1 || u.initial === u.animate) && !t.manuallyAnimateOnMount && (v = !1), s = !1, v ? e(f) : Promise.resolve();
|
|
1208
2034
|
}
|
|
1209
|
-
|
|
1210
|
-
var
|
|
1211
|
-
if (n[
|
|
1212
|
-
|
|
2035
|
+
function a(l, u) {
|
|
2036
|
+
var c;
|
|
2037
|
+
if (n[l].isActive === u)
|
|
2038
|
+
return Promise.resolve();
|
|
2039
|
+
(c = t.variantChildren) === null || c === void 0 || c.forEach((d) => {
|
|
1213
2040
|
var h;
|
|
1214
|
-
return (h =
|
|
1215
|
-
}), n[
|
|
1216
|
-
const
|
|
1217
|
-
for (const
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1231
|
-
function
|
|
1232
|
-
return
|
|
1233
|
-
}
|
|
1234
|
-
|
|
2041
|
+
return (h = d.animationState) === null || h === void 0 ? void 0 : h.setActive(l, u);
|
|
2042
|
+
}), n[l].isActive = u;
|
|
2043
|
+
const f = o(l);
|
|
2044
|
+
for (const d in n)
|
|
2045
|
+
n[d].protectedKeys = {};
|
|
2046
|
+
return f;
|
|
2047
|
+
}
|
|
2048
|
+
return {
|
|
2049
|
+
animateChanges: o,
|
|
2050
|
+
setActive: a,
|
|
2051
|
+
setAnimateFunction: r,
|
|
2052
|
+
getState: () => n,
|
|
2053
|
+
reset: () => {
|
|
2054
|
+
n = Jt(), s = !0;
|
|
2055
|
+
}
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
function _r(t, e) {
|
|
2059
|
+
return typeof e == "string" ? e !== t : Array.isArray(e) ? !pn(e, t) : !1;
|
|
2060
|
+
}
|
|
2061
|
+
function $(t = !1) {
|
|
2062
|
+
return {
|
|
2063
|
+
isActive: t,
|
|
2064
|
+
protectedKeys: {},
|
|
2065
|
+
needsAnimating: {},
|
|
2066
|
+
prevResolvedValues: {}
|
|
2067
|
+
};
|
|
2068
|
+
}
|
|
2069
|
+
function Jt() {
|
|
2070
|
+
return {
|
|
2071
|
+
animate: $(!0),
|
|
2072
|
+
whileInView: $(),
|
|
2073
|
+
whileHover: $(),
|
|
2074
|
+
whileTap: $(),
|
|
2075
|
+
whileDrag: $(),
|
|
2076
|
+
whileFocus: $(),
|
|
2077
|
+
exit: $()
|
|
2078
|
+
};
|
|
2079
|
+
}
|
|
2080
|
+
class re {
|
|
1235
2081
|
constructor(e) {
|
|
1236
2082
|
this.isMounted = !1, this.node = e;
|
|
1237
2083
|
}
|
|
1238
2084
|
update() {
|
|
1239
2085
|
}
|
|
1240
2086
|
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
2087
|
+
class $r extends re {
|
|
2088
|
+
/**
|
|
2089
|
+
* We dynamically generate the AnimationState manager as it contains a reference
|
|
2090
|
+
* to the underlying animation library. We only want to load that if we load this,
|
|
2091
|
+
* so people can optionally code split it out using the `m` component.
|
|
2092
|
+
*/
|
|
2093
|
+
constructor(e) {
|
|
2094
|
+
super(e), e.animationState || (e.animationState = Kr(e));
|
|
1245
2095
|
}
|
|
1246
2096
|
updateAnimationControlsSubscription() {
|
|
1247
|
-
const { animate:
|
|
1248
|
-
Ce(
|
|
2097
|
+
const { animate: e } = this.node.getProps();
|
|
2098
|
+
Ce(e) && (this.unmountControls = e.subscribe(this.node));
|
|
1249
2099
|
}
|
|
2100
|
+
/**
|
|
2101
|
+
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
2102
|
+
*/
|
|
1250
2103
|
mount() {
|
|
1251
2104
|
this.updateAnimationControlsSubscription();
|
|
1252
2105
|
}
|
|
1253
2106
|
update() {
|
|
1254
|
-
const { animate:
|
|
1255
|
-
|
|
2107
|
+
const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
|
|
2108
|
+
e !== n && this.updateAnimationControlsSubscription();
|
|
1256
2109
|
}
|
|
1257
2110
|
unmount() {
|
|
1258
|
-
var
|
|
1259
|
-
this.node.animationState.reset(), (
|
|
2111
|
+
var e;
|
|
2112
|
+
this.node.animationState.reset(), (e = this.unmountControls) === null || e === void 0 || e.call(this);
|
|
1260
2113
|
}
|
|
1261
|
-
}
|
|
2114
|
+
}
|
|
2115
|
+
let jr = 0;
|
|
2116
|
+
class Wr extends re {
|
|
1262
2117
|
constructor() {
|
|
1263
|
-
super(...arguments), this.id =
|
|
2118
|
+
super(...arguments), this.id = jr++;
|
|
1264
2119
|
}
|
|
1265
2120
|
update() {
|
|
1266
|
-
if (!this.node.presenceContext)
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
2121
|
+
if (!this.node.presenceContext)
|
|
2122
|
+
return;
|
|
2123
|
+
const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
|
|
2124
|
+
if (!this.node.animationState || e === s)
|
|
2125
|
+
return;
|
|
2126
|
+
const i = this.node.animationState.setActive("exit", !e);
|
|
2127
|
+
n && !e && i.then(() => n(this.id));
|
|
1271
2128
|
}
|
|
1272
2129
|
mount() {
|
|
1273
|
-
const { register:
|
|
1274
|
-
|
|
2130
|
+
const { register: e } = this.node.presenceContext || {};
|
|
2131
|
+
e && (this.unmount = e(this.id));
|
|
1275
2132
|
}
|
|
1276
2133
|
unmount() {
|
|
1277
2134
|
}
|
|
1278
|
-
} } }, Zi = !1;
|
|
1279
|
-
function rs(t) {
|
|
1280
|
-
return { point: { x: t.pageX, y: t.pageY } };
|
|
1281
2135
|
}
|
|
1282
|
-
|
|
2136
|
+
const Gr = {
|
|
2137
|
+
animation: {
|
|
2138
|
+
Feature: $r
|
|
2139
|
+
},
|
|
2140
|
+
exit: {
|
|
2141
|
+
Feature: Wr
|
|
2142
|
+
}
|
|
2143
|
+
}, Ur = {
|
|
2144
|
+
x: !1,
|
|
2145
|
+
y: !1
|
|
2146
|
+
};
|
|
2147
|
+
function zr() {
|
|
2148
|
+
return Ur.y;
|
|
2149
|
+
}
|
|
2150
|
+
const Hr = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1;
|
|
2151
|
+
function ns(t) {
|
|
2152
|
+
return {
|
|
2153
|
+
point: {
|
|
2154
|
+
x: t.pageX,
|
|
2155
|
+
y: t.pageY
|
|
2156
|
+
}
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
function Qt(t, e, n, s = { passive: !0 }) {
|
|
1283
2160
|
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
1284
2161
|
}
|
|
1285
|
-
function
|
|
2162
|
+
function ss(t) {
|
|
1286
2163
|
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
1287
2164
|
}
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
2165
|
+
const en = () => ({ min: 0, max: 0 }), is = () => ({
|
|
2166
|
+
x: en(),
|
|
2167
|
+
y: en()
|
|
2168
|
+
});
|
|
2169
|
+
function qr({ top: t, left: e, right: n, bottom: s }) {
|
|
2170
|
+
return {
|
|
2171
|
+
x: { min: e, max: n },
|
|
2172
|
+
y: { min: t, max: s }
|
|
2173
|
+
};
|
|
1293
2174
|
}
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
2175
|
+
function Yr(t, e) {
|
|
2176
|
+
if (!e)
|
|
2177
|
+
return t;
|
|
2178
|
+
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
2179
|
+
return {
|
|
2180
|
+
top: n.y,
|
|
2181
|
+
left: n.x,
|
|
2182
|
+
bottom: s.y,
|
|
2183
|
+
right: s.x
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
function Xr(t, e) {
|
|
2187
|
+
return qr(Yr(t.getBoundingClientRect(), e));
|
|
2188
|
+
}
|
|
2189
|
+
const rs = te(null), Zr = te({}), Jr = te({}), Qr = {}, { schedule: eo, cancel: Pa } = gn(queueMicrotask, !1);
|
|
2190
|
+
function to(t) {
|
|
2191
|
+
const e = F(t) ? t.get() : t;
|
|
2192
|
+
return br(e) ? e.toValue() : e;
|
|
2193
|
+
}
|
|
2194
|
+
function no(t, e, n) {
|
|
2195
|
+
var s;
|
|
2196
|
+
if (t instanceof Element)
|
|
2197
|
+
return [t];
|
|
2198
|
+
if (typeof t == "string") {
|
|
2199
|
+
let i = document;
|
|
2200
|
+
const r = (s = void 0) !== null && s !== void 0 ? s : i.querySelectorAll(t);
|
|
2201
|
+
return r ? Array.from(r) : [];
|
|
2202
|
+
}
|
|
2203
|
+
return Array.from(t);
|
|
2204
|
+
}
|
|
2205
|
+
function os(t, e) {
|
|
2206
|
+
const n = no(t), s = new AbortController(), i = {
|
|
2207
|
+
passive: !0,
|
|
2208
|
+
...e,
|
|
2209
|
+
signal: s.signal
|
|
2210
|
+
};
|
|
2211
|
+
return [n, i, () => s.abort()];
|
|
1304
2212
|
}
|
|
1305
2213
|
function tn(t) {
|
|
1306
2214
|
return (e) => {
|
|
1307
|
-
e.pointerType === "touch" ||
|
|
2215
|
+
e.pointerType === "touch" || zr() || t(e);
|
|
1308
2216
|
};
|
|
1309
2217
|
}
|
|
2218
|
+
function so(t, e, n = {}) {
|
|
2219
|
+
const [s, i, r] = os(t, n), o = tn((a) => {
|
|
2220
|
+
const { target: l } = a, u = e(a);
|
|
2221
|
+
if (!u || !l)
|
|
2222
|
+
return;
|
|
2223
|
+
const c = tn((f) => {
|
|
2224
|
+
u(f), l.removeEventListener("pointerleave", c);
|
|
2225
|
+
});
|
|
2226
|
+
l.addEventListener("pointerleave", c, i);
|
|
2227
|
+
});
|
|
2228
|
+
return s.forEach((a) => {
|
|
2229
|
+
a.addEventListener("pointerenter", o, i);
|
|
2230
|
+
}), r;
|
|
2231
|
+
}
|
|
1310
2232
|
function nn(t, e, n) {
|
|
1311
2233
|
const { props: s } = t;
|
|
1312
2234
|
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
1313
|
-
const i =
|
|
1314
|
-
|
|
2235
|
+
const i = "onHover" + n, r = s[i];
|
|
2236
|
+
r && R.postRender(() => r(e, ns(e)));
|
|
2237
|
+
}
|
|
2238
|
+
class io extends re {
|
|
2239
|
+
mount() {
|
|
2240
|
+
const { current: e } = this.node;
|
|
2241
|
+
e && (this.unmount = so(e, (n) => (nn(this.node, n, "Start"), (s) => nn(this.node, s, "End"))));
|
|
2242
|
+
}
|
|
2243
|
+
unmount() {
|
|
2244
|
+
}
|
|
1315
2245
|
}
|
|
1316
|
-
|
|
2246
|
+
class ro extends re {
|
|
2247
|
+
constructor() {
|
|
2248
|
+
super(...arguments), this.isActive = !1;
|
|
2249
|
+
}
|
|
2250
|
+
onFocus() {
|
|
2251
|
+
let e = !1;
|
|
2252
|
+
try {
|
|
2253
|
+
e = this.node.current.matches(":focus-visible");
|
|
2254
|
+
} catch {
|
|
2255
|
+
e = !0;
|
|
2256
|
+
}
|
|
2257
|
+
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
2258
|
+
}
|
|
2259
|
+
onBlur() {
|
|
2260
|
+
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
2261
|
+
}
|
|
2262
|
+
mount() {
|
|
2263
|
+
this.unmount = De(Qt(this.node.current, "focus", () => this.onFocus()), Qt(this.node.current, "blur", () => this.onBlur()));
|
|
2264
|
+
}
|
|
2265
|
+
unmount() {
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
const ae = /* @__PURE__ */ new WeakSet();
|
|
1317
2269
|
function sn(t) {
|
|
1318
2270
|
return (e) => {
|
|
1319
2271
|
e.key === "Enter" && t(e);
|
|
1320
2272
|
};
|
|
1321
2273
|
}
|
|
1322
|
-
function
|
|
2274
|
+
function Ke(t, e) {
|
|
1323
2275
|
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
1324
2276
|
}
|
|
1325
|
-
const
|
|
2277
|
+
const oo = (t, e) => {
|
|
2278
|
+
const n = t.currentTarget;
|
|
2279
|
+
if (!n)
|
|
2280
|
+
return;
|
|
2281
|
+
const s = sn(() => {
|
|
2282
|
+
if (ae.has(n))
|
|
2283
|
+
return;
|
|
2284
|
+
Ke(n, "down");
|
|
2285
|
+
const i = sn(() => {
|
|
2286
|
+
Ke(n, "up");
|
|
2287
|
+
}), r = () => Ke(n, "cancel");
|
|
2288
|
+
n.addEventListener("keyup", i, e), n.addEventListener("blur", r, e);
|
|
2289
|
+
});
|
|
2290
|
+
n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
|
|
2291
|
+
}, ao = /* @__PURE__ */ new Set([
|
|
2292
|
+
"BUTTON",
|
|
2293
|
+
"INPUT",
|
|
2294
|
+
"SELECT",
|
|
2295
|
+
"TEXTAREA",
|
|
2296
|
+
"A"
|
|
2297
|
+
]);
|
|
2298
|
+
function lo(t) {
|
|
2299
|
+
return ao.has(t.tagName) || t.tabIndex !== -1;
|
|
2300
|
+
}
|
|
2301
|
+
const as = (t, e) => e ? t === e ? !0 : as(t, e.parentElement) : !1;
|
|
1326
2302
|
function rn(t) {
|
|
1327
|
-
return (
|
|
2303
|
+
return Hr(t) && !0;
|
|
1328
2304
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const [s, i, r] =
|
|
2305
|
+
function uo(t, e, n = {}) {
|
|
2306
|
+
const [s, i, r] = os(t, n), o = (a) => {
|
|
1331
2307
|
const l = a.currentTarget;
|
|
1332
|
-
if (!rn(a) ||
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
2308
|
+
if (!rn(a) || ae.has(l))
|
|
2309
|
+
return;
|
|
2310
|
+
ae.add(l);
|
|
2311
|
+
const u = e(a), c = (h, y) => {
|
|
2312
|
+
window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", d), !(!rn(h) || !ae.has(l)) && (ae.delete(l), u && u(h, { success: y }));
|
|
2313
|
+
}, f = (h) => {
|
|
2314
|
+
c(h, n.useGlobalTarget || as(l, h.target));
|
|
2315
|
+
}, d = (h) => {
|
|
2316
|
+
c(h, !1);
|
|
1340
2317
|
};
|
|
1341
|
-
window.addEventListener("pointerup",
|
|
2318
|
+
window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", d, i);
|
|
1342
2319
|
};
|
|
1343
2320
|
return s.forEach((a) => {
|
|
1344
|
-
(
|
|
1345
|
-
return ir.has(l.tagName) || l.tabIndex !== -1;
|
|
1346
|
-
})(a) || (a.tabIndex = 0), (n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), a.addEventListener("focus", (l) => ((c, u) => {
|
|
1347
|
-
const h = c.currentTarget;
|
|
1348
|
-
if (!h) return;
|
|
1349
|
-
const d = sn(() => {
|
|
1350
|
-
if (re.has(h)) return;
|
|
1351
|
-
$e(h, "down");
|
|
1352
|
-
const f = sn(() => {
|
|
1353
|
-
$e(h, "up");
|
|
1354
|
-
});
|
|
1355
|
-
h.addEventListener("keyup", f, u), h.addEventListener("blur", () => $e(h, "cancel"), u);
|
|
1356
|
-
});
|
|
1357
|
-
h.addEventListener("keydown", d, u), h.addEventListener("blur", () => h.removeEventListener("keydown", d), u);
|
|
1358
|
-
})(l, i), i);
|
|
2321
|
+
lo(a) || (a.tabIndex = 0), (n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), a.addEventListener("focus", (u) => oo(u, i), i);
|
|
1359
2322
|
}), r;
|
|
1360
2323
|
}
|
|
1361
2324
|
function on(t, e, n) {
|
|
1362
2325
|
const { props: s } = t;
|
|
1363
2326
|
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
1364
|
-
const i =
|
|
1365
|
-
|
|
2327
|
+
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
2328
|
+
r && R.postRender(() => r(e, ns(e)));
|
|
1366
2329
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
2330
|
+
class co extends re {
|
|
2331
|
+
mount() {
|
|
2332
|
+
const { current: e } = this.node;
|
|
2333
|
+
e && (this.unmount = uo(e, (n) => (on(this.node, n, "Start"), (s, { success: i }) => on(this.node, s, i ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
2334
|
+
}
|
|
2335
|
+
unmount() {
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
const Qe = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), fo = (t) => {
|
|
2339
|
+
const e = Qe.get(t.target);
|
|
1369
2340
|
e && e(t);
|
|
1370
|
-
},
|
|
1371
|
-
t.forEach(
|
|
2341
|
+
}, ho = (t) => {
|
|
2342
|
+
t.forEach(fo);
|
|
1372
2343
|
};
|
|
1373
|
-
function
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
2344
|
+
function po({ root: t, ...e }) {
|
|
2345
|
+
const n = t || document;
|
|
2346
|
+
_e.has(n) || _e.set(n, {});
|
|
2347
|
+
const s = _e.get(n), i = JSON.stringify(e);
|
|
2348
|
+
return s[i] || (s[i] = new IntersectionObserver(ho, { root: t, ...e })), s[i];
|
|
2349
|
+
}
|
|
2350
|
+
function mo(t, e, n) {
|
|
2351
|
+
const s = po(e);
|
|
2352
|
+
return Qe.set(t, n), s.observe(t), () => {
|
|
2353
|
+
Qe.delete(t), s.unobserve(t);
|
|
1382
2354
|
};
|
|
1383
2355
|
}
|
|
1384
|
-
const
|
|
2356
|
+
const go = {
|
|
2357
|
+
some: 0,
|
|
2358
|
+
all: 1
|
|
2359
|
+
};
|
|
2360
|
+
class yo extends re {
|
|
1385
2361
|
constructor() {
|
|
1386
2362
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
1387
2363
|
}
|
|
1388
2364
|
startObserver() {
|
|
1389
2365
|
this.unmount();
|
|
1390
|
-
const { viewport:
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
const {
|
|
1396
|
-
u && u
|
|
1397
|
-
|
|
2366
|
+
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = e, o = {
|
|
2367
|
+
root: n ? n.current : void 0,
|
|
2368
|
+
rootMargin: s,
|
|
2369
|
+
threshold: typeof i == "number" ? i : go[i]
|
|
2370
|
+
}, a = (l) => {
|
|
2371
|
+
const { isIntersecting: u } = l;
|
|
2372
|
+
if (this.isInView === u || (this.isInView = u, r && !u && this.hasEnteredView))
|
|
2373
|
+
return;
|
|
2374
|
+
u && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", u);
|
|
2375
|
+
const { onViewportEnter: c, onViewportLeave: f } = this.node.getProps(), d = u ? c : f;
|
|
2376
|
+
d && d(l);
|
|
2377
|
+
};
|
|
2378
|
+
return mo(this.node.current, o, a);
|
|
1398
2379
|
}
|
|
1399
2380
|
mount() {
|
|
1400
2381
|
this.startObserver();
|
|
1401
2382
|
}
|
|
1402
2383
|
update() {
|
|
1403
|
-
if (typeof IntersectionObserver > "u")
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
}(t, e)) && this.startObserver();
|
|
1408
|
-
}
|
|
1409
|
-
unmount() {
|
|
1410
|
-
}
|
|
1411
|
-
} }, tap: { Feature: class extends G {
|
|
1412
|
-
mount() {
|
|
1413
|
-
const { current: t } = this.node;
|
|
1414
|
-
t && (this.unmount = rr(t, (e) => (on(this.node, e, "Start"), (n, { success: s }) => on(this.node, n, s ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
1415
|
-
}
|
|
1416
|
-
unmount() {
|
|
1417
|
-
}
|
|
1418
|
-
} }, focus: { Feature: class extends G {
|
|
1419
|
-
constructor() {
|
|
1420
|
-
super(...arguments), this.isActive = !1;
|
|
1421
|
-
}
|
|
1422
|
-
onFocus() {
|
|
1423
|
-
let t = !1;
|
|
1424
|
-
try {
|
|
1425
|
-
t = this.node.current.matches(":focus-visible");
|
|
1426
|
-
} catch {
|
|
1427
|
-
t = !0;
|
|
1428
|
-
}
|
|
1429
|
-
t && this.node.animationState && (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
1430
|
-
}
|
|
1431
|
-
onBlur() {
|
|
1432
|
-
this.isActive && this.node.animationState && (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
1433
|
-
}
|
|
1434
|
-
mount() {
|
|
1435
|
-
this.unmount = ke(en(this.node.current, "focus", () => this.onFocus()), en(this.node.current, "blur", () => this.onBlur()));
|
|
2384
|
+
if (typeof IntersectionObserver > "u")
|
|
2385
|
+
return;
|
|
2386
|
+
const { props: e, prevProps: n } = this.node;
|
|
2387
|
+
["amount", "margin", "root"].some(vo(e, n)) && this.startObserver();
|
|
1436
2388
|
}
|
|
1437
2389
|
unmount() {
|
|
1438
2390
|
}
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
2391
|
+
}
|
|
2392
|
+
function vo({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
2393
|
+
return (n) => t[n] !== e[n];
|
|
2394
|
+
}
|
|
2395
|
+
const bo = {
|
|
2396
|
+
inView: {
|
|
2397
|
+
Feature: yo
|
|
2398
|
+
},
|
|
2399
|
+
tap: {
|
|
2400
|
+
Feature: co
|
|
2401
|
+
},
|
|
2402
|
+
focus: {
|
|
2403
|
+
Feature: ro
|
|
2404
|
+
},
|
|
2405
|
+
hover: {
|
|
2406
|
+
Feature: io
|
|
2407
|
+
}
|
|
2408
|
+
}, ls = te({
|
|
2409
|
+
transformPagePoint: (t) => t,
|
|
2410
|
+
isStatic: !1,
|
|
2411
|
+
reducedMotion: "never"
|
|
2412
|
+
}), Ie = te({}), Tt = typeof window < "u", wo = Tt ? xs : nt, Vt = te({ strict: !1 });
|
|
2413
|
+
function To(t, e, n, s, i) {
|
|
1460
2414
|
var r, o;
|
|
1461
|
-
const { visualElement: a } = O(
|
|
1462
|
-
s = s || l.renderer, !
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
2415
|
+
const { visualElement: a } = O(Ie), l = O(Vt), u = O(rs), c = O(ls).reducedMotion, f = Z(null);
|
|
2416
|
+
s = s || l.renderer, !f.current && s && (f.current = s(t, {
|
|
2417
|
+
visualState: e,
|
|
2418
|
+
parent: a,
|
|
2419
|
+
props: n,
|
|
2420
|
+
presenceContext: u,
|
|
2421
|
+
blockInitialAnimation: u ? u.initial === !1 : !1,
|
|
2422
|
+
reducedMotionConfig: c
|
|
2423
|
+
}));
|
|
2424
|
+
const d = f.current, h = O(Jr);
|
|
2425
|
+
d && !d.projection && i && (d.type === "html" || d.type === "svg") && Vo(f.current, n, i, h);
|
|
2426
|
+
const y = Z(!1);
|
|
2427
|
+
As(() => {
|
|
2428
|
+
d && y.current && d.update(n, u);
|
|
1471
2429
|
});
|
|
1472
|
-
const
|
|
1473
|
-
return
|
|
1474
|
-
d && (
|
|
1475
|
-
}),
|
|
1476
|
-
d && (!
|
|
1477
|
-
var
|
|
1478
|
-
(
|
|
1479
|
-
}),
|
|
2430
|
+
const v = n[Qn], b = Z(!!v && !(!((r = window.MotionHandoffIsComplete) === null || r === void 0) && r.call(window, v)) && ((o = window.MotionHasOptimisedAnimation) === null || o === void 0 ? void 0 : o.call(window, v)));
|
|
2431
|
+
return wo(() => {
|
|
2432
|
+
d && (y.current = !0, window.MotionIsMounted = !0, d.updateFeatures(), eo.render(d.render), b.current && d.animationState && d.animationState.animateChanges());
|
|
2433
|
+
}), nt(() => {
|
|
2434
|
+
d && (!b.current && d.animationState && d.animationState.animateChanges(), b.current && (queueMicrotask(() => {
|
|
2435
|
+
var p;
|
|
2436
|
+
(p = window.MotionHandoffMarkAsComplete) === null || p === void 0 || p.call(window, v);
|
|
2437
|
+
}), b.current = !1));
|
|
1480
2438
|
}), d;
|
|
1481
2439
|
}
|
|
1482
|
-
function
|
|
1483
|
-
|
|
2440
|
+
function Vo(t, e, n, s) {
|
|
2441
|
+
const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: l, layoutRoot: u } = e;
|
|
2442
|
+
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : us(t.parent)), t.projection.setOptions({
|
|
2443
|
+
layoutId: i,
|
|
2444
|
+
layout: r,
|
|
2445
|
+
alwaysMeasureLayout: !!o || a && ss(a),
|
|
2446
|
+
visualElement: t,
|
|
2447
|
+
/**
|
|
2448
|
+
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
2449
|
+
* to update by the time layout animations run.
|
|
2450
|
+
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
2451
|
+
* ensuring it gets called if there's no potential layout animations.
|
|
2452
|
+
*
|
|
2453
|
+
*/
|
|
2454
|
+
animationType: typeof r == "string" ? r : "both",
|
|
2455
|
+
initialPromotionConfig: s,
|
|
2456
|
+
layoutScroll: l,
|
|
2457
|
+
layoutRoot: u
|
|
2458
|
+
});
|
|
1484
2459
|
}
|
|
1485
|
-
function
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
2460
|
+
function us(t) {
|
|
2461
|
+
if (t)
|
|
2462
|
+
return t.options.allowProjection !== !1 ? t.projection : us(t.parent);
|
|
2463
|
+
}
|
|
2464
|
+
function So(t, e, n) {
|
|
2465
|
+
return fn(
|
|
2466
|
+
(s) => {
|
|
2467
|
+
s && t.mount && t.mount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : ss(n) && (n.current = s));
|
|
2468
|
+
},
|
|
2469
|
+
/**
|
|
2470
|
+
* Only pass a new ref callback to React if we've received a visual element
|
|
2471
|
+
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
2472
|
+
* or other dependencies change.
|
|
2473
|
+
*/
|
|
2474
|
+
[e]
|
|
2475
|
+
);
|
|
1489
2476
|
}
|
|
1490
2477
|
function Oe(t) {
|
|
1491
|
-
return Ce(t.animate) ||
|
|
2478
|
+
return Ce(t.animate) || rt.some((e) => ue(t[e]));
|
|
1492
2479
|
}
|
|
1493
|
-
function
|
|
2480
|
+
function cs(t) {
|
|
1494
2481
|
return !!(Oe(t) || t.variants);
|
|
1495
2482
|
}
|
|
1496
|
-
function
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
return
|
|
2483
|
+
function xo(t, e) {
|
|
2484
|
+
if (Oe(t)) {
|
|
2485
|
+
const { initial: n, animate: s } = t;
|
|
2486
|
+
return {
|
|
2487
|
+
initial: n === !1 || ue(n) ? n : void 0,
|
|
2488
|
+
animate: ue(s) ? s : void 0
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
return t.inherit !== !1 ? e : {};
|
|
2492
|
+
}
|
|
2493
|
+
function Ao(t) {
|
|
2494
|
+
const { initial: e, animate: n } = xo(t, O(Ie));
|
|
2495
|
+
return Ae(() => ({ initial: e, animate: n }), [an(e), an(n)]);
|
|
1505
2496
|
}
|
|
1506
2497
|
function an(t) {
|
|
1507
2498
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
1508
2499
|
}
|
|
1509
|
-
const ln = {
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
2500
|
+
const ln = {
|
|
2501
|
+
animation: [
|
|
2502
|
+
"animate",
|
|
2503
|
+
"variants",
|
|
2504
|
+
"whileHover",
|
|
2505
|
+
"whileTap",
|
|
2506
|
+
"exit",
|
|
2507
|
+
"whileInView",
|
|
2508
|
+
"whileFocus",
|
|
2509
|
+
"whileDrag"
|
|
2510
|
+
],
|
|
2511
|
+
exit: ["exit"],
|
|
2512
|
+
drag: ["drag", "dragControls"],
|
|
2513
|
+
focus: ["whileFocus"],
|
|
2514
|
+
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
|
|
2515
|
+
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
|
|
2516
|
+
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
2517
|
+
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2518
|
+
layout: ["layout", "layoutId"]
|
|
2519
|
+
}, ee = {};
|
|
2520
|
+
for (const t in ln)
|
|
2521
|
+
ee[t] = {
|
|
2522
|
+
isEnabled: (e) => ln[t].some((n) => !!e[n])
|
|
2523
|
+
};
|
|
2524
|
+
function et(t) {
|
|
2525
|
+
for (const e in t)
|
|
2526
|
+
ee[e] = {
|
|
2527
|
+
...ee[e],
|
|
2528
|
+
...t[e]
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
const Mo = Symbol.for("motionComponentSymbol");
|
|
2532
|
+
function Co({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
|
|
2533
|
+
t && et(t);
|
|
2534
|
+
function r(a, l) {
|
|
2535
|
+
let u;
|
|
2536
|
+
const c = {
|
|
2537
|
+
...O(ls),
|
|
2538
|
+
...a,
|
|
2539
|
+
layoutId: Po(a)
|
|
2540
|
+
}, { isStatic: f } = c, d = Ao(a), h = s(a, f);
|
|
2541
|
+
if (!f && Tt) {
|
|
2542
|
+
Fo(c, t);
|
|
2543
|
+
const y = Do(c);
|
|
2544
|
+
u = y.MeasureLayout, d.visualElement = To(i, h, c, e, y.ProjectionNode);
|
|
1535
2545
|
}
|
|
1536
|
-
return
|
|
1537
|
-
}
|
|
1538
|
-
|
|
2546
|
+
return Y(Ie.Provider, { value: d, children: [u && d.visualElement ? E(u, { visualElement: d.visualElement, ...c }) : null, n(i, a, So(h, d.visualElement, l), h, f, d.visualElement)] });
|
|
2547
|
+
}
|
|
2548
|
+
const o = Ms(r);
|
|
2549
|
+
return o[Mo] = i, o;
|
|
1539
2550
|
}
|
|
1540
|
-
function
|
|
1541
|
-
const e = O(
|
|
2551
|
+
function Po({ layoutId: t }) {
|
|
2552
|
+
const e = O(Zr).id;
|
|
1542
2553
|
return e && t !== void 0 ? e + "-" + t : t;
|
|
1543
2554
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
for (const r in n) t.style.setProperty(r, n[r]);
|
|
2555
|
+
function Fo(t, e) {
|
|
2556
|
+
const n = O(Vt).strict;
|
|
2557
|
+
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
2558
|
+
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
2559
|
+
t.ignoreStrict ? ne(!1, s) : G(!1, s);
|
|
2560
|
+
}
|
|
1551
2561
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
2562
|
+
function Do(t) {
|
|
2563
|
+
const { drag: e, layout: n } = ee;
|
|
2564
|
+
if (!e && !n)
|
|
2565
|
+
return {};
|
|
2566
|
+
const s = { ...e, ...n };
|
|
2567
|
+
return {
|
|
2568
|
+
MeasureLayout: e != null && e.isEnabled(t) || n != null && n.isEnabled(t) ? s.MeasureLayout : void 0,
|
|
2569
|
+
ProjectionNode: s.ProjectionNode
|
|
2570
|
+
};
|
|
1556
2571
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
2572
|
+
const Ro = [
|
|
2573
|
+
"animate",
|
|
2574
|
+
"circle",
|
|
2575
|
+
"defs",
|
|
2576
|
+
"desc",
|
|
2577
|
+
"ellipse",
|
|
2578
|
+
"g",
|
|
2579
|
+
"image",
|
|
2580
|
+
"line",
|
|
2581
|
+
"filter",
|
|
2582
|
+
"marker",
|
|
2583
|
+
"mask",
|
|
2584
|
+
"metadata",
|
|
2585
|
+
"path",
|
|
2586
|
+
"pattern",
|
|
2587
|
+
"polygon",
|
|
2588
|
+
"polyline",
|
|
2589
|
+
"rect",
|
|
2590
|
+
"stop",
|
|
2591
|
+
"switch",
|
|
2592
|
+
"symbol",
|
|
2593
|
+
"svg",
|
|
2594
|
+
"text",
|
|
2595
|
+
"tspan",
|
|
2596
|
+
"use",
|
|
2597
|
+
"view"
|
|
2598
|
+
];
|
|
2599
|
+
function St(t) {
|
|
2600
|
+
return (
|
|
2601
|
+
/**
|
|
2602
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
2603
|
+
* HTML custom React components.
|
|
2604
|
+
*/
|
|
2605
|
+
typeof t != "string" || /**
|
|
2606
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
2607
|
+
*/
|
|
2608
|
+
t.includes("-") ? !1 : (
|
|
2609
|
+
/**
|
|
2610
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
2611
|
+
*/
|
|
2612
|
+
!!(Ro.indexOf(t) > -1 || /**
|
|
2613
|
+
* If it contains a capital letter, it's an SVG component
|
|
2614
|
+
*/
|
|
2615
|
+
/[A-Z]/u.test(t))
|
|
2616
|
+
)
|
|
2617
|
+
);
|
|
2618
|
+
}
|
|
2619
|
+
function ds(t, { style: e, vars: n }, s, i) {
|
|
2620
|
+
Object.assign(t.style, e, i && i.getProjectionStyles(s));
|
|
2621
|
+
for (const r in n)
|
|
2622
|
+
t.style.setProperty(r, n[r]);
|
|
2623
|
+
}
|
|
2624
|
+
const fs = /* @__PURE__ */ new Set([
|
|
2625
|
+
"baseFrequency",
|
|
2626
|
+
"diffuseConstant",
|
|
2627
|
+
"kernelMatrix",
|
|
2628
|
+
"kernelUnitLength",
|
|
2629
|
+
"keySplines",
|
|
2630
|
+
"keyTimes",
|
|
2631
|
+
"limitingConeAngle",
|
|
2632
|
+
"markerHeight",
|
|
2633
|
+
"markerWidth",
|
|
2634
|
+
"numOctaves",
|
|
2635
|
+
"targetX",
|
|
2636
|
+
"targetY",
|
|
2637
|
+
"surfaceScale",
|
|
2638
|
+
"specularConstant",
|
|
2639
|
+
"specularExponent",
|
|
2640
|
+
"stdDeviation",
|
|
2641
|
+
"tableValues",
|
|
2642
|
+
"viewBox",
|
|
2643
|
+
"gradientTransform",
|
|
2644
|
+
"pathLength",
|
|
2645
|
+
"startOffset",
|
|
2646
|
+
"textLength",
|
|
2647
|
+
"lengthAdjust"
|
|
2648
|
+
]);
|
|
2649
|
+
function hs(t, e, n, s) {
|
|
2650
|
+
ds(t, e, void 0, s);
|
|
2651
|
+
for (const i in e.attrs)
|
|
2652
|
+
t.setAttribute(fs.has(i) ? i : wt(i), e.attrs[i]);
|
|
2653
|
+
}
|
|
2654
|
+
function ps(t, { layout: e, layoutId: n }) {
|
|
2655
|
+
return z.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Qr[t] || t === "opacity");
|
|
1559
2656
|
}
|
|
1560
2657
|
function xt(t, e, n) {
|
|
1561
2658
|
var s;
|
|
1562
2659
|
const { style: i } = t, r = {};
|
|
1563
|
-
for (const o in i)
|
|
2660
|
+
for (const o in i)
|
|
2661
|
+
(F(i[o]) || e.style && F(e.style[o]) || ps(o, t) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (r[o] = i[o]);
|
|
1564
2662
|
return r;
|
|
1565
2663
|
}
|
|
1566
|
-
function
|
|
2664
|
+
function ms(t, e, n) {
|
|
1567
2665
|
const s = xt(t, e, n);
|
|
1568
|
-
for (const i in t)
|
|
2666
|
+
for (const i in t)
|
|
2667
|
+
if (F(t[i]) || F(e[i])) {
|
|
2668
|
+
const r = fe.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2669
|
+
s[r] = t[i];
|
|
2670
|
+
}
|
|
1569
2671
|
return s;
|
|
1570
2672
|
}
|
|
1571
|
-
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
}
|
|
2673
|
+
function Io(t) {
|
|
2674
|
+
const e = Z(null);
|
|
2675
|
+
return e.current === null && (e.current = t()), e.current;
|
|
2676
|
+
}
|
|
2677
|
+
function Oo({ scrapeMotionValuesFromProps: t, createRenderState: e, onMount: n }, s, i, r) {
|
|
2678
|
+
const o = {
|
|
2679
|
+
latestValues: Eo(s, i, r, t),
|
|
2680
|
+
renderState: e()
|
|
2681
|
+
};
|
|
2682
|
+
return n && (o.mount = (a) => n(s, a, o)), o;
|
|
2683
|
+
}
|
|
2684
|
+
const gs = (t) => (e, n) => {
|
|
2685
|
+
const s = O(Ie), i = O(rs), r = () => Oo(t, e, s, i);
|
|
2686
|
+
return n ? r() : Io(r);
|
|
1580
2687
|
};
|
|
1581
|
-
function
|
|
2688
|
+
function Eo(t, e, n, s) {
|
|
1582
2689
|
const i = {}, r = s(t, {});
|
|
1583
|
-
for (const d in r)
|
|
2690
|
+
for (const d in r)
|
|
2691
|
+
i[d] = to(r[d]);
|
|
1584
2692
|
let { initial: o, animate: a } = t;
|
|
1585
|
-
const l = Oe(t),
|
|
1586
|
-
e &&
|
|
1587
|
-
let
|
|
1588
|
-
|
|
1589
|
-
const
|
|
1590
|
-
if (
|
|
1591
|
-
const d = Array.isArray(
|
|
1592
|
-
for (let
|
|
1593
|
-
const
|
|
1594
|
-
if (
|
|
1595
|
-
const { transitionEnd:
|
|
1596
|
-
for (const
|
|
1597
|
-
let
|
|
1598
|
-
Array.isArray(
|
|
2693
|
+
const l = Oe(t), u = cs(t);
|
|
2694
|
+
e && u && !l && t.inherit !== !1 && (o === void 0 && (o = e.initial), a === void 0 && (a = e.animate));
|
|
2695
|
+
let c = n ? n.initial === !1 : !1;
|
|
2696
|
+
c = c || o === !1;
|
|
2697
|
+
const f = c ? a : o;
|
|
2698
|
+
if (f && typeof f != "boolean" && !Ce(f)) {
|
|
2699
|
+
const d = Array.isArray(f) ? f : [f];
|
|
2700
|
+
for (let h = 0; h < d.length; h++) {
|
|
2701
|
+
const y = st(t, d[h]);
|
|
2702
|
+
if (y) {
|
|
2703
|
+
const { transitionEnd: v, transition: b, ...p } = y;
|
|
2704
|
+
for (const g in p) {
|
|
2705
|
+
let V = p[g];
|
|
2706
|
+
if (Array.isArray(V)) {
|
|
2707
|
+
const A = c ? V.length - 1 : 0;
|
|
2708
|
+
V = V[A];
|
|
2709
|
+
}
|
|
2710
|
+
V !== null && (i[g] = V);
|
|
1599
2711
|
}
|
|
1600
|
-
for (const
|
|
2712
|
+
for (const g in v)
|
|
2713
|
+
i[g] = v[g];
|
|
1601
2714
|
}
|
|
1602
2715
|
}
|
|
1603
2716
|
}
|
|
1604
2717
|
return i;
|
|
1605
2718
|
}
|
|
1606
|
-
const
|
|
1607
|
-
|
|
2719
|
+
const At = () => ({
|
|
2720
|
+
style: {},
|
|
2721
|
+
transform: {},
|
|
2722
|
+
transformOrigin: {},
|
|
2723
|
+
vars: {}
|
|
2724
|
+
}), ys = () => ({
|
|
2725
|
+
...At(),
|
|
2726
|
+
attrs: {}
|
|
2727
|
+
}), vs = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ko = {
|
|
2728
|
+
x: "translateX",
|
|
2729
|
+
y: "translateY",
|
|
2730
|
+
z: "translateZ",
|
|
2731
|
+
transformPerspective: "perspective"
|
|
2732
|
+
}, Lo = fe.length;
|
|
2733
|
+
function No(t, e, n) {
|
|
2734
|
+
let s = "", i = !0;
|
|
2735
|
+
for (let r = 0; r < Lo; r++) {
|
|
2736
|
+
const o = fe[r], a = t[o];
|
|
2737
|
+
if (a === void 0)
|
|
2738
|
+
continue;
|
|
2739
|
+
let l = !0;
|
|
2740
|
+
if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
2741
|
+
const u = vs(a, ft[o]);
|
|
2742
|
+
if (!l) {
|
|
2743
|
+
i = !1;
|
|
2744
|
+
const c = ko[o] || o;
|
|
2745
|
+
s += `${c}(${u}) `;
|
|
2746
|
+
}
|
|
2747
|
+
n && (e[o] = u);
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
|
|
2751
|
+
}
|
|
2752
|
+
function Mt(t, e, n) {
|
|
1608
2753
|
const { style: s, vars: i, transformOrigin: r } = t;
|
|
1609
2754
|
let o = !1, a = !1;
|
|
1610
2755
|
for (const l in e) {
|
|
1611
|
-
const
|
|
1612
|
-
if (
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
2756
|
+
const u = e[l];
|
|
2757
|
+
if (z.has(l)) {
|
|
2758
|
+
o = !0;
|
|
2759
|
+
continue;
|
|
2760
|
+
} else if (Cn(l)) {
|
|
2761
|
+
i[l] = u;
|
|
2762
|
+
continue;
|
|
2763
|
+
} else {
|
|
2764
|
+
const c = vs(u, ft[l]);
|
|
2765
|
+
l.startsWith("origin") ? (a = !0, r[l] = c) : s[l] = c;
|
|
1617
2766
|
}
|
|
1618
2767
|
}
|
|
1619
|
-
if (e.transform || (o || n ? s.transform =
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
const v = he[f], p = l[v];
|
|
1623
|
-
if (p === void 0) continue;
|
|
1624
|
-
let g = !0;
|
|
1625
|
-
if (g = typeof p == "number" ? p === (v.startsWith("scale") ? 1 : 0) : parseFloat(p) === 0, !g || u) {
|
|
1626
|
-
const m = un(p, _e[v]);
|
|
1627
|
-
g || (d = !1, h += `${Tr[v] || v}(${m}) `), u && (c[v] = m);
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
return h = h.trim(), u ? h = u(c, d ? "" : h) : d && (h = "none"), h;
|
|
1631
|
-
}(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
1632
|
-
const { originX: l = "50%", originY: c = "50%", originZ: u = 0 } = r;
|
|
1633
|
-
s.transformOrigin = `${l} ${c} ${u}`;
|
|
2768
|
+
if (e.transform || (o || n ? s.transform = No(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
2769
|
+
const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = r;
|
|
2770
|
+
s.transformOrigin = `${l} ${u} ${c}`;
|
|
1634
2771
|
}
|
|
1635
2772
|
}
|
|
1636
|
-
function
|
|
1637
|
-
return typeof t == "string" ? t :
|
|
2773
|
+
function un(t, e, n) {
|
|
2774
|
+
return typeof t == "string" ? t : m.transform(e + n * t);
|
|
2775
|
+
}
|
|
2776
|
+
function Bo(t, e, n) {
|
|
2777
|
+
const s = un(e, t.x, t.width), i = un(n, t.y, t.height);
|
|
2778
|
+
return `${s} ${i}`;
|
|
1638
2779
|
}
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1641
|
-
|
|
2780
|
+
const Ko = {
|
|
2781
|
+
offset: "stroke-dashoffset",
|
|
2782
|
+
array: "stroke-dasharray"
|
|
2783
|
+
}, _o = {
|
|
2784
|
+
offset: "strokeDashoffset",
|
|
2785
|
+
array: "strokeDasharray"
|
|
2786
|
+
};
|
|
2787
|
+
function $o(t, e, n = 1, s = 0, i = !0) {
|
|
2788
|
+
t.pathLength = 1;
|
|
2789
|
+
const r = i ? Ko : _o;
|
|
2790
|
+
t[r.offset] = m.transform(-s);
|
|
2791
|
+
const o = m.transform(e), a = m.transform(n);
|
|
2792
|
+
t[r.array] = `${o} ${a}`;
|
|
2793
|
+
}
|
|
2794
|
+
function Ct(t, {
|
|
2795
|
+
attrX: e,
|
|
2796
|
+
attrY: n,
|
|
2797
|
+
attrScale: s,
|
|
2798
|
+
originX: i,
|
|
2799
|
+
originY: r,
|
|
2800
|
+
pathLength: o,
|
|
2801
|
+
pathSpacing: a = 1,
|
|
2802
|
+
pathOffset: l = 0,
|
|
2803
|
+
// This is object creation, which we try to avoid per-frame.
|
|
2804
|
+
...u
|
|
2805
|
+
}, c, f) {
|
|
2806
|
+
if (Mt(t, u, f), c) {
|
|
2807
|
+
t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
|
|
2808
|
+
return;
|
|
2809
|
+
}
|
|
1642
2810
|
t.attrs = t.style, t.style = {};
|
|
1643
|
-
const { attrs: d, style:
|
|
1644
|
-
d.transform && (
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
2811
|
+
const { attrs: d, style: h, dimensions: y } = t;
|
|
2812
|
+
d.transform && (y && (h.transform = d.transform), delete d.transform), y && (i !== void 0 || r !== void 0 || h.transform) && (h.transformOrigin = Bo(y, i !== void 0 ? i : 0.5, r !== void 0 ? r : 0.5)), e !== void 0 && (d.x = e), n !== void 0 && (d.y = n), s !== void 0 && (d.scale = s), o !== void 0 && $o(d, o, a, l, !1);
|
|
2813
|
+
}
|
|
2814
|
+
const Pt = (t) => typeof t == "string" && t.toLowerCase() === "svg", jo = {
|
|
2815
|
+
useVisualState: gs({
|
|
2816
|
+
scrapeMotionValuesFromProps: ms,
|
|
2817
|
+
createRenderState: ys,
|
|
2818
|
+
onMount: (t, e, { renderState: n, latestValues: s }) => {
|
|
2819
|
+
R.read(() => {
|
|
2820
|
+
try {
|
|
2821
|
+
n.dimensions = typeof e.getBBox == "function" ? e.getBBox() : e.getBoundingClientRect();
|
|
2822
|
+
} catch {
|
|
2823
|
+
n.dimensions = {
|
|
2824
|
+
x: 0,
|
|
2825
|
+
y: 0,
|
|
2826
|
+
width: 0,
|
|
2827
|
+
height: 0
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2830
|
+
}), R.render(() => {
|
|
2831
|
+
Ct(n, s, Pt(e.tagName), t.transformTemplate), hs(e, n);
|
|
2832
|
+
});
|
|
1660
2833
|
}
|
|
1661
|
-
})
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
}
|
|
1668
|
-
function
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
function
|
|
1683
|
-
|
|
1684
|
-
}
|
|
1685
|
-
|
|
2834
|
+
})
|
|
2835
|
+
}, Wo = {
|
|
2836
|
+
useVisualState: gs({
|
|
2837
|
+
scrapeMotionValuesFromProps: xt,
|
|
2838
|
+
createRenderState: At
|
|
2839
|
+
})
|
|
2840
|
+
};
|
|
2841
|
+
function bs(t, e, n) {
|
|
2842
|
+
for (const s in e)
|
|
2843
|
+
!F(e[s]) && !ps(s, n) && (t[s] = e[s]);
|
|
2844
|
+
}
|
|
2845
|
+
function Go({ transformTemplate: t }, e) {
|
|
2846
|
+
return Ae(() => {
|
|
2847
|
+
const n = At();
|
|
2848
|
+
return Mt(n, e, t), Object.assign({}, n.vars, n.style);
|
|
2849
|
+
}, [e]);
|
|
2850
|
+
}
|
|
2851
|
+
function Uo(t, e) {
|
|
2852
|
+
const n = t.style || {}, s = {};
|
|
2853
|
+
return bs(s, n, t), Object.assign(s, Go(t, e)), s;
|
|
2854
|
+
}
|
|
2855
|
+
function zo(t, e) {
|
|
2856
|
+
const n = {}, s = Uo(t, e);
|
|
2857
|
+
return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
2858
|
+
}
|
|
2859
|
+
const Ho = /* @__PURE__ */ new Set([
|
|
2860
|
+
"animate",
|
|
2861
|
+
"exit",
|
|
2862
|
+
"variants",
|
|
2863
|
+
"initial",
|
|
2864
|
+
"style",
|
|
2865
|
+
"values",
|
|
2866
|
+
"variants",
|
|
2867
|
+
"transition",
|
|
2868
|
+
"transformTemplate",
|
|
2869
|
+
"custom",
|
|
2870
|
+
"inherit",
|
|
2871
|
+
"onBeforeLayoutMeasure",
|
|
2872
|
+
"onAnimationStart",
|
|
2873
|
+
"onAnimationComplete",
|
|
2874
|
+
"onUpdate",
|
|
2875
|
+
"onDragStart",
|
|
2876
|
+
"onDrag",
|
|
2877
|
+
"onDragEnd",
|
|
2878
|
+
"onMeasureDragConstraints",
|
|
2879
|
+
"onDirectionLock",
|
|
2880
|
+
"onDragTransitionEnd",
|
|
2881
|
+
"_dragX",
|
|
2882
|
+
"_dragY",
|
|
2883
|
+
"onHoverStart",
|
|
2884
|
+
"onHoverEnd",
|
|
2885
|
+
"onViewportEnter",
|
|
2886
|
+
"onViewportLeave",
|
|
2887
|
+
"globalTapTarget",
|
|
2888
|
+
"ignoreStrict",
|
|
2889
|
+
"viewport"
|
|
2890
|
+
]);
|
|
2891
|
+
function xe(t) {
|
|
2892
|
+
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Ho.has(t);
|
|
2893
|
+
}
|
|
2894
|
+
let ws = (t) => !xe(t);
|
|
2895
|
+
function qo(t) {
|
|
2896
|
+
t && (ws = (e) => e.startsWith("on") ? !xe(e) : t(e));
|
|
2897
|
+
}
|
|
1686
2898
|
try {
|
|
1687
|
-
(
|
|
2899
|
+
qo(require("@emotion/is-prop-valid").default);
|
|
1688
2900
|
} catch {
|
|
1689
2901
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
const i
|
|
1693
|
-
|
|
1694
|
-
|
|
2902
|
+
function Yo(t, e, n) {
|
|
2903
|
+
const s = {};
|
|
2904
|
+
for (const i in t)
|
|
2905
|
+
i === "values" && typeof t.values == "object" || (ws(i) || n === !0 && xe(i) || !e && !xe(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
2906
|
+
t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
|
|
2907
|
+
return s;
|
|
2908
|
+
}
|
|
2909
|
+
function Xo(t, e, n, s) {
|
|
2910
|
+
const i = Ae(() => {
|
|
2911
|
+
const r = ys();
|
|
2912
|
+
return Ct(r, e, Pt(s), t.transformTemplate), {
|
|
2913
|
+
...r.attrs,
|
|
2914
|
+
style: { ...r.style }
|
|
2915
|
+
};
|
|
1695
2916
|
}, [e]);
|
|
1696
2917
|
if (t.style) {
|
|
1697
2918
|
const r = {};
|
|
1698
|
-
|
|
2919
|
+
bs(r, t.style, t), i.style = { ...r, ...i.style };
|
|
1699
2920
|
}
|
|
1700
2921
|
return i;
|
|
1701
2922
|
}
|
|
1702
|
-
function
|
|
1703
|
-
return (
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
}
|
|
1709
|
-
return Vs(e, { ...l, children: u });
|
|
2923
|
+
function Zo(t = !1) {
|
|
2924
|
+
return (n, s, i, { latestValues: r }, o) => {
|
|
2925
|
+
const l = (St(n) ? Xo : zo)(s, r, o, n), u = Yo(s, typeof n == "string", t), c = n !== hn ? { ...u, ...l, ref: i } : {}, { children: f } = s, d = Ae(() => F(f) ? f.get() : f, [f]);
|
|
2926
|
+
return Cs(n, {
|
|
2927
|
+
...c,
|
|
2928
|
+
children: d
|
|
2929
|
+
});
|
|
1710
2930
|
};
|
|
1711
2931
|
}
|
|
1712
|
-
function
|
|
1713
|
-
return function(
|
|
1714
|
-
|
|
2932
|
+
function Jo(t, e) {
|
|
2933
|
+
return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
|
|
2934
|
+
const o = {
|
|
2935
|
+
...St(s) ? jo : Wo,
|
|
2936
|
+
preloadedFeatures: t,
|
|
2937
|
+
useRender: Zo(i),
|
|
2938
|
+
createVisualElement: e,
|
|
2939
|
+
Component: s
|
|
2940
|
+
};
|
|
2941
|
+
return Co(o);
|
|
1715
2942
|
};
|
|
1716
2943
|
}
|
|
1717
|
-
const
|
|
1718
|
-
|
|
2944
|
+
const tt = { current: null }, Ts = { current: !1 };
|
|
2945
|
+
function Qo() {
|
|
2946
|
+
if (Ts.current = !0, !!Tt)
|
|
2947
|
+
if (window.matchMedia) {
|
|
2948
|
+
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => tt.current = t.matches;
|
|
2949
|
+
t.addListener(e), e();
|
|
2950
|
+
} else
|
|
2951
|
+
tt.current = !1;
|
|
2952
|
+
}
|
|
2953
|
+
function ea(t, e, n) {
|
|
2954
|
+
for (const s in e) {
|
|
2955
|
+
const i = e[s], r = n[s];
|
|
2956
|
+
if (F(i))
|
|
2957
|
+
t.addValue(s, i), process.env.NODE_ENV === "development" && Me(i.version === "11.15.0", `Attempting to mix Motion versions ${i.version} with 11.15.0 may not work as expected.`);
|
|
2958
|
+
else if (F(r))
|
|
2959
|
+
t.addValue(s, Se(i, { owner: t }));
|
|
2960
|
+
else if (r !== i)
|
|
2961
|
+
if (t.hasValue(s)) {
|
|
2962
|
+
const o = t.getValue(s);
|
|
2963
|
+
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
2964
|
+
} else {
|
|
2965
|
+
const o = t.getStaticValue(s);
|
|
2966
|
+
t.addValue(s, Se(o !== void 0 ? o : i, { owner: t }));
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
for (const s in n)
|
|
2970
|
+
e[s] === void 0 && t.removeValue(s);
|
|
2971
|
+
return e;
|
|
2972
|
+
}
|
|
2973
|
+
const cn = /* @__PURE__ */ new WeakMap(), ta = [...Dn, C, ie], na = (t) => ta.find(Fn(t)), dn = [
|
|
2974
|
+
"AnimationStart",
|
|
2975
|
+
"AnimationComplete",
|
|
2976
|
+
"Update",
|
|
2977
|
+
"BeforeLayoutMeasure",
|
|
2978
|
+
"LayoutMeasure",
|
|
2979
|
+
"LayoutAnimationStart",
|
|
2980
|
+
"LayoutAnimationComplete"
|
|
2981
|
+
];
|
|
2982
|
+
class sa {
|
|
2983
|
+
/**
|
|
2984
|
+
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2985
|
+
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
2986
|
+
*
|
|
2987
|
+
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
2988
|
+
* intended to be one.
|
|
2989
|
+
*/
|
|
1719
2990
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
1720
2991
|
return {};
|
|
1721
2992
|
}
|
|
1722
2993
|
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
|
|
1723
|
-
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver =
|
|
2994
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = ut, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
1724
2995
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
1725
2996
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
1726
|
-
const d =
|
|
1727
|
-
this.renderScheduledAt < d && (this.renderScheduledAt = d,
|
|
2997
|
+
const d = K.now();
|
|
2998
|
+
this.renderScheduledAt < d && (this.renderScheduledAt = d, R.render(this.render, !1, !0));
|
|
1728
2999
|
};
|
|
1729
|
-
const { latestValues: l, renderState:
|
|
1730
|
-
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState =
|
|
1731
|
-
const { willChange:
|
|
1732
|
-
for (const d in
|
|
1733
|
-
const
|
|
1734
|
-
l[d] !== void 0 &&
|
|
3000
|
+
const { latestValues: l, renderState: u } = o;
|
|
3001
|
+
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = Oe(n), this.isVariantNode = cs(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
3002
|
+
const { willChange: c, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
3003
|
+
for (const d in f) {
|
|
3004
|
+
const h = f[d];
|
|
3005
|
+
l[d] !== void 0 && F(h) && h.set(l[d], !1);
|
|
1735
3006
|
}
|
|
1736
3007
|
}
|
|
1737
3008
|
mount(e) {
|
|
1738
|
-
this.current = e,
|
|
1739
|
-
if (dn.current = !0, bt) if (window.matchMedia) {
|
|
1740
|
-
const n = window.matchMedia("(prefers-reduced-motion)"), s = () => Ke.current = n.matches;
|
|
1741
|
-
n.addListener(s), s();
|
|
1742
|
-
} else Ke.current = !1;
|
|
1743
|
-
}(), this.shouldReduceMotion = this.reducedMotionConfig !== "never" && (this.reducedMotionConfig === "always" || Ke.current), process.env.NODE_ENV !== "production" && we(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
3009
|
+
this.current = e, cn.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Ts.current || Qo(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : tt.current, process.env.NODE_ENV !== "production" && Me(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
1744
3010
|
}
|
|
1745
3011
|
unmount() {
|
|
1746
|
-
|
|
1747
|
-
for (const e in this.events)
|
|
3012
|
+
cn.delete(this.current), this.projection && this.projection.unmount(), We(this.notifyUpdate), We(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
3013
|
+
for (const e in this.events)
|
|
3014
|
+
this.events[e].clear();
|
|
1748
3015
|
for (const e in this.features) {
|
|
1749
3016
|
const n = this.features[e];
|
|
1750
3017
|
n && (n.unmount(), n.isMounted = !1);
|
|
@@ -1753,8 +3020,8 @@ class Dr {
|
|
|
1753
3020
|
}
|
|
1754
3021
|
bindToMotionValue(e, n) {
|
|
1755
3022
|
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
1756
|
-
const s =
|
|
1757
|
-
this.latestValues[e] = a, this.props.onUpdate &&
|
|
3023
|
+
const s = z.has(e), i = n.on("change", (a) => {
|
|
3024
|
+
this.latestValues[e] = a, this.props.onUpdate && R.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
|
|
1758
3025
|
}), r = n.on("renderRequest", this.scheduleRender);
|
|
1759
3026
|
let o;
|
|
1760
3027
|
window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
|
|
@@ -1762,13 +3029,14 @@ class Dr {
|
|
|
1762
3029
|
});
|
|
1763
3030
|
}
|
|
1764
3031
|
sortNodePosition(e) {
|
|
1765
|
-
return this.current
|
|
3032
|
+
return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
|
|
1766
3033
|
}
|
|
1767
3034
|
updateFeatures() {
|
|
1768
3035
|
let e = "animation";
|
|
1769
|
-
for (e in
|
|
1770
|
-
const n =
|
|
1771
|
-
if (!n)
|
|
3036
|
+
for (e in ee) {
|
|
3037
|
+
const n = ee[e];
|
|
3038
|
+
if (!n)
|
|
3039
|
+
continue;
|
|
1772
3040
|
const { isEnabled: s, Feature: i } = n;
|
|
1773
3041
|
if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
|
|
1774
3042
|
const r = this.features[e];
|
|
@@ -1779,8 +3047,13 @@ class Dr {
|
|
|
1779
3047
|
triggerBuild() {
|
|
1780
3048
|
this.build(this.renderState, this.latestValues, this.props);
|
|
1781
3049
|
}
|
|
3050
|
+
/**
|
|
3051
|
+
* Measure the current viewport box with or without transforms.
|
|
3052
|
+
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
3053
|
+
* removed with a re-render to work.
|
|
3054
|
+
*/
|
|
1782
3055
|
measureViewportBox() {
|
|
1783
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
3056
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : is();
|
|
1784
3057
|
}
|
|
1785
3058
|
getStaticValue(e) {
|
|
1786
3059
|
return this.latestValues[e];
|
|
@@ -1788,37 +3061,32 @@ class Dr {
|
|
|
1788
3061
|
setStaticValue(e, n) {
|
|
1789
3062
|
this.latestValues[e] = n;
|
|
1790
3063
|
}
|
|
3064
|
+
/**
|
|
3065
|
+
* Update the provided props. Ensure any newly-added motion values are
|
|
3066
|
+
* added to our map, old ones removed, and listeners updated.
|
|
3067
|
+
*/
|
|
1791
3068
|
update(e, n) {
|
|
1792
3069
|
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
1793
|
-
for (let s = 0; s <
|
|
1794
|
-
const i =
|
|
3070
|
+
for (let s = 0; s < dn.length; s++) {
|
|
3071
|
+
const i = dn[s];
|
|
1795
3072
|
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
1796
|
-
const r =
|
|
1797
|
-
|
|
3073
|
+
const r = "on" + i, o = e[r];
|
|
3074
|
+
o && (this.propEventSubscriptions[i] = this.on(i, o));
|
|
1798
3075
|
}
|
|
1799
|
-
this.prevMotionValues =
|
|
1800
|
-
for (const o in i) {
|
|
1801
|
-
const a = i[o], l = r[o];
|
|
1802
|
-
if (E(a)) s.addValue(o, a), process.env.NODE_ENV === "development" && we(a.version === "11.15.0", `Attempting to mix Motion versions ${a.version} with 11.15.0 may not work as expected.`);
|
|
1803
|
-
else if (E(l)) s.addValue(o, ye(a, { owner: s }));
|
|
1804
|
-
else if (l !== a) if (s.hasValue(o)) {
|
|
1805
|
-
const c = s.getValue(o);
|
|
1806
|
-
c.liveStyle === !0 ? c.jump(a) : c.hasAnimated || c.set(a);
|
|
1807
|
-
} else {
|
|
1808
|
-
const c = s.getStaticValue(o);
|
|
1809
|
-
s.addValue(o, ye(c !== void 0 ? c : a, { owner: s }));
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
for (const o in r) i[o] === void 0 && s.removeValue(o);
|
|
1813
|
-
return i;
|
|
1814
|
-
}(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
3076
|
+
this.prevMotionValues = ea(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
1815
3077
|
}
|
|
1816
3078
|
getProps() {
|
|
1817
3079
|
return this.props;
|
|
1818
3080
|
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Returns the variant definition with a given name.
|
|
3083
|
+
*/
|
|
1819
3084
|
getVariant(e) {
|
|
1820
3085
|
return this.props.variants ? this.props.variants[e] : void 0;
|
|
1821
3086
|
}
|
|
3087
|
+
/**
|
|
3088
|
+
* Returns the defined default transition on this component.
|
|
3089
|
+
*/
|
|
1822
3090
|
getDefaultTransition() {
|
|
1823
3091
|
return this.props.transition;
|
|
1824
3092
|
}
|
|
@@ -1828,61 +3096,88 @@ class Dr {
|
|
|
1828
3096
|
getClosestVariantNode() {
|
|
1829
3097
|
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
1830
3098
|
}
|
|
3099
|
+
/**
|
|
3100
|
+
* Add a child visual element to our set of children.
|
|
3101
|
+
*/
|
|
1831
3102
|
addVariantChild(e) {
|
|
1832
3103
|
const n = this.getClosestVariantNode();
|
|
1833
|
-
if (n)
|
|
3104
|
+
if (n)
|
|
3105
|
+
return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
|
|
1834
3106
|
}
|
|
3107
|
+
/**
|
|
3108
|
+
* Add a motion value and bind it to this visual element.
|
|
3109
|
+
*/
|
|
1835
3110
|
addValue(e, n) {
|
|
1836
3111
|
const s = this.values.get(e);
|
|
1837
3112
|
n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
|
|
1838
3113
|
}
|
|
3114
|
+
/**
|
|
3115
|
+
* Remove a motion value and unbind any active subscriptions.
|
|
3116
|
+
*/
|
|
1839
3117
|
removeValue(e) {
|
|
1840
3118
|
this.values.delete(e);
|
|
1841
3119
|
const n = this.valueSubscriptions.get(e);
|
|
1842
3120
|
n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
|
|
1843
3121
|
}
|
|
3122
|
+
/**
|
|
3123
|
+
* Check whether we have a motion value for this key
|
|
3124
|
+
*/
|
|
1844
3125
|
hasValue(e) {
|
|
1845
3126
|
return this.values.has(e);
|
|
1846
3127
|
}
|
|
1847
3128
|
getValue(e, n) {
|
|
1848
|
-
if (this.props.values && this.props.values[e])
|
|
3129
|
+
if (this.props.values && this.props.values[e])
|
|
3130
|
+
return this.props.values[e];
|
|
1849
3131
|
let s = this.values.get(e);
|
|
1850
|
-
return s === void 0 && n !== void 0 && (s =
|
|
3132
|
+
return s === void 0 && n !== void 0 && (s = Se(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
1851
3133
|
}
|
|
3134
|
+
/**
|
|
3135
|
+
* If we're trying to animate to a previously unencountered value,
|
|
3136
|
+
* we need to check for it in our state and as a last resort read it
|
|
3137
|
+
* directly from the instance (which might have performance implications).
|
|
3138
|
+
*/
|
|
1852
3139
|
readValue(e, n) {
|
|
1853
3140
|
var s;
|
|
1854
|
-
let i = this.latestValues[e]
|
|
1855
|
-
|
|
1856
|
-
return i != null && (typeof i == "string" && (Mn(i) || Cn(i)) ? i = parseFloat(i) : (r = i, !Rr.find(Fn(r)) && se.test(n) && (i = Ln(e, n))), this.setBaseTarget(e, E(i) ? i.get() : i)), E(i) ? i.get() : i;
|
|
3141
|
+
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
|
|
3142
|
+
return i != null && (typeof i == "string" && (An(i) || xn(i)) ? i = parseFloat(i) : !na(i) && ie.test(n) && (i = Bn(e, n)), this.setBaseTarget(e, F(i) ? i.get() : i)), F(i) ? i.get() : i;
|
|
1857
3143
|
}
|
|
3144
|
+
/**
|
|
3145
|
+
* Set the base target to later animate back to. This is currently
|
|
3146
|
+
* only hydrated on creation and when we first read a value.
|
|
3147
|
+
*/
|
|
1858
3148
|
setBaseTarget(e, n) {
|
|
1859
3149
|
this.baseTarget[e] = n;
|
|
1860
3150
|
}
|
|
3151
|
+
/**
|
|
3152
|
+
* Find the base target for a value thats been removed from all animation
|
|
3153
|
+
* props.
|
|
3154
|
+
*/
|
|
1861
3155
|
getBaseTarget(e) {
|
|
1862
3156
|
var n;
|
|
1863
3157
|
const { initial: s } = this.props;
|
|
1864
3158
|
let i;
|
|
1865
3159
|
if (typeof s == "string" || typeof s == "object") {
|
|
1866
|
-
const o =
|
|
3160
|
+
const o = st(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
|
|
1867
3161
|
o && (i = o[e]);
|
|
1868
3162
|
}
|
|
1869
|
-
if (s && i !== void 0)
|
|
3163
|
+
if (s && i !== void 0)
|
|
3164
|
+
return i;
|
|
1870
3165
|
const r = this.getBaseTargetFromProps(this.props, e);
|
|
1871
|
-
return r
|
|
3166
|
+
return r !== void 0 && !F(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
1872
3167
|
}
|
|
1873
3168
|
on(e, n) {
|
|
1874
|
-
return this.events[e] || (this.events[e] = new
|
|
3169
|
+
return this.events[e] || (this.events[e] = new Jn()), this.events[e].add(n);
|
|
1875
3170
|
}
|
|
1876
3171
|
notify(e, ...n) {
|
|
1877
3172
|
this.events[e] && this.events[e].notify(...n);
|
|
1878
3173
|
}
|
|
1879
3174
|
}
|
|
1880
|
-
class
|
|
3175
|
+
class Vs extends sa {
|
|
1881
3176
|
constructor() {
|
|
1882
|
-
super(...arguments), this.KeyframeResolver =
|
|
3177
|
+
super(...arguments), this.KeyframeResolver = Kn;
|
|
1883
3178
|
}
|
|
1884
3179
|
sortInstanceNodePosition(e, n) {
|
|
1885
|
-
return
|
|
3180
|
+
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
1886
3181
|
}
|
|
1887
3182
|
getBaseTargetFromProps(e, n) {
|
|
1888
3183
|
return e.style ? e.style[n] : void 0;
|
|
@@ -1893,87 +3188,87 @@ class Ss extends Dr {
|
|
|
1893
3188
|
handleChildMotionValue() {
|
|
1894
3189
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
1895
3190
|
const { children: e } = this.props;
|
|
1896
|
-
|
|
3191
|
+
F(e) && (this.childSubscription = e.on("change", (n) => {
|
|
1897
3192
|
this.current && (this.current.textContent = `${n}`);
|
|
1898
3193
|
}));
|
|
1899
3194
|
}
|
|
1900
3195
|
}
|
|
1901
|
-
|
|
3196
|
+
function ia(t) {
|
|
3197
|
+
return window.getComputedStyle(t);
|
|
3198
|
+
}
|
|
3199
|
+
class ra extends Vs {
|
|
1902
3200
|
constructor() {
|
|
1903
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
3201
|
+
super(...arguments), this.type = "html", this.renderInstance = ds;
|
|
1904
3202
|
}
|
|
1905
3203
|
readValueFromInstance(e, n) {
|
|
1906
|
-
if (
|
|
1907
|
-
const
|
|
1908
|
-
return
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
return typeof r == "string" ? r.trim() : r;
|
|
3204
|
+
if (z.has(n)) {
|
|
3205
|
+
const s = ht(n);
|
|
3206
|
+
return s && s.default || 0;
|
|
3207
|
+
} else {
|
|
3208
|
+
const s = ia(e), i = (Cn(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
3209
|
+
return typeof i == "string" ? i.trim() : i;
|
|
1913
3210
|
}
|
|
1914
|
-
var s;
|
|
1915
3211
|
}
|
|
1916
3212
|
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
1917
|
-
return
|
|
1918
|
-
return function({ top: r, left: o, right: a, bottom: l }) {
|
|
1919
|
-
return { x: { min: o, max: a }, y: { min: r, max: l } };
|
|
1920
|
-
}(function(r, o) {
|
|
1921
|
-
if (!o) return r;
|
|
1922
|
-
const a = o({ x: r.left, y: r.top }), l = o({ x: r.right, y: r.bottom });
|
|
1923
|
-
return { top: a.y, left: a.x, bottom: l.y, right: l.x };
|
|
1924
|
-
}(s.getBoundingClientRect(), i));
|
|
1925
|
-
}(e, n);
|
|
3213
|
+
return Xr(e, n);
|
|
1926
3214
|
}
|
|
1927
3215
|
build(e, n, s) {
|
|
1928
|
-
|
|
3216
|
+
Mt(e, n, s.transformTemplate);
|
|
1929
3217
|
}
|
|
1930
3218
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
1931
3219
|
return xt(e, n, s);
|
|
1932
3220
|
}
|
|
1933
3221
|
}
|
|
1934
|
-
class
|
|
3222
|
+
class oa extends Vs {
|
|
1935
3223
|
constructor() {
|
|
1936
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
3224
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = is;
|
|
1937
3225
|
}
|
|
1938
3226
|
getBaseTargetFromProps(e, n) {
|
|
1939
3227
|
return e[n];
|
|
1940
3228
|
}
|
|
1941
3229
|
readValueFromInstance(e, n) {
|
|
1942
|
-
if (
|
|
1943
|
-
const s =
|
|
3230
|
+
if (z.has(n)) {
|
|
3231
|
+
const s = ht(n);
|
|
1944
3232
|
return s && s.default || 0;
|
|
1945
3233
|
}
|
|
1946
|
-
return n =
|
|
3234
|
+
return n = fs.has(n) ? n : wt(n), e.getAttribute(n);
|
|
1947
3235
|
}
|
|
1948
3236
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
1949
|
-
return
|
|
3237
|
+
return ms(e, n, s);
|
|
1950
3238
|
}
|
|
1951
3239
|
build(e, n, s) {
|
|
1952
|
-
|
|
3240
|
+
Ct(e, n, this.isSVGTag, s.transformTemplate);
|
|
1953
3241
|
}
|
|
1954
3242
|
renderInstance(e, n, s, i) {
|
|
1955
|
-
|
|
3243
|
+
hs(e, n, s, i);
|
|
1956
3244
|
}
|
|
1957
3245
|
mount(e) {
|
|
1958
|
-
this.isSVGTag =
|
|
3246
|
+
this.isSVGTag = Pt(e.tagName), super.mount(e);
|
|
1959
3247
|
}
|
|
1960
3248
|
}
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
3249
|
+
const aa = (t, e) => St(t) ? new oa(e) : new ra(e, {
|
|
3250
|
+
allowProjection: t !== hn
|
|
3251
|
+
}), la = /* @__PURE__ */ Jo(), ua = /* @__PURE__ */ ks(la);
|
|
3252
|
+
function ca({ children: t, features: e, strict: n = !1 }) {
|
|
3253
|
+
const [, s] = Ps(!$e(e)), i = Z(void 0);
|
|
3254
|
+
if (!$e(e)) {
|
|
1964
3255
|
const { renderer: r, ...o } = e;
|
|
1965
|
-
i.current = r,
|
|
3256
|
+
i.current = r, et(o);
|
|
1966
3257
|
}
|
|
1967
|
-
return
|
|
1968
|
-
|
|
1969
|
-
|
|
3258
|
+
return nt(() => {
|
|
3259
|
+
$e(e) && e().then(({ renderer: r, ...o }) => {
|
|
3260
|
+
et(o), i.current = r, s(!0);
|
|
1970
3261
|
});
|
|
1971
|
-
}, []),
|
|
3262
|
+
}, []), E(Vt.Provider, { value: { renderer: i.current, strict: n }, children: t });
|
|
1972
3263
|
}
|
|
1973
|
-
function
|
|
3264
|
+
function $e(t) {
|
|
1974
3265
|
return typeof t == "function";
|
|
1975
3266
|
}
|
|
1976
|
-
const
|
|
3267
|
+
const da = {
|
|
3268
|
+
renderer: aa,
|
|
3269
|
+
...Gr,
|
|
3270
|
+
...bo
|
|
3271
|
+
}, fa = Fs(ua.div)`
|
|
1977
3272
|
${({ theme: t }) => `
|
|
1978
3273
|
background-color: ${t.palette.white};
|
|
1979
3274
|
box-shadow: ${t.shadows.lg};
|
|
@@ -1996,14 +3291,166 @@ const $r = { renderer: (t, e) => Tt(t) ? new Nr(e) : new Br(e, { allowProjection
|
|
|
1996
3291
|
height: auto;
|
|
1997
3292
|
}
|
|
1998
3293
|
`}
|
|
1999
|
-
`,
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
3294
|
+
`, Fa = ({
|
|
3295
|
+
children: t,
|
|
3296
|
+
closeIconId: e = "close-menu",
|
|
3297
|
+
isOpen: n,
|
|
3298
|
+
items: s,
|
|
3299
|
+
onClose: i,
|
|
3300
|
+
primaryButtonText: r,
|
|
3301
|
+
primaryOnClick: o,
|
|
3302
|
+
secondaryButtonText: a,
|
|
3303
|
+
secondaryOnClick: l,
|
|
3304
|
+
title: u
|
|
3305
|
+
}) => {
|
|
3306
|
+
const c = Ds(), f = Z(null), d = fn(
|
|
3307
|
+
(h) => () => {
|
|
3308
|
+
h(), i();
|
|
3309
|
+
},
|
|
3310
|
+
[i]
|
|
3311
|
+
);
|
|
3312
|
+
return Es(
|
|
3313
|
+
f.current,
|
|
3314
|
+
() => {
|
|
3315
|
+
i();
|
|
3316
|
+
},
|
|
3317
|
+
!0
|
|
3318
|
+
), /* @__PURE__ */ E(ca, { features: da, children: /* @__PURE__ */ E(
|
|
3319
|
+
fa,
|
|
3320
|
+
{
|
|
3321
|
+
animate: n ? {
|
|
3322
|
+
display: "block",
|
|
3323
|
+
x: 0
|
|
3324
|
+
} : {
|
|
3325
|
+
transitionEnd: {
|
|
3326
|
+
display: "none"
|
|
3327
|
+
},
|
|
3328
|
+
x: "100%"
|
|
3329
|
+
},
|
|
3330
|
+
initial: {
|
|
3331
|
+
display: "none",
|
|
3332
|
+
x: "100%"
|
|
3333
|
+
},
|
|
3334
|
+
ref: f,
|
|
3335
|
+
transition: {
|
|
3336
|
+
bounce: 0,
|
|
3337
|
+
duration: 0.6,
|
|
3338
|
+
type: "spring"
|
|
3339
|
+
},
|
|
3340
|
+
children: /* @__PURE__ */ Y(q, { height: "100%", position: "relative", children: [
|
|
3341
|
+
/* @__PURE__ */ Y(
|
|
3342
|
+
q,
|
|
3343
|
+
{
|
|
3344
|
+
alignItems: "center",
|
|
3345
|
+
bgColor: c.palette.white,
|
|
3346
|
+
borderBottom: "1px solid",
|
|
3347
|
+
borderColor: c.palette.gray[200],
|
|
3348
|
+
display: "flex",
|
|
3349
|
+
gap: 1.25,
|
|
3350
|
+
justify: "space-between",
|
|
3351
|
+
padding: [1.25, 1.25, 1.25, 1.25],
|
|
3352
|
+
position: "sticky",
|
|
3353
|
+
top: "0",
|
|
3354
|
+
zIndex: 40,
|
|
3355
|
+
children: [
|
|
3356
|
+
/* @__PURE__ */ E(
|
|
3357
|
+
Os,
|
|
3358
|
+
{
|
|
3359
|
+
color: c.palette.black,
|
|
3360
|
+
display: "inline",
|
|
3361
|
+
fontWeight: "bold",
|
|
3362
|
+
size: "xl",
|
|
3363
|
+
children: u
|
|
3364
|
+
}
|
|
3365
|
+
),
|
|
3366
|
+
/* @__PURE__ */ E(
|
|
3367
|
+
Is,
|
|
3368
|
+
{
|
|
3369
|
+
icon: "close",
|
|
3370
|
+
iconColor: c.palette.gray[400],
|
|
3371
|
+
iconSize: "xs",
|
|
3372
|
+
iconTransform: "grow-4",
|
|
3373
|
+
iconType: "fa-light",
|
|
3374
|
+
id: e,
|
|
3375
|
+
onClick: i,
|
|
3376
|
+
px: 0.25,
|
|
3377
|
+
py: 0.25,
|
|
3378
|
+
variant: "ghost"
|
|
3379
|
+
}
|
|
3380
|
+
)
|
|
3381
|
+
]
|
|
3382
|
+
}
|
|
3383
|
+
),
|
|
3384
|
+
/* @__PURE__ */ Y(
|
|
3385
|
+
q,
|
|
3386
|
+
{
|
|
3387
|
+
display: "flex",
|
|
3388
|
+
flexDirection: "column",
|
|
3389
|
+
justify: "space-between",
|
|
3390
|
+
minHeight: "100vh",
|
|
3391
|
+
children: [
|
|
3392
|
+
/* @__PURE__ */ Y(q, { py: 1.25, children: [
|
|
3393
|
+
(s ?? []).map(
|
|
3394
|
+
({
|
|
3395
|
+
customBadge: h,
|
|
3396
|
+
description: y,
|
|
3397
|
+
icon: v,
|
|
3398
|
+
onClick: b,
|
|
3399
|
+
requiresUpgrade: p,
|
|
3400
|
+
title: g
|
|
3401
|
+
}) => /* @__PURE__ */ E(
|
|
3402
|
+
Rs,
|
|
3403
|
+
{
|
|
3404
|
+
customBadge: h,
|
|
3405
|
+
description: y,
|
|
3406
|
+
icon: v,
|
|
3407
|
+
onClick: d(b),
|
|
3408
|
+
requiresUpgrade: p,
|
|
3409
|
+
title: g
|
|
3410
|
+
},
|
|
3411
|
+
g
|
|
3412
|
+
)
|
|
3413
|
+
),
|
|
3414
|
+
t && /* @__PURE__ */ E(q, { px: 1.25, children: t })
|
|
3415
|
+
] }),
|
|
3416
|
+
r === void 0 ? void 0 : /* @__PURE__ */ Y(
|
|
3417
|
+
q,
|
|
3418
|
+
{
|
|
3419
|
+
alignItems: "center",
|
|
3420
|
+
bgColor: c.palette.white,
|
|
3421
|
+
borderColor: c.palette.gray[200],
|
|
3422
|
+
borderTop: "1px solid",
|
|
3423
|
+
bottom: "0",
|
|
3424
|
+
display: "flex",
|
|
3425
|
+
gap: 1.25,
|
|
3426
|
+
justify: "end",
|
|
3427
|
+
padding: [1.25, 1.25, 1.25, 1.25],
|
|
3428
|
+
position: "sticky",
|
|
3429
|
+
width: "100%",
|
|
3430
|
+
zIndex: 40,
|
|
3431
|
+
children: [
|
|
3432
|
+
a === void 0 ? void 0 : /* @__PURE__ */ E(
|
|
3433
|
+
Rt,
|
|
3434
|
+
{
|
|
3435
|
+
color: `${c.palette.primary[500]} !important`,
|
|
3436
|
+
onClick: l,
|
|
3437
|
+
pl: 0.5,
|
|
3438
|
+
pr: 0.5,
|
|
3439
|
+
variant: "ghost",
|
|
3440
|
+
children: a
|
|
3441
|
+
}
|
|
3442
|
+
),
|
|
3443
|
+
/* @__PURE__ */ E(Rt, { onClick: o, type: "submit", children: r })
|
|
3444
|
+
]
|
|
3445
|
+
}
|
|
3446
|
+
)
|
|
3447
|
+
]
|
|
3448
|
+
}
|
|
3449
|
+
)
|
|
3450
|
+
] })
|
|
3451
|
+
}
|
|
3452
|
+
) });
|
|
2006
3453
|
};
|
|
2007
3454
|
export {
|
|
2008
|
-
|
|
3455
|
+
Fa as SlideOutMenu
|
|
2009
3456
|
};
|