@devalok/shilp-sutra 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/framer.js +946 -672
- package/dist/_chunks/keybinding.js +19 -0
- package/dist/_chunks/stat-row.js +455 -0
- package/dist/_chunks/tiptap.js +1 -1
- package/dist/_chunks/vendor-client.js +1 -1
- package/dist/_chunks/vendor-utils.js +1311 -1168
- package/dist/ai/ai-command-provider.d.ts +23 -0
- package/dist/ai/ai-command-provider.d.ts.map +1 -0
- package/dist/ai/ai-command-provider.js +20 -0
- package/dist/ai/block-renderer.d.ts +12 -0
- package/dist/ai/block-renderer.d.ts.map +1 -0
- package/dist/ai/block-renderer.js +54 -0
- package/dist/ai/blocks/block-table.d.ts +6 -0
- package/dist/ai/blocks/block-table.d.ts.map +1 -0
- package/dist/ai/blocks/confirm.d.ts +6 -0
- package/dist/ai/blocks/confirm.d.ts.map +1 -0
- package/dist/ai/blocks/divider.d.ts +6 -0
- package/dist/ai/blocks/divider.d.ts.map +1 -0
- package/dist/ai/blocks/error.d.ts +6 -0
- package/dist/ai/blocks/error.d.ts.map +1 -0
- package/dist/ai/blocks/index.d.ts +11 -0
- package/dist/ai/blocks/index.d.ts.map +1 -0
- package/dist/ai/blocks/index.js +13 -0
- package/dist/ai/blocks/info.d.ts +8 -0
- package/dist/ai/blocks/info.d.ts.map +1 -0
- package/dist/ai/blocks/loading.d.ts +6 -0
- package/dist/ai/blocks/loading.d.ts.map +1 -0
- package/dist/ai/blocks/stat-row.d.ts +6 -0
- package/dist/ai/blocks/stat-row.d.ts.map +1 -0
- package/dist/ai/blocks/success.d.ts +6 -0
- package/dist/ai/blocks/success.d.ts.map +1 -0
- package/dist/ai/blocks/text.d.ts +8 -0
- package/dist/ai/blocks/text.d.ts.map +1 -0
- package/dist/ai/command-bar.d.ts +40 -0
- package/dist/ai/command-bar.d.ts.map +1 -0
- package/dist/ai/command-bar.js +545 -0
- package/dist/ai/conversation.d.ts +20 -0
- package/dist/ai/conversation.d.ts.map +1 -0
- package/dist/ai/conversation.js +255 -0
- package/dist/ai/devadoot-icon.d.ts +23 -0
- package/dist/ai/devadoot-icon.d.ts.map +1 -0
- package/dist/ai/index.d.ts +22 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +170 -0
- package/dist/ai/types.d.ts +81 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/composed/avatar-group.js +1 -1
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +155 -167
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/priority-indicator.js +1 -1
- package/dist/composed/status-badge.js +1 -1
- package/dist/tailwind/index.cjs +1 -1
- package/dist/tailwind/preset.js +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/banner.js +4 -4
- package/dist/ui/button.js +7 -7
- package/dist/ui/card.js +7 -7
- package/dist/ui/chip.js +1 -1
- package/dist/ui/input.js +5 -5
- package/dist/ui/lib/keybinding.d.ts +8 -0
- package/dist/ui/lib/keybinding.d.ts.map +1 -0
- package/dist/ui/lib/motion.d.ts +4 -0
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/motion.js +18 -14
- package/dist/ui/lib/utils.js +1 -1
- package/dist/ui/progress.js +1 -1
- package/dist/ui/segmented-control.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/sheet.js +6 -6
- package/dist/ui/sidebar.js +1 -1
- package/dist/ui/skeleton.js +4 -4
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/text.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/llms-full.txt +1 -1
- package/llms.txt +42 -0
- package/package.json +733 -699
package/dist/_chunks/framer.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { i as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
const
|
|
12
|
-
transformPagePoint: (
|
|
2
|
+
import { jsx as I, Fragment as He, jsxs as Ne } from "react/jsx-runtime";
|
|
3
|
+
import * as ut from "react";
|
|
4
|
+
import { createContext as j, useRef as V, useLayoutEffect as Be, useEffect as ct, useId as At, useContext as C, useInsertionEffect as Vt, useMemo as R, useCallback as ot, Children as Ue, isValidElement as ze, useState as Y, Fragment as ae, createElement as $e, forwardRef as _e, Component as Ye } from "react";
|
|
5
|
+
import { i as mt, f as b, n as Gt, g as Ke, s as ue, a as q, r as Xe, b as ce, c as jt, d as qe, e as Je, h as Ze, j as Qe, k as tn, l as en, m as le, o as nn, p as sn, q as on, t as rn, w as an, u as lt, v as fe, S as de, H as he, F as O, x as un, y as cn, z as me, A as it, B as Wt, C as pe, D as ge, E as Et, G as ln, I as K, J as St, K as Ct, L as fn, M as dn, N as F, O as hn, P as mn, Q as pn, R as Ht, T as gn, U as vn, V as Nt, W as yn, X as Pn, Y as st, Z as wn, _ as En, $ as ve, a0 as Sn, a1 as Cn, a2 as ye, a3 as pt, a4 as xn, a5 as Mn, a6 as An, a7 as Vn, a8 as Dn, a9 as Pe, aa as we, ab as bn, ac as Ln, ad as Tn, ae as In, af as Rn, ag as kn, ah as rt, ai as Fn, aj as On, ak as Gn, al as jn, am as Wn } from "./vendor-utils.js";
|
|
6
|
+
const X = j({});
|
|
7
|
+
function B(t) {
|
|
8
|
+
const e = V(null);
|
|
9
|
+
return e.current === null && (e.current = t()), e.current;
|
|
10
|
+
}
|
|
11
|
+
const Hn = typeof window < "u", ft = Hn ? Be : ct, dt = /* @__PURE__ */ j(null), N = j({
|
|
12
|
+
transformPagePoint: (t) => t,
|
|
13
13
|
isStatic: !1,
|
|
14
14
|
reducedMotion: "never"
|
|
15
15
|
});
|
|
16
|
-
function
|
|
17
|
-
if (typeof
|
|
18
|
-
return e
|
|
19
|
-
|
|
16
|
+
function Bt(t, e) {
|
|
17
|
+
if (typeof t == "function")
|
|
18
|
+
return t(e);
|
|
19
|
+
t != null && (t.current = e);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return (
|
|
21
|
+
function Nn(...t) {
|
|
22
|
+
return (e) => {
|
|
23
23
|
let n = !1;
|
|
24
|
-
const s =
|
|
25
|
-
const i =
|
|
24
|
+
const s = t.map((o) => {
|
|
25
|
+
const i = Bt(o, e);
|
|
26
26
|
return !n && typeof i == "function" && (n = !0), i;
|
|
27
27
|
});
|
|
28
28
|
if (n)
|
|
29
29
|
return () => {
|
|
30
30
|
for (let o = 0; o < s.length; o++) {
|
|
31
31
|
const i = s[o];
|
|
32
|
-
typeof i == "function" ? i() :
|
|
32
|
+
typeof i == "function" ? i() : Bt(t[o], null);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function Bn(...t) {
|
|
38
|
+
return ut.useCallback(Nn(...t), t);
|
|
39
39
|
}
|
|
40
|
-
class
|
|
41
|
-
getSnapshotBeforeUpdate(
|
|
40
|
+
class Un extends ut.Component {
|
|
41
|
+
getSnapshotBeforeUpdate(e) {
|
|
42
42
|
const n = this.props.childRef.current;
|
|
43
|
-
if (
|
|
44
|
-
const s = n.offsetParent, o =
|
|
43
|
+
if (mt(n) && e.isPresent && !this.props.isPresent && this.props.pop !== !1) {
|
|
44
|
+
const s = n.offsetParent, o = mt(s) && s.offsetWidth || 0, i = mt(s) && s.offsetHeight || 0, r = getComputedStyle(n), a = this.props.sizeRef.current;
|
|
45
45
|
a.height = parseFloat(r.height), a.width = parseFloat(r.width), a.top = n.offsetTop, a.left = n.offsetLeft, a.right = o - a.width - a.left, a.bottom = i - a.height - a.top;
|
|
46
46
|
}
|
|
47
47
|
return null;
|
|
@@ -55,140 +55,140 @@ class nn extends q.Component {
|
|
|
55
55
|
return this.props.children;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
var
|
|
60
|
-
const r =
|
|
58
|
+
function zn({ children: t, isPresent: e, anchorX: n, anchorY: s, root: o, pop: i }) {
|
|
59
|
+
var l;
|
|
60
|
+
const r = At(), a = V(null), c = V({
|
|
61
61
|
width: 0,
|
|
62
62
|
height: 0,
|
|
63
63
|
top: 0,
|
|
64
64
|
left: 0,
|
|
65
65
|
right: 0,
|
|
66
66
|
bottom: 0
|
|
67
|
-
}), { nonce:
|
|
68
|
-
return
|
|
69
|
-
const { width:
|
|
70
|
-
if (
|
|
67
|
+
}), { nonce: f } = C(N), h = ((l = t.props) == null ? void 0 : l.ref) ?? (t == null ? void 0 : t.ref), u = Bn(a, h);
|
|
68
|
+
return Vt(() => {
|
|
69
|
+
const { width: m, height: d, top: y, left: g, right: p, bottom: v } = c.current;
|
|
70
|
+
if (e || i === !1 || !a.current || !m || !d)
|
|
71
71
|
return;
|
|
72
|
-
const
|
|
72
|
+
const E = n === "left" ? `left: ${g}` : `right: ${p}`, w = s === "bottom" ? `bottom: ${v}` : `top: ${y}`;
|
|
73
73
|
a.current.dataset.motionPopId = r;
|
|
74
74
|
const S = document.createElement("style");
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
return
|
|
75
|
+
f && (S.nonce = f);
|
|
76
|
+
const x = o ?? document.head;
|
|
77
|
+
return x.appendChild(S), S.sheet && S.sheet.insertRule(`
|
|
78
78
|
[data-motion-pop-id="${r}"] {
|
|
79
79
|
position: absolute !important;
|
|
80
|
-
width: ${
|
|
81
|
-
height: ${
|
|
82
|
-
${P}px !important;
|
|
80
|
+
width: ${m}px !important;
|
|
81
|
+
height: ${d}px !important;
|
|
83
82
|
${E}px !important;
|
|
83
|
+
${w}px !important;
|
|
84
84
|
}
|
|
85
85
|
`), () => {
|
|
86
|
-
var
|
|
87
|
-
(
|
|
86
|
+
var A;
|
|
87
|
+
(A = a.current) == null || A.removeAttribute("data-motion-pop-id"), x.contains(S) && x.removeChild(S);
|
|
88
88
|
};
|
|
89
|
-
}, [
|
|
89
|
+
}, [e]), I(Un, { isPresent: e, childRef: a, sizeRef: c, pop: i, children: i === !1 ? t : ut.cloneElement(t, { ref: u }) });
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
let
|
|
91
|
+
const $n = ({ children: t, initial: e, isPresent: n, onExitComplete: s, custom: o, presenceAffectsLayout: i, mode: r, anchorX: a, anchorY: c, root: f }) => {
|
|
92
|
+
const h = B(_n), u = At();
|
|
93
|
+
let l = !0, m = R(() => (l = !1, {
|
|
94
94
|
id: u,
|
|
95
|
-
initial:
|
|
95
|
+
initial: e,
|
|
96
96
|
isPresent: n,
|
|
97
97
|
custom: o,
|
|
98
|
-
onExitComplete: (
|
|
99
|
-
|
|
100
|
-
for (const
|
|
101
|
-
if (!
|
|
98
|
+
onExitComplete: (d) => {
|
|
99
|
+
h.set(d, !0);
|
|
100
|
+
for (const y of h.values())
|
|
101
|
+
if (!y)
|
|
102
102
|
return;
|
|
103
103
|
s && s();
|
|
104
104
|
},
|
|
105
|
-
register: (
|
|
106
|
-
}), [n,
|
|
107
|
-
return i &&
|
|
108
|
-
|
|
109
|
-
}, [n]),
|
|
110
|
-
!n && !
|
|
111
|
-
}, [n]),
|
|
105
|
+
register: (d) => (h.set(d, !1), () => h.delete(d))
|
|
106
|
+
}), [n, h, s]);
|
|
107
|
+
return i && l && (m = { ...m }), R(() => {
|
|
108
|
+
h.forEach((d, y) => h.set(y, !1));
|
|
109
|
+
}, [n]), ut.useEffect(() => {
|
|
110
|
+
!n && !h.size && s && s();
|
|
111
|
+
}, [n]), t = I(zn, { pop: r === "popLayout", isPresent: n, anchorX: a, anchorY: c, root: f, children: t }), I(dt.Provider, { value: m, children: t });
|
|
112
112
|
};
|
|
113
|
-
function
|
|
113
|
+
function _n() {
|
|
114
114
|
return /* @__PURE__ */ new Map();
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
116
|
+
function Ee(t = !0) {
|
|
117
|
+
const e = C(dt);
|
|
118
|
+
if (e === null)
|
|
119
119
|
return [!0, null];
|
|
120
|
-
const { isPresent: n, onExitComplete: s, register: o } =
|
|
121
|
-
|
|
122
|
-
if (
|
|
120
|
+
const { isPresent: n, onExitComplete: s, register: o } = e, i = At();
|
|
121
|
+
ct(() => {
|
|
122
|
+
if (t)
|
|
123
123
|
return o(i);
|
|
124
|
-
}, [
|
|
125
|
-
const r =
|
|
124
|
+
}, [t]);
|
|
125
|
+
const r = ot(() => t && s && s(i), [i, s, t]);
|
|
126
126
|
return !n && s ? [!1, r] : [!0];
|
|
127
127
|
}
|
|
128
|
-
const
|
|
129
|
-
function
|
|
130
|
-
const
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
}),
|
|
134
|
-
}
|
|
135
|
-
const
|
|
136
|
-
const [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
for (let
|
|
140
|
-
const
|
|
141
|
-
|
|
128
|
+
const tt = (t) => t.key || "";
|
|
129
|
+
function Ut(t) {
|
|
130
|
+
const e = [];
|
|
131
|
+
return Ue.forEach(t, (n) => {
|
|
132
|
+
ze(n) && e.push(n);
|
|
133
|
+
}), e;
|
|
134
|
+
}
|
|
135
|
+
const bo = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presenceAffectsLayout: o = !0, mode: i = "sync", propagate: r = !1, anchorX: a = "left", anchorY: c = "top", root: f }) => {
|
|
136
|
+
const [h, u] = Ee(r), l = R(() => Ut(t), [t]), m = r && !h ? [] : l.map(tt), d = V(!0), y = V(l), g = B(() => /* @__PURE__ */ new Map()), p = V(/* @__PURE__ */ new Set()), [v, E] = Y(l), [w, S] = Y(l);
|
|
137
|
+
ft(() => {
|
|
138
|
+
d.current = !1, y.current = l;
|
|
139
|
+
for (let M = 0; M < w.length; M++) {
|
|
140
|
+
const P = tt(w[M]);
|
|
141
|
+
m.includes(P) ? (g.delete(P), p.current.delete(P)) : g.get(P) !== !0 && g.set(P, !1);
|
|
142
142
|
}
|
|
143
|
-
}, [
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
let
|
|
147
|
-
for (let
|
|
148
|
-
const
|
|
149
|
-
|
|
143
|
+
}, [w, m.length, m.join("-")]);
|
|
144
|
+
const x = [];
|
|
145
|
+
if (l !== v) {
|
|
146
|
+
let M = [...l];
|
|
147
|
+
for (let P = 0; P < w.length; P++) {
|
|
148
|
+
const L = w[P], D = tt(L);
|
|
149
|
+
m.includes(D) || (M.splice(P, 0, L), x.push(L));
|
|
150
150
|
}
|
|
151
|
-
return i === "wait" &&
|
|
151
|
+
return i === "wait" && x.length && (M = x), S(Ut(M)), E(l), null;
|
|
152
152
|
}
|
|
153
|
-
process.env.NODE_ENV !== "production" && i === "wait" &&
|
|
154
|
-
const { forceRender:
|
|
155
|
-
return
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
153
|
+
process.env.NODE_ENV !== "production" && i === "wait" && w.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.`);
|
|
154
|
+
const { forceRender: A } = C(X);
|
|
155
|
+
return I(He, { children: w.map((M) => {
|
|
156
|
+
const P = tt(M), L = r && !h ? !1 : l === w || m.includes(P), D = () => {
|
|
157
|
+
if (p.current.has(P))
|
|
158
158
|
return;
|
|
159
|
-
if (g.has(
|
|
160
|
-
|
|
159
|
+
if (g.has(P))
|
|
160
|
+
p.current.add(P), g.set(P, !0);
|
|
161
161
|
else
|
|
162
162
|
return;
|
|
163
|
-
let
|
|
164
|
-
g.forEach((
|
|
165
|
-
|
|
166
|
-
}),
|
|
163
|
+
let W = !0;
|
|
164
|
+
g.forEach((G) => {
|
|
165
|
+
G || (W = !1);
|
|
166
|
+
}), W && (A == null || A(), S(y.current), r && (u == null || u()), s && s());
|
|
167
167
|
};
|
|
168
|
-
return
|
|
168
|
+
return I($n, { isPresent: L, initial: !d.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: o, mode: i, root: f, onExitComplete: L ? void 0 : D, anchorX: a, anchorY: c, children: M }, P);
|
|
169
169
|
}) });
|
|
170
|
-
},
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
}), []),
|
|
176
|
-
}
|
|
177
|
-
function
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
}, [
|
|
181
|
-
return [
|
|
170
|
+
}, Yn = j(null);
|
|
171
|
+
function Kn() {
|
|
172
|
+
const t = V(!1);
|
|
173
|
+
return ft(() => (t.current = !0, () => {
|
|
174
|
+
t.current = !1;
|
|
175
|
+
}), []), t;
|
|
176
|
+
}
|
|
177
|
+
function Xn() {
|
|
178
|
+
const t = Kn(), [e, n] = Y(0), s = ot(() => {
|
|
179
|
+
t.current && n(e + 1);
|
|
180
|
+
}, [e]);
|
|
181
|
+
return [ot(() => b.postRender(s), [s]), e];
|
|
182
182
|
}
|
|
183
|
-
const
|
|
184
|
-
const s =
|
|
185
|
-
a.current === null && (
|
|
186
|
-
id:
|
|
187
|
-
group:
|
|
183
|
+
const Se = (t) => t === !0, qn = (t) => Se(t === !0) || t === "id", Lo = ({ children: t, id: e, inherit: n = !0 }) => {
|
|
184
|
+
const s = C(X), o = C(Yn), [i, r] = Xn(), a = V(null), c = s.id || o;
|
|
185
|
+
a.current === null && (qn(n) && c && (e = e ? c + "-" + e : c), a.current = {
|
|
186
|
+
id: e,
|
|
187
|
+
group: Se(n) ? s.group || Gt() : Gt()
|
|
188
188
|
});
|
|
189
|
-
const
|
|
190
|
-
return
|
|
191
|
-
},
|
|
189
|
+
const f = R(() => ({ ...a.current, forceRender: i }), [r]);
|
|
190
|
+
return I(X.Provider, { value: f, children: t });
|
|
191
|
+
}, Ce = j({ strict: !1 }), zt = {
|
|
192
192
|
animation: [
|
|
193
193
|
"animate",
|
|
194
194
|
"variants",
|
|
@@ -208,30 +208,30 @@ const qt = (e) => e === !0, ln = (e) => qt(e === !0) || e === "id", Es = ({ chil
|
|
|
208
208
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
209
209
|
layout: ["layout", "layoutId"]
|
|
210
210
|
};
|
|
211
|
-
let
|
|
212
|
-
function
|
|
213
|
-
if (
|
|
211
|
+
let $t = !1;
|
|
212
|
+
function Jn() {
|
|
213
|
+
if ($t)
|
|
214
214
|
return;
|
|
215
|
-
const
|
|
216
|
-
for (const
|
|
217
|
-
e
|
|
218
|
-
isEnabled: (n) =>
|
|
215
|
+
const t = {};
|
|
216
|
+
for (const e in zt)
|
|
217
|
+
t[e] = {
|
|
218
|
+
isEnabled: (n) => zt[e].some((s) => !!n[s])
|
|
219
219
|
};
|
|
220
|
-
|
|
220
|
+
ue(t), $t = !0;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
return
|
|
222
|
+
function xe() {
|
|
223
|
+
return Jn(), Ke();
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
const
|
|
227
|
-
for (const n in
|
|
228
|
-
|
|
229
|
-
...
|
|
230
|
-
...
|
|
225
|
+
function Zn(t) {
|
|
226
|
+
const e = xe();
|
|
227
|
+
for (const n in t)
|
|
228
|
+
e[n] = {
|
|
229
|
+
...e[n],
|
|
230
|
+
...t[n]
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
ue(e);
|
|
233
233
|
}
|
|
234
|
-
const
|
|
234
|
+
const Qn = /* @__PURE__ */ new Set([
|
|
235
235
|
"animate",
|
|
236
236
|
"exit",
|
|
237
237
|
"variants",
|
|
@@ -264,97 +264,97 @@ const hn = /* @__PURE__ */ new Set([
|
|
|
264
264
|
"ignoreStrict",
|
|
265
265
|
"viewport"
|
|
266
266
|
]);
|
|
267
|
-
function
|
|
268
|
-
return
|
|
267
|
+
function at(t) {
|
|
268
|
+
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Qn.has(t);
|
|
269
269
|
}
|
|
270
|
-
let
|
|
271
|
-
function
|
|
272
|
-
typeof
|
|
270
|
+
let Me = (t) => !at(t);
|
|
271
|
+
function Ae(t) {
|
|
272
|
+
typeof t == "function" && (Me = (e) => e.startsWith("on") ? !at(e) : t(e));
|
|
273
273
|
}
|
|
274
274
|
try {
|
|
275
|
-
|
|
275
|
+
Ae(require("@emotion/is-prop-valid").default);
|
|
276
276
|
} catch {
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function ts(t, e, n) {
|
|
279
279
|
const s = {};
|
|
280
|
-
for (const o in
|
|
281
|
-
o === "values" && typeof
|
|
282
|
-
|
|
280
|
+
for (const o in t)
|
|
281
|
+
o === "values" && typeof t.values == "object" || q(t[o]) || (Me(o) || n === !0 && at(o) || !e && !at(o) || // If trying to use native HTML drag events, forward drag listeners
|
|
282
|
+
t.draggable && o.startsWith("onDrag")) && (s[o] = t[o]);
|
|
283
283
|
return s;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
const s =
|
|
288
|
-
n = { ...s, ...n }, n.transition =
|
|
289
|
-
const o =
|
|
285
|
+
function To({ children: t, isValidProp: e, ...n }) {
|
|
286
|
+
e && Ae(e);
|
|
287
|
+
const s = C(N);
|
|
288
|
+
n = { ...s, ...n }, n.transition = Xe(n.transition, s.transition), n.isStatic = B(() => n.isStatic);
|
|
289
|
+
const o = R(() => n, [
|
|
290
290
|
JSON.stringify(n.transition),
|
|
291
291
|
n.transformPagePoint,
|
|
292
292
|
n.reducedMotion,
|
|
293
293
|
n.skipAnimations
|
|
294
294
|
]);
|
|
295
|
-
return
|
|
295
|
+
return I(N.Provider, { value: o, children: t });
|
|
296
296
|
}
|
|
297
|
-
const
|
|
298
|
-
function
|
|
299
|
-
if (
|
|
300
|
-
const { initial: n, animate: s } =
|
|
297
|
+
const ht = /* @__PURE__ */ j({});
|
|
298
|
+
function es(t, e) {
|
|
299
|
+
if (ce(t)) {
|
|
300
|
+
const { initial: n, animate: s } = t;
|
|
301
301
|
return {
|
|
302
|
-
initial: n === !1 ||
|
|
303
|
-
animate:
|
|
302
|
+
initial: n === !1 || jt(n) ? n : void 0,
|
|
303
|
+
animate: jt(s) ? s : void 0
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
-
return
|
|
306
|
+
return t.inherit !== !1 ? e : {};
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
const { initial:
|
|
310
|
-
return
|
|
308
|
+
function ns(t) {
|
|
309
|
+
const { initial: e, animate: n } = es(t, C(ht));
|
|
310
|
+
return R(() => ({ initial: e, animate: n }), [_t(e), _t(n)]);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
return Array.isArray(
|
|
312
|
+
function _t(t) {
|
|
313
|
+
return Array.isArray(t) ? t.join(" ") : t;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const Dt = () => ({
|
|
316
316
|
style: {},
|
|
317
317
|
transform: {},
|
|
318
318
|
transformOrigin: {},
|
|
319
319
|
vars: {}
|
|
320
320
|
});
|
|
321
|
-
function
|
|
322
|
-
for (const s in
|
|
323
|
-
!
|
|
324
|
-
}
|
|
325
|
-
function
|
|
326
|
-
return
|
|
327
|
-
const n =
|
|
328
|
-
return
|
|
329
|
-
}, [
|
|
321
|
+
function Ve(t, e, n) {
|
|
322
|
+
for (const s in e)
|
|
323
|
+
!q(e[s]) && !qe(s, n) && (t[s] = e[s]);
|
|
324
|
+
}
|
|
325
|
+
function ss({ transformTemplate: t }, e) {
|
|
326
|
+
return R(() => {
|
|
327
|
+
const n = Dt();
|
|
328
|
+
return Je(n, e, t), Object.assign({}, n.vars, n.style);
|
|
329
|
+
}, [e]);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
const n =
|
|
333
|
-
return
|
|
331
|
+
function os(t, e) {
|
|
332
|
+
const n = t.style || {}, s = {};
|
|
333
|
+
return Ve(s, n, t), Object.assign(s, ss(t, e)), s;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
const n = {}, s =
|
|
337
|
-
return
|
|
335
|
+
function is(t, e) {
|
|
336
|
+
const n = {}, s = os(t, e);
|
|
337
|
+
return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
...
|
|
339
|
+
const De = () => ({
|
|
340
|
+
...Dt(),
|
|
341
341
|
attrs: {}
|
|
342
342
|
});
|
|
343
|
-
function
|
|
344
|
-
const o =
|
|
345
|
-
const i =
|
|
346
|
-
return
|
|
343
|
+
function rs(t, e, n, s) {
|
|
344
|
+
const o = R(() => {
|
|
345
|
+
const i = De();
|
|
346
|
+
return Ze(i, e, Qe(s), t.transformTemplate, t.style), {
|
|
347
347
|
...i.attrs,
|
|
348
348
|
style: { ...i.style }
|
|
349
349
|
};
|
|
350
|
-
}, [
|
|
351
|
-
if (
|
|
350
|
+
}, [e]);
|
|
351
|
+
if (t.style) {
|
|
352
352
|
const i = {};
|
|
353
|
-
|
|
353
|
+
Ve(i, t.style, t), o.style = { ...i, ...o.style };
|
|
354
354
|
}
|
|
355
355
|
return o;
|
|
356
356
|
}
|
|
357
|
-
const
|
|
357
|
+
const as = [
|
|
358
358
|
"animate",
|
|
359
359
|
"circle",
|
|
360
360
|
"defs",
|
|
@@ -381,139 +381,139 @@ const En = [
|
|
|
381
381
|
"use",
|
|
382
382
|
"view"
|
|
383
383
|
];
|
|
384
|
-
function
|
|
384
|
+
function bt(t) {
|
|
385
385
|
return (
|
|
386
386
|
/**
|
|
387
387
|
* If it's not a string, it's a custom React component. Currently we only support
|
|
388
388
|
* HTML custom React components.
|
|
389
389
|
*/
|
|
390
|
-
typeof
|
|
390
|
+
typeof t != "string" || /**
|
|
391
391
|
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
392
392
|
*/
|
|
393
|
-
|
|
393
|
+
t.includes("-") ? !1 : (
|
|
394
394
|
/**
|
|
395
395
|
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
396
396
|
*/
|
|
397
|
-
!!(
|
|
397
|
+
!!(as.indexOf(t) > -1 || /**
|
|
398
398
|
* If it contains a capital letter, it's an SVG component
|
|
399
399
|
*/
|
|
400
|
-
/[A-Z]/u.test(
|
|
400
|
+
/[A-Z]/u.test(t))
|
|
401
401
|
)
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
const
|
|
406
|
-
return
|
|
407
|
-
...
|
|
408
|
-
children:
|
|
404
|
+
function us(t, e, n, { latestValues: s }, o, i = !1, r) {
|
|
405
|
+
const c = (r ?? bt(t) ? rs : is)(e, s, o, t), f = ts(e, typeof t == "string", i), h = t !== ae ? { ...f, ...c, ref: n } : {}, { children: u } = e, l = R(() => q(u) ? u.get() : u, [u]);
|
|
406
|
+
return $e(t, {
|
|
407
|
+
...h,
|
|
408
|
+
children: l
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function cs({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, o) {
|
|
412
412
|
return {
|
|
413
|
-
latestValues:
|
|
414
|
-
renderState:
|
|
413
|
+
latestValues: ls(n, s, o, t),
|
|
414
|
+
renderState: e()
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
const o = {}, i = s(
|
|
419
|
-
for (const
|
|
420
|
-
o[
|
|
421
|
-
let { initial: r, animate: a } =
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
let
|
|
425
|
-
|
|
426
|
-
const u =
|
|
427
|
-
if (u && typeof u != "boolean" && !
|
|
428
|
-
const
|
|
429
|
-
for (let
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
const { transitionEnd:
|
|
433
|
-
for (const
|
|
434
|
-
let
|
|
435
|
-
if (Array.isArray(
|
|
436
|
-
const
|
|
437
|
-
|
|
417
|
+
function ls(t, e, n, s) {
|
|
418
|
+
const o = {}, i = s(t, {});
|
|
419
|
+
for (const l in i)
|
|
420
|
+
o[l] = tn(i[l]);
|
|
421
|
+
let { initial: r, animate: a } = t;
|
|
422
|
+
const c = ce(t), f = en(t);
|
|
423
|
+
e && f && !c && t.inherit !== !1 && (r === void 0 && (r = e.initial), a === void 0 && (a = e.animate));
|
|
424
|
+
let h = n ? n.initial === !1 : !1;
|
|
425
|
+
h = h || r === !1;
|
|
426
|
+
const u = h ? a : r;
|
|
427
|
+
if (u && typeof u != "boolean" && !le(u)) {
|
|
428
|
+
const l = Array.isArray(u) ? u : [u];
|
|
429
|
+
for (let m = 0; m < l.length; m++) {
|
|
430
|
+
const d = nn(t, l[m]);
|
|
431
|
+
if (d) {
|
|
432
|
+
const { transitionEnd: y, transition: g, ...p } = d;
|
|
433
|
+
for (const v in p) {
|
|
434
|
+
let E = p[v];
|
|
435
|
+
if (Array.isArray(E)) {
|
|
436
|
+
const w = h ? E.length - 1 : 0;
|
|
437
|
+
E = E[w];
|
|
438
438
|
}
|
|
439
|
-
|
|
439
|
+
E !== null && (o[v] = E);
|
|
440
440
|
}
|
|
441
|
-
for (const
|
|
442
|
-
o[
|
|
441
|
+
for (const v in y)
|
|
442
|
+
o[v] = y[v];
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
return o;
|
|
447
447
|
}
|
|
448
|
-
const
|
|
449
|
-
const s =
|
|
450
|
-
return n ? i() :
|
|
451
|
-
},
|
|
452
|
-
scrapeMotionValuesFromProps:
|
|
453
|
-
createRenderState:
|
|
454
|
-
}),
|
|
455
|
-
scrapeMotionValuesFromProps:
|
|
456
|
-
createRenderState:
|
|
457
|
-
}),
|
|
458
|
-
function
|
|
459
|
-
const s =
|
|
460
|
-
|
|
448
|
+
const be = (t) => (e, n) => {
|
|
449
|
+
const s = C(ht), o = C(dt), i = () => cs(t, e, s, o);
|
|
450
|
+
return n ? i() : B(i);
|
|
451
|
+
}, fs = /* @__PURE__ */ be({
|
|
452
|
+
scrapeMotionValuesFromProps: sn,
|
|
453
|
+
createRenderState: Dt
|
|
454
|
+
}), ds = /* @__PURE__ */ be({
|
|
455
|
+
scrapeMotionValuesFromProps: on,
|
|
456
|
+
createRenderState: De
|
|
457
|
+
}), hs = Symbol.for("motionComponentSymbol");
|
|
458
|
+
function ms(t, e, n) {
|
|
459
|
+
const s = V(n);
|
|
460
|
+
Vt(() => {
|
|
461
461
|
s.current = n;
|
|
462
462
|
});
|
|
463
|
-
const o =
|
|
464
|
-
return
|
|
463
|
+
const o = V(null);
|
|
464
|
+
return ot((i) => {
|
|
465
465
|
var a;
|
|
466
|
-
i && ((a =
|
|
466
|
+
i && ((a = t.onMount) == null || a.call(t, i));
|
|
467
467
|
const r = s.current;
|
|
468
468
|
if (typeof r == "function")
|
|
469
469
|
if (i) {
|
|
470
|
-
const
|
|
471
|
-
typeof
|
|
470
|
+
const c = r(i);
|
|
471
|
+
typeof c == "function" && (o.current = c);
|
|
472
472
|
} else o.current ? (o.current(), o.current = null) : r(i);
|
|
473
473
|
else r && (r.current = i);
|
|
474
|
-
|
|
475
|
-
}, [
|
|
474
|
+
e && (i ? e.mount(i) : e.unmount());
|
|
475
|
+
}, [e]);
|
|
476
476
|
}
|
|
477
|
-
const
|
|
478
|
-
function
|
|
479
|
-
return
|
|
477
|
+
const Le = j({});
|
|
478
|
+
function H(t) {
|
|
479
|
+
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
var
|
|
483
|
-
const { visualElement: r } =
|
|
484
|
-
s = s || a.renderer, !
|
|
485
|
-
visualState:
|
|
481
|
+
function ps(t, e, n, s, o, i) {
|
|
482
|
+
var E, w;
|
|
483
|
+
const { visualElement: r } = C(ht), a = C(Ce), c = C(dt), f = C(N), h = f.reducedMotion, u = f.skipAnimations, l = V(null), m = V(!1);
|
|
484
|
+
s = s || a.renderer, !l.current && s && (l.current = s(t, {
|
|
485
|
+
visualState: e,
|
|
486
486
|
parent: r,
|
|
487
487
|
props: n,
|
|
488
|
-
presenceContext:
|
|
489
|
-
blockInitialAnimation:
|
|
490
|
-
reducedMotionConfig:
|
|
488
|
+
presenceContext: c,
|
|
489
|
+
blockInitialAnimation: c ? c.initial === !1 : !1,
|
|
490
|
+
reducedMotionConfig: h,
|
|
491
491
|
skipAnimations: u,
|
|
492
492
|
isSVG: i
|
|
493
|
-
}),
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
const g =
|
|
497
|
-
|
|
498
|
-
|
|
493
|
+
}), m.current && l.current && (l.current.manuallyAnimateOnMount = !0));
|
|
494
|
+
const d = l.current, y = C(Le);
|
|
495
|
+
d && !d.projection && o && (d.type === "html" || d.type === "svg") && gs(l.current, n, o, y);
|
|
496
|
+
const g = V(!1);
|
|
497
|
+
Vt(() => {
|
|
498
|
+
d && g.current && d.update(n, c);
|
|
499
499
|
});
|
|
500
|
-
const
|
|
501
|
-
return
|
|
502
|
-
|
|
503
|
-
}),
|
|
504
|
-
|
|
500
|
+
const p = n[rn], v = V(!!p && typeof window < "u" && !((E = window.MotionHandoffIsComplete) != null && E.call(window, p)) && ((w = window.MotionHasOptimisedAnimation) == null ? void 0 : w.call(window, p)));
|
|
501
|
+
return ft(() => {
|
|
502
|
+
m.current = !0, d && (g.current = !0, window.MotionIsMounted = !0, d.updateFeatures(), d.scheduleRenderMicrotask(), v.current && d.animationState && d.animationState.animateChanges());
|
|
503
|
+
}), ct(() => {
|
|
504
|
+
d && (!v.current && d.animationState && d.animationState.animateChanges(), v.current && (queueMicrotask(() => {
|
|
505
505
|
var S;
|
|
506
|
-
(S = window.MotionHandoffMarkAsComplete) == null || S.call(window,
|
|
507
|
-
}),
|
|
508
|
-
}),
|
|
506
|
+
(S = window.MotionHandoffMarkAsComplete) == null || S.call(window, p);
|
|
507
|
+
}), v.current = !1), d.enteringChildren = void 0);
|
|
508
|
+
}), d;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
const { layoutId: o, layout: i, drag: r, dragConstraints: a, layoutScroll:
|
|
512
|
-
|
|
510
|
+
function gs(t, e, n, s) {
|
|
511
|
+
const { layoutId: o, layout: i, drag: r, dragConstraints: a, layoutScroll: c, layoutRoot: f, layoutCrossfade: h } = e;
|
|
512
|
+
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Te(t.parent)), t.projection.setOptions({
|
|
513
513
|
layoutId: o,
|
|
514
514
|
layout: i,
|
|
515
|
-
alwaysMeasureLayout: !!r || a &&
|
|
516
|
-
visualElement:
|
|
515
|
+
alwaysMeasureLayout: !!r || a && H(a),
|
|
516
|
+
visualElement: t,
|
|
517
517
|
/**
|
|
518
518
|
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
519
519
|
* to update by the time layout animations run.
|
|
@@ -523,85 +523,85 @@ function An(e, t, n, s) {
|
|
|
523
523
|
*/
|
|
524
524
|
animationType: typeof i == "string" ? i : "both",
|
|
525
525
|
initialPromotionConfig: s,
|
|
526
|
-
crossfade:
|
|
527
|
-
layoutScroll:
|
|
528
|
-
layoutRoot:
|
|
526
|
+
crossfade: h,
|
|
527
|
+
layoutScroll: c,
|
|
528
|
+
layoutRoot: f
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
if (
|
|
533
|
-
return
|
|
531
|
+
function Te(t) {
|
|
532
|
+
if (t)
|
|
533
|
+
return t.options.allowProjection !== !1 ? t.projection : Te(t.parent);
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
s &&
|
|
537
|
-
const i = n ? n === "svg" :
|
|
538
|
-
function a(
|
|
535
|
+
function gt(t, { forwardMotionProps: e = !1, type: n } = {}, s, o) {
|
|
536
|
+
s && Zn(s);
|
|
537
|
+
const i = n ? n === "svg" : bt(t), r = i ? ds : fs;
|
|
538
|
+
function a(f, h) {
|
|
539
539
|
let u;
|
|
540
|
-
const
|
|
541
|
-
...
|
|
542
|
-
...
|
|
543
|
-
layoutId:
|
|
544
|
-
}, { isStatic:
|
|
545
|
-
if (!
|
|
546
|
-
|
|
547
|
-
const g =
|
|
548
|
-
u = g.MeasureLayout,
|
|
540
|
+
const l = {
|
|
541
|
+
...C(N),
|
|
542
|
+
...f,
|
|
543
|
+
layoutId: vs(f)
|
|
544
|
+
}, { isStatic: m } = l, d = ns(f), y = r(f, m);
|
|
545
|
+
if (!m && typeof window < "u") {
|
|
546
|
+
ys(l, s);
|
|
547
|
+
const g = Ps(l);
|
|
548
|
+
u = g.MeasureLayout, d.visualElement = ps(t, y, l, o, g.ProjectionNode, i);
|
|
549
549
|
}
|
|
550
|
-
return
|
|
550
|
+
return Ne(ht.Provider, { value: d, children: [u && d.visualElement ? I(u, { visualElement: d.visualElement, ...l }) : null, us(t, f, ms(y, d.visualElement, h), y, m, e, i)] });
|
|
551
551
|
}
|
|
552
|
-
a.displayName = `motion.${typeof
|
|
553
|
-
const
|
|
554
|
-
return
|
|
552
|
+
a.displayName = `motion.${typeof t == "string" ? t : `create(${t.displayName ?? t.name ?? ""})`}`;
|
|
553
|
+
const c = _e(a);
|
|
554
|
+
return c[hs] = t, c;
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
const
|
|
558
|
-
return
|
|
556
|
+
function vs({ layoutId: t }) {
|
|
557
|
+
const e = C(X).id;
|
|
558
|
+
return e && t !== void 0 ? e + "-" + t : t;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
const n =
|
|
562
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
560
|
+
function ys(t, e) {
|
|
561
|
+
const n = C(Ce).strict;
|
|
562
|
+
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
563
563
|
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
564
|
-
|
|
564
|
+
t.ignoreStrict ? an(!1, s, "lazy-strict-mode") : lt(!1, s, "lazy-strict-mode");
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
const
|
|
567
|
+
function Ps(t) {
|
|
568
|
+
const e = xe(), { drag: n, layout: s } = e;
|
|
569
569
|
if (!n && !s)
|
|
570
570
|
return {};
|
|
571
571
|
const o = { ...n, ...s };
|
|
572
572
|
return {
|
|
573
|
-
MeasureLayout: n != null && n.isEnabled(
|
|
573
|
+
MeasureLayout: n != null && n.isEnabled(t) || s != null && s.isEnabled(t) ? o.MeasureLayout : void 0,
|
|
574
574
|
ProjectionNode: o.ProjectionNode
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function ws(t, e) {
|
|
578
578
|
if (typeof Proxy > "u")
|
|
579
|
-
return
|
|
580
|
-
const n = /* @__PURE__ */ new Map(), s = (i, r) =>
|
|
579
|
+
return gt;
|
|
580
|
+
const n = /* @__PURE__ */ new Map(), s = (i, r) => gt(i, r, t, e), o = (i, r) => (process.env.NODE_ENV !== "production" && fe(!1, "motion() is deprecated. Use motion.create() instead."), s(i, r));
|
|
581
581
|
return new Proxy(o, {
|
|
582
582
|
/**
|
|
583
583
|
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
584
584
|
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
585
585
|
* DOM component with that name.
|
|
586
586
|
*/
|
|
587
|
-
get: (i, r) => r === "create" ? s : (n.has(r) || n.set(r,
|
|
587
|
+
get: (i, r) => r === "create" ? s : (n.has(r) || n.set(r, gt(r, void 0, t, e)), n.get(r))
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
allowProjection:
|
|
590
|
+
const Es = (t, e) => e.isSVG ?? bt(t) ? new de(e) : new he(e, {
|
|
591
|
+
allowProjection: t !== ae
|
|
592
592
|
});
|
|
593
|
-
class
|
|
593
|
+
class Ss extends O {
|
|
594
594
|
/**
|
|
595
595
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
596
596
|
* to the underlying animation library. We only want to load that if we load this,
|
|
597
597
|
* so people can optionally code split it out using the `m` component.
|
|
598
598
|
*/
|
|
599
|
-
constructor(
|
|
600
|
-
super(
|
|
599
|
+
constructor(e) {
|
|
600
|
+
super(e), e.animationState || (e.animationState = un(e));
|
|
601
601
|
}
|
|
602
602
|
updateAnimationControlsSubscription() {
|
|
603
|
-
const { animate:
|
|
604
|
-
|
|
603
|
+
const { animate: e } = this.node.getProps();
|
|
604
|
+
le(e) && (this.unmountControls = e.subscribe(this.node));
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
607
607
|
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
@@ -610,35 +610,35 @@ class jn extends A {
|
|
|
610
610
|
this.updateAnimationControlsSubscription();
|
|
611
611
|
}
|
|
612
612
|
update() {
|
|
613
|
-
const { animate:
|
|
614
|
-
|
|
613
|
+
const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
|
|
614
|
+
e !== n && this.updateAnimationControlsSubscription();
|
|
615
615
|
}
|
|
616
616
|
unmount() {
|
|
617
|
-
var
|
|
618
|
-
this.node.animationState.reset(), (
|
|
617
|
+
var e;
|
|
618
|
+
this.node.animationState.reset(), (e = this.unmountControls) == null || e.call(this);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
let
|
|
622
|
-
class
|
|
621
|
+
let Cs = 0;
|
|
622
|
+
class xs extends O {
|
|
623
623
|
constructor() {
|
|
624
|
-
super(...arguments), this.id =
|
|
624
|
+
super(...arguments), this.id = Cs++, this.isExitComplete = !1;
|
|
625
625
|
}
|
|
626
626
|
update() {
|
|
627
627
|
var i;
|
|
628
628
|
if (!this.node.presenceContext)
|
|
629
629
|
return;
|
|
630
|
-
const { isPresent:
|
|
631
|
-
if (!this.node.animationState ||
|
|
630
|
+
const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
|
|
631
|
+
if (!this.node.animationState || e === s)
|
|
632
632
|
return;
|
|
633
|
-
if (
|
|
633
|
+
if (e && s === !1) {
|
|
634
634
|
if (this.isExitComplete) {
|
|
635
635
|
const { initial: r, custom: a } = this.node.getProps();
|
|
636
636
|
if (typeof r == "string") {
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
639
|
-
const { transition:
|
|
640
|
-
for (const
|
|
641
|
-
(i = this.node.getValue(
|
|
637
|
+
const c = cn(this.node, r, a);
|
|
638
|
+
if (c) {
|
|
639
|
+
const { transition: f, transitionEnd: h, ...u } = c;
|
|
640
|
+
for (const l in u)
|
|
641
|
+
(i = this.node.getValue(l)) == null || i.jump(u[l]);
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
this.node.animationState.reset(), this.node.animationState.animateChanges();
|
|
@@ -647,86 +647,86 @@ class Gn extends A {
|
|
|
647
647
|
this.isExitComplete = !1;
|
|
648
648
|
return;
|
|
649
649
|
}
|
|
650
|
-
const o = this.node.animationState.setActive("exit", !
|
|
651
|
-
n && !
|
|
650
|
+
const o = this.node.animationState.setActive("exit", !e);
|
|
651
|
+
n && !e && o.then(() => {
|
|
652
652
|
this.isExitComplete = !0, n(this.id);
|
|
653
653
|
});
|
|
654
654
|
}
|
|
655
655
|
mount() {
|
|
656
|
-
const { register:
|
|
657
|
-
n && n(this.id),
|
|
656
|
+
const { register: e, onExitComplete: n } = this.node.presenceContext || {};
|
|
657
|
+
n && n(this.id), e && (this.unmount = e(this.id));
|
|
658
658
|
}
|
|
659
659
|
unmount() {
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
const
|
|
662
|
+
const Ms = {
|
|
663
663
|
animation: {
|
|
664
|
-
Feature:
|
|
664
|
+
Feature: Ss
|
|
665
665
|
},
|
|
666
666
|
exit: {
|
|
667
|
-
Feature:
|
|
667
|
+
Feature: xs
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
|
-
function
|
|
670
|
+
function J(t) {
|
|
671
671
|
return {
|
|
672
672
|
point: {
|
|
673
|
-
x:
|
|
674
|
-
y:
|
|
673
|
+
x: t.pageX,
|
|
674
|
+
y: t.pageY
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
677
|
}
|
|
678
|
-
const
|
|
679
|
-
function
|
|
680
|
-
return
|
|
678
|
+
const As = (t) => (e) => me(e) && t(e, J(e));
|
|
679
|
+
function _(t, e, n, s) {
|
|
680
|
+
return it(t, e, As(n), s);
|
|
681
681
|
}
|
|
682
|
-
const
|
|
683
|
-
function
|
|
684
|
-
const n =
|
|
682
|
+
const Ie = ({ current: t }) => t ? t.ownerDocument.defaultView : null, Yt = (t, e) => Math.abs(t - e);
|
|
683
|
+
function Vs(t, e) {
|
|
684
|
+
const n = Yt(t.x, e.x), s = Yt(t.y, e.y);
|
|
685
685
|
return Math.sqrt(n ** 2 + s ** 2);
|
|
686
686
|
}
|
|
687
|
-
const
|
|
688
|
-
class
|
|
689
|
-
constructor(
|
|
690
|
-
if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.lastRawMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.scrollPositions = /* @__PURE__ */ new Map(), this.removeScrollListeners = null, this.onElementScroll = (
|
|
691
|
-
this.handleScroll(
|
|
687
|
+
const Kt = /* @__PURE__ */ new Set(["auto", "scroll"]);
|
|
688
|
+
class Re {
|
|
689
|
+
constructor(e, n, { transformPagePoint: s, contextWindow: o = window, dragSnapToOrigin: i = !1, distanceThreshold: r = 3, element: a } = {}) {
|
|
690
|
+
if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.lastRawMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.scrollPositions = /* @__PURE__ */ new Map(), this.removeScrollListeners = null, this.onElementScroll = (m) => {
|
|
691
|
+
this.handleScroll(m.target);
|
|
692
692
|
}, this.onWindowScroll = () => {
|
|
693
693
|
this.handleScroll(window);
|
|
694
694
|
}, this.updatePoint = () => {
|
|
695
695
|
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
696
696
|
return;
|
|
697
|
-
this.lastRawMoveEventInfo && (this.lastMoveEventInfo =
|
|
698
|
-
const
|
|
699
|
-
if (!
|
|
697
|
+
this.lastRawMoveEventInfo && (this.lastMoveEventInfo = et(this.lastRawMoveEventInfo, this.transformPagePoint));
|
|
698
|
+
const m = vt(this.lastMoveEventInfo, this.history), d = this.startEvent !== null, y = Vs(m.offset, { x: 0, y: 0 }) >= this.distanceThreshold;
|
|
699
|
+
if (!d && !y)
|
|
700
700
|
return;
|
|
701
|
-
const { point: g } =
|
|
702
|
-
this.history.push({ ...g, timestamp:
|
|
703
|
-
const { onStart:
|
|
704
|
-
|
|
705
|
-
}, this.handlePointerMove = (
|
|
706
|
-
this.lastMoveEvent =
|
|
707
|
-
}, this.handlePointerUp = (
|
|
701
|
+
const { point: g } = m, { timestamp: p } = Wt;
|
|
702
|
+
this.history.push({ ...g, timestamp: p });
|
|
703
|
+
const { onStart: v, onMove: E } = this.handlers;
|
|
704
|
+
d || (v && v(this.lastMoveEvent, m), this.startEvent = this.lastMoveEvent), E && E(this.lastMoveEvent, m);
|
|
705
|
+
}, this.handlePointerMove = (m, d) => {
|
|
706
|
+
this.lastMoveEvent = m, this.lastRawMoveEventInfo = d, this.lastMoveEventInfo = et(d, this.transformPagePoint), b.update(this.updatePoint, !0);
|
|
707
|
+
}, this.handlePointerUp = (m, d) => {
|
|
708
708
|
this.end();
|
|
709
|
-
const { onEnd:
|
|
710
|
-
if ((this.dragSnapToOrigin || !this.startEvent) &&
|
|
709
|
+
const { onEnd: y, onSessionEnd: g, resumeAnimation: p } = this.handlers;
|
|
710
|
+
if ((this.dragSnapToOrigin || !this.startEvent) && p && p(), !(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
711
711
|
return;
|
|
712
|
-
const
|
|
713
|
-
this.startEvent &&
|
|
714
|
-
},
|
|
712
|
+
const v = vt(m.type === "pointercancel" ? this.lastMoveEventInfo : et(d, this.transformPagePoint), this.history);
|
|
713
|
+
this.startEvent && y && y(m, v), g && g(m, v);
|
|
714
|
+
}, !me(e))
|
|
715
715
|
return;
|
|
716
716
|
this.dragSnapToOrigin = i, this.handlers = n, this.transformPagePoint = s, this.distanceThreshold = r, this.contextWindow = o || window;
|
|
717
|
-
const
|
|
718
|
-
this.history = [{ ...
|
|
719
|
-
const { onSessionStart:
|
|
720
|
-
|
|
717
|
+
const c = J(e), f = et(c, this.transformPagePoint), { point: h } = f, { timestamp: u } = Wt;
|
|
718
|
+
this.history = [{ ...h, timestamp: u }];
|
|
719
|
+
const { onSessionStart: l } = n;
|
|
720
|
+
l && l(e, vt(f, this.history)), this.removeListeners = pe(_(this.contextWindow, "pointermove", this.handlePointerMove), _(this.contextWindow, "pointerup", this.handlePointerUp), _(this.contextWindow, "pointercancel", this.handlePointerUp)), a && this.startScrollTracking(a);
|
|
721
721
|
}
|
|
722
722
|
/**
|
|
723
723
|
* Start tracking scroll on ancestors and window.
|
|
724
724
|
*/
|
|
725
|
-
startScrollTracking(
|
|
726
|
-
let n =
|
|
725
|
+
startScrollTracking(e) {
|
|
726
|
+
let n = e.parentElement;
|
|
727
727
|
for (; n; ) {
|
|
728
728
|
const s = getComputedStyle(n);
|
|
729
|
-
(
|
|
729
|
+
(Kt.has(s.overflowX) || Kt.has(s.overflowY)) && this.scrollPositions.set(n, {
|
|
730
730
|
x: n.scrollLeft,
|
|
731
731
|
y: n.scrollTop
|
|
732
732
|
}), n = n.parentElement;
|
|
@@ -748,54 +748,54 @@ class re {
|
|
|
748
748
|
* For element scroll: adjusts history origin since pageX/pageY doesn't change.
|
|
749
749
|
* For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
|
|
750
750
|
*/
|
|
751
|
-
handleScroll(
|
|
752
|
-
const n = this.scrollPositions.get(
|
|
751
|
+
handleScroll(e) {
|
|
752
|
+
const n = this.scrollPositions.get(e);
|
|
753
753
|
if (!n)
|
|
754
754
|
return;
|
|
755
|
-
const s =
|
|
756
|
-
x:
|
|
757
|
-
y:
|
|
755
|
+
const s = e === window, o = s ? { x: window.scrollX, y: window.scrollY } : {
|
|
756
|
+
x: e.scrollLeft,
|
|
757
|
+
y: e.scrollTop
|
|
758
758
|
}, i = { x: o.x - n.x, y: o.y - n.y };
|
|
759
|
-
i.x === 0 && i.y === 0 || (s ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += i.x, this.lastMoveEventInfo.point.y += i.y) : this.history.length > 0 && (this.history[0].x -= i.x, this.history[0].y -= i.y), this.scrollPositions.set(
|
|
759
|
+
i.x === 0 && i.y === 0 || (s ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += i.x, this.lastMoveEventInfo.point.y += i.y) : this.history.length > 0 && (this.history[0].x -= i.x, this.history[0].y -= i.y), this.scrollPositions.set(e, o), b.update(this.updatePoint, !0));
|
|
760
760
|
}
|
|
761
|
-
updateHandlers(
|
|
762
|
-
this.handlers =
|
|
761
|
+
updateHandlers(e) {
|
|
762
|
+
this.handlers = e;
|
|
763
763
|
}
|
|
764
764
|
end() {
|
|
765
|
-
this.removeListeners && this.removeListeners(), this.removeScrollListeners && this.removeScrollListeners(), this.scrollPositions.clear(),
|
|
765
|
+
this.removeListeners && this.removeListeners(), this.removeScrollListeners && this.removeScrollListeners(), this.scrollPositions.clear(), ge(this.updatePoint);
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
768
|
+
function et(t, e) {
|
|
769
|
+
return e ? { point: e(t.point) } : t;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
772
|
-
return { x:
|
|
771
|
+
function Xt(t, e) {
|
|
772
|
+
return { x: t.x - e.x, y: t.y - e.y };
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function vt({ point: t }, e) {
|
|
775
775
|
return {
|
|
776
|
-
point:
|
|
777
|
-
delta:
|
|
778
|
-
offset:
|
|
779
|
-
velocity:
|
|
776
|
+
point: t,
|
|
777
|
+
delta: Xt(t, ke(e)),
|
|
778
|
+
offset: Xt(t, Ds(e)),
|
|
779
|
+
velocity: bs(e, 0.1)
|
|
780
780
|
};
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
return
|
|
782
|
+
function Ds(t) {
|
|
783
|
+
return t[0];
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return
|
|
785
|
+
function ke(t) {
|
|
786
|
+
return t[t.length - 1];
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
if (
|
|
788
|
+
function bs(t, e) {
|
|
789
|
+
if (t.length < 2)
|
|
790
790
|
return { x: 0, y: 0 };
|
|
791
|
-
let n =
|
|
792
|
-
const o =
|
|
793
|
-
for (; n >= 0 && (s =
|
|
791
|
+
let n = t.length - 1, s = null;
|
|
792
|
+
const o = ke(t);
|
|
793
|
+
for (; n >= 0 && (s = t[n], !(o.timestamp - s.timestamp > Et(e))); )
|
|
794
794
|
n--;
|
|
795
795
|
if (!s)
|
|
796
796
|
return { x: 0, y: 0 };
|
|
797
|
-
s ===
|
|
798
|
-
const i =
|
|
797
|
+
s === t[0] && t.length > 2 && o.timestamp - s.timestamp > Et(e) * 2 && (s = t[1]);
|
|
798
|
+
const i = ln(o.timestamp - s.timestamp);
|
|
799
799
|
if (i === 0)
|
|
800
800
|
return { x: 0, y: 0 };
|
|
801
801
|
const r = {
|
|
@@ -804,134 +804,134 @@ function Un(e, t) {
|
|
|
804
804
|
};
|
|
805
805
|
return r.x === 1 / 0 && (r.x = 0), r.y === 1 / 0 && (r.y = 0), r;
|
|
806
806
|
}
|
|
807
|
-
function
|
|
808
|
-
return
|
|
807
|
+
function Ls(t, { min: e, max: n }, s) {
|
|
808
|
+
return e !== void 0 && t < e ? t = s ? K(e, t, s.min) : Math.max(t, e) : n !== void 0 && t > n && (t = s ? K(n, t, s.max) : Math.min(t, n)), t;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function qt(t, e, n) {
|
|
811
811
|
return {
|
|
812
|
-
min:
|
|
813
|
-
max: n !== void 0 ?
|
|
812
|
+
min: e !== void 0 ? t.min + e : void 0,
|
|
813
|
+
max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function Ts(t, { top: e, left: n, bottom: s, right: o }) {
|
|
817
817
|
return {
|
|
818
|
-
x:
|
|
819
|
-
y:
|
|
818
|
+
x: qt(t.x, n, o),
|
|
819
|
+
y: qt(t.y, e, s)
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
let n =
|
|
824
|
-
return
|
|
822
|
+
function Jt(t, e) {
|
|
823
|
+
let n = e.min - t.min, s = e.max - t.max;
|
|
824
|
+
return e.max - e.min < t.max - t.min && ([n, s] = [s, n]), { min: n, max: s };
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Is(t, e) {
|
|
827
827
|
return {
|
|
828
|
-
x:
|
|
829
|
-
y:
|
|
828
|
+
x: Jt(t.x, e.x),
|
|
829
|
+
y: Jt(t.y, e.y)
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Rs(t, e) {
|
|
833
833
|
let n = 0.5;
|
|
834
|
-
const s =
|
|
835
|
-
return o > s ? n =
|
|
834
|
+
const s = St(t), o = St(e);
|
|
835
|
+
return o > s ? n = Ct(e.min, e.max - s, t.min) : s > o && (n = Ct(t.min, t.max - o, e.min)), fn(0, 1, n);
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function ks(t, e) {
|
|
838
838
|
const n = {};
|
|
839
|
-
return
|
|
839
|
+
return e.min !== void 0 && (n.min = e.min - t.min), e.max !== void 0 && (n.max = e.max - t.min), n;
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
843
|
-
return
|
|
844
|
-
x:
|
|
845
|
-
y:
|
|
841
|
+
const xt = 0.35;
|
|
842
|
+
function Fs(t = xt) {
|
|
843
|
+
return t === !1 ? t = 0 : t === !0 && (t = xt), {
|
|
844
|
+
x: Zt(t, "left", "right"),
|
|
845
|
+
y: Zt(t, "top", "bottom")
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function Zt(t, e, n) {
|
|
849
849
|
return {
|
|
850
|
-
min:
|
|
851
|
-
max:
|
|
850
|
+
min: Qt(t, e),
|
|
851
|
+
max: Qt(t, n)
|
|
852
852
|
};
|
|
853
853
|
}
|
|
854
|
-
function
|
|
855
|
-
return typeof
|
|
854
|
+
function Qt(t, e) {
|
|
855
|
+
return typeof t == "number" ? t : t[e] || 0;
|
|
856
856
|
}
|
|
857
|
-
const
|
|
858
|
-
class
|
|
859
|
-
constructor(
|
|
860
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic =
|
|
857
|
+
const Os = /* @__PURE__ */ new WeakMap();
|
|
858
|
+
class Gs {
|
|
859
|
+
constructor(e) {
|
|
860
|
+
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = dn(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = e;
|
|
861
861
|
}
|
|
862
|
-
start(
|
|
862
|
+
start(e, { snapToCursor: n = !1, distanceThreshold: s } = {}) {
|
|
863
863
|
const { presenceContext: o } = this.visualElement;
|
|
864
864
|
if (o && o.isPresent === !1)
|
|
865
865
|
return;
|
|
866
866
|
const i = (u) => {
|
|
867
|
-
n && this.snapToCursor(
|
|
868
|
-
}, r = (u,
|
|
869
|
-
const { drag:
|
|
870
|
-
if (
|
|
867
|
+
n && this.snapToCursor(J(u).point), this.stopAnimation();
|
|
868
|
+
}, r = (u, l) => {
|
|
869
|
+
const { drag: m, dragPropagation: d, onDragStart: y } = this.getProps();
|
|
870
|
+
if (m && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = vn(m), !this.openDragLock))
|
|
871
871
|
return;
|
|
872
|
-
this.latestPointerEvent = u, this.latestPanInfo =
|
|
873
|
-
let
|
|
874
|
-
if (
|
|
875
|
-
const { projection:
|
|
876
|
-
if (
|
|
877
|
-
const
|
|
878
|
-
|
|
872
|
+
this.latestPointerEvent = u, this.latestPanInfo = l, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), F((p) => {
|
|
873
|
+
let v = this.getAxisMotionValue(p).get() || 0;
|
|
874
|
+
if (yn.test(v)) {
|
|
875
|
+
const { projection: E } = this.visualElement;
|
|
876
|
+
if (E && E.layout) {
|
|
877
|
+
const w = E.layout.layoutBox[p];
|
|
878
|
+
w && (v = St(w) * (parseFloat(v) / 100));
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
this.originPoint[
|
|
882
|
-
}),
|
|
881
|
+
this.originPoint[p] = v;
|
|
882
|
+
}), y && b.update(() => y(u, l), !1, !0), Ht(this.visualElement, "transform");
|
|
883
883
|
const { animationState: g } = this.visualElement;
|
|
884
884
|
g && g.setActive("whileDrag", !0);
|
|
885
|
-
}, a = (u,
|
|
886
|
-
this.latestPointerEvent = u, this.latestPanInfo =
|
|
887
|
-
const { dragPropagation:
|
|
888
|
-
if (!
|
|
885
|
+
}, a = (u, l) => {
|
|
886
|
+
this.latestPointerEvent = u, this.latestPanInfo = l;
|
|
887
|
+
const { dragPropagation: m, dragDirectionLock: d, onDirectionLock: y, onDrag: g } = this.getProps();
|
|
888
|
+
if (!m && !this.openDragLock)
|
|
889
889
|
return;
|
|
890
|
-
const { offset:
|
|
891
|
-
if (
|
|
892
|
-
this.currentDirection =
|
|
890
|
+
const { offset: p } = l;
|
|
891
|
+
if (d && this.currentDirection === null) {
|
|
892
|
+
this.currentDirection = Ws(p), this.currentDirection !== null && y && y(this.currentDirection);
|
|
893
893
|
return;
|
|
894
894
|
}
|
|
895
|
-
this.updateAxis("x",
|
|
896
|
-
},
|
|
897
|
-
this.latestPointerEvent = u, this.latestPanInfo =
|
|
898
|
-
},
|
|
895
|
+
this.updateAxis("x", l.point, p), this.updateAxis("y", l.point, p), this.visualElement.render(), g && b.update(() => g(u, l), !1, !0);
|
|
896
|
+
}, c = (u, l) => {
|
|
897
|
+
this.latestPointerEvent = u, this.latestPanInfo = l, this.stop(u, l), this.latestPointerEvent = null, this.latestPanInfo = null;
|
|
898
|
+
}, f = () => {
|
|
899
899
|
const { dragSnapToOrigin: u } = this.getProps();
|
|
900
900
|
(u || this.constraints) && this.startAnimation({ x: 0, y: 0 });
|
|
901
|
-
}, { dragSnapToOrigin:
|
|
902
|
-
this.panSession = new
|
|
901
|
+
}, { dragSnapToOrigin: h } = this.getProps();
|
|
902
|
+
this.panSession = new Re(e, {
|
|
903
903
|
onSessionStart: i,
|
|
904
904
|
onStart: r,
|
|
905
905
|
onMove: a,
|
|
906
|
-
onSessionEnd:
|
|
907
|
-
resumeAnimation:
|
|
906
|
+
onSessionEnd: c,
|
|
907
|
+
resumeAnimation: f
|
|
908
908
|
}, {
|
|
909
909
|
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
910
|
-
dragSnapToOrigin:
|
|
910
|
+
dragSnapToOrigin: h,
|
|
911
911
|
distanceThreshold: s,
|
|
912
|
-
contextWindow:
|
|
912
|
+
contextWindow: Ie(this.visualElement),
|
|
913
913
|
element: this.visualElement.current
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
/**
|
|
917
917
|
* @internal
|
|
918
918
|
*/
|
|
919
|
-
stop(
|
|
920
|
-
const s =
|
|
919
|
+
stop(e, n) {
|
|
920
|
+
const s = e || this.latestPointerEvent, o = n || this.latestPanInfo, i = this.isDragging;
|
|
921
921
|
if (this.cancel(), !i || !o || !s)
|
|
922
922
|
return;
|
|
923
923
|
const { velocity: r } = o;
|
|
924
924
|
this.startAnimation(r);
|
|
925
925
|
const { onDragEnd: a } = this.getProps();
|
|
926
|
-
a &&
|
|
926
|
+
a && b.postRender(() => a(s, o));
|
|
927
927
|
}
|
|
928
928
|
/**
|
|
929
929
|
* @internal
|
|
930
930
|
*/
|
|
931
931
|
cancel() {
|
|
932
932
|
this.isDragging = !1;
|
|
933
|
-
const { projection:
|
|
934
|
-
|
|
933
|
+
const { projection: e, animationState: n } = this.visualElement;
|
|
934
|
+
e && (e.isAnimationBlocked = !1), this.endPanSession();
|
|
935
935
|
const { dragPropagation: s } = this.getProps();
|
|
936
936
|
!s && this.openDragLock && (this.openDragLock(), this.openDragLock = null), n && n.setActive("whileDrag", !1);
|
|
937
937
|
}
|
|
@@ -944,65 +944,65 @@ class Jn {
|
|
|
944
944
|
endPanSession() {
|
|
945
945
|
this.panSession && this.panSession.end(), this.panSession = void 0;
|
|
946
946
|
}
|
|
947
|
-
updateAxis(
|
|
947
|
+
updateAxis(e, n, s) {
|
|
948
948
|
const { drag: o } = this.getProps();
|
|
949
|
-
if (!s || !
|
|
949
|
+
if (!s || !nt(e, o, this.currentDirection))
|
|
950
950
|
return;
|
|
951
|
-
const i = this.getAxisMotionValue(
|
|
952
|
-
let r = this.originPoint[
|
|
953
|
-
this.constraints && this.constraints[
|
|
951
|
+
const i = this.getAxisMotionValue(e);
|
|
952
|
+
let r = this.originPoint[e] + s[e];
|
|
953
|
+
this.constraints && this.constraints[e] && (r = Ls(r, this.constraints[e], this.elastic[e])), i.set(r);
|
|
954
954
|
}
|
|
955
955
|
resolveConstraints() {
|
|
956
956
|
var i;
|
|
957
|
-
const { dragConstraints:
|
|
958
|
-
|
|
959
|
-
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] =
|
|
957
|
+
const { dragConstraints: e, dragElastic: n } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (i = this.visualElement.projection) == null ? void 0 : i.layout, o = this.constraints;
|
|
958
|
+
e && H(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && s ? this.constraints = Ts(s.layoutBox, e) : this.constraints = !1, this.elastic = Fs(n), o !== this.constraints && !H(e) && s && this.constraints && !this.hasMutatedConstraints && F((r) => {
|
|
959
|
+
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] = ks(s.layoutBox[r], this.constraints[r]));
|
|
960
960
|
});
|
|
961
961
|
}
|
|
962
962
|
resolveRefConstraints() {
|
|
963
|
-
const { dragConstraints:
|
|
964
|
-
if (!
|
|
963
|
+
const { dragConstraints: e, onMeasureDragConstraints: n } = this.getProps();
|
|
964
|
+
if (!e || !H(e))
|
|
965
965
|
return !1;
|
|
966
|
-
const s =
|
|
967
|
-
|
|
966
|
+
const s = e.current;
|
|
967
|
+
lt(s !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
968
968
|
const { projection: o } = this.visualElement;
|
|
969
969
|
if (!o || !o.layout)
|
|
970
970
|
return !1;
|
|
971
|
-
const i =
|
|
972
|
-
let r =
|
|
971
|
+
const i = hn(s, o.root, this.visualElement.getTransformPagePoint());
|
|
972
|
+
let r = Is(o.layout.layoutBox, i);
|
|
973
973
|
if (n) {
|
|
974
|
-
const a = n(
|
|
975
|
-
this.hasMutatedConstraints = !!a, a && (r =
|
|
974
|
+
const a = n(mn(r));
|
|
975
|
+
this.hasMutatedConstraints = !!a, a && (r = pn(a));
|
|
976
976
|
}
|
|
977
977
|
return r;
|
|
978
978
|
}
|
|
979
|
-
startAnimation(
|
|
980
|
-
const { drag: n, dragMomentum: s, dragElastic: o, dragTransition: i, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(),
|
|
981
|
-
if (!
|
|
979
|
+
startAnimation(e) {
|
|
980
|
+
const { drag: n, dragMomentum: s, dragElastic: o, dragTransition: i, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), c = this.constraints || {}, f = F((h) => {
|
|
981
|
+
if (!nt(h, n, this.currentDirection))
|
|
982
982
|
return;
|
|
983
|
-
let u =
|
|
984
|
-
(r === !0 || r ===
|
|
985
|
-
const
|
|
983
|
+
let u = c && c[h] || {};
|
|
984
|
+
(r === !0 || r === h) && (u = { min: 0, max: 0 });
|
|
985
|
+
const l = o ? 200 : 1e6, m = o ? 40 : 1e7, d = {
|
|
986
986
|
type: "inertia",
|
|
987
|
-
velocity: s ?
|
|
988
|
-
bounceStiffness:
|
|
989
|
-
bounceDamping:
|
|
987
|
+
velocity: s ? e[h] : 0,
|
|
988
|
+
bounceStiffness: l,
|
|
989
|
+
bounceDamping: m,
|
|
990
990
|
timeConstant: 750,
|
|
991
991
|
restDelta: 1,
|
|
992
992
|
restSpeed: 10,
|
|
993
993
|
...i,
|
|
994
994
|
...u
|
|
995
995
|
};
|
|
996
|
-
return this.startAxisValueAnimation(
|
|
996
|
+
return this.startAxisValueAnimation(h, d);
|
|
997
997
|
});
|
|
998
|
-
return Promise.all(
|
|
998
|
+
return Promise.all(f).then(a);
|
|
999
999
|
}
|
|
1000
|
-
startAxisValueAnimation(
|
|
1001
|
-
const s = this.getAxisMotionValue(
|
|
1002
|
-
return
|
|
1000
|
+
startAxisValueAnimation(e, n) {
|
|
1001
|
+
const s = this.getAxisMotionValue(e);
|
|
1002
|
+
return Ht(this.visualElement, e), s.start(gn(e, s, 0, n, this.visualElement, !1));
|
|
1003
1003
|
}
|
|
1004
1004
|
stopAnimation() {
|
|
1005
|
-
|
|
1005
|
+
F((e) => this.getAxisMotionValue(e).stop());
|
|
1006
1006
|
}
|
|
1007
1007
|
/**
|
|
1008
1008
|
* Drag works differently depending on which props are provided.
|
|
@@ -1010,19 +1010,19 @@ class Jn {
|
|
|
1010
1010
|
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
|
|
1011
1011
|
* - Otherwise, we apply the delta to the x/y motion values.
|
|
1012
1012
|
*/
|
|
1013
|
-
getAxisMotionValue(
|
|
1014
|
-
const n = `_drag${
|
|
1015
|
-
return o || this.visualElement.getValue(
|
|
1013
|
+
getAxisMotionValue(e) {
|
|
1014
|
+
const n = `_drag${e.toUpperCase()}`, s = this.visualElement.getProps(), o = s[n];
|
|
1015
|
+
return o || this.visualElement.getValue(e, (s.initial ? s.initial[e] : void 0) || 0);
|
|
1016
1016
|
}
|
|
1017
|
-
snapToCursor(
|
|
1018
|
-
|
|
1017
|
+
snapToCursor(e) {
|
|
1018
|
+
F((n) => {
|
|
1019
1019
|
const { drag: s } = this.getProps();
|
|
1020
|
-
if (!
|
|
1020
|
+
if (!nt(n, s, this.currentDirection))
|
|
1021
1021
|
return;
|
|
1022
1022
|
const { projection: o } = this.visualElement, i = this.getAxisMotionValue(n);
|
|
1023
1023
|
if (o && o.layout) {
|
|
1024
|
-
const { min: r, max: a } = o.layout.layoutBox[n],
|
|
1025
|
-
i.set(
|
|
1024
|
+
const { min: r, max: a } = o.layout.layoutBox[n], c = i.get() || 0;
|
|
1025
|
+
i.set(e[n] - K(r, a, 0.5) + c);
|
|
1026
1026
|
}
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
@@ -1034,54 +1034,54 @@ class Jn {
|
|
|
1034
1034
|
scalePositionWithinConstraints() {
|
|
1035
1035
|
if (!this.visualElement.current)
|
|
1036
1036
|
return;
|
|
1037
|
-
const { drag:
|
|
1038
|
-
if (!
|
|
1037
|
+
const { drag: e, dragConstraints: n } = this.getProps(), { projection: s } = this.visualElement;
|
|
1038
|
+
if (!H(n) || !s || !this.constraints)
|
|
1039
1039
|
return;
|
|
1040
1040
|
this.stopAnimation();
|
|
1041
1041
|
const o = { x: 0, y: 0 };
|
|
1042
|
-
|
|
1042
|
+
F((r) => {
|
|
1043
1043
|
const a = this.getAxisMotionValue(r);
|
|
1044
1044
|
if (a && this.constraints !== !1) {
|
|
1045
|
-
const
|
|
1046
|
-
o[r] =
|
|
1045
|
+
const c = a.get();
|
|
1046
|
+
o[r] = Rs({ min: c, max: c }, this.constraints[r]);
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
1049
|
const { transformTemplate: i } = this.visualElement.getProps();
|
|
1050
|
-
this.visualElement.current.style.transform = i ? i({}, "") : "none", s.root && s.root.updateScroll(), s.updateLayout(), this.constraints = !1, this.resolveConstraints(),
|
|
1051
|
-
if (!
|
|
1050
|
+
this.visualElement.current.style.transform = i ? i({}, "") : "none", s.root && s.root.updateScroll(), s.updateLayout(), this.constraints = !1, this.resolveConstraints(), F((r) => {
|
|
1051
|
+
if (!nt(r, e, null))
|
|
1052
1052
|
return;
|
|
1053
|
-
const a = this.getAxisMotionValue(r), { min:
|
|
1054
|
-
a.set(
|
|
1053
|
+
const a = this.getAxisMotionValue(r), { min: c, max: f } = this.constraints[r];
|
|
1054
|
+
a.set(K(c, f, o[r]));
|
|
1055
1055
|
}), this.visualElement.render();
|
|
1056
1056
|
}
|
|
1057
1057
|
addListeners() {
|
|
1058
1058
|
if (!this.visualElement.current)
|
|
1059
1059
|
return;
|
|
1060
|
-
|
|
1061
|
-
const
|
|
1062
|
-
const { drag:
|
|
1063
|
-
|
|
1060
|
+
Os.set(this.visualElement, this);
|
|
1061
|
+
const e = this.visualElement.current, n = _(e, "pointerdown", (f) => {
|
|
1062
|
+
const { drag: h, dragListener: u = !0 } = this.getProps(), l = f.target, m = l !== e && Pn(l);
|
|
1063
|
+
h && u && !m && this.start(f);
|
|
1064
1064
|
});
|
|
1065
1065
|
let s;
|
|
1066
1066
|
const o = () => {
|
|
1067
|
-
const { dragConstraints:
|
|
1068
|
-
|
|
1067
|
+
const { dragConstraints: f } = this.getProps();
|
|
1068
|
+
H(f) && f.current && (this.constraints = this.resolveRefConstraints(), s || (s = js(e, f.current, () => this.scalePositionWithinConstraints())));
|
|
1069
1069
|
}, { projection: i } = this.visualElement, r = i.addEventListener("measure", o);
|
|
1070
|
-
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()),
|
|
1071
|
-
const a =
|
|
1072
|
-
this.isDragging &&
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1070
|
+
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), b.read(o);
|
|
1071
|
+
const a = it(window, "resize", () => this.scalePositionWithinConstraints()), c = i.addEventListener("didUpdate", ({ delta: f, hasLayoutChanged: h }) => {
|
|
1072
|
+
this.isDragging && h && (F((u) => {
|
|
1073
|
+
const l = this.getAxisMotionValue(u);
|
|
1074
|
+
l && (this.originPoint[u] += f[u].translate, l.set(l.get() + f[u].translate));
|
|
1075
1075
|
}), this.visualElement.render());
|
|
1076
1076
|
});
|
|
1077
1077
|
return () => {
|
|
1078
|
-
a(), n(), r(),
|
|
1078
|
+
a(), n(), r(), c && c(), s && s();
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
getProps() {
|
|
1082
|
-
const
|
|
1082
|
+
const e = this.visualElement.getProps(), { drag: n = !1, dragDirectionLock: s = !1, dragPropagation: o = !1, dragConstraints: i = !1, dragElastic: r = xt, dragMomentum: a = !0 } = e;
|
|
1083
1083
|
return {
|
|
1084
|
-
...
|
|
1084
|
+
...e,
|
|
1085
1085
|
drag: n,
|
|
1086
1086
|
dragDirectionLock: s,
|
|
1087
1087
|
dragPropagation: o,
|
|
@@ -1091,71 +1091,71 @@ class Jn {
|
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
let
|
|
1094
|
+
function te(t) {
|
|
1095
|
+
let e = !0;
|
|
1096
1096
|
return () => {
|
|
1097
|
-
if (
|
|
1098
|
-
|
|
1097
|
+
if (e) {
|
|
1098
|
+
e = !1;
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
|
-
|
|
1101
|
+
t();
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1105
|
-
const s =
|
|
1104
|
+
function js(t, e, n) {
|
|
1105
|
+
const s = Nt(t, te(n)), o = Nt(e, te(n));
|
|
1106
1106
|
return () => {
|
|
1107
1107
|
s(), o();
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return (
|
|
1110
|
+
function nt(t, e, n) {
|
|
1111
|
+
return (e === !0 || e === t) && (n === null || n === t);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function Ws(t, e = 10) {
|
|
1114
1114
|
let n = null;
|
|
1115
|
-
return Math.abs(
|
|
1115
|
+
return Math.abs(t.y) > e ? n = "y" : Math.abs(t.x) > e && (n = "x"), n;
|
|
1116
1116
|
}
|
|
1117
|
-
class
|
|
1118
|
-
constructor(
|
|
1119
|
-
super(
|
|
1117
|
+
class Hs extends O {
|
|
1118
|
+
constructor(e) {
|
|
1119
|
+
super(e), this.removeGroupControls = st, this.removeListeners = st, this.controls = new Gs(e);
|
|
1120
1120
|
}
|
|
1121
1121
|
mount() {
|
|
1122
|
-
const { dragControls:
|
|
1123
|
-
|
|
1122
|
+
const { dragControls: e } = this.node.getProps();
|
|
1123
|
+
e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || st;
|
|
1124
1124
|
}
|
|
1125
1125
|
update() {
|
|
1126
|
-
const { dragControls:
|
|
1127
|
-
|
|
1126
|
+
const { dragControls: e } = this.node.getProps(), { dragControls: n } = this.node.prevProps || {};
|
|
1127
|
+
e !== n && (this.removeGroupControls(), e && (this.removeGroupControls = e.subscribe(this.controls)));
|
|
1128
1128
|
}
|
|
1129
1129
|
unmount() {
|
|
1130
1130
|
this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1133
|
+
const yt = (t) => (e, n) => {
|
|
1134
|
+
t && b.update(() => t(e, n), !1, !0);
|
|
1135
1135
|
};
|
|
1136
|
-
class
|
|
1136
|
+
class Ns extends O {
|
|
1137
1137
|
constructor() {
|
|
1138
|
-
super(...arguments), this.removePointerDownListener =
|
|
1138
|
+
super(...arguments), this.removePointerDownListener = st;
|
|
1139
1139
|
}
|
|
1140
|
-
onPointerDown(
|
|
1141
|
-
this.session = new
|
|
1140
|
+
onPointerDown(e) {
|
|
1141
|
+
this.session = new Re(e, this.createPanHandlers(), {
|
|
1142
1142
|
transformPagePoint: this.node.getTransformPagePoint(),
|
|
1143
|
-
contextWindow:
|
|
1143
|
+
contextWindow: Ie(this.node)
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
createPanHandlers() {
|
|
1147
|
-
const { onPanSessionStart:
|
|
1147
|
+
const { onPanSessionStart: e, onPanStart: n, onPan: s, onPanEnd: o } = this.node.getProps();
|
|
1148
1148
|
return {
|
|
1149
|
-
onSessionStart:
|
|
1150
|
-
onStart:
|
|
1151
|
-
onMove:
|
|
1149
|
+
onSessionStart: yt(e),
|
|
1150
|
+
onStart: yt(n),
|
|
1151
|
+
onMove: yt(s),
|
|
1152
1152
|
onEnd: (i, r) => {
|
|
1153
|
-
delete this.session, o &&
|
|
1153
|
+
delete this.session, o && b.postRender(() => o(i, r));
|
|
1154
1154
|
}
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
1157
|
mount() {
|
|
1158
|
-
this.removePointerDownListener =
|
|
1158
|
+
this.removePointerDownListener = _(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
1159
1159
|
}
|
|
1160
1160
|
update() {
|
|
1161
1161
|
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
@@ -1164,116 +1164,116 @@ class es extends A {
|
|
|
1164
1164
|
this.removePointerDownListener(), this.session && this.session.end();
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
|
-
let
|
|
1168
|
-
class
|
|
1167
|
+
let Pt = !1;
|
|
1168
|
+
class Bs extends Ye {
|
|
1169
1169
|
/**
|
|
1170
1170
|
* This only mounts projection nodes for components that
|
|
1171
1171
|
* need measuring, we might want to do it for all components
|
|
1172
1172
|
* in order to incorporate transforms
|
|
1173
1173
|
*/
|
|
1174
1174
|
componentDidMount() {
|
|
1175
|
-
const { visualElement:
|
|
1176
|
-
i && (n.group && n.group.add(i), s && s.register && o && s.register(i),
|
|
1175
|
+
const { visualElement: e, layoutGroup: n, switchLayoutGroup: s, layoutId: o } = this.props, { projection: i } = e;
|
|
1176
|
+
i && (n.group && n.group.add(i), s && s.register && o && s.register(i), Pt && i.root.didUpdate(), i.addEventListener("animationComplete", () => {
|
|
1177
1177
|
this.safeToRemove();
|
|
1178
1178
|
}), i.setOptions({
|
|
1179
1179
|
...i.options,
|
|
1180
1180
|
layoutDependency: this.props.layoutDependency,
|
|
1181
1181
|
onExitComplete: () => this.safeToRemove()
|
|
1182
|
-
})),
|
|
1182
|
+
})), En.hasEverUpdated = !0;
|
|
1183
1183
|
}
|
|
1184
|
-
getSnapshotBeforeUpdate(
|
|
1184
|
+
getSnapshotBeforeUpdate(e) {
|
|
1185
1185
|
const { layoutDependency: n, visualElement: s, drag: o, isPresent: i } = this.props, { projection: r } = s;
|
|
1186
|
-
return r && (r.isPresent = i,
|
|
1186
|
+
return r && (r.isPresent = i, e.layoutDependency !== n && r.setOptions({
|
|
1187
1187
|
...r.options,
|
|
1188
1188
|
layoutDependency: n
|
|
1189
|
-
}),
|
|
1189
|
+
}), Pt = !0, o || e.layoutDependency !== n || n === void 0 || e.isPresent !== i ? r.willUpdate() : this.safeToRemove(), e.isPresent !== i && (i ? r.promote() : r.relegate() || b.postRender(() => {
|
|
1190
1190
|
const a = r.getStack();
|
|
1191
1191
|
(!a || !a.members.length) && this.safeToRemove();
|
|
1192
1192
|
}))), null;
|
|
1193
1193
|
}
|
|
1194
1194
|
componentDidUpdate() {
|
|
1195
|
-
const { projection:
|
|
1196
|
-
|
|
1197
|
-
!
|
|
1195
|
+
const { projection: e } = this.props.visualElement;
|
|
1196
|
+
e && (e.root.didUpdate(), wn.postRender(() => {
|
|
1197
|
+
!e.currentAnimation && e.isLead() && this.safeToRemove();
|
|
1198
1198
|
}));
|
|
1199
1199
|
}
|
|
1200
1200
|
componentWillUnmount() {
|
|
1201
|
-
const { visualElement:
|
|
1202
|
-
|
|
1201
|
+
const { visualElement: e, layoutGroup: n, switchLayoutGroup: s } = this.props, { projection: o } = e;
|
|
1202
|
+
Pt = !0, o && (o.scheduleCheckAfterUnmount(), n && n.group && n.group.remove(o), s && s.deregister && s.deregister(o));
|
|
1203
1203
|
}
|
|
1204
1204
|
safeToRemove() {
|
|
1205
|
-
const { safeToRemove:
|
|
1206
|
-
|
|
1205
|
+
const { safeToRemove: e } = this.props;
|
|
1206
|
+
e && e();
|
|
1207
1207
|
}
|
|
1208
1208
|
render() {
|
|
1209
1209
|
return null;
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1213
|
-
const [
|
|
1214
|
-
return
|
|
1212
|
+
function Fe(t) {
|
|
1213
|
+
const [e, n] = Ee(), s = C(X);
|
|
1214
|
+
return I(Bs, { ...t, layoutGroup: s, switchLayoutGroup: C(Le), isPresent: e, safeToRemove: n });
|
|
1215
1215
|
}
|
|
1216
|
-
const
|
|
1216
|
+
const Us = {
|
|
1217
1217
|
pan: {
|
|
1218
|
-
Feature:
|
|
1218
|
+
Feature: Ns
|
|
1219
1219
|
},
|
|
1220
1220
|
drag: {
|
|
1221
|
-
Feature:
|
|
1222
|
-
ProjectionNode:
|
|
1223
|
-
MeasureLayout:
|
|
1221
|
+
Feature: Hs,
|
|
1222
|
+
ProjectionNode: ve,
|
|
1223
|
+
MeasureLayout: Fe
|
|
1224
1224
|
}
|
|
1225
1225
|
};
|
|
1226
|
-
function
|
|
1227
|
-
const { props: s } =
|
|
1228
|
-
|
|
1226
|
+
function ee(t, e, n) {
|
|
1227
|
+
const { props: s } = t;
|
|
1228
|
+
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
1229
1229
|
const o = "onHover" + n, i = s[o];
|
|
1230
|
-
i &&
|
|
1230
|
+
i && b.postRender(() => i(e, J(e)));
|
|
1231
1231
|
}
|
|
1232
|
-
class
|
|
1232
|
+
class zs extends O {
|
|
1233
1233
|
mount() {
|
|
1234
|
-
const { current:
|
|
1235
|
-
|
|
1234
|
+
const { current: e } = this.node;
|
|
1235
|
+
e && (this.unmount = Sn(e, (n, s) => (ee(this.node, s, "Start"), (o) => ee(this.node, o, "End"))));
|
|
1236
1236
|
}
|
|
1237
1237
|
unmount() {
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
|
-
class
|
|
1240
|
+
class $s extends O {
|
|
1241
1241
|
constructor() {
|
|
1242
1242
|
super(...arguments), this.isActive = !1;
|
|
1243
1243
|
}
|
|
1244
1244
|
onFocus() {
|
|
1245
|
-
let
|
|
1245
|
+
let e = !1;
|
|
1246
1246
|
try {
|
|
1247
|
-
|
|
1247
|
+
e = this.node.current.matches(":focus-visible");
|
|
1248
1248
|
} catch {
|
|
1249
|
-
|
|
1249
|
+
e = !0;
|
|
1250
1250
|
}
|
|
1251
|
-
!
|
|
1251
|
+
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
1252
1252
|
}
|
|
1253
1253
|
onBlur() {
|
|
1254
1254
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
1255
1255
|
}
|
|
1256
1256
|
mount() {
|
|
1257
|
-
this.unmount =
|
|
1257
|
+
this.unmount = pe(it(this.node.current, "focus", () => this.onFocus()), it(this.node.current, "blur", () => this.onBlur()));
|
|
1258
1258
|
}
|
|
1259
1259
|
unmount() {
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1263
|
-
const { props: s } =
|
|
1264
|
-
if (
|
|
1262
|
+
function ne(t, e, n) {
|
|
1263
|
+
const { props: s } = t;
|
|
1264
|
+
if (t.current instanceof HTMLButtonElement && t.current.disabled)
|
|
1265
1265
|
return;
|
|
1266
|
-
|
|
1266
|
+
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
1267
1267
|
const o = "onTap" + (n === "End" ? "" : n), i = s[o];
|
|
1268
|
-
i &&
|
|
1268
|
+
i && b.postRender(() => i(e, J(e)));
|
|
1269
1269
|
}
|
|
1270
|
-
class
|
|
1270
|
+
class _s extends O {
|
|
1271
1271
|
mount() {
|
|
1272
|
-
const { current:
|
|
1273
|
-
if (!
|
|
1272
|
+
const { current: e } = this.node;
|
|
1273
|
+
if (!e)
|
|
1274
1274
|
return;
|
|
1275
1275
|
const { globalTapTarget: n, propagate: s } = this.node.props;
|
|
1276
|
-
this.unmount =
|
|
1276
|
+
this.unmount = Cn(e, (o, i) => (ne(this.node, i, "Start"), (r, { success: a }) => ne(this.node, r, a ? "End" : "Cancel")), {
|
|
1277
1277
|
useGlobalTarget: n,
|
|
1278
1278
|
stopPropagation: (s == null ? void 0 : s.tap) === !1
|
|
1279
1279
|
});
|
|
@@ -1281,47 +1281,47 @@ class rs extends A {
|
|
|
1281
1281
|
unmount() {
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
const
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1287
|
-
},
|
|
1288
|
-
|
|
1284
|
+
const Mt = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), Ys = (t) => {
|
|
1285
|
+
const e = Mt.get(t.target);
|
|
1286
|
+
e && e(t);
|
|
1287
|
+
}, Ks = (t) => {
|
|
1288
|
+
t.forEach(Ys);
|
|
1289
1289
|
};
|
|
1290
|
-
function
|
|
1291
|
-
const n =
|
|
1292
|
-
|
|
1293
|
-
const s =
|
|
1294
|
-
return s[o] || (s[o] = new IntersectionObserver(
|
|
1295
|
-
}
|
|
1296
|
-
function
|
|
1297
|
-
const s =
|
|
1298
|
-
return
|
|
1299
|
-
|
|
1290
|
+
function Xs({ root: t, ...e }) {
|
|
1291
|
+
const n = t || document;
|
|
1292
|
+
wt.has(n) || wt.set(n, {});
|
|
1293
|
+
const s = wt.get(n), o = JSON.stringify(e);
|
|
1294
|
+
return s[o] || (s[o] = new IntersectionObserver(Ks, { root: t, ...e })), s[o];
|
|
1295
|
+
}
|
|
1296
|
+
function qs(t, e, n) {
|
|
1297
|
+
const s = Xs(e);
|
|
1298
|
+
return Mt.set(t, n), s.observe(t), () => {
|
|
1299
|
+
Mt.delete(t), s.unobserve(t);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
|
-
const
|
|
1302
|
+
const Js = {
|
|
1303
1303
|
some: 0,
|
|
1304
1304
|
all: 1
|
|
1305
1305
|
};
|
|
1306
|
-
class
|
|
1306
|
+
class Zs extends O {
|
|
1307
1307
|
constructor() {
|
|
1308
1308
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
1309
1309
|
}
|
|
1310
1310
|
startObserver() {
|
|
1311
1311
|
this.unmount();
|
|
1312
|
-
const { viewport:
|
|
1312
|
+
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: o = "some", once: i } = e, r = {
|
|
1313
1313
|
root: n ? n.current : void 0,
|
|
1314
1314
|
rootMargin: s,
|
|
1315
|
-
threshold: typeof o == "number" ? o :
|
|
1316
|
-
}, a = (
|
|
1317
|
-
const { isIntersecting:
|
|
1318
|
-
if (this.isInView ===
|
|
1315
|
+
threshold: typeof o == "number" ? o : Js[o]
|
|
1316
|
+
}, a = (c) => {
|
|
1317
|
+
const { isIntersecting: f } = c;
|
|
1318
|
+
if (this.isInView === f || (this.isInView = f, i && !f && this.hasEnteredView))
|
|
1319
1319
|
return;
|
|
1320
|
-
|
|
1321
|
-
const { onViewportEnter:
|
|
1322
|
-
|
|
1320
|
+
f && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", f);
|
|
1321
|
+
const { onViewportEnter: h, onViewportLeave: u } = this.node.getProps(), l = f ? h : u;
|
|
1322
|
+
l && l(c);
|
|
1323
1323
|
};
|
|
1324
|
-
return
|
|
1324
|
+
return qs(this.node.current, r, a);
|
|
1325
1325
|
}
|
|
1326
1326
|
mount() {
|
|
1327
1327
|
this.startObserver();
|
|
@@ -1329,48 +1329,322 @@ class ds extends A {
|
|
|
1329
1329
|
update() {
|
|
1330
1330
|
if (typeof IntersectionObserver > "u")
|
|
1331
1331
|
return;
|
|
1332
|
-
const { props:
|
|
1333
|
-
["amount", "margin", "root"].some(
|
|
1332
|
+
const { props: e, prevProps: n } = this.node;
|
|
1333
|
+
["amount", "margin", "root"].some(Qs(e, n)) && this.startObserver();
|
|
1334
1334
|
}
|
|
1335
1335
|
unmount() {
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1339
|
-
return (n) =>
|
|
1338
|
+
function Qs({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
1339
|
+
return (n) => t[n] !== e[n];
|
|
1340
1340
|
}
|
|
1341
|
-
const
|
|
1341
|
+
const to = {
|
|
1342
1342
|
inView: {
|
|
1343
|
-
Feature:
|
|
1343
|
+
Feature: Zs
|
|
1344
1344
|
},
|
|
1345
1345
|
tap: {
|
|
1346
|
-
Feature:
|
|
1346
|
+
Feature: _s
|
|
1347
1347
|
},
|
|
1348
1348
|
focus: {
|
|
1349
|
-
Feature:
|
|
1349
|
+
Feature: $s
|
|
1350
1350
|
},
|
|
1351
1351
|
hover: {
|
|
1352
|
-
Feature:
|
|
1352
|
+
Feature: zs
|
|
1353
1353
|
}
|
|
1354
|
-
},
|
|
1354
|
+
}, eo = {
|
|
1355
1355
|
layout: {
|
|
1356
|
-
ProjectionNode:
|
|
1357
|
-
MeasureLayout:
|
|
1358
|
-
}
|
|
1359
|
-
},
|
|
1360
|
-
...
|
|
1361
|
-
...
|
|
1362
|
-
...
|
|
1363
|
-
...
|
|
1364
|
-
},
|
|
1365
|
-
function
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1356
|
+
ProjectionNode: ve,
|
|
1357
|
+
MeasureLayout: Fe
|
|
1358
|
+
}
|
|
1359
|
+
}, no = {
|
|
1360
|
+
...Ms,
|
|
1361
|
+
...to,
|
|
1362
|
+
...Us,
|
|
1363
|
+
...eo
|
|
1364
|
+
}, Io = /* @__PURE__ */ ws(no, Es);
|
|
1365
|
+
function so(t) {
|
|
1366
|
+
const e = B(() => ye(t)), { isStatic: n } = C(N);
|
|
1367
|
+
if (n) {
|
|
1368
|
+
const [, s] = Y(t);
|
|
1369
|
+
ct(() => e.on("change", s), []);
|
|
1370
|
+
}
|
|
1371
|
+
return e;
|
|
1372
|
+
}
|
|
1373
|
+
function Oe(t, e) {
|
|
1374
|
+
const n = so(e()), s = () => n.set(e());
|
|
1375
|
+
return s(), ft(() => {
|
|
1376
|
+
const o = () => b.preRender(s, !1, !0), i = t.map((r) => r.on("change", o));
|
|
1377
|
+
return () => {
|
|
1378
|
+
i.forEach((r) => r()), ge(s);
|
|
1379
|
+
};
|
|
1380
|
+
}), n;
|
|
1381
|
+
}
|
|
1382
|
+
function oo(t) {
|
|
1383
|
+
pt.current = [], t();
|
|
1384
|
+
const e = Oe(pt.current, t);
|
|
1385
|
+
return pt.current = void 0, e;
|
|
1386
|
+
}
|
|
1387
|
+
function Ro(t, e, n, s) {
|
|
1388
|
+
if (typeof t == "function")
|
|
1389
|
+
return oo(t);
|
|
1390
|
+
const i = typeof e == "function" ? e : xn(e, n, s), r = Array.isArray(t) ? se(t, i) : se([t], ([c]) => i(c)), a = Array.isArray(t) ? void 0 : t.accelerate;
|
|
1391
|
+
return a && !a.isTransformed && typeof e != "function" && Array.isArray(n) && (s == null ? void 0 : s.clamp) !== !1 && (r.accelerate = {
|
|
1392
|
+
...a,
|
|
1393
|
+
times: e,
|
|
1394
|
+
keyframes: n,
|
|
1395
|
+
isTransformed: !0
|
|
1396
|
+
}), r;
|
|
1397
|
+
}
|
|
1398
|
+
function se(t, e) {
|
|
1399
|
+
const n = B(() => []);
|
|
1400
|
+
return Oe(t, () => {
|
|
1401
|
+
n.length = 0;
|
|
1402
|
+
const s = t.length;
|
|
1403
|
+
for (let o = 0; o < s; o++)
|
|
1404
|
+
n[o] = t[o].get();
|
|
1405
|
+
return e(n);
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
function ko() {
|
|
1409
|
+
!Mn.current && An();
|
|
1410
|
+
const [t] = Y(Vn.current);
|
|
1411
|
+
return process.env.NODE_ENV !== "production" && fe(t !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), t;
|
|
1412
|
+
}
|
|
1413
|
+
function Lt(t) {
|
|
1414
|
+
return typeof t == "object" && !Array.isArray(t);
|
|
1415
|
+
}
|
|
1416
|
+
function Ge(t, e, n, s) {
|
|
1417
|
+
return t == null ? [] : typeof t == "string" && Lt(e) ? Dn(t, n, s) : t instanceof NodeList ? Array.from(t) : Array.isArray(t) ? t.filter((o) => o != null) : [t];
|
|
1418
|
+
}
|
|
1419
|
+
function io(t, e, n) {
|
|
1420
|
+
return t * (e + 1);
|
|
1421
|
+
}
|
|
1422
|
+
function oe(t, e, n, s) {
|
|
1423
|
+
return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, t + parseFloat(e)) : e === "<" ? n : e.startsWith("<") ? Math.max(0, n + parseFloat(e.slice(1))) : s.get(e) ?? t;
|
|
1424
|
+
}
|
|
1425
|
+
function ro(t, e, n) {
|
|
1426
|
+
for (let s = 0; s < t.length; s++) {
|
|
1427
|
+
const o = t[s];
|
|
1428
|
+
o.at > e && o.at < n && (we(t, o), s--);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function ao(t, e, n, s, o, i) {
|
|
1432
|
+
ro(t, o, i);
|
|
1433
|
+
for (let r = 0; r < e.length; r++)
|
|
1434
|
+
t.push({
|
|
1435
|
+
value: e[r],
|
|
1436
|
+
at: K(o, i, s[r]),
|
|
1437
|
+
easing: Pe(n, r)
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
function uo(t, e) {
|
|
1441
|
+
for (let n = 0; n < t.length; n++)
|
|
1442
|
+
t[n] = t[n] / (e + 1);
|
|
1443
|
+
}
|
|
1444
|
+
function co(t, e) {
|
|
1445
|
+
return t.at === e.at ? t.value === null ? 1 : e.value === null ? -1 : 0 : t.at - e.at;
|
|
1446
|
+
}
|
|
1447
|
+
const lo = "easeInOut", fo = 20;
|
|
1448
|
+
function ho(t, { defaultTransition: e = {}, ...n } = {}, s, o) {
|
|
1449
|
+
const i = e.duration || 0.3, r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), c = {}, f = /* @__PURE__ */ new Map();
|
|
1450
|
+
let h = 0, u = 0, l = 0;
|
|
1451
|
+
for (let m = 0; m < t.length; m++) {
|
|
1452
|
+
const d = t[m];
|
|
1453
|
+
if (typeof d == "string") {
|
|
1454
|
+
f.set(d, u);
|
|
1455
|
+
continue;
|
|
1456
|
+
} else if (!Array.isArray(d)) {
|
|
1457
|
+
f.set(d.name, oe(u, d.at, h, f));
|
|
1458
|
+
continue;
|
|
1459
|
+
}
|
|
1460
|
+
let [y, g, p = {}] = d;
|
|
1461
|
+
p.at !== void 0 && (u = oe(u, p.at, h, f));
|
|
1462
|
+
let v = 0;
|
|
1463
|
+
const E = (w, S, x, A = 0, M = 0) => {
|
|
1464
|
+
const P = mo(w), { delay: L = 0, times: D = bn(P), type: W = e.type || "keyframes", repeat: G, repeatType: xo, repeatDelay: Mo = 0, ...We } = S;
|
|
1465
|
+
let { ease: k = e.ease || "easeOut", duration: T } = S;
|
|
1466
|
+
const Tt = typeof L == "function" ? L(A, M) : L, It = P.length, Rt = In(W) ? W : o == null ? void 0 : o[W || "keyframes"];
|
|
1467
|
+
if (It <= 2 && Rt) {
|
|
1468
|
+
let U = 100;
|
|
1469
|
+
if (It === 2 && vo(P)) {
|
|
1470
|
+
const z = P[1] - P[0];
|
|
1471
|
+
U = Math.abs(z);
|
|
1472
|
+
}
|
|
1473
|
+
const Z = {
|
|
1474
|
+
...e,
|
|
1475
|
+
...We
|
|
1476
|
+
};
|
|
1477
|
+
T !== void 0 && (Z.duration = Et(T));
|
|
1478
|
+
const Q = Ln(Z, U, Rt);
|
|
1479
|
+
k = Q.ease, T = Q.duration;
|
|
1480
|
+
}
|
|
1481
|
+
T ?? (T = i);
|
|
1482
|
+
const kt = u + Tt;
|
|
1483
|
+
D.length === 1 && D[0] === 0 && (D[1] = 1);
|
|
1484
|
+
const Ft = D.length - P.length;
|
|
1485
|
+
if (Ft > 0 && Tn(D, Ft), P.length === 1 && P.unshift(null), G) {
|
|
1486
|
+
lt(G < fo, "Repeat count too high, must be less than 20", "repeat-count-high"), T = io(T, G);
|
|
1487
|
+
const U = [...P], Z = [...D];
|
|
1488
|
+
k = Array.isArray(k) ? [...k] : [k];
|
|
1489
|
+
const Q = [...k];
|
|
1490
|
+
for (let z = 0; z < G; z++) {
|
|
1491
|
+
P.push(...U);
|
|
1492
|
+
for (let $ = 0; $ < U.length; $++)
|
|
1493
|
+
D.push(Z[$] + (z + 1)), k.push($ === 0 ? "linear" : Pe(Q, $ - 1));
|
|
1494
|
+
}
|
|
1495
|
+
uo(D, G);
|
|
1496
|
+
}
|
|
1497
|
+
const Ot = kt + T;
|
|
1498
|
+
ao(x, P, k, D, kt, Ot), v = Math.max(Tt + T, v), l = Math.max(Ot, l);
|
|
1499
|
+
};
|
|
1500
|
+
if (q(y)) {
|
|
1501
|
+
const w = ie(y, a);
|
|
1502
|
+
E(g, p, re("default", w));
|
|
1503
|
+
} else {
|
|
1504
|
+
const w = Ge(y, g, s, c), S = w.length;
|
|
1505
|
+
for (let x = 0; x < S; x++) {
|
|
1506
|
+
g = g, p = p;
|
|
1507
|
+
const A = w[x], M = ie(A, a);
|
|
1508
|
+
for (const P in g)
|
|
1509
|
+
E(g[P], po(p, P), re(P, M), x, S);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
h = u, u += v;
|
|
1513
|
+
}
|
|
1514
|
+
return a.forEach((m, d) => {
|
|
1515
|
+
for (const y in m) {
|
|
1516
|
+
const g = m[y];
|
|
1517
|
+
g.sort(co);
|
|
1518
|
+
const p = [], v = [], E = [];
|
|
1519
|
+
for (let A = 0; A < g.length; A++) {
|
|
1520
|
+
const { at: M, value: P, easing: L } = g[A];
|
|
1521
|
+
p.push(P), v.push(Ct(0, l, M)), E.push(L || "easeOut");
|
|
1522
|
+
}
|
|
1523
|
+
v[0] !== 0 && (v.unshift(0), p.unshift(p[0]), E.unshift(lo)), v[v.length - 1] !== 1 && (v.push(1), p.push(null)), r.has(d) || r.set(d, {
|
|
1524
|
+
keyframes: {},
|
|
1525
|
+
transition: {}
|
|
1526
|
+
});
|
|
1527
|
+
const w = r.get(d);
|
|
1528
|
+
w.keyframes[y] = p;
|
|
1529
|
+
const { type: S, ...x } = e;
|
|
1530
|
+
w.transition[y] = {
|
|
1531
|
+
...x,
|
|
1532
|
+
duration: l,
|
|
1533
|
+
ease: E,
|
|
1534
|
+
times: v,
|
|
1535
|
+
...n
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
}), r;
|
|
1539
|
+
}
|
|
1540
|
+
function ie(t, e) {
|
|
1541
|
+
return !e.has(t) && e.set(t, {}), e.get(t);
|
|
1542
|
+
}
|
|
1543
|
+
function re(t, e) {
|
|
1544
|
+
return e[t] || (e[t] = []), e[t];
|
|
1545
|
+
}
|
|
1546
|
+
function mo(t) {
|
|
1547
|
+
return Array.isArray(t) ? t : [t];
|
|
1548
|
+
}
|
|
1549
|
+
function po(t, e) {
|
|
1550
|
+
return t && t[e] ? {
|
|
1551
|
+
...t,
|
|
1552
|
+
...t[e]
|
|
1553
|
+
} : { ...t };
|
|
1554
|
+
}
|
|
1555
|
+
const go = (t) => typeof t == "number", vo = (t) => t.every(go);
|
|
1556
|
+
function yo(t) {
|
|
1557
|
+
const e = {
|
|
1558
|
+
presenceContext: null,
|
|
1559
|
+
props: {},
|
|
1560
|
+
visualState: {
|
|
1561
|
+
renderState: {
|
|
1562
|
+
transform: {},
|
|
1563
|
+
transformOrigin: {},
|
|
1564
|
+
style: {},
|
|
1565
|
+
vars: {},
|
|
1566
|
+
attrs: {}
|
|
1567
|
+
},
|
|
1568
|
+
latestValues: {}
|
|
1569
|
+
}
|
|
1570
|
+
}, n = Rn(t) && !kn(t) ? new de(e) : new he(e);
|
|
1571
|
+
n.mount(t), rt.set(t, n);
|
|
1572
|
+
}
|
|
1573
|
+
function Po(t) {
|
|
1574
|
+
const e = {
|
|
1575
|
+
presenceContext: null,
|
|
1576
|
+
props: {},
|
|
1577
|
+
visualState: {
|
|
1578
|
+
renderState: {
|
|
1579
|
+
output: {}
|
|
1580
|
+
},
|
|
1581
|
+
latestValues: {}
|
|
1582
|
+
}
|
|
1583
|
+
}, n = new Fn(e);
|
|
1584
|
+
n.mount(t), rt.set(t, n);
|
|
1585
|
+
}
|
|
1586
|
+
function wo(t, e) {
|
|
1587
|
+
return q(t) || typeof t == "number" || typeof t == "string" && !Lt(e);
|
|
1588
|
+
}
|
|
1589
|
+
function je(t, e, n, s) {
|
|
1590
|
+
const o = [];
|
|
1591
|
+
if (wo(t, e))
|
|
1592
|
+
o.push(On(t, Lt(e) && e.default || e, n && (n.default || n)));
|
|
1593
|
+
else {
|
|
1594
|
+
if (t == null)
|
|
1595
|
+
return o;
|
|
1596
|
+
const i = Ge(t, e, s), r = i.length;
|
|
1597
|
+
lt(!!r, "No valid elements provided.", "no-valid-elements");
|
|
1598
|
+
for (let a = 0; a < r; a++) {
|
|
1599
|
+
const c = i[a], f = c instanceof Element ? yo : Po;
|
|
1600
|
+
rt.has(c) || f(c);
|
|
1601
|
+
const h = rt.get(c), u = { ...n };
|
|
1602
|
+
"delay" in u && typeof u.delay == "function" && (u.delay = u.delay(a, r)), o.push(...Gn(h, { ...e, transition: u }, {}));
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
return o;
|
|
1606
|
+
}
|
|
1607
|
+
function Eo(t, e, n) {
|
|
1608
|
+
const s = [], o = t.map((r) => {
|
|
1609
|
+
if (Array.isArray(r) && typeof r[0] == "function") {
|
|
1610
|
+
const a = r[0], c = ye(0);
|
|
1611
|
+
return c.on("change", a), r.length === 1 ? [c, [0, 1]] : r.length === 2 ? [c, [0, 1], r[1]] : [c, r[1], r[2]];
|
|
1612
|
+
}
|
|
1613
|
+
return r;
|
|
1614
|
+
});
|
|
1615
|
+
return ho(o, e, n, { spring: jn }).forEach(({ keyframes: r, transition: a }, c) => {
|
|
1616
|
+
s.push(...je(c, r, a));
|
|
1617
|
+
}), s;
|
|
1618
|
+
}
|
|
1619
|
+
function So(t) {
|
|
1620
|
+
return Array.isArray(t) && t.some(Array.isArray);
|
|
1621
|
+
}
|
|
1622
|
+
function Co(t = {}) {
|
|
1623
|
+
const { scope: e, reduceMotion: n } = t;
|
|
1624
|
+
function s(o, i, r) {
|
|
1625
|
+
let a = [], c;
|
|
1626
|
+
if (So(o)) {
|
|
1627
|
+
const { onComplete: h, ...u } = i || {};
|
|
1628
|
+
typeof h == "function" && (c = h), a = Eo(o, n !== void 0 ? { reduceMotion: n, ...u } : u, e);
|
|
1629
|
+
} else {
|
|
1630
|
+
const { onComplete: h, ...u } = r || {};
|
|
1631
|
+
typeof h == "function" && (c = h), a = je(o, i, n !== void 0 ? { reduceMotion: n, ...u } : u, e);
|
|
1632
|
+
}
|
|
1633
|
+
const f = new Wn(a);
|
|
1634
|
+
return c && f.finished.then(c), e && (e.animations.push(f), f.finished.then(() => {
|
|
1635
|
+
we(e.animations, f);
|
|
1636
|
+
})), f;
|
|
1637
|
+
}
|
|
1638
|
+
return s;
|
|
1369
1639
|
}
|
|
1640
|
+
const Fo = Co();
|
|
1370
1641
|
export {
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1642
|
+
bo as A,
|
|
1643
|
+
Lo as L,
|
|
1644
|
+
To as M,
|
|
1645
|
+
so as a,
|
|
1646
|
+
Fo as b,
|
|
1647
|
+
Ro as c,
|
|
1648
|
+
Io as m,
|
|
1649
|
+
ko as u
|
|
1376
1650
|
};
|