react-emotion-face 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -1
- package/dist/react-emotion-face.es.js +401 -378
- package/dist/react-emotion-face.umd.cjs +2 -2
- package/package.json +12 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as f, Fragment as wr, jsxs as C } from "react/jsx-runtime";
|
|
2
2
|
import * as Ne from "react";
|
|
3
|
-
import
|
|
3
|
+
import Tr, { createContext as xt, useRef as Z, useId as We, useContext as B, useInsertionEffect as zi, useCallback as Ue, useMemo as lt, useEffect as $e, Children as Pr, isValidElement as Ar, useLayoutEffect as Cr, useState as Cn, forwardRef as Vr, Fragment as Gi, createElement as Dr, Component as Mr } from "react";
|
|
4
4
|
const _e = xt({});
|
|
5
5
|
function Ke(t) {
|
|
6
6
|
const e = Z(null);
|
|
@@ -30,7 +30,7 @@ class kr extends Ne.Component {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
function Er({ children: t, isPresent: e }) {
|
|
33
|
-
const n =
|
|
33
|
+
const n = We(), i = Z(null), s = Z({
|
|
34
34
|
width: 0,
|
|
35
35
|
height: 0,
|
|
36
36
|
top: 0,
|
|
@@ -53,10 +53,10 @@ function Er({ children: t, isPresent: e }) {
|
|
|
53
53
|
`), () => {
|
|
54
54
|
document.head.removeChild(u);
|
|
55
55
|
};
|
|
56
|
-
}, [e]),
|
|
56
|
+
}, [e]), f(kr, { isPresent: e, childRef: i, sizeRef: s, children: Ne.cloneElement(t, { ref: i }) });
|
|
57
57
|
}
|
|
58
58
|
const Rr = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom: s, presenceAffectsLayout: o, mode: r }) => {
|
|
59
|
-
const a = Ke(Lr), l =
|
|
59
|
+
const a = Ke(Lr), l = We(), c = Ue((h) => {
|
|
60
60
|
a.set(h, !0);
|
|
61
61
|
for (const d of a.values())
|
|
62
62
|
if (!d)
|
|
@@ -82,7 +82,7 @@ const Rr = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom:
|
|
|
82
82
|
a.forEach((h, d) => a.set(d, !1));
|
|
83
83
|
}, [n]), Ne.useEffect(() => {
|
|
84
84
|
!n && !a.size && i && i();
|
|
85
|
-
}, [n]), r === "popLayout" && (t =
|
|
85
|
+
}, [n]), r === "popLayout" && (t = f(Er, { isPresent: n, children: t })), f(te.Provider, { value: u, children: t });
|
|
86
86
|
};
|
|
87
87
|
function Lr() {
|
|
88
88
|
return /* @__PURE__ */ new Map();
|
|
@@ -91,14 +91,14 @@ function Hi(t = !0) {
|
|
|
91
91
|
const e = B(te);
|
|
92
92
|
if (e === null)
|
|
93
93
|
return [!0, null];
|
|
94
|
-
const { isPresent: n, onExitComplete: i, register: s } = e, o =
|
|
94
|
+
const { isPresent: n, onExitComplete: i, register: s } = e, o = We();
|
|
95
95
|
$e(() => {
|
|
96
96
|
t && s(o);
|
|
97
97
|
}, [t]);
|
|
98
|
-
const r =
|
|
98
|
+
const r = Ue(() => t && i && i(o), [o, i, t]);
|
|
99
99
|
return !n && i ? [!1, r] : [!0];
|
|
100
100
|
}
|
|
101
|
-
const
|
|
101
|
+
const Wt = (t) => t.key || "";
|
|
102
102
|
function Vn(t) {
|
|
103
103
|
const e = [];
|
|
104
104
|
return Pr.forEach(t, (n) => {
|
|
@@ -106,19 +106,19 @@ function Vn(t) {
|
|
|
106
106
|
}), e;
|
|
107
107
|
}
|
|
108
108
|
const Ge = typeof window < "u", qi = Ge ? Cr : $e, ee = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presenceAffectsLayout: s = !0, mode: o = "sync", propagate: r = !1 }) => {
|
|
109
|
-
const [a, l] = Hi(r), c = lt(() => Vn(t), [t]), u = r && !a ? [] : c.map(
|
|
109
|
+
const [a, l] = Hi(r), c = lt(() => Vn(t), [t]), u = r && !a ? [] : c.map(Wt), h = Z(!0), d = Z(c), p = Ke(() => /* @__PURE__ */ new Map()), [m, g] = Cn(c), [v, y] = Cn(c);
|
|
110
110
|
qi(() => {
|
|
111
111
|
h.current = !1, d.current = c;
|
|
112
112
|
for (let P = 0; P < v.length; P++) {
|
|
113
|
-
const x =
|
|
114
|
-
u.includes(x) ?
|
|
113
|
+
const x = Wt(v[P]);
|
|
114
|
+
u.includes(x) ? p.delete(x) : p.get(x) !== !0 && p.set(x, !1);
|
|
115
115
|
}
|
|
116
116
|
}, [v, u.length, u.join("-")]);
|
|
117
117
|
const S = [];
|
|
118
118
|
if (c !== m) {
|
|
119
119
|
let P = [...c];
|
|
120
120
|
for (let x = 0; x < v.length; x++) {
|
|
121
|
-
const A = v[x], k =
|
|
121
|
+
const A = v[x], k = Wt(A);
|
|
122
122
|
u.includes(k) || (P.splice(x, 0, A), S.push(A));
|
|
123
123
|
}
|
|
124
124
|
o === "wait" && S.length && (P = S), y(Vn(P)), g(c);
|
|
@@ -126,18 +126,18 @@ const Ge = typeof window < "u", qi = Ge ? Cr : $e, ee = ({ children: t, custom:
|
|
|
126
126
|
}
|
|
127
127
|
process.env.NODE_ENV !== "production" && o === "wait" && v.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
128
128
|
const { forceRender: b } = B(_e);
|
|
129
|
-
return
|
|
130
|
-
const x =
|
|
131
|
-
if (
|
|
132
|
-
|
|
129
|
+
return f(wr, { children: v.map((P) => {
|
|
130
|
+
const x = Wt(P), A = r && !a ? !1 : c === v || u.includes(x), k = () => {
|
|
131
|
+
if (p.has(x))
|
|
132
|
+
p.set(x, !0);
|
|
133
133
|
else
|
|
134
134
|
return;
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
L || (
|
|
138
|
-
}),
|
|
135
|
+
let T = !0;
|
|
136
|
+
p.forEach((L) => {
|
|
137
|
+
L || (T = !1);
|
|
138
|
+
}), T && (b == null || b(), y(d.current), r && (l == null || l()), i && i());
|
|
139
139
|
};
|
|
140
|
-
return
|
|
140
|
+
return f(Rr, { isPresent: A, initial: !h.current || n ? void 0 : !1, custom: A ? void 0 : e, presenceAffectsLayout: s, mode: o, onExitComplete: A ? void 0 : k, children: P }, x);
|
|
141
141
|
}) });
|
|
142
142
|
}, j = /* @__NO_SIDE_EFFECTS__ */ (t) => t;
|
|
143
143
|
let St = j, J = j;
|
|
@@ -174,8 +174,8 @@ function Br(t) {
|
|
|
174
174
|
* Schedule a process to run on the next frame.
|
|
175
175
|
*/
|
|
176
176
|
schedule: (c, u = !1, h = !1) => {
|
|
177
|
-
const
|
|
178
|
-
return u && o.add(c),
|
|
177
|
+
const p = h && i ? e : n;
|
|
178
|
+
return u && o.add(c), p.has(c) || p.add(c), c;
|
|
179
179
|
},
|
|
180
180
|
/**
|
|
181
181
|
* Cancel the provided callback from running on the next frame.
|
|
@@ -196,7 +196,7 @@ function Br(t) {
|
|
|
196
196
|
};
|
|
197
197
|
return l;
|
|
198
198
|
}
|
|
199
|
-
const
|
|
199
|
+
const Ut = [
|
|
200
200
|
"read",
|
|
201
201
|
// Read
|
|
202
202
|
"resolveKeyframes",
|
|
@@ -216,18 +216,18 @@ function Yi(t, e) {
|
|
|
216
216
|
delta: 0,
|
|
217
217
|
timestamp: 0,
|
|
218
218
|
isProcessing: !1
|
|
219
|
-
}, o = () => n = !0, r =
|
|
219
|
+
}, o = () => n = !0, r = Ut.reduce((y, S) => (y[S] = Br(o), y), {}), { read: a, resolveKeyframes: l, update: c, preRender: u, render: h, postRender: d } = r, p = () => {
|
|
220
220
|
const y = performance.now();
|
|
221
|
-
n = !1, s.delta = i ? 1e3 / 60 : Math.max(Math.min(y - s.timestamp, Or), 1), s.timestamp = y, s.isProcessing = !0, a.process(s), l.process(s), c.process(s), u.process(s), h.process(s), d.process(s), s.isProcessing = !1, n && e && (i = !1, t(
|
|
221
|
+
n = !1, s.delta = i ? 1e3 / 60 : Math.max(Math.min(y - s.timestamp, Or), 1), s.timestamp = y, s.isProcessing = !0, a.process(s), l.process(s), c.process(s), u.process(s), h.process(s), d.process(s), s.isProcessing = !1, n && e && (i = !1, t(p));
|
|
222
222
|
}, m = () => {
|
|
223
|
-
n = !0, i = !0, s.isProcessing || t(
|
|
223
|
+
n = !0, i = !0, s.isProcessing || t(p);
|
|
224
224
|
};
|
|
225
|
-
return { schedule:
|
|
225
|
+
return { schedule: Ut.reduce((y, S) => {
|
|
226
226
|
const b = r[S];
|
|
227
227
|
return y[S] = (P, x = !1, A = !1) => (n || m(), b.schedule(P, x, A)), y;
|
|
228
228
|
}, {}), cancel: (y) => {
|
|
229
|
-
for (let S = 0; S <
|
|
230
|
-
r[
|
|
229
|
+
for (let S = 0; S < Ut.length; S++)
|
|
230
|
+
r[Ut[S]].cancel(y);
|
|
231
231
|
}, state: s, steps: r };
|
|
232
232
|
}
|
|
233
233
|
const { schedule: V, cancel: tt, state: R, steps: ue } = Yi(typeof requestAnimationFrame < "u" ? requestAnimationFrame : j, !0), Xi = xt({ strict: !1 }), Dn = {
|
|
@@ -304,7 +304,7 @@ try {
|
|
|
304
304
|
Nr(require("@emotion/is-prop-valid").default);
|
|
305
305
|
} catch {
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function Wr(t, e, n) {
|
|
308
308
|
const i = {};
|
|
309
309
|
for (const s in t)
|
|
310
310
|
s === "values" && typeof t.values == "object" || (Qi(s) || n === !0 && Ht(s) || !e && !Ht(s) || // If trying to use native HTML drag events, forward drag listeners
|
|
@@ -315,7 +315,7 @@ const Mn = /* @__PURE__ */ new Set();
|
|
|
315
315
|
function ne(t, e, n) {
|
|
316
316
|
t || Mn.has(e) || (console.warn(e), Mn.add(e));
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Ur(t) {
|
|
319
319
|
if (typeof Proxy > "u")
|
|
320
320
|
return t;
|
|
321
321
|
const e = /* @__PURE__ */ new Map(), n = (...i) => (process.env.NODE_ENV !== "production" && ne(!1, "motion() is deprecated. Use motion.create() instead."), t(...i));
|
|
@@ -372,7 +372,7 @@ function ht(t) {
|
|
|
372
372
|
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
373
373
|
}
|
|
374
374
|
function zr(t, e, n) {
|
|
375
|
-
return
|
|
375
|
+
return Ue(
|
|
376
376
|
(i) => {
|
|
377
377
|
i && t.onMount && t.onMount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) : ht(n) && (n.current = i));
|
|
378
378
|
},
|
|
@@ -396,8 +396,8 @@ function Hr(t, e, n, i, s) {
|
|
|
396
396
|
blockInitialAnimation: c ? c.initial === !1 : !1,
|
|
397
397
|
reducedMotionConfig: u
|
|
398
398
|
}));
|
|
399
|
-
const d = h.current,
|
|
400
|
-
d && !d.projection && s && (d.type === "html" || d.type === "svg") && qr(h.current, n, s,
|
|
399
|
+
const d = h.current, p = B(ts);
|
|
400
|
+
d && !d.projection && s && (d.type === "html" || d.type === "svg") && qr(h.current, n, s, p);
|
|
401
401
|
const m = Z(!1);
|
|
402
402
|
zi(() => {
|
|
403
403
|
d && m.current && d.update(n, c);
|
|
@@ -445,13 +445,13 @@ function Yr({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVis
|
|
|
445
445
|
...B(ze),
|
|
446
446
|
...c,
|
|
447
447
|
layoutId: Xr(c)
|
|
448
|
-
}, { isStatic:
|
|
449
|
-
if (!
|
|
448
|
+
}, { isStatic: p } = d, m = _r(c), g = i(c, p);
|
|
449
|
+
if (!p && Ge) {
|
|
450
450
|
Qr(d, t);
|
|
451
451
|
const v = Zr(d);
|
|
452
452
|
h = v.MeasureLayout, m.visualElement = Hr(s, g, d, e, v.ProjectionNode);
|
|
453
453
|
}
|
|
454
|
-
return C(ie.Provider, { value: m, children: [h && m.visualElement ?
|
|
454
|
+
return C(ie.Provider, { value: m, children: [h && m.visualElement ? f(h, { visualElement: m.visualElement, ...d }) : null, n(s, c, zr(g, m.visualElement, u), g, p, m.visualElement)] });
|
|
455
455
|
}
|
|
456
456
|
a.displayName = `motion.${typeof s == "string" ? s : `create(${(r = (o = s.displayName) !== null && o !== void 0 ? o : s.name) !== null && r !== void 0 ? r : ""})`}`;
|
|
457
457
|
const l = Vr(a);
|
|
@@ -542,7 +542,7 @@ function Je(t, e, n, i) {
|
|
|
542
542
|
}
|
|
543
543
|
return e;
|
|
544
544
|
}
|
|
545
|
-
const
|
|
545
|
+
const Te = (t) => Array.isArray(t), to = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), eo = (t) => Te(t) ? t[t.length - 1] || 0 : t, O = (t) => !!(t && t.getVelocity);
|
|
546
546
|
function Kt(t) {
|
|
547
547
|
const e = O(t) ? t.get() : t;
|
|
548
548
|
return to(e) ? e.toValue() : e;
|
|
@@ -570,8 +570,8 @@ function io(t, e, n, i) {
|
|
|
570
570
|
const h = u ? a : r;
|
|
571
571
|
if (h && typeof h != "boolean" && !se(h)) {
|
|
572
572
|
const d = Array.isArray(h) ? h : [h];
|
|
573
|
-
for (let
|
|
574
|
-
const m = Je(t, d[
|
|
573
|
+
for (let p = 0; p < d.length; p++) {
|
|
574
|
+
const m = Je(t, d[p]);
|
|
575
575
|
if (m) {
|
|
576
576
|
const { transitionEnd: g, transition: v, ...y } = m;
|
|
577
577
|
for (const S in y) {
|
|
@@ -607,60 +607,60 @@ const bt = [
|
|
|
607
607
|
"skew",
|
|
608
608
|
"skewX",
|
|
609
609
|
"skewY"
|
|
610
|
-
], ct = new Set(bt), is = (t) => (e) => typeof e == "string" && e.startsWith(t), ss = /* @__PURE__ */ is("--"), so = /* @__PURE__ */ is("var(--"), tn = (t) => so(t) ? ro.test(t.split("/*")[0].trim()) : !1, ro = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, rs = (t, e) => e && typeof t == "number" ? e.transform(t) : t, X = (t, e, n) => n > e ? e : n < t ? t : n,
|
|
610
|
+
], ct = new Set(bt), is = (t) => (e) => typeof e == "string" && e.startsWith(t), ss = /* @__PURE__ */ is("--"), so = /* @__PURE__ */ is("var(--"), tn = (t) => so(t) ? ro.test(t.split("/*")[0].trim()) : !1, ro = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, rs = (t, e) => e && typeof t == "number" ? e.transform(t) : t, X = (t, e, n) => n > e ? e : n < t ? t : n, wt = {
|
|
611
611
|
test: (t) => typeof t == "number",
|
|
612
612
|
parse: parseFloat,
|
|
613
613
|
transform: (t) => t
|
|
614
614
|
}, Rt = {
|
|
615
|
-
...
|
|
615
|
+
...wt,
|
|
616
616
|
transform: (t) => X(0, 1, t)
|
|
617
617
|
}, $t = {
|
|
618
|
-
...
|
|
618
|
+
...wt,
|
|
619
619
|
default: 1
|
|
620
620
|
}, Ot = (t) => ({
|
|
621
621
|
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
622
622
|
parse: parseFloat,
|
|
623
623
|
transform: (e) => `${e}${t}`
|
|
624
|
-
}), Q = /* @__PURE__ */ Ot("deg"), G = /* @__PURE__ */ Ot("%"),
|
|
624
|
+
}), Q = /* @__PURE__ */ Ot("deg"), G = /* @__PURE__ */ Ot("%"), w = /* @__PURE__ */ Ot("px"), oo = /* @__PURE__ */ Ot("vh"), ao = /* @__PURE__ */ Ot("vw"), Rn = {
|
|
625
625
|
...G,
|
|
626
626
|
parse: (t) => G.parse(t) / 100,
|
|
627
627
|
transform: (t) => G.transform(t * 100)
|
|
628
628
|
}, lo = {
|
|
629
629
|
// Border props
|
|
630
|
-
borderWidth:
|
|
631
|
-
borderTopWidth:
|
|
632
|
-
borderRightWidth:
|
|
633
|
-
borderBottomWidth:
|
|
634
|
-
borderLeftWidth:
|
|
635
|
-
borderRadius:
|
|
636
|
-
radius:
|
|
637
|
-
borderTopLeftRadius:
|
|
638
|
-
borderTopRightRadius:
|
|
639
|
-
borderBottomRightRadius:
|
|
640
|
-
borderBottomLeftRadius:
|
|
630
|
+
borderWidth: w,
|
|
631
|
+
borderTopWidth: w,
|
|
632
|
+
borderRightWidth: w,
|
|
633
|
+
borderBottomWidth: w,
|
|
634
|
+
borderLeftWidth: w,
|
|
635
|
+
borderRadius: w,
|
|
636
|
+
radius: w,
|
|
637
|
+
borderTopLeftRadius: w,
|
|
638
|
+
borderTopRightRadius: w,
|
|
639
|
+
borderBottomRightRadius: w,
|
|
640
|
+
borderBottomLeftRadius: w,
|
|
641
641
|
// Positioning props
|
|
642
|
-
width:
|
|
643
|
-
maxWidth:
|
|
644
|
-
height:
|
|
645
|
-
maxHeight:
|
|
646
|
-
top:
|
|
647
|
-
right:
|
|
648
|
-
bottom:
|
|
649
|
-
left:
|
|
642
|
+
width: w,
|
|
643
|
+
maxWidth: w,
|
|
644
|
+
height: w,
|
|
645
|
+
maxHeight: w,
|
|
646
|
+
top: w,
|
|
647
|
+
right: w,
|
|
648
|
+
bottom: w,
|
|
649
|
+
left: w,
|
|
650
650
|
// Spacing props
|
|
651
|
-
padding:
|
|
652
|
-
paddingTop:
|
|
653
|
-
paddingRight:
|
|
654
|
-
paddingBottom:
|
|
655
|
-
paddingLeft:
|
|
656
|
-
margin:
|
|
657
|
-
marginTop:
|
|
658
|
-
marginRight:
|
|
659
|
-
marginBottom:
|
|
660
|
-
marginLeft:
|
|
651
|
+
padding: w,
|
|
652
|
+
paddingTop: w,
|
|
653
|
+
paddingRight: w,
|
|
654
|
+
paddingBottom: w,
|
|
655
|
+
paddingLeft: w,
|
|
656
|
+
margin: w,
|
|
657
|
+
marginTop: w,
|
|
658
|
+
marginRight: w,
|
|
659
|
+
marginBottom: w,
|
|
660
|
+
marginLeft: w,
|
|
661
661
|
// Misc
|
|
662
|
-
backgroundPositionX:
|
|
663
|
-
backgroundPositionY:
|
|
662
|
+
backgroundPositionX: w,
|
|
663
|
+
backgroundPositionY: w
|
|
664
664
|
}, co = {
|
|
665
665
|
rotate: Q,
|
|
666
666
|
rotateX: Q,
|
|
@@ -673,27 +673,27 @@ const bt = [
|
|
|
673
673
|
skew: Q,
|
|
674
674
|
skewX: Q,
|
|
675
675
|
skewY: Q,
|
|
676
|
-
distance:
|
|
677
|
-
translateX:
|
|
678
|
-
translateY:
|
|
679
|
-
translateZ:
|
|
680
|
-
x:
|
|
681
|
-
y:
|
|
682
|
-
z:
|
|
683
|
-
perspective:
|
|
684
|
-
transformPerspective:
|
|
676
|
+
distance: w,
|
|
677
|
+
translateX: w,
|
|
678
|
+
translateY: w,
|
|
679
|
+
translateZ: w,
|
|
680
|
+
x: w,
|
|
681
|
+
y: w,
|
|
682
|
+
z: w,
|
|
683
|
+
perspective: w,
|
|
684
|
+
transformPerspective: w,
|
|
685
685
|
opacity: Rt,
|
|
686
686
|
originX: Rn,
|
|
687
687
|
originY: Rn,
|
|
688
|
-
originZ:
|
|
688
|
+
originZ: w
|
|
689
689
|
}, Ln = {
|
|
690
|
-
...
|
|
690
|
+
...wt,
|
|
691
691
|
transform: Math.round
|
|
692
692
|
}, en = {
|
|
693
693
|
...lo,
|
|
694
694
|
...co,
|
|
695
695
|
zIndex: Ln,
|
|
696
|
-
size:
|
|
696
|
+
size: w,
|
|
697
697
|
// SVG
|
|
698
698
|
fillOpacity: Rt,
|
|
699
699
|
strokeOpacity: Rt,
|
|
@@ -754,12 +754,12 @@ const po = {
|
|
|
754
754
|
function go(t, e, n = 1, i = 0, s = !0) {
|
|
755
755
|
t.pathLength = 1;
|
|
756
756
|
const o = s ? po : mo;
|
|
757
|
-
t[o.offset] =
|
|
758
|
-
const r =
|
|
757
|
+
t[o.offset] = w.transform(-i);
|
|
758
|
+
const r = w.transform(e), a = w.transform(n);
|
|
759
759
|
t[o.array] = `${r} ${a}`;
|
|
760
760
|
}
|
|
761
761
|
function Fn(t, e, n) {
|
|
762
|
-
return typeof t == "string" ? t :
|
|
762
|
+
return typeof t == "string" ? t : w.transform(e + n * t);
|
|
763
763
|
}
|
|
764
764
|
function yo(t, e, n) {
|
|
765
765
|
const i = Fn(e, t.x, t.width), s = Fn(n, t.y, t.height);
|
|
@@ -782,8 +782,8 @@ function sn(t, {
|
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
784
784
|
t.attrs = t.style, t.style = {};
|
|
785
|
-
const { attrs: d, style:
|
|
786
|
-
d.transform && (m && (
|
|
785
|
+
const { attrs: d, style: p, dimensions: m } = t;
|
|
786
|
+
d.transform && (m && (p.transform = d.transform), delete d.transform), m && (s !== void 0 || o !== void 0 || p.transform) && (p.transformOrigin = yo(m, s !== void 0 ? s : 0.5, o !== void 0 ? o : 0.5)), e !== void 0 && (d.x = e), n !== void 0 && (d.y = n), i !== void 0 && (d.scale = i), r !== void 0 && go(d, r, a, l, !1);
|
|
787
787
|
}
|
|
788
788
|
const rn = () => ({
|
|
789
789
|
style: {},
|
|
@@ -904,18 +904,18 @@ function ds(t, e, n) {
|
|
|
904
904
|
for (const i in e)
|
|
905
905
|
!O(e[i]) && !us(i, n) && (t[i] = e[i]);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function wo({ transformTemplate: t }, e) {
|
|
908
908
|
return lt(() => {
|
|
909
909
|
const n = rn();
|
|
910
910
|
return nn(n, e, t), Object.assign({}, n.vars, n.style);
|
|
911
911
|
}, [e]);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function To(t, e) {
|
|
914
914
|
const n = t.style || {}, i = {};
|
|
915
|
-
return ds(i, n, t), Object.assign(i,
|
|
915
|
+
return ds(i, n, t), Object.assign(i, wo(t, e)), i;
|
|
916
916
|
}
|
|
917
917
|
function Po(t, e) {
|
|
918
|
-
const n = {}, i =
|
|
918
|
+
const n = {}, i = To(t, e);
|
|
919
919
|
return t.drag && t.dragListener !== !1 && (n.draggable = !1, i.userSelect = i.WebkitUserSelect = i.WebkitTouchCallout = "none", i.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 = i, n;
|
|
920
920
|
}
|
|
921
921
|
function Ao(t, e, n, i) {
|
|
@@ -934,7 +934,7 @@ function Ao(t, e, n, i) {
|
|
|
934
934
|
}
|
|
935
935
|
function Co(t = !1) {
|
|
936
936
|
return (n, i, s, { latestValues: o }, r) => {
|
|
937
|
-
const l = (Ze(n) ? Ao : Po)(i, o, r, n), c =
|
|
937
|
+
const l = (Ze(n) ? Ao : Po)(i, o, r, n), c = Wr(i, typeof n == "string", t), u = n !== Gi ? { ...c, ...l, ref: s } : {}, { children: h } = i, d = lt(() => O(h) ? h.get() : h, [h]);
|
|
938
938
|
return Dr(n, {
|
|
939
939
|
...u,
|
|
940
940
|
children: d
|
|
@@ -1192,12 +1192,12 @@ function jo(t, e, n = {}) {
|
|
|
1192
1192
|
if (!Nn(a) || At.has(l))
|
|
1193
1193
|
return;
|
|
1194
1194
|
At.add(l);
|
|
1195
|
-
const c = e(a), u = (
|
|
1196
|
-
window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", d), !(!Nn(
|
|
1197
|
-
}, h = (
|
|
1198
|
-
u(
|
|
1199
|
-
}, d = (
|
|
1200
|
-
u(
|
|
1195
|
+
const c = e(a), u = (p, m) => {
|
|
1196
|
+
window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", d), !(!Nn(p) || !At.has(l)) && (At.delete(l), typeof c == "function" && c(p, { success: m }));
|
|
1197
|
+
}, h = (p) => {
|
|
1198
|
+
u(p, n.useGlobalTarget || Ss(l, p.target));
|
|
1199
|
+
}, d = (p) => {
|
|
1200
|
+
u(p, !1);
|
|
1201
1201
|
};
|
|
1202
1202
|
window.addEventListener("pointerup", h, s), window.addEventListener("pointercancel", d, s);
|
|
1203
1203
|
};
|
|
@@ -1222,13 +1222,13 @@ const bs = /* @__PURE__ */ new Set([
|
|
|
1222
1222
|
...bt
|
|
1223
1223
|
]);
|
|
1224
1224
|
let zt;
|
|
1225
|
-
function
|
|
1225
|
+
function Wo() {
|
|
1226
1226
|
zt = void 0;
|
|
1227
1227
|
}
|
|
1228
1228
|
const H = {
|
|
1229
1229
|
now: () => (zt === void 0 && H.set(R.isProcessing || Fr.useManualTiming ? R.timestamp : performance.now()), zt),
|
|
1230
1230
|
set: (t) => {
|
|
1231
|
-
zt = t, queueMicrotask(
|
|
1231
|
+
zt = t, queueMicrotask(Wo);
|
|
1232
1232
|
}
|
|
1233
1233
|
};
|
|
1234
1234
|
function dn(t, e) {
|
|
@@ -1263,10 +1263,10 @@ class pn {
|
|
|
1263
1263
|
this.subscriptions.length = 0;
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function ws(t, e) {
|
|
1267
1267
|
return e ? t * (1e3 / e) : 0;
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const Wn = 30, Uo = (t) => !isNaN(parseFloat(t));
|
|
1270
1270
|
class $o {
|
|
1271
1271
|
/**
|
|
1272
1272
|
* @param init - The initiating value
|
|
@@ -1283,7 +1283,7 @@ class $o {
|
|
|
1283
1283
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1284
1284
|
}
|
|
1285
1285
|
setCurrent(e) {
|
|
1286
|
-
this.current = e, this.updatedAt = H.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity =
|
|
1286
|
+
this.current = e, this.updatedAt = H.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Uo(this.current));
|
|
1287
1287
|
}
|
|
1288
1288
|
setPrevFrameValue(e = this.current) {
|
|
1289
1289
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1405,10 +1405,10 @@ class $o {
|
|
|
1405
1405
|
*/
|
|
1406
1406
|
getVelocity() {
|
|
1407
1407
|
const e = H.now();
|
|
1408
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
1408
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Wn)
|
|
1409
1409
|
return 0;
|
|
1410
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
1411
|
-
return
|
|
1410
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Wn);
|
|
1411
|
+
return ws(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1412
1412
|
}
|
|
1413
1413
|
/**
|
|
1414
1414
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1484,7 +1484,7 @@ function Ce(t, e) {
|
|
|
1484
1484
|
if (zo(n))
|
|
1485
1485
|
return n.add(e);
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Ts(t) {
|
|
1488
1488
|
return t.props[Ji];
|
|
1489
1489
|
}
|
|
1490
1490
|
const Ps = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, Go = 1e-7, Ho = 12;
|
|
@@ -1520,7 +1520,7 @@ const Qo = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
1520
1520
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
1521
1521
|
};
|
|
1522
1522
|
}, Zo = (t) => X(0, 255, t), de = {
|
|
1523
|
-
...
|
|
1523
|
+
...wt,
|
|
1524
1524
|
transform: (t) => Math.round(Zo(t))
|
|
1525
1525
|
}, ot = {
|
|
1526
1526
|
test: /* @__PURE__ */ vn("rgb", "red"),
|
|
@@ -1553,7 +1553,7 @@ function ea(t) {
|
|
|
1553
1553
|
var e, n;
|
|
1554
1554
|
return isNaN(t) && typeof t == "string" && (((e = t.match(yn)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(ta)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
1555
1555
|
}
|
|
1556
|
-
const Fs = "number", Bs = "color", na = "var", ia = "var(",
|
|
1556
|
+
const Fs = "number", Bs = "color", na = "var", ia = "var(", Un = "${}", sa = /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;
|
|
1557
1557
|
function Ft(t) {
|
|
1558
1558
|
const e = t.toString(), n = [], i = {
|
|
1559
1559
|
color: [],
|
|
@@ -1561,7 +1561,7 @@ function Ft(t) {
|
|
|
1561
1561
|
var: []
|
|
1562
1562
|
}, s = [];
|
|
1563
1563
|
let o = 0;
|
|
1564
|
-
const a = e.replace(sa, (l) => (F.test(l) ? (i.color.push(o), s.push(Bs), n.push(F.parse(l))) : l.startsWith(ia) ? (i.var.push(o), s.push(na), n.push(l)) : (i.number.push(o), s.push(Fs), n.push(parseFloat(l))), ++o,
|
|
1564
|
+
const a = e.replace(sa, (l) => (F.test(l) ? (i.color.push(o), s.push(Bs), n.push(F.parse(l))) : l.startsWith(ia) ? (i.var.push(o), s.push(na), n.push(l)) : (i.number.push(o), s.push(Fs), n.push(parseFloat(l))), ++o, Un)).split(Un);
|
|
1565
1565
|
return { values: n, split: a, indexes: i, types: s };
|
|
1566
1566
|
}
|
|
1567
1567
|
function Os(t) {
|
|
@@ -1639,7 +1639,7 @@ function da(t, e, n) {
|
|
|
1639
1639
|
for (const o of e)
|
|
1640
1640
|
t[o] = js(n, s);
|
|
1641
1641
|
}
|
|
1642
|
-
const $n = (t) => t ===
|
|
1642
|
+
const $n = (t) => t === wt || t === w, _n = (t, e) => parseFloat(t.split(", ")[e]), Kn = (t, e) => (n, { transform: i }) => {
|
|
1643
1643
|
if (i === "none" || !i)
|
|
1644
1644
|
return 0;
|
|
1645
1645
|
const s = i.match(/^matrix3d\((.+)\)$/u);
|
|
@@ -1692,20 +1692,20 @@ function Ns() {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
ke = !1, Me = !1, at.forEach((t) => t.complete()), at.clear();
|
|
1694
1694
|
}
|
|
1695
|
-
function
|
|
1695
|
+
function Ws() {
|
|
1696
1696
|
at.forEach((t) => {
|
|
1697
1697
|
t.readKeyframes(), t.needsMeasurement && (ke = !0);
|
|
1698
1698
|
});
|
|
1699
1699
|
}
|
|
1700
1700
|
function ga() {
|
|
1701
|
-
|
|
1701
|
+
Ws(), Ns();
|
|
1702
1702
|
}
|
|
1703
1703
|
class Sn {
|
|
1704
1704
|
constructor(e, n, i, s, o, r = !1) {
|
|
1705
1705
|
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = i, this.motionValue = s, this.element = o, this.isAsync = r;
|
|
1706
1706
|
}
|
|
1707
1707
|
scheduleResolve() {
|
|
1708
|
-
this.isScheduled = !0, this.isAsync ? (at.add(this), Me || (Me = !0, V.read(
|
|
1708
|
+
this.isScheduled = !0, this.isAsync ? (at.add(this), Me || (Me = !0, V.read(Ws), V.resolveKeyframes(Ns))) : (this.readKeyframes(), this.complete());
|
|
1709
1709
|
}
|
|
1710
1710
|
readKeyframes() {
|
|
1711
1711
|
const { unresolvedKeyframes: e, name: n, element: i, motionValue: s } = this;
|
|
@@ -1741,7 +1741,7 @@ class Sn {
|
|
|
1741
1741
|
this.isComplete || this.scheduleResolve();
|
|
1742
1742
|
}
|
|
1743
1743
|
}
|
|
1744
|
-
const
|
|
1744
|
+
const Us = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), ya = (
|
|
1745
1745
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1746
1746
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1747
1747
|
);
|
|
@@ -1761,14 +1761,14 @@ function $s(t, e, n = 1) {
|
|
|
1761
1761
|
const o = window.getComputedStyle(e).getPropertyValue(i);
|
|
1762
1762
|
if (o) {
|
|
1763
1763
|
const r = o.trim();
|
|
1764
|
-
return
|
|
1764
|
+
return Us(r) ? parseFloat(r) : r;
|
|
1765
1765
|
}
|
|
1766
1766
|
return tn(s) ? $s(s, e, n + 1) : s;
|
|
1767
1767
|
}
|
|
1768
1768
|
const _s = (t) => (e) => e.test(t), Sa = {
|
|
1769
1769
|
test: (t) => t === "auto",
|
|
1770
1770
|
parse: (t) => t
|
|
1771
|
-
}, Ks = [
|
|
1771
|
+
}, Ks = [wt, w, G, Q, ao, oo, Sa], zn = (t) => Ks.find(_s(t));
|
|
1772
1772
|
class zs extends Sn {
|
|
1773
1773
|
constructor(e, n, i, s, o) {
|
|
1774
1774
|
super(e, n, i, s, o, !0);
|
|
@@ -1835,7 +1835,7 @@ function ba(t) {
|
|
|
1835
1835
|
if (t[n] !== e)
|
|
1836
1836
|
return !0;
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1838
|
+
function wa(t, e, n, i) {
|
|
1839
1839
|
const s = t[0];
|
|
1840
1840
|
if (s === null)
|
|
1841
1841
|
return !1;
|
|
@@ -1844,9 +1844,9 @@ function Ta(t, e, n, i) {
|
|
|
1844
1844
|
const o = t[t.length - 1], r = Gn(s, e), a = Gn(o, e);
|
|
1845
1845
|
return St(r === a, `You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`), !r || !a ? !1 : ba(t) || (n === "spring" || cn(n)) && i;
|
|
1846
1846
|
}
|
|
1847
|
-
const
|
|
1847
|
+
const Ta = (t) => t !== null;
|
|
1848
1848
|
function ae(t, { repeat: e, repeatType: n = "loop" }, i) {
|
|
1849
|
-
const s = t.filter(
|
|
1849
|
+
const s = t.filter(Ta), o = e && n !== "loop" && e % 2 === 1 ? 0 : s.length - 1;
|
|
1850
1850
|
return !o || i === void 0 ? s[o] : i;
|
|
1851
1851
|
}
|
|
1852
1852
|
const Pa = 40;
|
|
@@ -1891,7 +1891,7 @@ class Gs {
|
|
|
1891
1891
|
onKeyframesResolved(e, n) {
|
|
1892
1892
|
this.resolvedAt = H.now(), this.hasAttemptedResolve = !0;
|
|
1893
1893
|
const { name: i, type: s, velocity: o, delay: r, onComplete: a, onUpdate: l, isGenerator: c } = this.options;
|
|
1894
|
-
if (!c && !
|
|
1894
|
+
if (!c && !wa(e, i, s, o))
|
|
1895
1895
|
if (r)
|
|
1896
1896
|
this.options.duration = 0;
|
|
1897
1897
|
else {
|
|
@@ -2011,7 +2011,7 @@ function qs(t, e, n) {
|
|
|
2011
2011
|
const Fa = 5;
|
|
2012
2012
|
function Ys(t, e, n) {
|
|
2013
2013
|
const i = Math.max(e - Fa, 0);
|
|
2014
|
-
return
|
|
2014
|
+
return ws(n - t(i), e - i);
|
|
2015
2015
|
}
|
|
2016
2016
|
const D = {
|
|
2017
2017
|
// Default spring physics
|
|
@@ -2047,11 +2047,11 @@ function Ba({ duration: t = D.duration, bounce: e = D.bounce, velocity: n = D.ve
|
|
|
2047
2047
|
St(t <= /* @__PURE__ */ z(D.maxDuration), "Spring duration must be 10 seconds or less");
|
|
2048
2048
|
let r = 1 - e;
|
|
2049
2049
|
r = X(D.minDamping, D.maxDamping, r), t = X(D.minDuration, D.maxDuration, /* @__PURE__ */ Y(t)), r < 1 ? (s = (c) => {
|
|
2050
|
-
const u = c * r, h = u * t, d = u - n,
|
|
2051
|
-
return me - d /
|
|
2050
|
+
const u = c * r, h = u * t, d = u - n, p = Re(c, r), m = Math.exp(-h);
|
|
2051
|
+
return me - d / p * m;
|
|
2052
2052
|
}, o = (c) => {
|
|
2053
|
-
const h = c * r * t, d = h * n + n,
|
|
2054
|
-
return (-s(c) + me > 0 ? -1 : 1) * ((d -
|
|
2053
|
+
const h = c * r * t, d = h * n + n, p = Math.pow(r, 2) * Math.pow(c, 2) * t, m = Math.exp(-h), g = Re(Math.pow(c, 2), r);
|
|
2054
|
+
return (-s(c) + me > 0 ? -1 : 1) * ((d - p) * m) / g;
|
|
2055
2055
|
}) : (s = (c) => {
|
|
2056
2056
|
const u = Math.exp(-c * t), h = (c - n) * t + 1;
|
|
2057
2057
|
return -me + u * h;
|
|
@@ -2089,7 +2089,7 @@ const ja = ["duration", "bounce"], Na = ["stiffness", "damping", "mass"];
|
|
|
2089
2089
|
function Yn(t, e) {
|
|
2090
2090
|
return e.some((n) => t[n] !== void 0);
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2092
|
+
function Wa(t) {
|
|
2093
2093
|
let e = {
|
|
2094
2094
|
velocity: D.velocity,
|
|
2095
2095
|
stiffness: D.stiffness,
|
|
@@ -2124,7 +2124,7 @@ function Xs(t = D.visualDuration, e = D.bounce) {
|
|
|
2124
2124
|
bounce: e
|
|
2125
2125
|
} : t;
|
|
2126
2126
|
let { restSpeed: i, restDelta: s } = n;
|
|
2127
|
-
const o = n.keyframes[0], r = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: o }, { stiffness: l, damping: c, mass: u, duration: h, velocity: d, isResolvedFromDuration:
|
|
2127
|
+
const o = n.keyframes[0], r = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: o }, { stiffness: l, damping: c, mass: u, duration: h, velocity: d, isResolvedFromDuration: p } = Wa({
|
|
2128
2128
|
...n,
|
|
2129
2129
|
velocity: -/* @__PURE__ */ Y(n.velocity || 0)
|
|
2130
2130
|
}), m = d || 0, g = c / (2 * Math.sqrt(l * u)), v = r - o, y = /* @__PURE__ */ Y(Math.sqrt(l / u)), S = Math.abs(v) < 5;
|
|
@@ -2141,21 +2141,21 @@ function Xs(t = D.visualDuration, e = D.bounce) {
|
|
|
2141
2141
|
else {
|
|
2142
2142
|
const x = y * Math.sqrt(g * g - 1);
|
|
2143
2143
|
b = (A) => {
|
|
2144
|
-
const k = Math.exp(-g * y * A),
|
|
2145
|
-
return r - k * ((m + g * y * v) * Math.sinh(
|
|
2144
|
+
const k = Math.exp(-g * y * A), T = Math.min(x * A, 300);
|
|
2145
|
+
return r - k * ((m + g * y * v) * Math.sinh(T) + x * v * Math.cosh(T)) / x;
|
|
2146
2146
|
};
|
|
2147
2147
|
}
|
|
2148
2148
|
const P = {
|
|
2149
|
-
calculatedDuration:
|
|
2149
|
+
calculatedDuration: p && h || null,
|
|
2150
2150
|
next: (x) => {
|
|
2151
2151
|
const A = b(x);
|
|
2152
|
-
if (
|
|
2152
|
+
if (p)
|
|
2153
2153
|
a.done = x >= h;
|
|
2154
2154
|
else {
|
|
2155
2155
|
let k = 0;
|
|
2156
2156
|
g < 1 && (k = x === 0 ? /* @__PURE__ */ z(m) : Ys(b, x, A));
|
|
2157
|
-
const
|
|
2158
|
-
a.done =
|
|
2157
|
+
const T = Math.abs(k) <= i, L = Math.abs(r - A) <= s;
|
|
2158
|
+
a.done = T && L;
|
|
2159
2159
|
}
|
|
2160
2160
|
return a.value = a.done ? r : A, a;
|
|
2161
2161
|
},
|
|
@@ -2170,19 +2170,19 @@ function Xn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2170
2170
|
const h = t[0], d = {
|
|
2171
2171
|
done: !1,
|
|
2172
2172
|
value: h
|
|
2173
|
-
},
|
|
2173
|
+
}, p = (T) => a !== void 0 && T < a || l !== void 0 && T > l, m = (T) => a === void 0 ? l : l === void 0 || Math.abs(a - T) < Math.abs(l - T) ? a : l;
|
|
2174
2174
|
let g = n * e;
|
|
2175
2175
|
const v = h + g, y = r === void 0 ? v : r(v);
|
|
2176
2176
|
y !== v && (g = y - h);
|
|
2177
|
-
const S = (
|
|
2178
|
-
const L = S(
|
|
2179
|
-
d.done = Math.abs(L) <= c, d.value = d.done ? y :
|
|
2177
|
+
const S = (T) => -g * Math.exp(-T / i), b = (T) => y + S(T), P = (T) => {
|
|
2178
|
+
const L = S(T), U = b(T);
|
|
2179
|
+
d.done = Math.abs(L) <= c, d.value = d.done ? y : U;
|
|
2180
2180
|
};
|
|
2181
2181
|
let x, A;
|
|
2182
|
-
const k = (
|
|
2183
|
-
|
|
2182
|
+
const k = (T) => {
|
|
2183
|
+
p(d.value) && (x = T, A = Xs({
|
|
2184
2184
|
keyframes: [d.value, m(d.value)],
|
|
2185
|
-
velocity: Ys(b,
|
|
2185
|
+
velocity: Ys(b, T, d.value),
|
|
2186
2186
|
// TODO: This should be passing * 1000
|
|
2187
2187
|
damping: s,
|
|
2188
2188
|
stiffness: o,
|
|
@@ -2192,15 +2192,15 @@ function Xn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2192
2192
|
};
|
|
2193
2193
|
return k(0), {
|
|
2194
2194
|
calculatedDuration: null,
|
|
2195
|
-
next: (
|
|
2195
|
+
next: (T) => {
|
|
2196
2196
|
let L = !1;
|
|
2197
|
-
return !A && x === void 0 && (L = !0, P(
|
|
2197
|
+
return !A && x === void 0 && (L = !0, P(T), k(T)), x !== void 0 && T >= x ? A.next(T - x) : (!L && P(T), d);
|
|
2198
2198
|
}
|
|
2199
2199
|
};
|
|
2200
2200
|
}
|
|
2201
|
-
const
|
|
2201
|
+
const Ua = /* @__PURE__ */ It(0.42, 0, 1, 1), $a = /* @__PURE__ */ It(0, 0, 0.58, 1), Qs = /* @__PURE__ */ It(0.42, 0, 0.58, 1), _a = (t) => Array.isArray(t) && typeof t[0] != "number", Qn = {
|
|
2202
2202
|
linear: j,
|
|
2203
|
-
easeIn:
|
|
2203
|
+
easeIn: Ua,
|
|
2204
2204
|
easeInOut: Qs,
|
|
2205
2205
|
easeOut: $a,
|
|
2206
2206
|
circIn: gn,
|
|
@@ -2303,7 +2303,7 @@ const Xa = (t) => {
|
|
|
2303
2303
|
keyframes: Qt,
|
|
2304
2304
|
spring: Xs
|
|
2305
2305
|
}, Za = (t) => t / 100;
|
|
2306
|
-
class
|
|
2306
|
+
class wn extends Gs {
|
|
2307
2307
|
constructor(e) {
|
|
2308
2308
|
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 = () => {
|
|
2309
2309
|
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
@@ -2328,14 +2328,14 @@ class Tn extends Gs {
|
|
|
2328
2328
|
keyframes: [...e].reverse(),
|
|
2329
2329
|
velocity: -r
|
|
2330
2330
|
})), u.calculatedDuration === null && (u.calculatedDuration = ps(u));
|
|
2331
|
-
const { calculatedDuration: h } = u, d = h + s,
|
|
2331
|
+
const { calculatedDuration: h } = u, d = h + s, p = d * (i + 1) - s;
|
|
2332
2332
|
return {
|
|
2333
2333
|
generator: u,
|
|
2334
2334
|
mirroredGenerator: c,
|
|
2335
2335
|
mapPercentToKeyframes: l,
|
|
2336
2336
|
calculatedDuration: h,
|
|
2337
2337
|
resolvedDuration: d,
|
|
2338
|
-
totalDuration:
|
|
2338
|
+
totalDuration: p
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
2341
2341
|
onPostResolved() {
|
|
@@ -2345,21 +2345,21 @@ class Tn extends Gs {
|
|
|
2345
2345
|
tick(e, n = !1) {
|
|
2346
2346
|
const { resolved: i } = this;
|
|
2347
2347
|
if (!i) {
|
|
2348
|
-
const { keyframes:
|
|
2349
|
-
return { done: !0, value:
|
|
2348
|
+
const { keyframes: T } = this.options;
|
|
2349
|
+
return { done: !0, value: T[T.length - 1] };
|
|
2350
2350
|
}
|
|
2351
2351
|
const { finalKeyframe: s, generator: o, mirroredGenerator: r, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: c, totalDuration: u, resolvedDuration: h } = i;
|
|
2352
2352
|
if (this.startTime === null)
|
|
2353
2353
|
return o.next(0);
|
|
2354
|
-
const { delay: d, repeat:
|
|
2354
|
+
const { delay: d, repeat: p, repeatType: m, repeatDelay: g, onUpdate: v } = this.options;
|
|
2355
2355
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - u / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
2356
2356
|
const y = this.currentTime - d * (this.speed >= 0 ? 1 : -1), S = this.speed >= 0 ? y < 0 : y > u;
|
|
2357
2357
|
this.currentTime = Math.max(y, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = u);
|
|
2358
2358
|
let b = this.currentTime, P = o;
|
|
2359
|
-
if (
|
|
2360
|
-
const
|
|
2361
|
-
let L = Math.floor(
|
|
2362
|
-
!
|
|
2359
|
+
if (p) {
|
|
2360
|
+
const T = Math.min(this.currentTime, u) / h;
|
|
2361
|
+
let L = Math.floor(T), U = T % 1;
|
|
2362
|
+
!U && T >= 1 && (U = 1), U === 1 && L--, L = Math.min(L, p + 1), !!(L % 2) && (m === "reverse" ? (U = 1 - U, g && (U -= g / h)) : m === "mirror" && (P = r)), b = X(0, 1, U) * h;
|
|
2363
2363
|
}
|
|
2364
2364
|
const x = S ? { done: !1, value: l[0] } : P.next(b);
|
|
2365
2365
|
a && (x.value = a(x.value));
|
|
@@ -2453,7 +2453,7 @@ function il(t) {
|
|
|
2453
2453
|
return cn(t.type) || t.type === "spring" || !gs(t.ease);
|
|
2454
2454
|
}
|
|
2455
2455
|
function sl(t, e) {
|
|
2456
|
-
const n = new
|
|
2456
|
+
const n = new wn({
|
|
2457
2457
|
...e,
|
|
2458
2458
|
keyframes: t,
|
|
2459
2459
|
repeat: 0,
|
|
@@ -2491,7 +2491,7 @@ class Jn extends Gs {
|
|
|
2491
2491
|
if (!a.owner || !a.owner.current)
|
|
2492
2492
|
return !1;
|
|
2493
2493
|
if (typeof o == "string" && Yt() && rl(o) && (o = Zs[o]), il(this.options)) {
|
|
2494
|
-
const { onComplete: h, onUpdate: d, motionValue:
|
|
2494
|
+
const { onComplete: h, onUpdate: d, motionValue: p, element: m, ...g } = this.options, v = sl(e, g);
|
|
2495
2495
|
e = v.keyframes, e.length === 1 && (e[1] = e[0]), i = v.duration, s = v.times, o = v.ease, r = "keyframes";
|
|
2496
2496
|
}
|
|
2497
2497
|
const u = tl(a.owner.current, l, e, { ...this.options, duration: i, times: s, ease: o });
|
|
@@ -2599,8 +2599,8 @@ class Jn extends Gs {
|
|
|
2599
2599
|
if (n.playState === "idle" || n.playState === "finished")
|
|
2600
2600
|
return;
|
|
2601
2601
|
if (this.time) {
|
|
2602
|
-
const { motionValue: c, onUpdate: u, onComplete: h, element: d, ...
|
|
2603
|
-
...
|
|
2602
|
+
const { motionValue: c, onUpdate: u, onComplete: h, element: d, ...p } = this.options, m = new wn({
|
|
2603
|
+
...p,
|
|
2604
2604
|
keyframes: i,
|
|
2605
2605
|
duration: s,
|
|
2606
2606
|
type: o,
|
|
@@ -2654,7 +2654,7 @@ const ol = {
|
|
|
2654
2654
|
function hl({ when: t, delay: e, delayChildren: n, staggerChildren: i, staggerDirection: s, repeat: o, repeatType: r, repeatDelay: a, from: l, elapsed: c, ...u }) {
|
|
2655
2655
|
return !!Object.keys(u).length;
|
|
2656
2656
|
}
|
|
2657
|
-
const
|
|
2657
|
+
const Tn = (t, e, n, i = {}, s, o) => (r) => {
|
|
2658
2658
|
const a = ln(i, t) || {}, l = a.delay || i.delay || 0;
|
|
2659
2659
|
let { elapsed: c = 0 } = i;
|
|
2660
2660
|
c = c - /* @__PURE__ */ z(l);
|
|
@@ -2686,7 +2686,7 @@ const wn = (t, e, n, i = {}, s, o) => (r) => {
|
|
|
2686
2686
|
u.onUpdate(d), u.onComplete();
|
|
2687
2687
|
}), new ko([]);
|
|
2688
2688
|
}
|
|
2689
|
-
return !o && Jn.supports(u) ? new Jn(u) : new
|
|
2689
|
+
return !o && Jn.supports(u) ? new Jn(u) : new wn(u);
|
|
2690
2690
|
};
|
|
2691
2691
|
function dl({ protectedKeys: t, needsAnimating: e }, n) {
|
|
2692
2692
|
const i = t.hasOwnProperty(n) && e[n] !== !0;
|
|
@@ -2698,8 +2698,8 @@ function Js(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
|
2698
2698
|
i && (r = i);
|
|
2699
2699
|
const c = [], u = s && t.animationState && t.animationState.getState()[s];
|
|
2700
2700
|
for (const h in l) {
|
|
2701
|
-
const d = t.getValue(h, (o = t.latestValues[h]) !== null && o !== void 0 ? o : null),
|
|
2702
|
-
if (
|
|
2701
|
+
const d = t.getValue(h, (o = t.latestValues[h]) !== null && o !== void 0 ? o : null), p = l[h];
|
|
2702
|
+
if (p === void 0 || u && dl(u, h))
|
|
2703
2703
|
continue;
|
|
2704
2704
|
const m = {
|
|
2705
2705
|
delay: n,
|
|
@@ -2707,13 +2707,13 @@ function Js(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
|
2707
2707
|
};
|
|
2708
2708
|
let g = !1;
|
|
2709
2709
|
if (window.MotionHandoffAnimation) {
|
|
2710
|
-
const y =
|
|
2710
|
+
const y = Ts(t);
|
|
2711
2711
|
if (y) {
|
|
2712
2712
|
const S = window.MotionHandoffAnimation(y, h, V);
|
|
2713
2713
|
S !== null && (m.startTime = S, g = !0);
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
|
-
Ce(t, h), d.start(
|
|
2716
|
+
Ce(t, h), d.start(Tn(h, d, p, t.shouldReduceMotion && bs.has(h) ? { type: !1 } : m, t, g));
|
|
2717
2717
|
const v = d.animation;
|
|
2718
2718
|
v && c.push(v);
|
|
2719
2719
|
}
|
|
@@ -2791,7 +2791,7 @@ function Sl(t) {
|
|
|
2791
2791
|
var h;
|
|
2792
2792
|
const d = oe(t, u, l === "exit" ? (h = t.presenceContext) === null || h === void 0 ? void 0 : h.custom : void 0);
|
|
2793
2793
|
if (d) {
|
|
2794
|
-
const { transition:
|
|
2794
|
+
const { transition: p, transitionEnd: m, ...g } = d;
|
|
2795
2795
|
c = { ...c, ...g, ...m };
|
|
2796
2796
|
}
|
|
2797
2797
|
return c;
|
|
@@ -2801,39 +2801,39 @@ function Sl(t) {
|
|
|
2801
2801
|
}
|
|
2802
2802
|
function r(l) {
|
|
2803
2803
|
const { props: c } = t, u = tr(t.parent) || {}, h = [], d = /* @__PURE__ */ new Set();
|
|
2804
|
-
let
|
|
2804
|
+
let p = {}, m = 1 / 0;
|
|
2805
2805
|
for (let v = 0; v < vl; v++) {
|
|
2806
2806
|
const y = yl[v], S = n[y], b = c[y] !== void 0 ? c[y] : u[y], P = Et(b), x = y === l ? S.isActive : null;
|
|
2807
2807
|
x === !1 && (m = v);
|
|
2808
2808
|
let A = b === u[y] && b !== c[y] && P;
|
|
2809
|
-
if (A && i && t.manuallyAnimateOnMount && (A = !1), S.protectedKeys = { ...
|
|
2809
|
+
if (A && i && t.manuallyAnimateOnMount && (A = !1), S.protectedKeys = { ...p }, // If it isn't active and hasn't *just* been set as inactive
|
|
2810
2810
|
!S.isActive && x === null || // If we didn't and don't have any defined prop for this animation type
|
|
2811
2811
|
!b && !S.prevProp || // Or if the prop doesn't define an animation
|
|
2812
2812
|
se(b) || typeof b == "boolean")
|
|
2813
2813
|
continue;
|
|
2814
2814
|
const k = bl(S.prevProp, b);
|
|
2815
|
-
let
|
|
2815
|
+
let T = k || // If we're making this variant active, we want to always make it active
|
|
2816
2816
|
y === l && S.isActive && !A && P || // If we removed a higher-priority variant (i is in reverse order)
|
|
2817
2817
|
v > m && P, L = !1;
|
|
2818
|
-
const
|
|
2819
|
-
let ut =
|
|
2818
|
+
const U = Array.isArray(b) ? b : [b];
|
|
2819
|
+
let ut = U.reduce(s(y), {});
|
|
2820
2820
|
x === !1 && (ut = {});
|
|
2821
2821
|
const { prevResolvedValues: Pn = {} } = S, br = {
|
|
2822
2822
|
...Pn,
|
|
2823
2823
|
...ut
|
|
2824
2824
|
}, An = (I) => {
|
|
2825
|
-
|
|
2825
|
+
T = !0, d.has(I) && (L = !0, d.delete(I)), S.needsAnimating[I] = !0;
|
|
2826
2826
|
const q = t.getValue(I);
|
|
2827
2827
|
q && (q.liveStyle = !1);
|
|
2828
2828
|
};
|
|
2829
2829
|
for (const I in br) {
|
|
2830
2830
|
const q = ut[I], le = Pn[I];
|
|
2831
|
-
if (
|
|
2831
|
+
if (p.hasOwnProperty(I))
|
|
2832
2832
|
continue;
|
|
2833
2833
|
let ce = !1;
|
|
2834
|
-
|
|
2834
|
+
Te(q) && Te(le) ? ce = !fs(q, le) : ce = q !== le, ce ? q != null ? An(I) : d.add(I) : q !== void 0 && d.has(I) ? An(I) : S.protectedKeys[I] = !0;
|
|
2835
2835
|
}
|
|
2836
|
-
S.prevProp = b, S.prevResolvedValues = ut, S.isActive && (
|
|
2836
|
+
S.prevProp = b, S.prevResolvedValues = ut, S.isActive && (p = { ...p, ...ut }), i && t.blockInitialAnimation && (T = !1), T && (!(A && k) || L) && h.push(...U.map((I) => ({
|
|
2837
2837
|
animation: I,
|
|
2838
2838
|
options: { type: y }
|
|
2839
2839
|
})));
|
|
@@ -2853,8 +2853,8 @@ function Sl(t) {
|
|
|
2853
2853
|
if (n[l].isActive === c)
|
|
2854
2854
|
return Promise.resolve();
|
|
2855
2855
|
(u = t.variantChildren) === null || u === void 0 || u.forEach((d) => {
|
|
2856
|
-
var
|
|
2857
|
-
return (
|
|
2856
|
+
var p;
|
|
2857
|
+
return (p = d.animationState) === null || p === void 0 ? void 0 : p.setActive(l, c);
|
|
2858
2858
|
}), n[l].isActive = c;
|
|
2859
2859
|
const h = r(l);
|
|
2860
2860
|
for (const d in n)
|
|
@@ -2900,7 +2900,7 @@ class nt {
|
|
|
2900
2900
|
update() {
|
|
2901
2901
|
}
|
|
2902
2902
|
}
|
|
2903
|
-
class
|
|
2903
|
+
class wl extends nt {
|
|
2904
2904
|
/**
|
|
2905
2905
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
2906
2906
|
* to the underlying animation library. We only want to load that if we load this,
|
|
@@ -2928,10 +2928,10 @@ class Tl extends nt {
|
|
|
2928
2928
|
this.node.animationState.reset(), (e = this.unmountControls) === null || e === void 0 || e.call(this);
|
|
2929
2929
|
}
|
|
2930
2930
|
}
|
|
2931
|
-
let
|
|
2931
|
+
let Tl = 0;
|
|
2932
2932
|
class Pl extends nt {
|
|
2933
2933
|
constructor() {
|
|
2934
|
-
super(...arguments), this.id =
|
|
2934
|
+
super(...arguments), this.id = Tl++;
|
|
2935
2935
|
}
|
|
2936
2936
|
update() {
|
|
2937
2937
|
if (!this.node.presenceContext)
|
|
@@ -2951,7 +2951,7 @@ class Pl extends nt {
|
|
|
2951
2951
|
}
|
|
2952
2952
|
const Al = {
|
|
2953
2953
|
animation: {
|
|
2954
|
-
Feature:
|
|
2954
|
+
Feature: wl
|
|
2955
2955
|
},
|
|
2956
2956
|
exit: {
|
|
2957
2957
|
Feature: Pl
|
|
@@ -2982,8 +2982,8 @@ class er {
|
|
|
2982
2982
|
if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.updatePoint = () => {
|
|
2983
2983
|
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
2984
2984
|
return;
|
|
2985
|
-
const h = ye(this.lastMoveEventInfo, this.history), d = this.startEvent !== null,
|
|
2986
|
-
if (!d && !
|
|
2985
|
+
const h = ye(this.lastMoveEventInfo, this.history), d = this.startEvent !== null, p = Vl(h.offset, { x: 0, y: 0 }) >= 3;
|
|
2986
|
+
if (!d && !p)
|
|
2987
2987
|
return;
|
|
2988
2988
|
const { point: m } = h, { timestamp: g } = R;
|
|
2989
2989
|
this.history.push({ ...m, timestamp: g });
|
|
@@ -2993,11 +2993,11 @@ class er {
|
|
|
2993
2993
|
this.lastMoveEvent = h, this.lastMoveEventInfo = ge(d, this.transformPagePoint), V.update(this.updatePoint, !0);
|
|
2994
2994
|
}, this.handlePointerUp = (h, d) => {
|
|
2995
2995
|
this.end();
|
|
2996
|
-
const { onEnd:
|
|
2996
|
+
const { onEnd: p, onSessionEnd: m, resumeAnimation: g } = this.handlers;
|
|
2997
2997
|
if (this.dragSnapToOrigin && g && g(), !(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
2998
2998
|
return;
|
|
2999
2999
|
const v = ye(h.type === "pointercancel" ? this.lastMoveEventInfo : ge(d, this.transformPagePoint), this.history);
|
|
3000
|
-
this.startEvent &&
|
|
3000
|
+
this.startEvent && p && p(h, v), m && m(h, v);
|
|
3001
3001
|
}, !hn(e))
|
|
3002
3002
|
return;
|
|
3003
3003
|
this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = i, this.contextWindow = s || window;
|
|
@@ -3052,26 +3052,26 @@ function Ml(t, e) {
|
|
|
3052
3052
|
return r.x === 1 / 0 && (r.x = 0), r.y === 1 / 0 && (r.y = 0), r;
|
|
3053
3053
|
}
|
|
3054
3054
|
const ir = 1e-4, kl = 1 - ir, El = 1 + ir, sr = 0.01, Rl = 0 - sr, Ll = 0 + sr;
|
|
3055
|
-
function
|
|
3055
|
+
function W(t) {
|
|
3056
3056
|
return t.max - t.min;
|
|
3057
3057
|
}
|
|
3058
3058
|
function Fl(t, e, n) {
|
|
3059
3059
|
return Math.abs(t - e) <= n;
|
|
3060
3060
|
}
|
|
3061
3061
|
function ii(t, e, n, i = 0.5) {
|
|
3062
|
-
t.origin = i, t.originPoint = M(e.min, e.max, t.origin), t.scale =
|
|
3062
|
+
t.origin = i, t.originPoint = M(e.min, e.max, t.origin), t.scale = W(n) / W(e), t.translate = M(n.min, n.max, t.origin) - t.originPoint, (t.scale >= kl && t.scale <= El || isNaN(t.scale)) && (t.scale = 1), (t.translate >= Rl && t.translate <= Ll || isNaN(t.translate)) && (t.translate = 0);
|
|
3063
3063
|
}
|
|
3064
3064
|
function Mt(t, e, n, i) {
|
|
3065
3065
|
ii(t.x, e.x, n.x, i ? i.originX : void 0), ii(t.y, e.y, n.y, i ? i.originY : void 0);
|
|
3066
3066
|
}
|
|
3067
3067
|
function si(t, e, n) {
|
|
3068
|
-
t.min = n.min + e.min, t.max = t.min +
|
|
3068
|
+
t.min = n.min + e.min, t.max = t.min + W(e);
|
|
3069
3069
|
}
|
|
3070
3070
|
function Bl(t, e, n) {
|
|
3071
3071
|
si(t.x, e.x, n.x), si(t.y, e.y, n.y);
|
|
3072
3072
|
}
|
|
3073
3073
|
function ri(t, e, n) {
|
|
3074
|
-
t.min = e.min - n.min, t.max = t.min +
|
|
3074
|
+
t.min = e.min - n.min, t.max = t.min + W(e);
|
|
3075
3075
|
}
|
|
3076
3076
|
function kt(t, e, n) {
|
|
3077
3077
|
ri(t.x, e.x, n.x), ri(t.y, e.y, n.y);
|
|
@@ -3103,15 +3103,15 @@ function jl(t, e) {
|
|
|
3103
3103
|
}
|
|
3104
3104
|
function Nl(t, e) {
|
|
3105
3105
|
let n = 0.5;
|
|
3106
|
-
const i =
|
|
3106
|
+
const i = W(t), s = W(e);
|
|
3107
3107
|
return s > i ? n = /* @__PURE__ */ gt(e.min, e.max - i, t.min) : i > s && (n = /* @__PURE__ */ gt(t.min, t.max - s, e.min)), X(0, 1, n);
|
|
3108
3108
|
}
|
|
3109
|
-
function
|
|
3109
|
+
function Wl(t, e) {
|
|
3110
3110
|
const n = {};
|
|
3111
3111
|
return e.min !== void 0 && (n.min = e.min - t.min), e.max !== void 0 && (n.max = e.max - t.min), n;
|
|
3112
3112
|
}
|
|
3113
3113
|
const Fe = 0.35;
|
|
3114
|
-
function
|
|
3114
|
+
function Ul(t = Fe) {
|
|
3115
3115
|
return t === !1 ? t = 0 : t === !0 && (t = Fe), {
|
|
3116
3116
|
x: li(t, "left", "right"),
|
|
3117
3117
|
y: li(t, "top", "bottom")
|
|
@@ -3236,8 +3236,8 @@ class Hl {
|
|
|
3236
3236
|
const { dragSnapToOrigin: h } = this.getProps();
|
|
3237
3237
|
h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(Nt(u).point);
|
|
3238
3238
|
}, o = (u, h) => {
|
|
3239
|
-
const { drag: d, dragPropagation:
|
|
3240
|
-
if (d && !
|
|
3239
|
+
const { drag: d, dragPropagation: p, onDragStart: m } = this.getProps();
|
|
3240
|
+
if (d && !p && (this.openDragLock && this.openDragLock(), this.openDragLock = No(d), !this.openDragLock))
|
|
3241
3241
|
return;
|
|
3242
3242
|
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), _((v) => {
|
|
3243
3243
|
let y = this.getAxisMotionValue(v).get() || 0;
|
|
@@ -3245,7 +3245,7 @@ class Hl {
|
|
|
3245
3245
|
const { projection: S } = this.visualElement;
|
|
3246
3246
|
if (S && S.layout) {
|
|
3247
3247
|
const b = S.layout.layoutBox[v];
|
|
3248
|
-
b && (y =
|
|
3248
|
+
b && (y = W(b) * (parseFloat(y) / 100));
|
|
3249
3249
|
}
|
|
3250
3250
|
}
|
|
3251
3251
|
this.originPoint[v] = y;
|
|
@@ -3253,11 +3253,11 @@ class Hl {
|
|
|
3253
3253
|
const { animationState: g } = this.visualElement;
|
|
3254
3254
|
g && g.setActive("whileDrag", !0);
|
|
3255
3255
|
}, r = (u, h) => {
|
|
3256
|
-
const { dragPropagation: d, dragDirectionLock:
|
|
3256
|
+
const { dragPropagation: d, dragDirectionLock: p, onDirectionLock: m, onDrag: g } = this.getProps();
|
|
3257
3257
|
if (!d && !this.openDragLock)
|
|
3258
3258
|
return;
|
|
3259
3259
|
const { offset: v } = h;
|
|
3260
|
-
if (
|
|
3260
|
+
if (p && this.currentDirection === null) {
|
|
3261
3261
|
this.currentDirection = ql(v), this.currentDirection !== null && m && m(this.currentDirection);
|
|
3262
3262
|
return;
|
|
3263
3263
|
}
|
|
@@ -3305,8 +3305,8 @@ class Hl {
|
|
|
3305
3305
|
resolveConstraints() {
|
|
3306
3306
|
var e;
|
|
3307
3307
|
const { dragConstraints: n, dragElastic: i } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (e = this.visualElement.projection) === null || e === void 0 ? void 0 : e.layout, o = this.constraints;
|
|
3308
|
-
n && ht(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = Il(s.layoutBox, n) : this.constraints = !1, this.elastic =
|
|
3309
|
-
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] =
|
|
3308
|
+
n && ht(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = Il(s.layoutBox, n) : this.constraints = !1, this.elastic = Ul(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && _((r) => {
|
|
3309
|
+
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] = Wl(s.layoutBox[r], this.constraints[r]));
|
|
3310
3310
|
});
|
|
3311
3311
|
}
|
|
3312
3312
|
resolveRefConstraints() {
|
|
@@ -3332,11 +3332,11 @@ class Hl {
|
|
|
3332
3332
|
return;
|
|
3333
3333
|
let h = l && l[u] || {};
|
|
3334
3334
|
r && (h = { min: 0, max: 0 });
|
|
3335
|
-
const d = s ? 200 : 1e6,
|
|
3335
|
+
const d = s ? 200 : 1e6, p = s ? 40 : 1e7, m = {
|
|
3336
3336
|
type: "inertia",
|
|
3337
3337
|
velocity: i ? e[u] : 0,
|
|
3338
3338
|
bounceStiffness: d,
|
|
3339
|
-
bounceDamping:
|
|
3339
|
+
bounceDamping: p,
|
|
3340
3340
|
timeConstant: 750,
|
|
3341
3341
|
restDelta: 1,
|
|
3342
3342
|
restSpeed: 10,
|
|
@@ -3349,7 +3349,7 @@ class Hl {
|
|
|
3349
3349
|
}
|
|
3350
3350
|
startAxisValueAnimation(e, n) {
|
|
3351
3351
|
const i = this.getAxisMotionValue(e);
|
|
3352
|
-
return Ce(this.visualElement, e), i.start(
|
|
3352
|
+
return Ce(this.visualElement, e), i.start(Tn(e, i, 0, n, this.visualElement, !1));
|
|
3353
3353
|
}
|
|
3354
3354
|
stopAnimation() {
|
|
3355
3355
|
_((e) => this.getAxisMotionValue(e).stop());
|
|
@@ -3517,12 +3517,12 @@ const Gt = {
|
|
|
3517
3517
|
function vi(t, e) {
|
|
3518
3518
|
return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
|
|
3519
3519
|
}
|
|
3520
|
-
const
|
|
3520
|
+
const Tt = {
|
|
3521
3521
|
correct: (t, e) => {
|
|
3522
3522
|
if (!e.target)
|
|
3523
3523
|
return t;
|
|
3524
3524
|
if (typeof t == "string")
|
|
3525
|
-
if (
|
|
3525
|
+
if (w.test(t))
|
|
3526
3526
|
t = parseFloat(t);
|
|
3527
3527
|
else
|
|
3528
3528
|
return t;
|
|
@@ -3582,11 +3582,11 @@ class Zl extends Mr {
|
|
|
3582
3582
|
}
|
|
3583
3583
|
function ur(t) {
|
|
3584
3584
|
const [e, n] = Hi(), i = B(_e);
|
|
3585
|
-
return
|
|
3585
|
+
return f(Zl, { ...t, layoutGroup: i, switchLayoutGroup: B(ts), isPresent: e, safeToRemove: n });
|
|
3586
3586
|
}
|
|
3587
3587
|
const Jl = {
|
|
3588
3588
|
borderRadius: {
|
|
3589
|
-
...
|
|
3589
|
+
...Tt,
|
|
3590
3590
|
applyTo: [
|
|
3591
3591
|
"borderTopLeftRadius",
|
|
3592
3592
|
"borderTopRightRadius",
|
|
@@ -3594,15 +3594,15 @@ const Jl = {
|
|
|
3594
3594
|
"borderBottomRightRadius"
|
|
3595
3595
|
]
|
|
3596
3596
|
},
|
|
3597
|
-
borderTopLeftRadius:
|
|
3598
|
-
borderTopRightRadius:
|
|
3599
|
-
borderBottomLeftRadius:
|
|
3600
|
-
borderBottomRightRadius:
|
|
3597
|
+
borderTopLeftRadius: Tt,
|
|
3598
|
+
borderTopRightRadius: Tt,
|
|
3599
|
+
borderBottomLeftRadius: Tt,
|
|
3600
|
+
borderBottomRightRadius: Tt,
|
|
3601
3601
|
boxShadow: Ql
|
|
3602
3602
|
};
|
|
3603
3603
|
function tc(t, e, n) {
|
|
3604
3604
|
const i = O(t) ? t : Lt(t);
|
|
3605
|
-
return i.start(
|
|
3605
|
+
return i.start(Tn("", i, e, n)), i.animation;
|
|
3606
3606
|
}
|
|
3607
3607
|
function ec(t) {
|
|
3608
3608
|
return t instanceof SVGElement && t.tagName !== "svg";
|
|
@@ -3629,7 +3629,7 @@ function sc(t, e) {
|
|
|
3629
3629
|
};
|
|
3630
3630
|
return V.read(i, !0), () => tt(i);
|
|
3631
3631
|
}
|
|
3632
|
-
const hr = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], rc = hr.length, xi = (t) => typeof t == "string" ? parseFloat(t) : t, Si = (t) => typeof t == "number" ||
|
|
3632
|
+
const hr = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], rc = hr.length, xi = (t) => typeof t == "string" ? parseFloat(t) : t, Si = (t) => typeof t == "number" || w.test(t);
|
|
3633
3633
|
function oc(t, e, n, i, s, o) {
|
|
3634
3634
|
s ? (t.opacity = M(
|
|
3635
3635
|
0,
|
|
@@ -3653,13 +3653,13 @@ const ac = /* @__PURE__ */ dr(0, 0.5, ks), lc = /* @__PURE__ */ dr(0.5, 0.95, j)
|
|
|
3653
3653
|
function dr(t, e, n) {
|
|
3654
3654
|
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */ gt(t, e, i));
|
|
3655
3655
|
}
|
|
3656
|
-
function
|
|
3656
|
+
function wi(t, e) {
|
|
3657
3657
|
t.min = e.min, t.max = e.max;
|
|
3658
3658
|
}
|
|
3659
3659
|
function $(t, e) {
|
|
3660
|
-
|
|
3660
|
+
wi(t.x, e.x), wi(t.y, e.y);
|
|
3661
3661
|
}
|
|
3662
|
-
function
|
|
3662
|
+
function Ti(t, e) {
|
|
3663
3663
|
t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
|
|
3664
3664
|
}
|
|
3665
3665
|
function Pi(t, e, n, i, s) {
|
|
@@ -3697,7 +3697,7 @@ function pr(t, e) {
|
|
|
3697
3697
|
return Mi(t.x, e.x) && Mi(t.y, e.y);
|
|
3698
3698
|
}
|
|
3699
3699
|
function ki(t) {
|
|
3700
|
-
return
|
|
3700
|
+
return W(t.x) / W(t.y);
|
|
3701
3701
|
}
|
|
3702
3702
|
function Ei(t, e) {
|
|
3703
3703
|
return t.translate === e.translate && t.scale === e.scale && t.originPoint === e.originPoint;
|
|
@@ -3760,8 +3760,8 @@ function pc(t, e, n) {
|
|
|
3760
3760
|
let i = "";
|
|
3761
3761
|
const s = t.x.translate / e.x, o = t.y.translate / e.y, r = (n == null ? void 0 : n.z) || 0;
|
|
3762
3762
|
if ((s || o || r) && (i = `translate3d(${s}px, ${o}px, ${r}px) `), (e.x !== 1 || e.y !== 1) && (i += `scale(${1 / e.x}, ${1 / e.y}) `), n) {
|
|
3763
|
-
const { transformPerspective: c, rotate: u, rotateX: h, rotateY: d, skewX:
|
|
3764
|
-
c && (i = `perspective(${c}px) ${i}`), u && (i += `rotate(${u}deg) `), h && (i += `rotateX(${h}deg) `), d && (i += `rotateY(${d}deg) `),
|
|
3763
|
+
const { transformPerspective: c, rotate: u, rotateX: h, rotateY: d, skewX: p, skewY: m } = n;
|
|
3764
|
+
c && (i = `perspective(${c}px) ${i}`), u && (i += `rotate(${u}deg) `), h && (i += `rotateX(${h}deg) `), d && (i += `rotateY(${d}deg) `), p && (i += `skewX(${p}deg) `), m && (i += `skewY(${m}deg) `);
|
|
3765
3765
|
}
|
|
3766
3766
|
const a = t.x.scale * e.x, l = t.y.scale * e.y;
|
|
3767
3767
|
return (a !== 1 || l !== 1) && (i += `scale(${a}, ${l})`), i || "none";
|
|
@@ -3783,7 +3783,7 @@ function mr(t) {
|
|
|
3783
3783
|
const { visualElement: e } = t.options;
|
|
3784
3784
|
if (!e)
|
|
3785
3785
|
return;
|
|
3786
|
-
const n =
|
|
3786
|
+
const n = Ts(e);
|
|
3787
3787
|
if (window.MotionHasOptimisedAnimation(n, "transform")) {
|
|
3788
3788
|
const { layout: s, layoutId: o } = t.options;
|
|
3789
3789
|
window.MotionCancelOptimisedAnimation(n, "transform", V, !(s || o));
|
|
@@ -3828,12 +3828,12 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
3828
3828
|
this.root.updateBlockedByResize = !0, h && h(), h = sc(d, 250), Gt.hasAnimatedSinceResize && (Gt.hasAnimatedSinceResize = !1, this.nodes.forEach(Fi));
|
|
3829
3829
|
});
|
|
3830
3830
|
}
|
|
3831
|
-
l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && u && (l || c) && this.addEventListener("didUpdate", ({ delta: h, hasLayoutChanged: d, hasRelativeTargetChanged:
|
|
3831
|
+
l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && u && (l || c) && this.addEventListener("didUpdate", ({ delta: h, hasLayoutChanged: d, hasRelativeTargetChanged: p, layout: m }) => {
|
|
3832
3832
|
if (this.isTreeAnimationBlocked()) {
|
|
3833
3833
|
this.target = void 0, this.relativeTarget = void 0;
|
|
3834
3834
|
return;
|
|
3835
3835
|
}
|
|
3836
|
-
const g = this.options.transition || u.getDefaultTransition() || kc, { onLayoutAnimationStart: v, onLayoutAnimationComplete: y } = u.getProps(), S = !this.targetLayout || !pr(this.targetLayout, m) ||
|
|
3836
|
+
const g = this.options.transition || u.getDefaultTransition() || kc, { onLayoutAnimationStart: v, onLayoutAnimationComplete: y } = u.getProps(), S = !this.targetLayout || !pr(this.targetLayout, m) || p, b = !d && p;
|
|
3837
3837
|
if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || b || d && (S || !this.currentAnimation)) {
|
|
3838
3838
|
this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0), this.setAnimationOrigin(h, b);
|
|
3839
3839
|
const P = {
|
|
@@ -3896,7 +3896,7 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
3896
3896
|
this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(Li);
|
|
3897
3897
|
return;
|
|
3898
3898
|
}
|
|
3899
|
-
this.isUpdating || this.nodes.forEach(
|
|
3899
|
+
this.isUpdating || this.nodes.forEach(wc), this.isUpdating = !1, this.nodes.forEach(Tc), this.nodes.forEach(yc), this.nodes.forEach(vc), this.clearAllSnapshots();
|
|
3900
3900
|
const a = H.now();
|
|
3901
3901
|
R.delta = X(0, 1e3 / 60, a - R.timestamp), R.timestamp = a, R.isProcessing = !0, ue.update.process(R), ue.preRender.process(R), ue.render.process(R), R.isProcessing = !1;
|
|
3902
3902
|
}
|
|
@@ -4035,14 +4035,14 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4035
4035
|
const { layout: h, layoutId: d } = this.options;
|
|
4036
4036
|
if (!(!this.layout || !(h || d))) {
|
|
4037
4037
|
if (this.resolvedRelativeTargetAt = R.timestamp, !this.targetDelta && !this.relativeTarget) {
|
|
4038
|
-
const
|
|
4039
|
-
|
|
4038
|
+
const p = this.getClosestProjectingParent();
|
|
4039
|
+
p && p.layout && this.animationProgress !== 1 ? (this.relativeParent = p, this.forceRelativeParentToResolveTarget(), this.relativeTarget = E(), this.relativeTargetOrigin = E(), kt(this.relativeTargetOrigin, this.layout.layoutBox, p.layout.layoutBox), $(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4040
4040
|
}
|
|
4041
4041
|
if (!(!this.relativeTarget && !this.targetDelta)) {
|
|
4042
4042
|
if (this.target || (this.target = E(), this.targetWithTransforms = E()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), Bl(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : $(this.target, this.layout.layoutBox), ar(this.target, this.targetDelta)) : $(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget) {
|
|
4043
4043
|
this.attemptToResolveRelativeTarget = !1;
|
|
4044
|
-
const
|
|
4045
|
-
|
|
4044
|
+
const p = this.getClosestProjectingParent();
|
|
4045
|
+
p && !!p.resumingFrom == !!this.resumingFrom && !p.options.layoutScroll && p.target && this.animationProgress !== 1 ? (this.relativeParent = p, this.forceRelativeParentToResolveTarget(), this.relativeTarget = E(), this.relativeTargetOrigin = E(), kt(this.relativeTargetOrigin, this.target, p.target), $(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4046
4046
|
}
|
|
4047
4047
|
Ct && rt.resolvedTargetDeltas++;
|
|
4048
4048
|
}
|
|
@@ -4065,14 +4065,14 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4065
4065
|
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(u || h))
|
|
4066
4066
|
return;
|
|
4067
4067
|
$(this.layoutCorrected, this.layout.layoutBox);
|
|
4068
|
-
const d = this.treeScale.x,
|
|
4068
|
+
const d = this.treeScale.x, p = this.treeScale.y;
|
|
4069
4069
|
Kl(this.layoutCorrected, this.treeScale, this.path, l), a.layout && !a.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (a.target = a.layout.layoutBox, a.targetWithTransforms = E());
|
|
4070
4070
|
const { target: m } = a;
|
|
4071
4071
|
if (!m) {
|
|
4072
4072
|
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
4073
4073
|
return;
|
|
4074
4074
|
}
|
|
4075
|
-
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (
|
|
4075
|
+
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (Ti(this.prevProjectionDelta.x, this.projectionDelta.x), Ti(this.prevProjectionDelta.y, this.projectionDelta.y)), Mt(this.projectionDelta, this.layoutCorrected, m, this.latestValues), (this.treeScale.x !== d || this.treeScale.y !== p || !Ei(this.projectionDelta.x, this.prevProjectionDelta.x) || !Ei(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", m)), Ct && rt.recalculatedProjection++;
|
|
4076
4076
|
}
|
|
4077
4077
|
hide() {
|
|
4078
4078
|
this.isVisible = !1;
|
|
@@ -4094,7 +4094,7 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4094
4094
|
setAnimationOrigin(r, a = !1) {
|
|
4095
4095
|
const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, h = ft();
|
|
4096
4096
|
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
|
|
4097
|
-
const d = E(),
|
|
4097
|
+
const d = E(), p = l ? l.source : void 0, m = this.layout ? this.layout.source : void 0, g = p !== m, v = this.getStack(), y = !v || v.members.length <= 1, S = !!(g && !y && this.options.crossfade === !0 && !this.path.some(Mc));
|
|
4098
4098
|
this.animationProgress = 0;
|
|
4099
4099
|
let b;
|
|
4100
4100
|
this.mixTargetDelta = (P) => {
|
|
@@ -4129,9 +4129,9 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4129
4129
|
if (!(!a || !l || !c)) {
|
|
4130
4130
|
if (this !== r && this.layout && c && yr(this.options.animationType, this.layout.layoutBox, c.layoutBox)) {
|
|
4131
4131
|
l = this.target || E();
|
|
4132
|
-
const h =
|
|
4132
|
+
const h = W(this.layout.layoutBox.x);
|
|
4133
4133
|
l.x.min = r.target.x.min, l.x.max = l.x.min + h;
|
|
4134
|
-
const d =
|
|
4134
|
+
const d = W(this.layout.layoutBox.y);
|
|
4135
4135
|
l.y.min = r.target.y.min, l.y.max = l.y.min + d;
|
|
4136
4136
|
}
|
|
4137
4137
|
$(a, l), mt(a, u), Mt(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
|
|
@@ -4207,8 +4207,8 @@ function gr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4207
4207
|
}
|
|
4208
4208
|
const d = h.animationValues || h.latestValues;
|
|
4209
4209
|
this.applyTransformsToTarget(), c.transform = pc(this.projectionDeltaWithTransform, this.treeScale, d), u && (c.transform = u(d, c.transform));
|
|
4210
|
-
const { x:
|
|
4211
|
-
c.transformOrigin = `${
|
|
4210
|
+
const { x: p, y: m } = this.projectionDelta;
|
|
4211
|
+
c.transformOrigin = `${p.origin * 100}% ${m.origin * 100}% 0`, h.animationValues ? c.opacity = h === this ? (l = (a = d.opacity) !== null && a !== void 0 ? a : this.latestValues.opacity) !== null && l !== void 0 ? l : 1 : this.preserveOpacity ? this.latestValues.opacity : d.opacityExit : c.opacity = h === this ? d.opacity !== void 0 ? d.opacity : "" : d.opacityExit !== void 0 ? d.opacityExit : 0;
|
|
4212
4212
|
for (const g in qt) {
|
|
4213
4213
|
if (d[g] === void 0)
|
|
4214
4214
|
continue;
|
|
@@ -4243,11 +4243,11 @@ function vc(t) {
|
|
|
4243
4243
|
if (t.isLead() && t.layout && n && t.hasListeners("didUpdate")) {
|
|
4244
4244
|
const { layoutBox: i, measuredBox: s } = t.layout, { animationType: o } = t.options, r = n.source !== t.layout.source;
|
|
4245
4245
|
o === "size" ? _((h) => {
|
|
4246
|
-
const d = r ? n.measuredBox[h] : n.layoutBox[h],
|
|
4247
|
-
d.min = i[h].min, d.max = d.min +
|
|
4246
|
+
const d = r ? n.measuredBox[h] : n.layoutBox[h], p = W(d);
|
|
4247
|
+
d.min = i[h].min, d.max = d.min + p;
|
|
4248
4248
|
}) : yr(o, n.layoutBox, i) && _((h) => {
|
|
4249
|
-
const d = r ? n.measuredBox[h] : n.layoutBox[h],
|
|
4250
|
-
d.max = d.min +
|
|
4249
|
+
const d = r ? n.measuredBox[h] : n.layoutBox[h], p = W(i[h]);
|
|
4250
|
+
d.max = d.min + p, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[h].max = t.relativeTarget[h].min + p);
|
|
4251
4251
|
});
|
|
4252
4252
|
const a = ft();
|
|
4253
4253
|
Mt(a, i, n.layoutBox);
|
|
@@ -4258,12 +4258,12 @@ function vc(t) {
|
|
|
4258
4258
|
if (!t.resumeFrom) {
|
|
4259
4259
|
const h = t.getClosestProjectingParent();
|
|
4260
4260
|
if (h && !h.resumeFrom) {
|
|
4261
|
-
const { snapshot: d, layout:
|
|
4262
|
-
if (d &&
|
|
4261
|
+
const { snapshot: d, layout: p } = h;
|
|
4262
|
+
if (d && p) {
|
|
4263
4263
|
const m = E();
|
|
4264
4264
|
kt(m, n.layoutBox, d.layoutBox);
|
|
4265
4265
|
const g = E();
|
|
4266
|
-
kt(g, i,
|
|
4266
|
+
kt(g, i, p.layoutBox), pr(m, g) || (u = !0), h.options.layoutRoot && (t.relativeTarget = g, t.relativeTargetOrigin = m, t.relativeParent = h);
|
|
4267
4267
|
}
|
|
4268
4268
|
}
|
|
4269
4269
|
}
|
|
@@ -4293,10 +4293,10 @@ function bc(t) {
|
|
|
4293
4293
|
function Li(t) {
|
|
4294
4294
|
t.clearMeasurements();
|
|
4295
4295
|
}
|
|
4296
|
-
function
|
|
4296
|
+
function wc(t) {
|
|
4297
4297
|
t.isLayoutDirty = !1;
|
|
4298
4298
|
}
|
|
4299
|
-
function
|
|
4299
|
+
function Tc(t) {
|
|
4300
4300
|
const { visualElement: e } = t.options;
|
|
4301
4301
|
e && e.getProps().onBeforeLayoutMeasure && e.notify("BeforeLayoutMeasure"), t.resetTransform();
|
|
4302
4302
|
}
|
|
@@ -4379,7 +4379,7 @@ const Lc = gr({
|
|
|
4379
4379
|
MeasureLayout: ur
|
|
4380
4380
|
}
|
|
4381
4381
|
};
|
|
4382
|
-
function
|
|
4382
|
+
function Wi(t, e, n) {
|
|
4383
4383
|
const { props: i } = t;
|
|
4384
4384
|
t.animationState && i.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
4385
4385
|
const s = "onHover" + n, o = i[s];
|
|
@@ -4388,7 +4388,7 @@ function Ui(t, e, n) {
|
|
|
4388
4388
|
class Bc extends nt {
|
|
4389
4389
|
mount() {
|
|
4390
4390
|
const { current: e } = this.node;
|
|
4391
|
-
e && (this.unmount = Fo(e, (n) => (
|
|
4391
|
+
e && (this.unmount = Fo(e, (n) => (Wi(this.node, n, "Start"), (i) => Wi(this.node, i, "End"))));
|
|
4392
4392
|
}
|
|
4393
4393
|
unmount() {
|
|
4394
4394
|
}
|
|
@@ -4415,7 +4415,7 @@ class Oc extends nt {
|
|
|
4415
4415
|
unmount() {
|
|
4416
4416
|
}
|
|
4417
4417
|
}
|
|
4418
|
-
function
|
|
4418
|
+
function Ui(t, e, n) {
|
|
4419
4419
|
const { props: i } = t;
|
|
4420
4420
|
t.animationState && i.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
4421
4421
|
const s = "onTap" + (n === "End" ? "" : n), o = i[s];
|
|
@@ -4424,25 +4424,25 @@ function Wi(t, e, n) {
|
|
|
4424
4424
|
class Ic extends nt {
|
|
4425
4425
|
mount() {
|
|
4426
4426
|
const { current: e } = this.node;
|
|
4427
|
-
e && (this.unmount = jo(e, (n) => (
|
|
4427
|
+
e && (this.unmount = jo(e, (n) => (Ui(this.node, n, "Start"), (i, { success: s }) => Ui(this.node, i, s ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
4428
4428
|
}
|
|
4429
4429
|
unmount() {
|
|
4430
4430
|
}
|
|
4431
4431
|
}
|
|
4432
|
-
const Ie = /* @__PURE__ */ new WeakMap(),
|
|
4432
|
+
const Ie = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), jc = (t) => {
|
|
4433
4433
|
const e = Ie.get(t.target);
|
|
4434
4434
|
e && e(t);
|
|
4435
4435
|
}, Nc = (t) => {
|
|
4436
4436
|
t.forEach(jc);
|
|
4437
4437
|
};
|
|
4438
|
-
function
|
|
4438
|
+
function Wc({ root: t, ...e }) {
|
|
4439
4439
|
const n = t || document;
|
|
4440
|
-
|
|
4441
|
-
const i =
|
|
4440
|
+
we.has(n) || we.set(n, {});
|
|
4441
|
+
const i = we.get(n), s = JSON.stringify(e);
|
|
4442
4442
|
return i[s] || (i[s] = new IntersectionObserver(Nc, { root: t, ...e })), i[s];
|
|
4443
4443
|
}
|
|
4444
|
-
function
|
|
4445
|
-
const i =
|
|
4444
|
+
function Uc(t, e, n) {
|
|
4445
|
+
const i = Wc(e);
|
|
4446
4446
|
return Ie.set(t, n), i.observe(t), () => {
|
|
4447
4447
|
Ie.delete(t), i.unobserve(t);
|
|
4448
4448
|
};
|
|
@@ -4469,7 +4469,7 @@ class _c extends nt {
|
|
|
4469
4469
|
const { onViewportEnter: u, onViewportLeave: h } = this.node.getProps(), d = c ? u : h;
|
|
4470
4470
|
d && d(l);
|
|
4471
4471
|
};
|
|
4472
|
-
return
|
|
4472
|
+
return Uc(this.node.current, r, a);
|
|
4473
4473
|
}
|
|
4474
4474
|
mount() {
|
|
4475
4475
|
this.startObserver();
|
|
@@ -4558,15 +4558,15 @@ class Qc {
|
|
|
4558
4558
|
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = Sn, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
4559
4559
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
4560
4560
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
4561
|
-
const
|
|
4562
|
-
this.renderScheduledAt <
|
|
4561
|
+
const p = H.now();
|
|
4562
|
+
this.renderScheduledAt < p && (this.renderScheduledAt = p, V.render(this.render, !1, !0));
|
|
4563
4563
|
};
|
|
4564
4564
|
const { latestValues: l, renderState: c, onUpdate: u } = r;
|
|
4565
4565
|
this.onUpdate = u, this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = e, this.props = n, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = s, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = re(n), this.isVariantNode = Zi(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
4566
4566
|
const { willChange: h, ...d } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
4567
|
-
for (const
|
|
4568
|
-
const m = d[
|
|
4569
|
-
l[
|
|
4567
|
+
for (const p in d) {
|
|
4568
|
+
const m = d[p];
|
|
4569
|
+
l[p] !== void 0 && O(m) && m.set(l[p], !1);
|
|
4570
4570
|
}
|
|
4571
4571
|
}
|
|
4572
4572
|
mount(e) {
|
|
@@ -4703,7 +4703,7 @@ class Qc {
|
|
|
4703
4703
|
readValue(e, n) {
|
|
4704
4704
|
var i;
|
|
4705
4705
|
let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (i = this.getBaseTargetFromProps(this.props, e)) !== null && i !== void 0 ? i : this.readValueFromInstance(this.current, e, this.options);
|
|
4706
|
-
return s != null && (typeof s == "string" && (
|
|
4706
|
+
return s != null && (typeof s == "string" && (Us(s) || Rs(s)) ? s = parseFloat(s) : !Yc(s) && et.test(n) && (s = js(e, n)), this.setBaseTarget(e, O(s) ? s.get() : s)), O(s) ? s.get() : s;
|
|
4707
4707
|
}
|
|
4708
4708
|
/**
|
|
4709
4709
|
* Set the base target to later animate back to. This is currently
|
|
@@ -4817,7 +4817,7 @@ const eu = (t, e) => Ze(t) ? new tu(e) : new Jc(e, {
|
|
|
4817
4817
|
...zc,
|
|
4818
4818
|
...Fc,
|
|
4819
4819
|
...Gc
|
|
4820
|
-
}, eu), N = /* @__PURE__ */
|
|
4820
|
+
}, eu), N = /* @__PURE__ */ Ur(nu), iu = {
|
|
4821
4821
|
happy: {
|
|
4822
4822
|
eyeShape: "normal",
|
|
4823
4823
|
eyebrowShape: "normal",
|
|
@@ -4982,34 +4982,42 @@ const eu = (t, e) => Ze(t) ? new tu(e) : new Jc(e, {
|
|
|
4982
4982
|
idleAnimation: { type: "tremble", duration: 0.3 },
|
|
4983
4983
|
accessories: { sweatDrop: !0 },
|
|
4984
4984
|
skinColor: "#FFDAB9"
|
|
4985
|
+
},
|
|
4986
|
+
laughing: {
|
|
4987
|
+
eyeShape: "closed",
|
|
4988
|
+
eyebrowShape: "lifted",
|
|
4989
|
+
mouthShape: "laugh",
|
|
4990
|
+
idleAnimation: { type: "bounce", duration: 0.6 },
|
|
4991
|
+
accessories: { blush: !0 },
|
|
4992
|
+
skinColor: "#FFD700"
|
|
4985
4993
|
}
|
|
4986
4994
|
};
|
|
4987
4995
|
function su({ cx: t, cy: e, animated: n }) {
|
|
4988
4996
|
return /* @__PURE__ */ C("g", { className: n ? "ef-eye-blink" : "", style: { transformOrigin: `${t}px ${e}px` }, children: [
|
|
4989
|
-
/* @__PURE__ */
|
|
4990
|
-
/* @__PURE__ */
|
|
4997
|
+
/* @__PURE__ */ f("ellipse", { cx: t, cy: e, rx: 9, ry: 11, fill: "#333" }),
|
|
4998
|
+
/* @__PURE__ */ f("circle", { cx: t + 3, cy: e - 3, r: 2.5, fill: "white" })
|
|
4991
4999
|
] });
|
|
4992
5000
|
}
|
|
4993
5001
|
function ru({ cx: t, cy: e }) {
|
|
4994
5002
|
return /* @__PURE__ */ C("g", { children: [
|
|
4995
|
-
/* @__PURE__ */
|
|
4996
|
-
/* @__PURE__ */
|
|
5003
|
+
/* @__PURE__ */ f("ellipse", { cx: t, cy: e + 2, rx: 10, ry: 5, fill: "#333" }),
|
|
5004
|
+
/* @__PURE__ */ f("line", { x1: t - 10, y1: e - 3, x2: t + 10, y2: e - 3, stroke: "#333", strokeWidth: 2.5, strokeLinecap: "round" })
|
|
4997
5005
|
] });
|
|
4998
5006
|
}
|
|
4999
5007
|
function ou({ cx: t, cy: e, animated: n }) {
|
|
5000
5008
|
return /* @__PURE__ */ C("g", { className: n ? "ef-eye-blink" : "", style: { transformOrigin: `${t}px ${e}px` }, children: [
|
|
5001
|
-
/* @__PURE__ */
|
|
5002
|
-
/* @__PURE__ */
|
|
5009
|
+
/* @__PURE__ */ f("ellipse", { cx: t, cy: e, rx: 10, ry: 13, fill: "#333" }),
|
|
5010
|
+
/* @__PURE__ */ f("circle", { cx: t + 3, cy: e - 4, r: 3, fill: "white" })
|
|
5003
5011
|
] });
|
|
5004
5012
|
}
|
|
5005
5013
|
function au({ cx: t, cy: e, animated: n }) {
|
|
5006
5014
|
return /* @__PURE__ */ C("g", { className: n ? "ef-eye-blink" : "", style: { transformOrigin: `${t}px ${e}px` }, children: [
|
|
5007
|
-
/* @__PURE__ */
|
|
5008
|
-
/* @__PURE__ */
|
|
5015
|
+
/* @__PURE__ */ f("ellipse", { cx: t, cy: e + 2, rx: 9, ry: 10, fill: "#333" }),
|
|
5016
|
+
/* @__PURE__ */ f("circle", { cx: t + 3, cy: e - 2, r: 2, fill: "white" })
|
|
5009
5017
|
] });
|
|
5010
5018
|
}
|
|
5011
5019
|
function lu({ cx: t, cy: e }) {
|
|
5012
|
-
return /* @__PURE__ */
|
|
5020
|
+
return /* @__PURE__ */ f("g", { children: /* @__PURE__ */ f(
|
|
5013
5021
|
"path",
|
|
5014
5022
|
{
|
|
5015
5023
|
d: `M ${t} ${e + 6} C ${t - 10} ${e - 2} ${t - 14} ${e + 8} ${t} ${e + 14} C ${t + 14} ${e + 8} ${t + 10} ${e - 2} ${t} ${e + 6} Z`,
|
|
@@ -5019,7 +5027,7 @@ function lu({ cx: t, cy: e }) {
|
|
|
5019
5027
|
) });
|
|
5020
5028
|
}
|
|
5021
5029
|
function cu({ cx: t, cy: e }) {
|
|
5022
|
-
return /* @__PURE__ */
|
|
5030
|
+
return /* @__PURE__ */ f("g", { children: /* @__PURE__ */ f(
|
|
5023
5031
|
"path",
|
|
5024
5032
|
{
|
|
5025
5033
|
d: `M ${t - 10} ${e} Q ${t} ${e - 6} ${t + 10} ${e}`,
|
|
@@ -5032,15 +5040,15 @@ function cu({ cx: t, cy: e }) {
|
|
|
5032
5040
|
}
|
|
5033
5041
|
function uu({ cx: t, cy: e, animated: n }) {
|
|
5034
5042
|
return /* @__PURE__ */ C("g", { className: n ? "ef-eye-blink" : "", style: { transformOrigin: `${t}px ${e}px` }, children: [
|
|
5035
|
-
/* @__PURE__ */
|
|
5036
|
-
/* @__PURE__ */
|
|
5043
|
+
/* @__PURE__ */ f("ellipse", { cx: t, cy: e + 3, rx: 9, ry: 6, fill: "#333" }),
|
|
5044
|
+
/* @__PURE__ */ f("line", { x1: t - 9, y1: e - 3, x2: t + 9, y2: e - 3, stroke: "#333", strokeWidth: 2.5, strokeLinecap: "round" })
|
|
5037
5045
|
] });
|
|
5038
5046
|
}
|
|
5039
5047
|
function hu({ cx: t, cy: e, animated: n }) {
|
|
5040
5048
|
return /* @__PURE__ */ C("g", { className: n ? "ef-eye-blink" : "", style: { transformOrigin: `${t}px ${e}px` }, children: [
|
|
5041
|
-
/* @__PURE__ */
|
|
5042
|
-
/* @__PURE__ */
|
|
5043
|
-
/* @__PURE__ */
|
|
5049
|
+
/* @__PURE__ */ f("circle", { cx: t, cy: e, r: 12, fill: "white", stroke: "#333", strokeWidth: 2 }),
|
|
5050
|
+
/* @__PURE__ */ f("circle", { cx: t, cy: e, r: 8, fill: "#333" }),
|
|
5051
|
+
/* @__PURE__ */ f("circle", { cx: t + 3, cy: e - 3, r: 2.5, fill: "white" })
|
|
5044
5052
|
] });
|
|
5045
5053
|
}
|
|
5046
5054
|
function du({ shape: t, animated: e }) {
|
|
@@ -5048,7 +5056,7 @@ function du({ shape: t, animated: e }) {
|
|
|
5048
5056
|
{ cx: 62, cy: 95 },
|
|
5049
5057
|
{ cx: 138, cy: 95 }
|
|
5050
5058
|
];
|
|
5051
|
-
return /* @__PURE__ */
|
|
5059
|
+
return /* @__PURE__ */ f(ee, { mode: "wait", children: /* @__PURE__ */ f(
|
|
5052
5060
|
N.g,
|
|
5053
5061
|
{
|
|
5054
5062
|
initial: { opacity: 0 },
|
|
@@ -5058,21 +5066,21 @@ function du({ shape: t, animated: e }) {
|
|
|
5058
5066
|
children: n.map(({ cx: i, cy: s }, o) => {
|
|
5059
5067
|
switch (t) {
|
|
5060
5068
|
case "sleepy":
|
|
5061
|
-
return /* @__PURE__ */
|
|
5069
|
+
return /* @__PURE__ */ f(ru, { cx: i, cy: s }, o);
|
|
5062
5070
|
case "surprised":
|
|
5063
|
-
return /* @__PURE__ */
|
|
5071
|
+
return /* @__PURE__ */ f(ou, { cx: i, cy: s, animated: e }, o);
|
|
5064
5072
|
case "sad":
|
|
5065
|
-
return /* @__PURE__ */
|
|
5073
|
+
return /* @__PURE__ */ f(au, { cx: i, cy: s, animated: e }, o);
|
|
5066
5074
|
case "heart":
|
|
5067
|
-
return /* @__PURE__ */
|
|
5075
|
+
return /* @__PURE__ */ f(lu, { cx: i, cy: s }, o);
|
|
5068
5076
|
case "closed":
|
|
5069
|
-
return /* @__PURE__ */
|
|
5077
|
+
return /* @__PURE__ */ f(cu, { cx: i, cy: s }, o);
|
|
5070
5078
|
case "squint":
|
|
5071
|
-
return /* @__PURE__ */
|
|
5079
|
+
return /* @__PURE__ */ f(uu, { cx: i, cy: s, animated: e }, o);
|
|
5072
5080
|
case "wide":
|
|
5073
|
-
return /* @__PURE__ */
|
|
5081
|
+
return /* @__PURE__ */ f(hu, { cx: i, cy: s, animated: e }, o);
|
|
5074
5082
|
default:
|
|
5075
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ f(su, { cx: i, cy: s, animated: e }, o);
|
|
5076
5084
|
}
|
|
5077
5085
|
})
|
|
5078
5086
|
},
|
|
@@ -5084,43 +5092,43 @@ function fu({ shape: t }) {
|
|
|
5084
5092
|
switch (t) {
|
|
5085
5093
|
case "normal":
|
|
5086
5094
|
return /* @__PURE__ */ C("g", { children: [
|
|
5087
|
-
/* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ f("path", { d: "M 54 74 Q 66 70 78 74", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5096
|
+
/* @__PURE__ */ f("path", { d: "M 122 74 Q 134 70 146 74", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5089
5097
|
] });
|
|
5090
5098
|
case "raised":
|
|
5091
5099
|
return /* @__PURE__ */ C("g", { children: [
|
|
5092
|
-
/* @__PURE__ */
|
|
5093
|
-
/* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ f("path", { d: "M 54 68 Q 66 64 78 68", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5101
|
+
/* @__PURE__ */ f("path", { d: "M 122 68 Q 134 64 146 68", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5094
5102
|
] });
|
|
5095
5103
|
case "furrowed":
|
|
5096
5104
|
return /* @__PURE__ */ C("g", { children: [
|
|
5097
|
-
/* @__PURE__ */
|
|
5098
|
-
/* @__PURE__ */
|
|
5105
|
+
/* @__PURE__ */ f("path", { d: "M 54 74 Q 66 78 78 70", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5106
|
+
/* @__PURE__ */ f("path", { d: "M 122 70 Q 134 78 146 74", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5099
5107
|
] });
|
|
5100
5108
|
case "sad":
|
|
5101
5109
|
return /* @__PURE__ */ C("g", { children: [
|
|
5102
|
-
/* @__PURE__ */
|
|
5103
|
-
/* @__PURE__ */
|
|
5110
|
+
/* @__PURE__ */ f("path", { d: "M 54 72 Q 66 76 78 72", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5111
|
+
/* @__PURE__ */ f("path", { d: "M 122 72 Q 134 76 146 72", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5104
5112
|
] });
|
|
5105
5113
|
case "lifted":
|
|
5106
5114
|
return /* @__PURE__ */ C("g", { children: [
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5115
|
+
/* @__PURE__ */ f("path", { d: "M 54 72 Q 66 66 78 70", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5116
|
+
/* @__PURE__ */ f("path", { d: "M 122 70 Q 134 66 146 72", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5109
5117
|
] });
|
|
5110
5118
|
case "flat":
|
|
5111
5119
|
return /* @__PURE__ */ C("g", { children: [
|
|
5112
|
-
/* @__PURE__ */
|
|
5113
|
-
/* @__PURE__ */
|
|
5120
|
+
/* @__PURE__ */ f("line", { x1: "54", y1: "74", x2: "78", y2: "74", stroke: e, strokeWidth: 3.5, strokeLinecap: i }),
|
|
5121
|
+
/* @__PURE__ */ f("line", { x1: "122", y1: "74", x2: "146", y2: "74", stroke: e, strokeWidth: 3.5, strokeLinecap: i })
|
|
5114
5122
|
] });
|
|
5115
5123
|
case "asymmetric":
|
|
5116
5124
|
return /* @__PURE__ */ C("g", { children: [
|
|
5117
|
-
/* @__PURE__ */
|
|
5118
|
-
/* @__PURE__ */
|
|
5125
|
+
/* @__PURE__ */ f("path", { d: "M 54 68 Q 66 64 78 70", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5126
|
+
/* @__PURE__ */ f("path", { d: "M 122 70 Q 134 78 146 72", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5119
5127
|
] });
|
|
5120
5128
|
default:
|
|
5121
5129
|
return /* @__PURE__ */ C("g", { children: [
|
|
5122
|
-
/* @__PURE__ */
|
|
5123
|
-
/* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ f("path", { d: "M 54 74 Q 66 70 78 74", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i }),
|
|
5131
|
+
/* @__PURE__ */ f("path", { d: "M 122 74 Q 134 70 146 74", stroke: e, strokeWidth: 3.5, fill: "none", strokeLinecap: i })
|
|
5124
5132
|
] });
|
|
5125
5133
|
}
|
|
5126
5134
|
}
|
|
@@ -5134,7 +5142,7 @@ const Ki = {
|
|
|
5134
5142
|
};
|
|
5135
5143
|
function pu({ shape: t }) {
|
|
5136
5144
|
const e = Ki[t] || Ki.flat;
|
|
5137
|
-
return /* @__PURE__ */
|
|
5145
|
+
return /* @__PURE__ */ f(
|
|
5138
5146
|
N.path,
|
|
5139
5147
|
{
|
|
5140
5148
|
d: e,
|
|
@@ -5148,22 +5156,22 @@ function pu({ shape: t }) {
|
|
|
5148
5156
|
);
|
|
5149
5157
|
}
|
|
5150
5158
|
function mu() {
|
|
5151
|
-
return /* @__PURE__ */
|
|
5159
|
+
return /* @__PURE__ */ f("ellipse", { cx: 100, cy: 118, rx: 8, ry: 10, fill: "#333" });
|
|
5152
5160
|
}
|
|
5153
5161
|
function gu() {
|
|
5154
5162
|
return /* @__PURE__ */ C("g", { children: [
|
|
5155
|
-
/* @__PURE__ */
|
|
5156
|
-
/* @__PURE__ */
|
|
5163
|
+
/* @__PURE__ */ f("path", { d: "M 82 114 Q 100 134 118 114", stroke: "#333", strokeWidth: 3.5, fill: "#cc4444", strokeLinecap: "round" }),
|
|
5164
|
+
/* @__PURE__ */ f("path", { d: "M 82 114 Q 100 134 118 114 Z", fill: "#cc4444" })
|
|
5157
5165
|
] });
|
|
5158
5166
|
}
|
|
5159
5167
|
function yu() {
|
|
5160
5168
|
return /* @__PURE__ */ C("g", { children: [
|
|
5161
|
-
/* @__PURE__ */
|
|
5162
|
-
/* @__PURE__ */
|
|
5169
|
+
/* @__PURE__ */ f("path", { d: "M 85 116 Q 100 128 115 116", stroke: "#333", strokeWidth: 3.5, fill: "none", strokeLinecap: "round" }),
|
|
5170
|
+
/* @__PURE__ */ f("ellipse", { cx: 100, cy: 125, rx: 8, ry: 6, fill: "#FF69B4", stroke: "#333", strokeWidth: 2 })
|
|
5163
5171
|
] });
|
|
5164
5172
|
}
|
|
5165
5173
|
function vu() {
|
|
5166
|
-
return /* @__PURE__ */
|
|
5174
|
+
return /* @__PURE__ */ f(
|
|
5167
5175
|
"polyline",
|
|
5168
5176
|
{
|
|
5169
5177
|
points: "85,122 90,116 95,122 100,116 105,122 110,116 115,120",
|
|
@@ -5175,9 +5183,18 @@ function vu() {
|
|
|
5175
5183
|
}
|
|
5176
5184
|
);
|
|
5177
5185
|
}
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5186
|
+
function xu() {
|
|
5187
|
+
return /* @__PURE__ */ C("g", { children: [
|
|
5188
|
+
/* @__PURE__ */ f("path", { d: "M 80 112 Q 100 138 120 112", stroke: "#333", strokeWidth: 3.5, fill: "#cc4444", strokeLinecap: "round" }),
|
|
5189
|
+
/* @__PURE__ */ f("line", { x1: "80", y1: "112", x2: "120", y2: "112", stroke: "#333", strokeWidth: 3 }),
|
|
5190
|
+
/* @__PURE__ */ f("rect", { x: 83, y: 108, width: 9, height: 7, rx: 2, fill: "white", stroke: "#ccc", strokeWidth: 0.5 }),
|
|
5191
|
+
/* @__PURE__ */ f("rect", { x: 94, y: 107, width: 12, height: 8, rx: 2, fill: "white", stroke: "#ccc", strokeWidth: 0.5 }),
|
|
5192
|
+
/* @__PURE__ */ f("rect", { x: 108, y: 108, width: 9, height: 7, rx: 2, fill: "white", stroke: "#ccc", strokeWidth: 0.5 })
|
|
5193
|
+
] });
|
|
5194
|
+
}
|
|
5195
|
+
const Su = /* @__PURE__ */ new Set(["surprised-o", "excited-open", "silly", "zigzag", "laugh"]);
|
|
5196
|
+
function bu({ shape: t }) {
|
|
5197
|
+
return Su.has(t) ? /* @__PURE__ */ f(ee, { mode: "wait", children: /* @__PURE__ */ C(
|
|
5181
5198
|
N.g,
|
|
5182
5199
|
{
|
|
5183
5200
|
initial: { opacity: 0, scale: 0.8 },
|
|
@@ -5186,24 +5203,25 @@ function Su({ shape: t }) {
|
|
|
5186
5203
|
transition: { duration: 0.2 },
|
|
5187
5204
|
style: { transformOrigin: "100px 122px" },
|
|
5188
5205
|
children: [
|
|
5189
|
-
t === "surprised-o" && /* @__PURE__ */
|
|
5190
|
-
t === "excited-open" && /* @__PURE__ */
|
|
5191
|
-
t === "silly" && /* @__PURE__ */
|
|
5192
|
-
t === "zigzag" && /* @__PURE__ */
|
|
5206
|
+
t === "surprised-o" && /* @__PURE__ */ f(mu, {}),
|
|
5207
|
+
t === "excited-open" && /* @__PURE__ */ f(gu, {}),
|
|
5208
|
+
t === "silly" && /* @__PURE__ */ f(yu, {}),
|
|
5209
|
+
t === "zigzag" && /* @__PURE__ */ f(vu, {}),
|
|
5210
|
+
t === "laugh" && /* @__PURE__ */ f(xu, {})
|
|
5193
5211
|
]
|
|
5194
5212
|
},
|
|
5195
5213
|
t
|
|
5196
|
-
) }) : /* @__PURE__ */
|
|
5214
|
+
) }) : /* @__PURE__ */ f(pu, { shape: t });
|
|
5197
5215
|
}
|
|
5198
|
-
function
|
|
5216
|
+
function wu() {
|
|
5199
5217
|
return /* @__PURE__ */ C("g", { children: [
|
|
5200
|
-
/* @__PURE__ */
|
|
5201
|
-
/* @__PURE__ */
|
|
5218
|
+
/* @__PURE__ */ f("ellipse", { cx: 62, cy: 100, rx: 14, ry: 8, fill: "#FF9999", opacity: 0.6 }),
|
|
5219
|
+
/* @__PURE__ */ f("ellipse", { cx: 138, cy: 100, rx: 14, ry: 8, fill: "#FF9999", opacity: 0.6 })
|
|
5202
5220
|
] });
|
|
5203
5221
|
}
|
|
5204
5222
|
function Tu({ animated: t }) {
|
|
5205
5223
|
return /* @__PURE__ */ C("g", { children: [
|
|
5206
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ f(
|
|
5207
5225
|
"ellipse",
|
|
5208
5226
|
{
|
|
5209
5227
|
cx: 68,
|
|
@@ -5214,7 +5232,7 @@ function Tu({ animated: t }) {
|
|
|
5214
5232
|
className: t ? "ef-tear-1" : ""
|
|
5215
5233
|
}
|
|
5216
5234
|
),
|
|
5217
|
-
/* @__PURE__ */
|
|
5235
|
+
/* @__PURE__ */ f(
|
|
5218
5236
|
"ellipse",
|
|
5219
5237
|
{
|
|
5220
5238
|
cx: 132,
|
|
@@ -5227,9 +5245,9 @@ function Tu({ animated: t }) {
|
|
|
5227
5245
|
)
|
|
5228
5246
|
] });
|
|
5229
5247
|
}
|
|
5230
|
-
function
|
|
5248
|
+
function Pu({ animated: t }) {
|
|
5231
5249
|
return /* @__PURE__ */ C("g", { children: [
|
|
5232
|
-
/* @__PURE__ */
|
|
5250
|
+
/* @__PURE__ */ f(
|
|
5233
5251
|
"text",
|
|
5234
5252
|
{
|
|
5235
5253
|
x: 145,
|
|
@@ -5242,7 +5260,7 @@ function wu({ animated: t }) {
|
|
|
5242
5260
|
children: "Z"
|
|
5243
5261
|
}
|
|
5244
5262
|
),
|
|
5245
|
-
/* @__PURE__ */
|
|
5263
|
+
/* @__PURE__ */ f(
|
|
5246
5264
|
"text",
|
|
5247
5265
|
{
|
|
5248
5266
|
x: 155,
|
|
@@ -5255,7 +5273,7 @@ function wu({ animated: t }) {
|
|
|
5255
5273
|
children: "z"
|
|
5256
5274
|
}
|
|
5257
5275
|
),
|
|
5258
|
-
/* @__PURE__ */
|
|
5276
|
+
/* @__PURE__ */ f(
|
|
5259
5277
|
"text",
|
|
5260
5278
|
{
|
|
5261
5279
|
x: 163,
|
|
@@ -5270,12 +5288,12 @@ function wu({ animated: t }) {
|
|
|
5270
5288
|
)
|
|
5271
5289
|
] });
|
|
5272
5290
|
}
|
|
5273
|
-
function
|
|
5274
|
-
return /* @__PURE__ */
|
|
5291
|
+
function Au({ animated: t }) {
|
|
5292
|
+
return /* @__PURE__ */ f("g", { children: [
|
|
5275
5293
|
{ x: 148, y: 65, size: 12, cls: "ef-float-heart-1" },
|
|
5276
5294
|
{ x: 160, y: 50, size: 9, cls: "ef-float-heart-2" },
|
|
5277
5295
|
{ x: 138, y: 45, size: 7, cls: "ef-float-heart-3" }
|
|
5278
|
-
].map(({ x: n, y: i, size: s, cls: o }, r) => /* @__PURE__ */
|
|
5296
|
+
].map(({ x: n, y: i, size: s, cls: o }, r) => /* @__PURE__ */ f(
|
|
5279
5297
|
"text",
|
|
5280
5298
|
{
|
|
5281
5299
|
x: n,
|
|
@@ -5289,8 +5307,8 @@ function Pu({ animated: t }) {
|
|
|
5289
5307
|
r
|
|
5290
5308
|
)) });
|
|
5291
5309
|
}
|
|
5292
|
-
function
|
|
5293
|
-
return /* @__PURE__ */
|
|
5310
|
+
function Cu({ animated: t }) {
|
|
5311
|
+
return /* @__PURE__ */ f("g", { className: t ? "ef-sweat-drop" : "", children: /* @__PURE__ */ f(
|
|
5294
5312
|
"path",
|
|
5295
5313
|
{
|
|
5296
5314
|
d: "M 148 68 Q 152 60 156 68 Q 156 74 152 75 Q 148 74 148 68 Z",
|
|
@@ -5300,13 +5318,13 @@ function Au({ animated: t }) {
|
|
|
5300
5318
|
}
|
|
5301
5319
|
) });
|
|
5302
5320
|
}
|
|
5303
|
-
function
|
|
5304
|
-
return /* @__PURE__ */
|
|
5321
|
+
function Vu({ animated: t }) {
|
|
5322
|
+
return /* @__PURE__ */ f("g", { children: [
|
|
5305
5323
|
{ x: 148, y: 52, cls: "ef-sparkle-1" },
|
|
5306
5324
|
{ x: 155, y: 68, cls: "ef-sparkle-2" },
|
|
5307
5325
|
{ x: 40, y: 60, cls: "ef-sparkle-3" },
|
|
5308
5326
|
{ x: 48, y: 75, cls: "ef-sparkle-4" }
|
|
5309
|
-
].map(({ x: n, y: i, cls: s }, o) => /* @__PURE__ */
|
|
5327
|
+
].map(({ x: n, y: i, cls: s }, o) => /* @__PURE__ */ f(
|
|
5310
5328
|
"text",
|
|
5311
5329
|
{
|
|
5312
5330
|
x: n,
|
|
@@ -5320,15 +5338,15 @@ function Cu({ animated: t }) {
|
|
|
5320
5338
|
o
|
|
5321
5339
|
)) });
|
|
5322
5340
|
}
|
|
5323
|
-
function
|
|
5341
|
+
function Du() {
|
|
5324
5342
|
return /* @__PURE__ */ C("g", { className: "ef-anger-pulse", children: [
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
/* @__PURE__ */
|
|
5327
|
-
/* @__PURE__ */
|
|
5343
|
+
/* @__PURE__ */ f("path", { d: "M 42 52 L 50 44 L 58 52 L 50 60 Z", fill: "#FF4444", opacity: 0.85 }),
|
|
5344
|
+
/* @__PURE__ */ f("line", { x1: "46", y1: "48", x2: "54", y2: "56", stroke: "#CC0000", strokeWidth: 2 }),
|
|
5345
|
+
/* @__PURE__ */ f("line", { x1: "54", y1: "48", x2: "46", y2: "56", stroke: "#CC0000", strokeWidth: 2 })
|
|
5328
5346
|
] });
|
|
5329
5347
|
}
|
|
5330
|
-
function
|
|
5331
|
-
return /* @__PURE__ */
|
|
5348
|
+
function Mu() {
|
|
5349
|
+
return /* @__PURE__ */ f(
|
|
5332
5350
|
"text",
|
|
5333
5351
|
{
|
|
5334
5352
|
x: 148,
|
|
@@ -5341,7 +5359,7 @@ function Du() {
|
|
|
5341
5359
|
}
|
|
5342
5360
|
);
|
|
5343
5361
|
}
|
|
5344
|
-
function
|
|
5362
|
+
function ku({ config: t, animated: e }) {
|
|
5345
5363
|
const {
|
|
5346
5364
|
blush: n,
|
|
5347
5365
|
tears: i,
|
|
@@ -5353,17 +5371,17 @@ function Mu({ config: t, animated: e }) {
|
|
|
5353
5371
|
questionMark: c
|
|
5354
5372
|
} = t;
|
|
5355
5373
|
return /* @__PURE__ */ C(ee, { children: [
|
|
5356
|
-
n && /* @__PURE__ */
|
|
5357
|
-
i && /* @__PURE__ */
|
|
5358
|
-
s && /* @__PURE__ */
|
|
5359
|
-
o && /* @__PURE__ */
|
|
5360
|
-
r && /* @__PURE__ */
|
|
5361
|
-
a && /* @__PURE__ */
|
|
5362
|
-
l && /* @__PURE__ */
|
|
5363
|
-
c && /* @__PURE__ */
|
|
5374
|
+
n && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(wu, {}) }, "blush"),
|
|
5375
|
+
i && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Tu, { animated: e }) }, "tears"),
|
|
5376
|
+
s && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Pu, { animated: e }) }, "z"),
|
|
5377
|
+
o && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Au, { animated: e }) }, "hearts"),
|
|
5378
|
+
r && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Cu, { animated: e }) }, "sweat"),
|
|
5379
|
+
a && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Vu, { animated: e }) }, "sparkles"),
|
|
5380
|
+
l && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Du, {}) }, "anger"),
|
|
5381
|
+
c && /* @__PURE__ */ f(N.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: /* @__PURE__ */ f(Mu, {}) }, "question")
|
|
5364
5382
|
] });
|
|
5365
5383
|
}
|
|
5366
|
-
function
|
|
5384
|
+
function Eu(t, e) {
|
|
5367
5385
|
if (!e) return "";
|
|
5368
5386
|
switch (t.idleAnimation.type) {
|
|
5369
5387
|
case "breathe":
|
|
@@ -5386,9 +5404,9 @@ function ku(t, e) {
|
|
|
5386
5404
|
return "";
|
|
5387
5405
|
}
|
|
5388
5406
|
}
|
|
5389
|
-
function
|
|
5390
|
-
const s =
|
|
5391
|
-
return /* @__PURE__ */
|
|
5407
|
+
function Ru({ config: t, color: e, animated: n, size: i }) {
|
|
5408
|
+
const s = Eu(t, n);
|
|
5409
|
+
return /* @__PURE__ */ f(
|
|
5392
5410
|
"svg",
|
|
5393
5411
|
{
|
|
5394
5412
|
width: i,
|
|
@@ -5408,7 +5426,7 @@ function Eu({ config: t, color: e, animated: n, size: i }) {
|
|
|
5408
5426
|
ease: "easeInOut"
|
|
5409
5427
|
} : void 0,
|
|
5410
5428
|
children: [
|
|
5411
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ f(
|
|
5412
5430
|
"rect",
|
|
5413
5431
|
{
|
|
5414
5432
|
x: 25,
|
|
@@ -5421,19 +5439,19 @@ function Eu({ config: t, color: e, animated: n, size: i }) {
|
|
|
5421
5439
|
strokeWidth: 3
|
|
5422
5440
|
}
|
|
5423
5441
|
),
|
|
5424
|
-
/* @__PURE__ */
|
|
5425
|
-
/* @__PURE__ */
|
|
5426
|
-
/* @__PURE__ */
|
|
5427
|
-
/* @__PURE__ */
|
|
5428
|
-
/* @__PURE__ */
|
|
5429
|
-
/* @__PURE__ */
|
|
5442
|
+
/* @__PURE__ */ f("ellipse", { cx: 56, cy: 105, rx: 12, ry: 8, fill: "#ff8c8c", opacity: 0.6 }),
|
|
5443
|
+
/* @__PURE__ */ f("ellipse", { cx: 144, cy: 105, rx: 12, ry: 8, fill: "#ff8c8c", opacity: 0.6 }),
|
|
5444
|
+
/* @__PURE__ */ f(ku, { config: t.accessories, animated: n }),
|
|
5445
|
+
/* @__PURE__ */ f(fu, { shape: t.eyebrowShape }),
|
|
5446
|
+
/* @__PURE__ */ f(du, { shape: t.eyeShape, animated: n }),
|
|
5447
|
+
/* @__PURE__ */ f(bu, { shape: t.mouthShape })
|
|
5430
5448
|
]
|
|
5431
5449
|
}
|
|
5432
5450
|
)
|
|
5433
5451
|
}
|
|
5434
5452
|
);
|
|
5435
5453
|
}
|
|
5436
|
-
function
|
|
5454
|
+
function Lu({ message: t, size: e }) {
|
|
5437
5455
|
return /* @__PURE__ */ C(
|
|
5438
5456
|
N.div,
|
|
5439
5457
|
{
|
|
@@ -5462,7 +5480,7 @@ function Ru({ message: t, size: e }) {
|
|
|
5462
5480
|
},
|
|
5463
5481
|
children: [
|
|
5464
5482
|
t,
|
|
5465
|
-
/* @__PURE__ */
|
|
5483
|
+
/* @__PURE__ */ f(
|
|
5466
5484
|
"div",
|
|
5467
5485
|
{
|
|
5468
5486
|
style: {
|
|
@@ -5477,7 +5495,7 @@ function Ru({ message: t, size: e }) {
|
|
|
5477
5495
|
}
|
|
5478
5496
|
}
|
|
5479
5497
|
),
|
|
5480
|
-
/* @__PURE__ */
|
|
5498
|
+
/* @__PURE__ */ f(
|
|
5481
5499
|
"div",
|
|
5482
5500
|
{
|
|
5483
5501
|
style: {
|
|
@@ -5496,7 +5514,7 @@ function Ru({ message: t, size: e }) {
|
|
|
5496
5514
|
}
|
|
5497
5515
|
);
|
|
5498
5516
|
}
|
|
5499
|
-
function
|
|
5517
|
+
function Wu({
|
|
5500
5518
|
emotion: t,
|
|
5501
5519
|
message: e,
|
|
5502
5520
|
size: n = 200,
|
|
@@ -5505,7 +5523,7 @@ function ju({
|
|
|
5505
5523
|
onEmotionChange: o
|
|
5506
5524
|
}) {
|
|
5507
5525
|
const r = iu[t], a = s || r.skinColor || "#FFD700";
|
|
5508
|
-
return
|
|
5526
|
+
return Tr.useEffect(() => {
|
|
5509
5527
|
o == null || o(t);
|
|
5510
5528
|
}, [t, o]), /* @__PURE__ */ C(
|
|
5511
5529
|
"div",
|
|
@@ -5516,8 +5534,8 @@ function ju({
|
|
|
5516
5534
|
width: n
|
|
5517
5535
|
},
|
|
5518
5536
|
children: [
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
|
|
5537
|
+
/* @__PURE__ */ f(
|
|
5538
|
+
Ru,
|
|
5521
5539
|
{
|
|
5522
5540
|
config: r,
|
|
5523
5541
|
color: a,
|
|
@@ -5525,8 +5543,8 @@ function ju({
|
|
|
5525
5543
|
size: n
|
|
5526
5544
|
}
|
|
5527
5545
|
),
|
|
5528
|
-
/* @__PURE__ */
|
|
5529
|
-
|
|
5546
|
+
/* @__PURE__ */ f(ee, { children: e && /* @__PURE__ */ f(
|
|
5547
|
+
Lu,
|
|
5530
5548
|
{
|
|
5531
5549
|
message: e,
|
|
5532
5550
|
size: n
|
|
@@ -5537,7 +5555,7 @@ function ju({
|
|
|
5537
5555
|
}
|
|
5538
5556
|
);
|
|
5539
5557
|
}
|
|
5540
|
-
const
|
|
5558
|
+
const Fu = [
|
|
5541
5559
|
"happy",
|
|
5542
5560
|
"sad",
|
|
5543
5561
|
"angry",
|
|
@@ -5557,9 +5575,14 @@ const Nu = [
|
|
|
5557
5575
|
"silly",
|
|
5558
5576
|
"determined",
|
|
5559
5577
|
"shy",
|
|
5560
|
-
"anxious"
|
|
5578
|
+
"anxious",
|
|
5579
|
+
"laughing"
|
|
5561
5580
|
];
|
|
5581
|
+
function Uu() {
|
|
5582
|
+
return Fu;
|
|
5583
|
+
}
|
|
5562
5584
|
export {
|
|
5563
|
-
|
|
5564
|
-
|
|
5585
|
+
Fu as EMOTIONS,
|
|
5586
|
+
Wu as EmotionFace,
|
|
5587
|
+
Uu as getEmotions
|
|
5565
5588
|
};
|