motion-dom 12.27.0-alpha.0 → 12.27.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +78 -22
- package/dist/es/layout/animate-layout.mjs +76 -16
- package/dist/es/layout/mutation-observer.mjs +1 -5
- package/dist/index.d.ts +20 -10
- package/dist/motion-dom.dev.js +78 -22
- package/dist/motion-dom.js +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -3742,11 +3742,7 @@ function convertAttrKey(key) {
|
|
|
3742
3742
|
/**
|
|
3743
3743
|
* Selectors for elements that should participate in layout animations
|
|
3744
3744
|
*/
|
|
3745
|
-
const LAYOUT_SELECTORS = [
|
|
3746
|
-
"[data-layout]",
|
|
3747
|
-
"[data-layout-id]",
|
|
3748
|
-
"[data-animate-layout]",
|
|
3749
|
-
];
|
|
3745
|
+
const LAYOUT_SELECTORS$1 = ["[data-layout]", "[data-layout-id]"];
|
|
3750
3746
|
/**
|
|
3751
3747
|
* Execute a mutation callback while observing DOM changes.
|
|
3752
3748
|
* Returns information about elements that were added or removed.
|
|
@@ -3776,7 +3772,7 @@ const LAYOUT_SELECTORS = [
|
|
|
3776
3772
|
function observeMutation(container, mutation) {
|
|
3777
3773
|
// Snapshot approach: capture layout elements before and after mutation
|
|
3778
3774
|
// MutationObserver callbacks are async microtasks, so we use direct comparison instead
|
|
3779
|
-
const selector = LAYOUT_SELECTORS.join(", ");
|
|
3775
|
+
const selector = LAYOUT_SELECTORS$1.join(", ");
|
|
3780
3776
|
// Capture elements and their bounds before mutation
|
|
3781
3777
|
const elementsBefore = new Map();
|
|
3782
3778
|
container.querySelectorAll(selector).forEach((el) => {
|
|
@@ -4065,42 +4061,102 @@ async function executeLayoutAnimation(nodes, mutation, options, enterConfig, exi
|
|
|
4065
4061
|
return new GroupAnimation(animations);
|
|
4066
4062
|
}
|
|
4067
4063
|
/**
|
|
4068
|
-
*
|
|
4064
|
+
* Selectors for elements that participate in layout animations
|
|
4065
|
+
*/
|
|
4066
|
+
const LAYOUT_SELECTORS = "[data-layout], [data-layout-id]";
|
|
4067
|
+
/**
|
|
4068
|
+
* Check if a value is a valid element or selector
|
|
4069
|
+
*/
|
|
4070
|
+
function isElementOrSelector(value) {
|
|
4071
|
+
return (value instanceof Element ||
|
|
4072
|
+
typeof value === "string" ||
|
|
4073
|
+
(Array.isArray(value) && value.length > 0 && value[0] instanceof Element) ||
|
|
4074
|
+
value instanceof NodeList);
|
|
4075
|
+
}
|
|
4076
|
+
/**
|
|
4077
|
+
* Animate layout changes for elements with data-layout or data-layout-id attributes.
|
|
4069
4078
|
* Returns a builder that resolves to a GroupAnimation implementing AnimationPlaybackControls.
|
|
4070
4079
|
*
|
|
4080
|
+
* When a selector/element is provided, it acts as a **scope** - layout elements
|
|
4081
|
+
* (those with data-layout or data-layout-id) are searched within that scope.
|
|
4082
|
+
*
|
|
4083
|
+
* @example
|
|
4084
|
+
* // Document-wide layout animation (all data-layout elements in document)
|
|
4085
|
+
* const animation = await animateLayout(() => {
|
|
4086
|
+
* updateDOM()
|
|
4087
|
+
* }, { duration: 0.3 })
|
|
4088
|
+
*
|
|
4071
4089
|
* @example
|
|
4072
|
-
* //
|
|
4073
|
-
* const animation = await animateLayout("
|
|
4074
|
-
*
|
|
4090
|
+
* // Scoped layout animation - finds data-layout elements within .container
|
|
4091
|
+
* const animation = await animateLayout(".container", () => {
|
|
4092
|
+
* // Toggle classes, the underline with data-layout-id will animate
|
|
4093
|
+
* oldTab.classList.remove("selected")
|
|
4094
|
+
* newTab.classList.add("selected")
|
|
4075
4095
|
* }, { duration: 0.3 })
|
|
4076
|
-
* animation.pause()
|
|
4077
4096
|
*
|
|
4078
4097
|
* @example
|
|
4079
4098
|
* // Builder pattern with enter/exit animations
|
|
4080
|
-
* const animation = await animateLayout(".cards", { duration: 0.3 })
|
|
4099
|
+
* const animation = await animateLayout(".cards-container", { duration: 0.3 })
|
|
4081
4100
|
* .enter({ opacity: [0, 1], scale: [0.8, 1] }, { duration: 0.2 })
|
|
4082
4101
|
* .exit({ opacity: 0, scale: 0.8 }, { duration: 0.15 })
|
|
4083
4102
|
* animation.time = 0 // Seek to start
|
|
4084
4103
|
*
|
|
4085
4104
|
* @example
|
|
4086
|
-
* //
|
|
4087
|
-
* const animation = await animateLayout(
|
|
4088
|
-
*
|
|
4105
|
+
* // Scope to specific element
|
|
4106
|
+
* const animation = await animateLayout(containerElement, () => {
|
|
4107
|
+
* containerElement.querySelector('.item').style.width = "500px"
|
|
4089
4108
|
* })
|
|
4090
4109
|
*/
|
|
4091
|
-
function animateLayout(
|
|
4110
|
+
function animateLayout(elementOrSelectorOrMutation, mutationOrOptions, options) {
|
|
4092
4111
|
// Check if factory is configured
|
|
4093
4112
|
if (!globalFactory) {
|
|
4094
4113
|
throw new Error("animateLayout: No layout node factory configured. " +
|
|
4095
4114
|
"Make sure to import from 'framer-motion' or call setLayoutNodeFactory() first.");
|
|
4096
4115
|
}
|
|
4097
4116
|
const factory = globalFactory;
|
|
4098
|
-
|
|
4099
|
-
//
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4117
|
+
// Parse overloaded arguments to support:
|
|
4118
|
+
// animateLayout(mutation, options) - document-wide
|
|
4119
|
+
// animateLayout(options) - document-wide
|
|
4120
|
+
// animateLayout(selector, mutation, options) - scoped
|
|
4121
|
+
// animateLayout(selector, options) - scoped
|
|
4122
|
+
let elements;
|
|
4123
|
+
let mutation;
|
|
4124
|
+
let opts;
|
|
4125
|
+
if (!elementOrSelectorOrMutation || !isElementOrSelector(elementOrSelectorOrMutation)) {
|
|
4126
|
+
// No selector provided - scope to entire document
|
|
4127
|
+
elements = Array.from(document.querySelectorAll(LAYOUT_SELECTORS));
|
|
4128
|
+
if (typeof elementOrSelectorOrMutation === "function") {
|
|
4129
|
+
// animateLayout(mutation, options)
|
|
4130
|
+
mutation = elementOrSelectorOrMutation;
|
|
4131
|
+
opts = mutationOrOptions ?? {};
|
|
4132
|
+
}
|
|
4133
|
+
else {
|
|
4134
|
+
// animateLayout(options) or animateLayout()
|
|
4135
|
+
mutation = typeof mutationOrOptions === "function" ? mutationOrOptions : undefined;
|
|
4136
|
+
opts = elementOrSelectorOrMutation ??
|
|
4137
|
+
(typeof mutationOrOptions === "object" ? mutationOrOptions : {});
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
else {
|
|
4141
|
+
// Selector provided - use as scope for finding layout elements
|
|
4142
|
+
const scopeElements = resolveElements(elementOrSelectorOrMutation);
|
|
4143
|
+
elements = [];
|
|
4144
|
+
for (const scope of scopeElements) {
|
|
4145
|
+
// Find layout elements within this scope
|
|
4146
|
+
const layoutElements = scope.querySelectorAll(LAYOUT_SELECTORS);
|
|
4147
|
+
elements.push(...Array.from(layoutElements));
|
|
4148
|
+
// Also include the scope element itself if it has layout attributes
|
|
4149
|
+
if (scope.matches(LAYOUT_SELECTORS)) {
|
|
4150
|
+
elements.push(scope);
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
// Remove duplicates (in case nested scopes)
|
|
4154
|
+
elements = [...new Set(elements)];
|
|
4155
|
+
mutation = typeof mutationOrOptions === "function" ? mutationOrOptions : undefined;
|
|
4156
|
+
opts = typeof mutationOrOptions === "object"
|
|
4157
|
+
? mutationOrOptions
|
|
4158
|
+
: options ?? {};
|
|
4159
|
+
}
|
|
4104
4160
|
// Merge with default transition
|
|
4105
4161
|
const mergedOptions = {
|
|
4106
4162
|
...opts,
|
|
@@ -197,42 +197,102 @@ async function executeLayoutAnimation(nodes, mutation, options, enterConfig, exi
|
|
|
197
197
|
return new GroupAnimation(animations);
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
|
-
*
|
|
200
|
+
* Selectors for elements that participate in layout animations
|
|
201
|
+
*/
|
|
202
|
+
const LAYOUT_SELECTORS = "[data-layout], [data-layout-id]";
|
|
203
|
+
/**
|
|
204
|
+
* Check if a value is a valid element or selector
|
|
205
|
+
*/
|
|
206
|
+
function isElementOrSelector(value) {
|
|
207
|
+
return (value instanceof Element ||
|
|
208
|
+
typeof value === "string" ||
|
|
209
|
+
(Array.isArray(value) && value.length > 0 && value[0] instanceof Element) ||
|
|
210
|
+
value instanceof NodeList);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Animate layout changes for elements with data-layout or data-layout-id attributes.
|
|
201
214
|
* Returns a builder that resolves to a GroupAnimation implementing AnimationPlaybackControls.
|
|
202
215
|
*
|
|
216
|
+
* When a selector/element is provided, it acts as a **scope** - layout elements
|
|
217
|
+
* (those with data-layout or data-layout-id) are searched within that scope.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* // Document-wide layout animation (all data-layout elements in document)
|
|
221
|
+
* const animation = await animateLayout(() => {
|
|
222
|
+
* updateDOM()
|
|
223
|
+
* }, { duration: 0.3 })
|
|
224
|
+
*
|
|
203
225
|
* @example
|
|
204
|
-
* //
|
|
205
|
-
* const animation = await animateLayout("
|
|
206
|
-
*
|
|
226
|
+
* // Scoped layout animation - finds data-layout elements within .container
|
|
227
|
+
* const animation = await animateLayout(".container", () => {
|
|
228
|
+
* // Toggle classes, the underline with data-layout-id will animate
|
|
229
|
+
* oldTab.classList.remove("selected")
|
|
230
|
+
* newTab.classList.add("selected")
|
|
207
231
|
* }, { duration: 0.3 })
|
|
208
|
-
* animation.pause()
|
|
209
232
|
*
|
|
210
233
|
* @example
|
|
211
234
|
* // Builder pattern with enter/exit animations
|
|
212
|
-
* const animation = await animateLayout(".cards", { duration: 0.3 })
|
|
235
|
+
* const animation = await animateLayout(".cards-container", { duration: 0.3 })
|
|
213
236
|
* .enter({ opacity: [0, 1], scale: [0.8, 1] }, { duration: 0.2 })
|
|
214
237
|
* .exit({ opacity: 0, scale: 0.8 }, { duration: 0.15 })
|
|
215
238
|
* animation.time = 0 // Seek to start
|
|
216
239
|
*
|
|
217
240
|
* @example
|
|
218
|
-
* //
|
|
219
|
-
* const animation = await animateLayout(
|
|
220
|
-
*
|
|
241
|
+
* // Scope to specific element
|
|
242
|
+
* const animation = await animateLayout(containerElement, () => {
|
|
243
|
+
* containerElement.querySelector('.item').style.width = "500px"
|
|
221
244
|
* })
|
|
222
245
|
*/
|
|
223
|
-
function animateLayout(
|
|
246
|
+
function animateLayout(elementOrSelectorOrMutation, mutationOrOptions, options) {
|
|
224
247
|
// Check if factory is configured
|
|
225
248
|
if (!globalFactory) {
|
|
226
249
|
throw new Error("animateLayout: No layout node factory configured. " +
|
|
227
250
|
"Make sure to import from 'framer-motion' or call setLayoutNodeFactory() first.");
|
|
228
251
|
}
|
|
229
252
|
const factory = globalFactory;
|
|
230
|
-
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
253
|
+
// Parse overloaded arguments to support:
|
|
254
|
+
// animateLayout(mutation, options) - document-wide
|
|
255
|
+
// animateLayout(options) - document-wide
|
|
256
|
+
// animateLayout(selector, mutation, options) - scoped
|
|
257
|
+
// animateLayout(selector, options) - scoped
|
|
258
|
+
let elements;
|
|
259
|
+
let mutation;
|
|
260
|
+
let opts;
|
|
261
|
+
if (!elementOrSelectorOrMutation || !isElementOrSelector(elementOrSelectorOrMutation)) {
|
|
262
|
+
// No selector provided - scope to entire document
|
|
263
|
+
elements = Array.from(document.querySelectorAll(LAYOUT_SELECTORS));
|
|
264
|
+
if (typeof elementOrSelectorOrMutation === "function") {
|
|
265
|
+
// animateLayout(mutation, options)
|
|
266
|
+
mutation = elementOrSelectorOrMutation;
|
|
267
|
+
opts = mutationOrOptions ?? {};
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
// animateLayout(options) or animateLayout()
|
|
271
|
+
mutation = typeof mutationOrOptions === "function" ? mutationOrOptions : undefined;
|
|
272
|
+
opts = elementOrSelectorOrMutation ??
|
|
273
|
+
(typeof mutationOrOptions === "object" ? mutationOrOptions : {});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
// Selector provided - use as scope for finding layout elements
|
|
278
|
+
const scopeElements = resolveElements(elementOrSelectorOrMutation);
|
|
279
|
+
elements = [];
|
|
280
|
+
for (const scope of scopeElements) {
|
|
281
|
+
// Find layout elements within this scope
|
|
282
|
+
const layoutElements = scope.querySelectorAll(LAYOUT_SELECTORS);
|
|
283
|
+
elements.push(...Array.from(layoutElements));
|
|
284
|
+
// Also include the scope element itself if it has layout attributes
|
|
285
|
+
if (scope.matches(LAYOUT_SELECTORS)) {
|
|
286
|
+
elements.push(scope);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// Remove duplicates (in case nested scopes)
|
|
290
|
+
elements = [...new Set(elements)];
|
|
291
|
+
mutation = typeof mutationOrOptions === "function" ? mutationOrOptions : undefined;
|
|
292
|
+
opts = typeof mutationOrOptions === "object"
|
|
293
|
+
? mutationOrOptions
|
|
294
|
+
: options ?? {};
|
|
295
|
+
}
|
|
236
296
|
// Merge with default transition
|
|
237
297
|
const mergedOptions = {
|
|
238
298
|
...opts,
|
|
@@ -6,11 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Selectors for elements that should participate in layout animations
|
|
8
8
|
*/
|
|
9
|
-
const LAYOUT_SELECTORS = [
|
|
10
|
-
"[data-layout]",
|
|
11
|
-
"[data-layout-id]",
|
|
12
|
-
"[data-animate-layout]",
|
|
13
|
-
];
|
|
9
|
+
const LAYOUT_SELECTORS = ["[data-layout]", "[data-layout-id]"];
|
|
14
10
|
/**
|
|
15
11
|
* Execute a mutation callback while observing DOM changes.
|
|
16
12
|
* Returns information about elements that were added or removed.
|
package/dist/index.d.ts
CHANGED
|
@@ -2671,30 +2671,40 @@ declare function setLayoutNodeFactory(factory: LayoutNodeFactory): void;
|
|
|
2671
2671
|
*/
|
|
2672
2672
|
declare function getLayoutNodeFactory(): LayoutNodeFactory | null;
|
|
2673
2673
|
/**
|
|
2674
|
-
* Animate layout changes for
|
|
2674
|
+
* Animate layout changes for elements with data-layout or data-layout-id attributes.
|
|
2675
2675
|
* Returns a builder that resolves to a GroupAnimation implementing AnimationPlaybackControls.
|
|
2676
2676
|
*
|
|
2677
|
+
* When a selector/element is provided, it acts as a **scope** - layout elements
|
|
2678
|
+
* (those with data-layout or data-layout-id) are searched within that scope.
|
|
2679
|
+
*
|
|
2680
|
+
* @example
|
|
2681
|
+
* // Document-wide layout animation (all data-layout elements in document)
|
|
2682
|
+
* const animation = await animateLayout(() => {
|
|
2683
|
+
* updateDOM()
|
|
2684
|
+
* }, { duration: 0.3 })
|
|
2685
|
+
*
|
|
2677
2686
|
* @example
|
|
2678
|
-
* //
|
|
2679
|
-
* const animation = await animateLayout("
|
|
2680
|
-
*
|
|
2687
|
+
* // Scoped layout animation - finds data-layout elements within .container
|
|
2688
|
+
* const animation = await animateLayout(".container", () => {
|
|
2689
|
+
* // Toggle classes, the underline with data-layout-id will animate
|
|
2690
|
+
* oldTab.classList.remove("selected")
|
|
2691
|
+
* newTab.classList.add("selected")
|
|
2681
2692
|
* }, { duration: 0.3 })
|
|
2682
|
-
* animation.pause()
|
|
2683
2693
|
*
|
|
2684
2694
|
* @example
|
|
2685
2695
|
* // Builder pattern with enter/exit animations
|
|
2686
|
-
* const animation = await animateLayout(".cards", { duration: 0.3 })
|
|
2696
|
+
* const animation = await animateLayout(".cards-container", { duration: 0.3 })
|
|
2687
2697
|
* .enter({ opacity: [0, 1], scale: [0.8, 1] }, { duration: 0.2 })
|
|
2688
2698
|
* .exit({ opacity: 0, scale: 0.8 }, { duration: 0.15 })
|
|
2689
2699
|
* animation.time = 0 // Seek to start
|
|
2690
2700
|
*
|
|
2691
2701
|
* @example
|
|
2692
|
-
* //
|
|
2693
|
-
* const animation = await animateLayout(
|
|
2694
|
-
*
|
|
2702
|
+
* // Scope to specific element
|
|
2703
|
+
* const animation = await animateLayout(containerElement, () => {
|
|
2704
|
+
* containerElement.querySelector('.item').style.width = "500px"
|
|
2695
2705
|
* })
|
|
2696
2706
|
*/
|
|
2697
|
-
declare function animateLayout(
|
|
2707
|
+
declare function animateLayout(elementOrSelectorOrMutation?: ElementOrSelector | (() => void) | AnimateLayoutOptions, mutationOrOptions?: (() => void) | AnimateLayoutOptions, options?: AnimateLayoutOptions): LayoutAnimationBuilder;
|
|
2698
2708
|
|
|
2699
2709
|
/**
|
|
2700
2710
|
* Helper to create a LayoutNodeFactory from concrete implementations.
|
package/dist/motion-dom.dev.js
CHANGED
|
@@ -3741,11 +3741,7 @@
|
|
|
3741
3741
|
/**
|
|
3742
3742
|
* Selectors for elements that should participate in layout animations
|
|
3743
3743
|
*/
|
|
3744
|
-
const LAYOUT_SELECTORS = [
|
|
3745
|
-
"[data-layout]",
|
|
3746
|
-
"[data-layout-id]",
|
|
3747
|
-
"[data-animate-layout]",
|
|
3748
|
-
];
|
|
3744
|
+
const LAYOUT_SELECTORS$1 = ["[data-layout]", "[data-layout-id]"];
|
|
3749
3745
|
/**
|
|
3750
3746
|
* Execute a mutation callback while observing DOM changes.
|
|
3751
3747
|
* Returns information about elements that were added or removed.
|
|
@@ -3775,7 +3771,7 @@
|
|
|
3775
3771
|
function observeMutation(container, mutation) {
|
|
3776
3772
|
// Snapshot approach: capture layout elements before and after mutation
|
|
3777
3773
|
// MutationObserver callbacks are async microtasks, so we use direct comparison instead
|
|
3778
|
-
const selector = LAYOUT_SELECTORS.join(", ");
|
|
3774
|
+
const selector = LAYOUT_SELECTORS$1.join(", ");
|
|
3779
3775
|
// Capture elements and their bounds before mutation
|
|
3780
3776
|
const elementsBefore = new Map();
|
|
3781
3777
|
container.querySelectorAll(selector).forEach((el) => {
|
|
@@ -4064,42 +4060,102 @@
|
|
|
4064
4060
|
return new GroupAnimation(animations);
|
|
4065
4061
|
}
|
|
4066
4062
|
/**
|
|
4067
|
-
*
|
|
4063
|
+
* Selectors for elements that participate in layout animations
|
|
4064
|
+
*/
|
|
4065
|
+
const LAYOUT_SELECTORS = "[data-layout], [data-layout-id]";
|
|
4066
|
+
/**
|
|
4067
|
+
* Check if a value is a valid element or selector
|
|
4068
|
+
*/
|
|
4069
|
+
function isElementOrSelector(value) {
|
|
4070
|
+
return (value instanceof Element ||
|
|
4071
|
+
typeof value === "string" ||
|
|
4072
|
+
(Array.isArray(value) && value.length > 0 && value[0] instanceof Element) ||
|
|
4073
|
+
value instanceof NodeList);
|
|
4074
|
+
}
|
|
4075
|
+
/**
|
|
4076
|
+
* Animate layout changes for elements with data-layout or data-layout-id attributes.
|
|
4068
4077
|
* Returns a builder that resolves to a GroupAnimation implementing AnimationPlaybackControls.
|
|
4069
4078
|
*
|
|
4079
|
+
* When a selector/element is provided, it acts as a **scope** - layout elements
|
|
4080
|
+
* (those with data-layout or data-layout-id) are searched within that scope.
|
|
4081
|
+
*
|
|
4082
|
+
* @example
|
|
4083
|
+
* // Document-wide layout animation (all data-layout elements in document)
|
|
4084
|
+
* const animation = await animateLayout(() => {
|
|
4085
|
+
* updateDOM()
|
|
4086
|
+
* }, { duration: 0.3 })
|
|
4087
|
+
*
|
|
4070
4088
|
* @example
|
|
4071
|
-
* //
|
|
4072
|
-
* const animation = await animateLayout("
|
|
4073
|
-
*
|
|
4089
|
+
* // Scoped layout animation - finds data-layout elements within .container
|
|
4090
|
+
* const animation = await animateLayout(".container", () => {
|
|
4091
|
+
* // Toggle classes, the underline with data-layout-id will animate
|
|
4092
|
+
* oldTab.classList.remove("selected")
|
|
4093
|
+
* newTab.classList.add("selected")
|
|
4074
4094
|
* }, { duration: 0.3 })
|
|
4075
|
-
* animation.pause()
|
|
4076
4095
|
*
|
|
4077
4096
|
* @example
|
|
4078
4097
|
* // Builder pattern with enter/exit animations
|
|
4079
|
-
* const animation = await animateLayout(".cards", { duration: 0.3 })
|
|
4098
|
+
* const animation = await animateLayout(".cards-container", { duration: 0.3 })
|
|
4080
4099
|
* .enter({ opacity: [0, 1], scale: [0.8, 1] }, { duration: 0.2 })
|
|
4081
4100
|
* .exit({ opacity: 0, scale: 0.8 }, { duration: 0.15 })
|
|
4082
4101
|
* animation.time = 0 // Seek to start
|
|
4083
4102
|
*
|
|
4084
4103
|
* @example
|
|
4085
|
-
* //
|
|
4086
|
-
* const animation = await animateLayout(
|
|
4087
|
-
*
|
|
4104
|
+
* // Scope to specific element
|
|
4105
|
+
* const animation = await animateLayout(containerElement, () => {
|
|
4106
|
+
* containerElement.querySelector('.item').style.width = "500px"
|
|
4088
4107
|
* })
|
|
4089
4108
|
*/
|
|
4090
|
-
function animateLayout(
|
|
4109
|
+
function animateLayout(elementOrSelectorOrMutation, mutationOrOptions, options) {
|
|
4091
4110
|
// Check if factory is configured
|
|
4092
4111
|
if (!globalFactory) {
|
|
4093
4112
|
throw new Error("animateLayout: No layout node factory configured. " +
|
|
4094
4113
|
"Make sure to import from 'framer-motion' or call setLayoutNodeFactory() first.");
|
|
4095
4114
|
}
|
|
4096
4115
|
const factory = globalFactory;
|
|
4097
|
-
|
|
4098
|
-
//
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4116
|
+
// Parse overloaded arguments to support:
|
|
4117
|
+
// animateLayout(mutation, options) - document-wide
|
|
4118
|
+
// animateLayout(options) - document-wide
|
|
4119
|
+
// animateLayout(selector, mutation, options) - scoped
|
|
4120
|
+
// animateLayout(selector, options) - scoped
|
|
4121
|
+
let elements;
|
|
4122
|
+
let mutation;
|
|
4123
|
+
let opts;
|
|
4124
|
+
if (!elementOrSelectorOrMutation || !isElementOrSelector(elementOrSelectorOrMutation)) {
|
|
4125
|
+
// No selector provided - scope to entire document
|
|
4126
|
+
elements = Array.from(document.querySelectorAll(LAYOUT_SELECTORS));
|
|
4127
|
+
if (typeof elementOrSelectorOrMutation === "function") {
|
|
4128
|
+
// animateLayout(mutation, options)
|
|
4129
|
+
mutation = elementOrSelectorOrMutation;
|
|
4130
|
+
opts = mutationOrOptions ?? {};
|
|
4131
|
+
}
|
|
4132
|
+
else {
|
|
4133
|
+
// animateLayout(options) or animateLayout()
|
|
4134
|
+
mutation = typeof mutationOrOptions === "function" ? mutationOrOptions : undefined;
|
|
4135
|
+
opts = elementOrSelectorOrMutation ??
|
|
4136
|
+
(typeof mutationOrOptions === "object" ? mutationOrOptions : {});
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
else {
|
|
4140
|
+
// Selector provided - use as scope for finding layout elements
|
|
4141
|
+
const scopeElements = resolveElements(elementOrSelectorOrMutation);
|
|
4142
|
+
elements = [];
|
|
4143
|
+
for (const scope of scopeElements) {
|
|
4144
|
+
// Find layout elements within this scope
|
|
4145
|
+
const layoutElements = scope.querySelectorAll(LAYOUT_SELECTORS);
|
|
4146
|
+
elements.push(...Array.from(layoutElements));
|
|
4147
|
+
// Also include the scope element itself if it has layout attributes
|
|
4148
|
+
if (scope.matches(LAYOUT_SELECTORS)) {
|
|
4149
|
+
elements.push(scope);
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
// Remove duplicates (in case nested scopes)
|
|
4153
|
+
elements = [...new Set(elements)];
|
|
4154
|
+
mutation = typeof mutationOrOptions === "function" ? mutationOrOptions : undefined;
|
|
4155
|
+
opts = typeof mutationOrOptions === "object"
|
|
4156
|
+
? mutationOrOptions
|
|
4157
|
+
: options ?? {};
|
|
4158
|
+
}
|
|
4103
4159
|
// Merge with default transition
|
|
4104
4160
|
const mergedOptions = {
|
|
4105
4161
|
...opts,
|
package/dist/motion-dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],i={value:null,addProjectionMetrics:null};function s(t,s){let r=!1,o=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>r=!0,u=n.reduce((t,e)=>(t[e]=function(t,e){let n=new Set,s=new Set,r=!1,o=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},u=0;function c(e){a.has(e)&&(d.schedule(e),t()),u++,e(l)}const d={schedule:(t,e=!1,i=!1)=>{const o=i&&r?n:s;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{l=t,r?o=!0:(r=!0,[n,s]=[s,n],n.forEach(c),e&&i.value&&i.value.frameloop[e].push(u),u=0,n.clear(),r=!1,o&&(o=!1,d.process(t)))}};return d}(l,s?e:void 0),t),{}),{setup:c,read:d,resolveKeyframes:m,preUpdate:h,update:p,preRender:f,render:y,postRender:g}=u,v=()=>{const n=e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now();r=!1,e.MotionGlobalConfig.useManualTiming||(a.delta=o?1e3/60:Math.max(Math.min(n-a.timestamp,40),1)),a.timestamp=n,a.isProcessing=!0,c.process(a),d.process(a),m.process(a),h.process(a),p.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,r&&s&&(o=!1,t(v))};return{schedule:n.reduce((e,n)=>{const i=u[n];return e[n]=(e,n=!1,s=!1)=>(r||(r=!0,o=!0,a.isProcessing||t(v)),i.schedule(e,n,s)),e},{}),cancel:t=>{for(let e=0;e<n.length;e++)u[n[e]].cancel(t)},state:a,steps:u}}const{schedule:r,cancel:o,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let u;function c(){u=void 0}const d={now:()=>(void 0===u&&d.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),u),set:t=>{u=t,queueMicrotask(c)}},m={layout:0,mainThread:0,waapi:0},h=t=>e=>"string"==typeof e&&e.startsWith(t),p=h("--"),f=h("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},b={...x,transform:t=>e.clamp(0,1,t)},T={...x,default:1},w=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const E=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,M=(t,e)=>n=>Boolean("string"==typeof n&&E.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),A=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(S);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},k={...x,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},R={test:M("rgb","red"),parse:A("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+k.transform(t)+", "+k.transform(e)+", "+k.transform(n)+", "+w(b.transform(i))+")"};const P={test:M("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:R.transform},V=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),D=V("deg"),B=V("%"),F=V("px"),L=V("vh"),C=V("vw"),O=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),I={test:M("hsl","hue"),parse:A("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+B.transform(w(e))+", "+B.transform(w(n))+", "+w(b.transform(i))+")"},N={test:t=>R.test(t)||P.test(t)||I.test(t),parse:t=>R.test(t)?R.parse(t):I.test(t)?I.parse(t):P.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?R.transform(t):I.transform(t),getAnimatableNone:t=>{const e=N.parse(t);return e.alpha=0,N.transform(e)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const j="number",K="color",W=/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;function Y(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(W,t=>(N.test(t)?(i.color.push(r),s.push(K),n.push(N.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(j),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function X(t){return Y(t).values}function U(t){const{split:e,types:n}=Y(t),i=e.length;return t=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],void 0!==t[r]){const e=n[r];s+=e===j?w(t[r]):e===K?N.transform(t[r]):t[r]}return s}}const q=t=>"number"==typeof t?0:N.test(t)?N.getAnimatableNone(t):t;const z={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(S)?.length||0)+(t.match($)?.length||0)>0},parse:X,createTransformer:U,getAnimatableNone:function(t){const e=X(t);return U(t)(e.map(q))}};function G(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Z({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=G(a,i,t+1/3),r=G(a,i,t),o=G(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}function _(t,e){return n=>n>0?e:t}const H=(t,e,n)=>t+(e-t)*n,J=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Q=[P,R,I];function tt(t){const n=(i=t,Q.find(t=>t.test(i)));var i;if(e.warning(Boolean(n),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(t);return n===I&&(s=Z(s)),s}const et=(t,e)=>{const n=tt(t),i=tt(e);if(!n||!i)return _(t,e);const s={...n};return t=>(s.red=J(n.red,i.red,t),s.green=J(n.green,i.green,t),s.blue=J(n.blue,i.blue,t),s.alpha=H(n.alpha,i.alpha,t),R.transform(s))},nt=new Set(["none","hidden"]);function it(t,e){return nt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function st(t,e){return n=>H(t,e,n)}function rt(t){return"number"==typeof t?st:"string"==typeof t?y(t)?_:N.test(t)?et:lt:Array.isArray(t)?ot:"object"==typeof t?N.test(t)?et:at:_}function ot(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>rt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function at(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=rt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const lt=(t,n)=>{const i=z.createTransformer(n),s=Y(t),r=Y(n);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?nt.has(t)&&!r.values.length||nt.has(n)&&!s.values.length?it(t,n):e.pipe(ot(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(s,r),r.values),i):(e.warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),_(t,n))};function ut(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return H(t,e,n);return rt(t)(t,e)}const ct=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>r.update(e,t),stop:()=>o(e),now:()=>a.isProcessing?a.timestamp:d.now()}},dt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},mt=2e4;function ht(t){let e=0;let n=t.next(e);for(;!n.done&&e<mt;)e+=50,n=t.next(e);return e>=mt?1/0:e}function pt(t,n=100,i){const s=i({...t,keyframes:[0,n]}),r=Math.min(ht(s),mt);return{type:"keyframes",ease:t=>s.next(r*t).value/n,duration:e.millisecondsToSeconds(r)}}function ft(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}const yt=100,gt=10,vt=1,xt=0,bt=800,Tt=.3,wt=.3,St={granular:.01,default:2},Et={granular:.005,default:.5},Mt=.01,At=10,kt=.05,Rt=1,Pt=.001;function Vt({duration:t=bt,bounce:n=Tt,velocity:i=xt,mass:s=vt}){let r,o;e.warning(t<=e.secondsToMilliseconds(At),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=e.clamp(kt,Rt,a),t=e.clamp(Mt,At,e.millisecondsToSeconds(t)),a<1?(r=e=>{const n=e*a,s=n*t,r=n-i,o=Bt(e,a),l=Math.exp(-s);return Pt-r/o*l},o=e=>{const n=e*a*t,s=n*i+i,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),u=Bt(Math.pow(e,2),a);return(-r(e)+Pt>0?-1:1)*((s-o)*l)/u}):(r=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,n){let i=n;for(let n=1;n<Dt;n++)i-=t(i)/e(i);return i}(r,o,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:yt,damping:gt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const Dt=12;function Bt(t,e){return t*Math.sqrt(1-e*e)}const Ft=["duration","bounce"],Lt=["stiffness","damping","mass"];function Ct(t,e){return e.some(e=>void 0!==t[e])}function Ot(t=wt,n=Tt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:s,restDelta:r}=i;const o=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:d,duration:m,velocity:h,isResolvedFromDuration:p}=function(t){let n={velocity:xt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Ct(t,Lt)&&Ct(t,Ft))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),r=s*s,o=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:vt,stiffness:r,damping:o}}else{const e=Vt(t);n={...n,...e,mass:vt},n.isResolvedFromDuration=!0}return n}({...i,velocity:-e.millisecondsToSeconds(i.velocity||0)}),f=h||0,y=c/(2*Math.sqrt(u*d)),g=a-o,v=e.millisecondsToSeconds(Math.sqrt(u/d)),x=Math.abs(g)<5;let b;if(s||(s=x?St.granular:St.default),r||(r=x?Et.granular:Et.default),y<1){const t=Bt(v,y);b=e=>{const n=Math.exp(-y*v*e);return a-n*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)b=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);b=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return a-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const T={calculatedDuration:p&&m||null,next:t=>{const n=b(t);if(p)l.done=t>=m;else{let i=0===t?f:0;y<1&&(i=0===t?e.secondsToMilliseconds(f):ft(b,t,n));const o=Math.abs(i)<=s,u=Math.abs(a-n)<=r;l.done=o&&u}return l.value=l.done?a:n,l},toString:()=>{const t=Math.min(ht(T),mt),e=dt(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}function It({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],m={done:!1,value:d},h=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let p=n*e;const f=d+p,y=void 0===o?f:o(f);y!==f&&(p=y-d);const g=t=>-p*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);m.done=Math.abs(e)<=u,m.value=m.done?y:n};let b,T;const w=t=>{var e;(e=m.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=Ot({keyframes:[m.value,h(m.value)],velocity:ft(v,t,m.value),damping:s,stiffness:r,restDelta:u,restSpeed:c}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,x(t),w(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&x(t),m)}}}function Nt(t,n,{clamp:i=!0,ease:s,mixer:r}={}){const o=t.length;if(e.invariant(o===n.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>n[0];if(2===o&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],r=i||e.MotionGlobalConfig.mix||ut,o=t.length-1;for(let i=0;i<o;i++){let o=r(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;o=e.pipe(t,o)}s.push(o)}return s}(n,s,r),u=l.length,c=i=>{if(a&&i<t[0])return n[0];let s=0;if(u>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const r=e.progress(t[s],t[s+1],i);return l[s](r)};return i?n=>c(e.clamp(t[0],t[o-1],n)):c}function $t(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const r=e.progress(0,n,s);t.push(H(i,1,r))}}function jt(t){const e=[0];return $t(e,t.length-1),e}function Kt(t,e){return t.map(t=>t*e)}function Wt(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Yt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const r=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),o={done:!1,value:n[0]},a=Nt(Kt(i&&i.length===n.length?i:jt(n),t),n,{ease:Array.isArray(r)?r:Wt(n,r)});return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}Ot.applyToOptions=t=>{const n=pt(t,100,Ot);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};const Xt=t=>null!==t;function Ut(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Xt),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const qt={decay:It,inertia:It,tween:Yt,keyframes:Yt,spring:Ot};function zt(t){"string"==typeof t.type&&(t.type=qt[t.type])}class Gt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Zt=t=>t/100;class _t extends Gt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==d.now()&&this.tick(d.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},m.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;zt(t);const{type:n=Yt,repeat:i=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Yt;l!==Yt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Zt,ut(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});"mirror"===r&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=ht(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:u=0,keyframes:c,repeat:d,repeatType:m,repeatDelay:h,type:p,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,b=i;if(d){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,d+1);Boolean(n%2)&&("reverse"===m?(i=1-i,h&&(i-=h/a)):"mirror"===m&&(b=o)),x=e.clamp(0,1,i)*a}const T=v?{done:!1,value:c[0]}:b.next(x);r&&(T.value=r(T.value));let{done:w}=T;v||null===l||(w=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&p!==It&&(T.value=Ut(c,this.options,y,this.speed)),f&&f(T.value),S&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(d.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ct,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(d.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,m.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Ht(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Jt=t=>180*t/Math.PI,Qt=t=>{const e=Jt(Math.atan2(t[1],t[0]));return ee(e)},te={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qt,rotateZ:Qt,skewX:t=>Jt(Math.atan(t[1])),skewY:t=>Jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ee=t=>((t%=360)<0&&(t+=360),t),ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ie=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),se={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ne,scaleY:ie,scale:t=>(ne(t)+ie(t))/2,rotateX:t=>ee(Jt(Math.atan2(t[6],t[5]))),rotateY:t=>ee(Jt(Math.atan2(-t[2],t[0]))),rotateZ:Qt,rotate:Qt,skewX:t=>Jt(Math.atan(t[4])),skewY:t=>Jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function re(t){return t.includes("scale")?1:0}function oe(t,e){if(!t||"none"===t)return re(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=se,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=te,s=e}if(!s)return re(e);const r=i[e],o=s[1].split(",").map(ae);return"function"==typeof r?r(o):o[r]}function ae(t){return parseFloat(t.trim())}const le=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ue=(()=>new Set(le))(),ce=t=>t===x||t===F,de=new Set(["x","y","z"]),me=le.filter(t=>!de.has(t));const he={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>oe(e,"x"),y:(t,{transform:e})=>oe(e,"y")};he.translateX=he.x,he.translateY=he.y;const pe=new Set;let fe=!1,ye=!1,ge=!1;function ve(){if(ye){const t=Array.from(pe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return me.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ye=!1,fe=!1,pe.forEach(t=>t.complete(ge)),pe.clear()}function xe(){pe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ye=!0)})}function be(){ge=!0,xe(),ve(),ge=!1}class Te{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(pe.add(this),fe||(fe=!0,r.read(xe),r.resolveKeyframes(ve))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}Ht(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),pe.delete(this)}cancel(){"scheduled"===this.state&&(pe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const we=t=>t.startsWith("--");function Se(t,e,n){we(e)?t.style.setProperty(e,n):t.style[e]=n}const Ee=e.memo(()=>void 0!==window.ScrollTimeline),Me={};function Ae(t,n){const i=e.memo(t);return()=>Me[n]??i()}const ke=Ae(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Re=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Pe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Re([0,.65,.55,1]),circOut:Re([.55,0,1,.45]),backIn:Re([.31,.01,.66,-.59]),backOut:Re([.33,1.53,.69,.99])};function Ve(t,n){return t?"function"==typeof t?ke()?dt(t,n):"ease-out":e.isBezierDefinition(t)?Re(t):Array.isArray(t)?t.map(t=>Ve(t,n)||Pe.easeOut):Pe[t]:void 0}function De(t,e,n,{delay:s=0,duration:r=300,repeat:o=0,repeatType:a="loop",ease:l="easeOut",times:u}={},c=void 0){const d={[e]:n};u&&(d.offset=u);const h=Ve(l,r);Array.isArray(h)&&(d.easing=h),i.value&&m.waapi++;const p={delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};c&&(p.pseudoElement=c);const f=t.animate(d,p);return i.value&&f.finished.finally(()=>{m.waapi--}),f}function Be(t){return"function"==typeof t&&"applyToOptions"in t}function Fe({type:t,...e}){return Be(t)&&ke()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Le extends Gt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=o,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=Fe(t);this.animation=De(n,i,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=Ut(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Se(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ee()?(this.animation.timeline=t,e.noop):n(this)}}const Ce={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Ce&&(t.ease=Ce[t.ease])}class Ie extends Le{constructor(t){Oe(t),zt(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...o}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new _t({...o,autoplay:!1}),l=Math.max(10,d.now()-this.startTime),u=e.clamp(0,10,l-10);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const Ne=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!z.test(t)&&"0"!==t||t.startsWith("url(")));function $e(t){t.duration=0,t.type="keyframes"}const je=new Set(["opacity","clipPath","filter","transform"]),Ke=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function We(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Ke()&&n&&je.has(n)&&("transform"!==n||!u)&&!l&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}class Ye{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Xe(this.animations,"duration")}get iterationDuration(){return Xe(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Xe(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class Ue extends Le{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const qe=new WeakMap;const ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ge(t){const e=ze.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Ze(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Ge(t);if(!s)return;const o=window.getComputedStyle(n).getPropertyValue(s);if(o){const t=o.trim();return e.isNumericalString(t)?parseFloat(t):t}return y(r)?Ze(r,n,i+1):r}function _e(t,e){return t?.[e]??t?.default??t}const He=new Set(["width","height","top","left","right","bottom",...le]),Je=t=>e=>e.test(t),Qe=[x,F,B,D,C,L,{test:t=>"auto"===t,parse:t=>t}],tn=t=>Qe.find(Je(t));function en(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const nn=new Set(["brightness","contrast","saturate","opacity"]);function sn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(S)||[];if(!i)return t;const s=n.replace(i,"");let r=nn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const rn=/\b([a-z-]*)\(.*?\)/gu,on={...z,getAnimatableNone:t=>{const e=t.match(rn);return e?e.map(sn).join(" "):t}},an={...x,transform:Math.round},ln={rotate:D,rotateX:D,rotateY:D,rotateZ:D,scale:T,scaleX:T,scaleY:T,scaleZ:T,skew:D,skewX:D,skewY:D,distance:F,translateX:F,translateY:F,translateZ:F,x:F,y:F,z:F,perspective:F,transformPerspective:F,opacity:b,originX:O,originY:O,originZ:F},un={borderWidth:F,borderTopWidth:F,borderRightWidth:F,borderBottomWidth:F,borderLeftWidth:F,borderRadius:F,radius:F,borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,width:F,maxWidth:F,height:F,maxHeight:F,top:F,right:F,bottom:F,left:F,inset:F,insetBlock:F,insetBlockStart:F,insetBlockEnd:F,insetInline:F,insetInlineStart:F,insetInlineEnd:F,padding:F,paddingTop:F,paddingRight:F,paddingBottom:F,paddingLeft:F,paddingBlock:F,paddingBlockStart:F,paddingBlockEnd:F,paddingInline:F,paddingInlineStart:F,paddingInlineEnd:F,margin:F,marginTop:F,marginRight:F,marginBottom:F,marginLeft:F,marginBlock:F,marginBlockStart:F,marginBlockEnd:F,marginInline:F,marginInlineStart:F,marginInlineEnd:F,backgroundPositionX:F,backgroundPositionY:F,...ln,zIndex:an,fillOpacity:b,strokeOpacity:b,numOctaves:an},cn={...un,color:N,backgroundColor:N,outlineColor:N,fill:N,stroke:N,borderColor:N,borderTopColor:N,borderRightColor:N,borderBottomColor:N,borderLeftColor:N,filter:on,WebkitFilter:on},dn=t=>cn[t];function mn(t,e){let n=dn(t);return n!==on&&(n=z),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const hn=new Set(["auto","none","0"]);const pn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);const fn=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),yn=new Set(["opacity","clipPath","filter","transform"]);function gn(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function vn(t){return(e,n)=>{const i=gn(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const xn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class bn{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const i=e.get();this.latest[t]=s?xn(i,un[t]):i,n&&r.render(n)};l();const u=e.on("change",l);i&&e.addDependent(i);const c=()=>{u(),n&&o(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:c}),c}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function Tn(t){const e=new WeakMap,n=[];return(i,s)=>{const r=e.get(i)??new bn;e.set(i,r);for(const e in s){const o=s[e],a=t(i,r,e,o);n.push(a)}return()=>{for(const t of n)t()}}}const wn=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),r=s?n:n.startsWith("data")||n.startsWith("aria")?n.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`):n;const o=s?()=>{t[r]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(r):t.setAttribute(r,String(i))};return e.set(n,i,o)},Sn=vn(Tn(wn)),En=Tn((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function Mn(t){return e.isObject(t)&&"offsetHeight"in t}const An={current:void 0};class kn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=d.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=d.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e.SubscriptionManager);const i=this.events[t].add(n);return"change"===t?()=>{i(),r.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return An.current&&An.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=d.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rn(t,e){return new kn(t,e)}const Pn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const Vn=new Set(["originX","originY","originZ"]),Dn=(t,e,n,i)=>{let s,r;return ue.has(n)?(e.get("transform")||(Mn(t)||e.get("transformBox")||Dn(t,e,"transformBox",new kn("fill-box")),e.set("transform",new kn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<le.length;i++){const s=le[i],r=t.latest[s];if(void 0===r)continue;let o=!0;o="number"==typeof r?r===(s.startsWith("scale")?1:0):0===parseFloat(r),o||(n=!1,e+=`${Pn[s]||s}(${t.latest[s]}) `)}return n?"none":e.trim()}(e)})),r=e.get("transform")):Vn.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new kn(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),r=e.get("transformOrigin")):s=we(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,r)},Bn=vn(Tn(Dn)),Fn=F.transform;const Ln=vn(Tn((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return r.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>t.setAttribute("stroke-dashoffset",Fn(-e.latest[n]))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new kn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${Fn(n)} ${Fn(i??1-Number(n))}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return wn(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Dn:wn)(t,e,n,i)}));const Cn=["[data-layout]","[data-layout-id]","[data-animate-layout]"];function On(t,e){const n=Cn.join(", "),i=new Map;t.querySelectorAll(n).forEach(t=>{i.set(t,t.getBoundingClientRect())}),e();const s=new Set(t.querySelectorAll(n)),r=[];s.forEach(t=>{!i.has(t)&&t instanceof HTMLElement&&r.push(t)});const o=[];return i.forEach((t,e)=>{!s.has(e)&&e instanceof HTMLElement&&o.push({element:e,bounds:t})}),{addedElements:r,removedElements:o}}function In(t){if(0===t.length)return document.body;if(1===t.length)return t[0].parentElement??document.body;const e=new Set;let n=t[0];for(;n;)e.add(n),n=n.parentElement;for(let i=1;i<t.length;i++)for(n=t[i];n;){if(e.has(n)){if(t.every(t=>n===t||n?.contains(t)))return n}n=n.parentElement}return document.body}function Nn(t,e,n){const i=t.cloneNode(!0);return i.style.position="fixed",i.style.top=`${e.top}px`,i.style.left=`${e.left}px`,i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.margin="0",i.style.pointerEvents="none",i.style.zIndex="9999",i.setAttribute("data-layout-exiting","true"),n.appendChild(i),{clone:i,cleanup:()=>{i.parentNode&&i.parentNode.removeChild(i)}}}const $n={duration:.3,ease:[.4,0,.2,1]};let jn=null;function Kn(t){jn=t}const Wn=new WeakMap;function Yn(t,e,n,i){let s=Wn.get(t);return s||(s=i.createProjectionNode(t,e,n),Wn.set(t,s)),s}function Xn(t,e,n){const{keyframes:i,transition:s}=e,r=s?.duration??n,o=Object.entries(i),a={},l={};for(const[t,e]of o)Array.isArray(e)?(a[t]=e[0],l[t]=e[e.length-1]):l[t]=e;for(const[e,n]of Object.entries(a))e in t.style&&(t.style[e]=n);const u=t.animate([a,l],{duration:1e3*r,easing:"string"==typeof s?.ease?s.ease:"ease-out",fill:"forwards"});return u.finished&&u.finished.then(()=>{u.commitStyles(),u.cancel()}),new Ue(u)}function Un(t,e,n,i,s){const{keyframes:r,transition:o}=n,a=o?.duration??i,{clone:l,cleanup:u}=Nn(t,e,s),c=l.animate([{},r],{duration:1e3*a,easing:"string"==typeof o?.ease?o.ease:"ease-out",fill:"forwards"});return c.finished.then(u),new Ue(c)}async function qn(t,e,n,i,s){const o=[];if(0===t.length&&!e)return new Ye(o);t.forEach(t=>t.willUpdate());const a=In(t.map(t=>t.instance).filter(t=>void 0!==t));let l=[],u=[];if(e){const t=On(a,e);l=t.addedElements,u=t.removedElements}const c=t[0]?.root;c&&c.didUpdate(),await new Promise(t=>{r.postRender(()=>t())});for(const e of t)e.currentAnimation&&o.push(e.currentAnimation);if(i&&l.length>0)for(const t of l){const e=Xn(t,i,n.duration??.3);o.push(e)}if(s&&u.length>0)for(const{element:t,bounds:e}of u){const i=Un(t,e,s,n.duration??.3,a);o.push(i)}return new Ye(o)}class zn{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t),t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Gn=new Map;function Zn(t,e,n){Gn.has(t)||Gn.set(t,new zn);const i=Gn.get(t);i.add(e),i.promote(e,n)}function _n(t,e){const n=Gn.get(t);n&&(n.remove(e),0===n.members.length&&Gn.delete(t))}function Hn(t){const{ProjectionNode:e,VisualElement:n}=t;return{createProjectionNode(t,i,s={}){const r={},o=s.layoutId??t.dataset?.layoutId??void 0,a=new n({visualState:{latestValues:r,renderState:{transformOrigin:{},transform:{},style:{},vars:{}}},props:{}}),l=new e(r,i);if(l.setOptions({scheduleRender:()=>{a.scheduleRender&&a.scheduleRender()},visualElement:a,layout:!0,layoutId:o,transition:s.transition??{duration:s.duration??.3,ease:s.ease}}),l.mount(t),a.projection=l,o){Zn(o,l);const t=l.unmount?.bind(l);l.unmount=()=>{_n(o,l),t&&t()}}return l.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{l.resumeFrom&&(l.resumingFrom=l.resumeFrom,l.resumingFrom&&(l.resumingFrom.resumingFrom=void 0)),e&&(l.setAnimationOrigin(t),l.startAnimation(s.transition??{duration:s.duration??.3,ease:s.ease}))}),l},createVisualElement:(t,e={})=>new n({visualState:{latestValues:{},renderState:{transformOrigin:{},transform:{},style:{},vars:{}}},props:{}})}}const{schedule:Jn,cancel:Qn}=s(queueMicrotask,!1),ti={x:!1,y:!1};function ei(){return ti.x||ti.y}function ni(t,e){const n=gn(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function ii(t){return!("touch"===t.pointerType||ei())}const si=(t,e)=>!!e&&(t===e||si(t,e.parentElement)),ri=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,oi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ai(t){return oi.has(t.tagName)||!0===t.isContentEditable}const li=new WeakSet;function ui(t){return e=>{"Enter"===e.key&&t(e)}}function ci(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function di(t){return ri(t)&&!ei()}const mi=["TopLeft","TopRight","BottomLeft","BottomRight"],hi=mi.length,pi=t=>"string"==typeof t?parseFloat(t):t,fi=t=>"number"==typeof t||F.test(t);function yi(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const gi=xi(0,.5,e.circOut),vi=xi(.5,.95,e.noop);function xi(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function bi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ti(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function wi(t,e){t.min=e.min,t.max=e.max}function Si(t){return void 0===t||1===t}function Ei({scale:t,scaleX:e,scaleY:n}){return!Si(t)||!Si(e)||!Si(n)}function Mi(t){return Ei(t)||Ai(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ai(t){return ki(t.x)||ki(t.y)}function ki(t){return t&&"0%"!==t}function Ri(t,e,n){return n+e*(t-n)}function Pi(t,e,n,i,s){return void 0!==s&&(t=Ri(t,s,i)),Ri(t,n,i)+e}function Vi(t,e=0,n=1,i,s){t.min=Pi(t.min,e,n,i,s),t.max=Pi(t.max,e,n,i,s)}function Di(t,{x:e,y:n}){Vi(t.x,e.translate,e.scale,e.originPoint),Vi(t.y,n.translate,n.scale,n.originPoint)}const Bi=.999999999999,Fi=1.0000000000001;function Li(t,e){t.min=t.min+e,t.max=t.max+e}function Ci(t,e,n,i,s=.5){Vi(t,e,n,H(t.min,t.max,s),i)}function Oi(t,e){Ci(t.x,e.x,e.scaleX,e.scale,e.originX),Ci(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ii(t){return t.max-t.min}function Ni(t,e,n,i=.5){t.origin=i,t.originPoint=H(e.min,e.max,t.origin),t.scale=Ii(n)/Ii(e),t.translate=H(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function $i(t,e,n){t.min=n.min+e.min,t.max=t.min+Ii(e)}function ji(t,e,n){t.min=e.min-n.min,t.max=t.min+Ii(e)}function Ki(t,e,n,i,s){return t=Ri(t-=e,1/n,i),void 0!==s&&(t=Ri(t,1/s,i)),t}function Wi(t,e=0,n=1,i=.5,s,r=t,o=t){if(B.test(e)){e=parseFloat(e);e=H(o.min,o.max,e/100)-o.min}if("number"!=typeof e)return;let a=H(r.min,r.max,i);t===r&&(a-=e),t.min=Ki(t.min,e,n,a,s),t.max=Ki(t.max,e,n,a,s)}function Yi(t,e,[n,i,s],r,o){Wi(t,e[n],e[i],e[s],e.scale,r,o)}const Xi=["x","scaleX","originX"],Ui=["y","scaleY","originY"];const qi=()=>({translate:0,scale:1,origin:0,originPoint:0}),zi=()=>({min:0,max:0});function Gi(t){return 0===t.translate&&1===t.scale}function Zi(t,e){return t.min===e.min&&t.max===e.max}function _i(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Hi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ji={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!F.test(t))return t;t=parseFloat(t)}return`${Hi(t,e.target.x)}% ${Hi(t,e.target.y)}%`}},Qi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=z.parse(t);if(s.length>5)return i;const r=z.createTransformer(t),o="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=H(a,l,.5);return"number"==typeof s[2+o]&&(s[2+o]/=u),"number"==typeof s[3+o]&&(s[3+o]/=u),r(s)}},ts={borderRadius:{...Ji,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ji,borderTopRightRadius:Ji,borderBottomLeftRadius:Ji,borderBottomRightRadius:Ji,boxShadow:Qi};function es(t,e){return bi(Ti(t.getBoundingClientRect(),e))}const ns=(t,e)=>t.depth-e.depth;function is(t){return e.isObject(t)&&"ownerSVGElement"in t}const ss=new WeakMap;let rs;const os=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:is(i)&&"getBBox"in i?i.getBBox()[e]:i[n],as=os("inline","width","offsetWidth"),ls=os("block","height","offsetHeight");function us({target:t,borderBoxSize:e}){ss.get(t)?.forEach(n=>{n(t,{get width(){return as(t,e)},get height(){return ls(t,e)}})})}function cs(t){t.forEach(us)}function ds(t,e){rs||"undefined"!=typeof ResizeObserver&&(rs=new ResizeObserver(cs));const n=gn(t);return n.forEach(t=>{let n=ss.get(t);n||(n=new Set,ss.set(t,n)),n.add(e),rs?.observe(t)}),()=>{n.forEach(t=>{const n=ss.get(t);n?.delete(e),n?.size||rs?.unobserve(t)})}}const ms=new Set;let hs;function ps(t){return ms.add(t),hs||(hs=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};ms.forEach(e=>e(t))},window.addEventListener("resize",hs)),()=>{ms.delete(t),ms.size||"function"!=typeof hs||(window.removeEventListener("resize",hs),hs=void 0)}}function fs(){const{value:t}=i;null!==t?(t.frameloop.rate.push(a.delta),t.animations.mainThread.push(m.mainThread),t.animations.waapi.push(m.waapi),t.animations.layout.push(m.layout)):o(fs)}function ys(t){return t.reduce((t,e)=>t+e,0)/t.length}function gs(t,e=ys){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const vs=t=>Math.round(1e3/t);function xs(){i.value=null,i.addProjectionMetrics=null}function bs(){const{value:t}=i;if(!t)throw new Error("Stats are not being measured");xs(),o(fs);const e={frameloop:{setup:gs(t.frameloop.setup),rate:gs(t.frameloop.rate),read:gs(t.frameloop.read),resolveKeyframes:gs(t.frameloop.resolveKeyframes),preUpdate:gs(t.frameloop.preUpdate),update:gs(t.frameloop.update),preRender:gs(t.frameloop.preRender),render:gs(t.frameloop.render),postRender:gs(t.frameloop.postRender)},animations:{mainThread:gs(t.animations.mainThread),waapi:gs(t.animations.waapi),layout:gs(t.animations.layout)},layoutProjection:{nodes:gs(t.layoutProjection.nodes),calculatedTargetDeltas:gs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:gs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=vs(n.min),n.max=vs(n.max),n.avg=vs(n.avg),[n.min,n.max]=[n.max,n.min],e}function Ts(t,e){const n=d.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(o(i),t(r-e))};return r.setup(i,!0),()=>o(i)}function ws(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ss(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Nt(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function Es(t){const e=[];An.current=e;const n=t();An.current=void 0;const i=Rn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>r.preRender(i,!1,!0),a=t.map(t=>t.on("change",s));e.on("destroy",()=>{a.forEach(t=>t()),o(i)})}(e,i,t),i}const Ms=t=>Boolean(t&&t.getVelocity);function As(t,e,n){const i=t.get();let s,o=null,a=i;const l="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,u=()=>{o&&(o.stop(),o=null)};if(t.attach((e,i)=>{a=e,s=t=>i(ks(t,l)),r.postRender(()=>{u(),o=new _t({keyframes:[Rs(t.get()),Rs(a)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}),t.events.animationStart?.notify(),o?.then(()=>{t.events.animationComplete?.notify()})})},u),Ms(e)){const n=e.on("change",e=>t.set(ks(e,l))),i=t.on("destroy",n);return()=>{n(),i()}}return u}function ks(t,e){return e?t+e:t}function Rs(t){return"number"==typeof t?t:parseFloat(t)}const Ps=[...Qe,N,z];function Vs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Ds={},Bs=null;const Fs=(t,e)=>{Ds[t]=e},Ls=()=>{Bs||(Bs=document.createElement("style"),Bs.id="motion-view");let t="";for(const e in Ds){const n=Ds[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}Bs.textContent=t,document.head.appendChild(Bs),Ds={}},Cs=()=>{Bs&&Bs.parentElement&&Bs.parentElement.removeChild(Bs)};function Os(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Is(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function Ns(){return document.getAnimations().filter(Is)}const $s=["layout","enter","exit","new","old"];function js(t){const{update:n,targets:i,options:s}=t;if(!document.startViewTransition)return new Promise(async t=>{await n(),t(new Ye([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||Fs(":root",{"view-transition-name":"none"}),Fs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Ls();const r=document.startViewTransition(async()=>{await n()});return r.finished.finally(()=>{Cs()}),new Promise(t=>{r.ready.then(()=>{const n=Ns(),r=[];i.forEach((t,n)=>{for(const i of $s){if(!t[i])continue;const{keyframes:o,options:a}=t[i];for(let[t,l]of Object.entries(o)){if(!l)continue;const o={..._e(s,t),..._e(a,t)},u=Vs(i);if("opacity"===t&&!Array.isArray(l)){l=["new"===u?0:1,l]}"function"==typeof o.delay&&(o.delay=o.delay(0,1)),o.duration&&(o.duration=e.secondsToMilliseconds(o.duration)),o.delay&&(o.delay=e.secondsToMilliseconds(o.delay));const c=new Le({...o,element:document.documentElement,name:t,pseudoElement:`::view-transition-${u}(${n})`,keyframes:l});r.push(c)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:o}=n;if(!o)continue;const a=Os(o);if(!a)continue;const l=i.get(a.layer);if(l)Ks(l,"enter")&&Ks(l,"exit")&&n.getKeyframes().some(t=>t.mixBlendMode)?r.push(new Ue(t)):t.cancel();else{const i="group"===a.type?"layout":"";let o={..._e(s,i)};o.duration&&(o.duration=e.secondsToMilliseconds(o.duration)),o=Fe(o);const l=Ve(o.ease,o.duration);n.updateTiming({delay:e.secondsToMilliseconds(o.delay??0),duration:o.duration,easing:l}),r.push(new Ue(t))}}t(new Ye(r))})})}function Ks(t,e){return t?.[e]?.keyframes.opacity}let Ws=[],Ys=null;function Xs(){Ys=null;const[t]=Ws;var n;t&&(n=t,e.removeItem(Ws,n),Ys=n,js(n).then(t=>{n.notifyReady(t),t.finished.finally(Xs)}))}function Us(){for(let t=Ws.length-1;t>=0;t--){const e=Ws[t],{interrupt:n}=e.options;if("immediate"===n){const n=Ws.slice(0,t+1).map(t=>t.update),i=Ws.slice(t+1);e.update=()=>{n.forEach(t=>t())},Ws=[e,...i];break}}Ys&&"immediate"!==Ws[0]?.options.interrupt||Xs()}class qs{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.notifyReady=e.noop,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...n},i=this,Ws.push(i),Jn.render(Us)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const zs=r,Gs=n.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.AsyncMotionValueAnimation=class extends Gt{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=d.now();const m={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:u,...c},h=u?.KeyframeResolver||Te;this.keyframeResolver=new h(o,(t,e,n)=>this.onKeyframesResolved(t,e,m,!n),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=i;this.resolvedAt=d.now(),function(t,n,i,s){const r=t[0];if(null===r)return!1;if("display"===n||"visibility"===n)return!0;const o=t[t.length-1],a=Ne(r,n),l=Ne(o,n);return e.warning(a===l,`You are trying to animate ${n} from "${r}" to "${o}". "${a?o:r}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===i||Be(i))&&s)}(t,r,o,a)||(!e.MotionGlobalConfig.instantAnimations&&l||c?.(Ut(t,i,n)),t[0]=t[t.length-1],$e(i),i.repeat=0);const m={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},h=!u&&We(m)?new Ie({...m,element:m.motionValue.owner.current}):new _t(m);h.finished.then(()=>this.notifyFinished()).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),be()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},t.DOMKeyframesResolver=class extends Te{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),y(i))){const s=Ze(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!He.has(n)||2!==t.length)return;const[i,s]=t,r=tn(i),o=tn(s);if(v(i)!==v(s)&&he[n])this.needsMeasurement=!0;else if(r!==o)if(ce(r)&&ce(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else he[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||en(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!hn.has(e)&&Y(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=mn(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=he[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=he[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}},t.FlatTree=class{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ns),this.isDirty=!1,this.children.forEach(t)}},t.GroupAnimation=Ye,t.GroupAnimationWithThen=class extends Ye{then(t,e){return this.finished.finally(t).then(()=>{})}},t.JSAnimation=_t,t.KeyframeResolver=Te,t.MotionValue=kn,t.NativeAnimation=Le,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=Ue,t.NodeStack=zn,t.ViewTransitionBuilder=qs,t.acceleratedValues=yn,t.activeAnimations=m,t.addAttrValue=wn,t.addScaleCorrector=function(t){for(const e in t)ts[e]=t[e],p(e)&&(ts[e].isCSSVariable=!0)},t.addStyleValue=Dn,t.alpha=b,t.analyseComplexValue=Y,t.animateValue=function(t){return new _t(t)},t.animateView=function(t,e={}){return new qs(t,e)},t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=Vi,t.applyBoxDelta=Di,t.applyGeneratorOptions=Fe,t.applyPointDelta=Pi,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&pn.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=function(t,e,n,i=!1){const s=n.length;if(!s)return;let r,o;e.x=e.y=1;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:s}=r.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Oi(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Di(t,o)),i&&Mi(r.latestValues)&&Oi(t,r.latestValues))}e.x<Fi&&e.x>Bi&&(e.x=1),e.y<Fi&&e.y>Bi&&(e.y=1)},t.aspectRatio=function(t){return Ii(t.x)/Ii(t.y)},t.attachSpring=As,t.attrEffect=Sn,t.axisDeltaEquals=function(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint},t.axisEquals=Zi,t.axisEqualsRounded=_i,t.boxEquals=function(t,e){return Zi(t.x,e.x)&&Zi(t.y,e.y)},t.boxEqualsRounded=function(t,e){return _i(t.x,e.x)&&_i(t.y,e.y)},t.buildProjectionTransform=function(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:r,skewX:o,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),o&&(i+=`skewX(${o}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"},t.calcAxisDelta=Ni,t.calcBoxDelta=function(t,e,n,i){Ni(t.x,e.x,n.x,i?i.originX:void 0),Ni(t.y,e.y,n.y,i?i.originY:void 0)},t.calcGeneratorDuration=ht,t.calcLength=Ii,t.calcRelativeAxis=$i,t.calcRelativeAxisPosition=ji,t.calcRelativeBox=function(t,e,n){$i(t.x,e.x,n.x),$i(t.y,e.y,n.y)},t.calcRelativePosition=function(t,e,n){ji(t.x,e.x,n.x),ji(t.y,e.y,n.y)},t.cancelFrame=o,t.cancelMicrotask=Qn,t.cancelSync=Gs,t.clearSharedLayoutRegistry=function(){Gn.clear()},t.collectMotionValues=An,t.color=N,t.compareByDepth=ns,t.complex=z,t.containsCSSVariable=v,t.convertBoundingBoxToBox=bi,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Kt,t.copyAxisDeltaInto=function(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin},t.copyAxisInto=wi,t.copyBoxInto=function(t,e){wi(t.x,e.x),wi(t.y,e.y)},t.correctBorderRadius=Ji,t.correctBoxShadow=Qi,t.createAxis=zi,t.createAxisDelta=qi,t.createBox=()=>({x:{min:0,max:0},y:{min:0,max:0}}),t.createDelta=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),t.createGeneratorEasing=pt,t.createLayoutNodeFactory=Hn,t.createRenderBatcher=s,t.cubicBezierAsString=Re,t.defaultEasing=Wt,t.defaultOffset=jt,t.defaultTransformValue=re,t.defaultValueTypes=cn,t.degrees=D,t.delay=Ts,t.delayInSeconds=function(t,n){return Ts(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=Qe,t.eachAxis=function(t){return[t("x"),t("y")]},t.fillOffset=$t,t.fillWildcards=Ht,t.findCommonAncestor=In,t.findDimensionValueType=tn,t.findValueType=t=>Ps.find(Je(t)),t.flushKeyframeResolvers=be,t.frame=r,t.frameData=a,t.frameSteps=l,t.generateLinearEasing=dt,t.getAnimatableNone=mn,t.getAnimationMap=function(t){const e=qe.get(t)||new Map;return qe.set(t,e),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return we(e)?n.getPropertyValue(e):n[e]},t.getDefaultValueType=dn,t.getLayoutNodeFactory=function(){return jn},t.getMixer=rt,t.getOriginIndex=ws,t.getSharedLayoutLead=function(t){const e=Gn.get(t);return e?.lead},t.getSharedLayoutStack=function(t){return Gn.get(t)},t.getValueAsType=xn,t.getValueTransition=_e,t.getVariableValue=Ze,t.getViewAnimationLayerInfo=Os,t.getViewAnimations=Ns,t.globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1},t.has2DTranslate=Ai,t.hasScale=Ei,t.hasSharedLayoutNodes=function(t){const e=Gn.get(t);return void 0!==e&&e.members.length>0},t.hasTransform=Mi,t.hex=P,t.hover=function(t,e,n={}){const[i,s,r]=ni(t,n),o=t=>{if(!ii(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{ii(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r},t.hsla=I,t.hslaToRgba=Z,t.inertia=It,t.initLayoutSystem=function(t){Kn(Hn(t))},t.interpolate=Nt,t.invisibleValues=nt,t.isCSSVariableName=p,t.isCSSVariableToken=y,t.isDeltaZero=function(t){return Gi(t.x)&&Gi(t.y)},t.isDragActive=ei,t.isDragging=ti,t.isElementKeyboardAccessible=ai,t.isGenerator=Be,t.isHTMLElement=Mn,t.isMotionValue=Ms,t.isNear=function(t,e,n){return Math.abs(t-e)<=n},t.isNodeOrChild=si,t.isPrimaryPointer=ri,t.isSVGElement=is,t.isSVGSVGElement=function(t){return is(t)&&"svg"===t.tagName},t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&ke()||!n||"string"==typeof n&&(n in Pe||ke())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.keyframes=Yt,t.makeAnimationInstant=$e,t.mapEasingToNativeEasing=Ve,t.mapValue=function(t,e,n,i){const s=Ss(e,n,i);return Es(()=>s(t.get()))},t.maxGeneratorDuration=mt,t.measurePageBox=function(t,e,n){const i=es(t,n),{scroll:s}=e;return s&&(Li(i.x,s.offset.x),Li(i.y,s.offset.y)),i},t.measureViewportBox=es,t.microtask=Jn,t.mix=ut,t.mixArray=ot,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=_,t.mixLinearColor=J,t.mixNumber=H,t.mixObject=at,t.mixValues=function(t,e,n,i,s,r){s?(t.opacity=H(0,n.opacity??1,gi(i)),t.opacityExit=H(e.opacity??1,0,vi(i))):r&&(t.opacity=H(e.opacity??1,n.opacity??1,i));for(let s=0;s<hi;s++){const r=`border${mi[s]}Radius`;let o=yi(e,r),a=yi(n,r);if(void 0===o&&void 0===a)continue;o||(o=0),a||(a=0);0===o||0===a||fi(o)===fi(a)?(t[r]=Math.max(H(pi(o),pi(a),i),0),(B.test(a)||B.test(o))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=H(e.rotate||0,n.rotate||0,i))},t.mixVisibility=it,t.motionValue=Rn,t.notifyExitAnimationComplete=function(t){const e=Gn.get(t);e&&e.exitAnimationComplete()},t.number=x,t.numberValueTypes=un,t.observeMutation=On,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return r.preUpdate(i,!0),()=>o(i)},t.parseCSSVariable=Ge,t.parseValueFromTransform=oe,t.percent=B,t.pixelsToPercent=Hi,t.positionalKeys=He,t.preserveElementForExit=Nn,t.press=function(t,e,n={}){const[i,s,r]=ni(t,n),o=t=>{const i=t.currentTarget;if(!di(t))return;li.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),li.has(i)&&li.delete(i),di(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||si(i,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),Mn(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ui(()=>{if(li.has(n))return;ci(n,"down");const t=ui(()=>{ci(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ci(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),ai(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r},t.progressPercentage=O,t.propEffect=En,t.px=F,t.readTransformValue=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return oe(n,e)},t.recordStats=function(){if(i.value)throw xs(),new Error("Stats are already being measured");const t=i;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},r.postRender(fs,!0),bs},t.registerSharedLayoutNode=Zn,t.removeAxisDelta=Wi,t.removeAxisTransforms=Yi,t.removeBoxTransforms=function(t,e,n,i){Yi(t.x,e,Xi,n?n.x:void 0,i?i.x:void 0),Yi(t.y,e,Ui,n?n.y:void 0,i?i.y:void 0)},t.removePointDelta=Ki,t.resize=function(t,e){return"function"==typeof t?ps(t):ds(t,e)},t.resolveElements=gn,t.rgbUnit=k,t.rgba=R,t.scale=T,t.scaleCorrectors=ts,t.scalePoint=Ri,t.scheduleSharedLayoutRender=function(t){const e=Gn.get(t);e&&e.scheduleRender()},t.setDragLock=function(t){return"x"===t||"y"===t?ti[t]?null:(ti[t]=!0,()=>{ti[t]=!1}):ti.x||ti.y?null:(ti.x=ti.y=!0,()=>{ti.x=ti.y=!1})},t.setLayoutNodeFactory=Kn,t.setStyle=Se,t.spring=Ot,t.springValue=function(t,e){const n=Rn(Ms(t)?t.get():t);return As(n,t,e),n},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(r,o)=>{const a="number"==typeof i?i:ws(i,o),l=Math.abs(a-r);let u=t*l;if(s){const n=o*t;u=e.easingDefinitionToFunction(s)(u/n)*n}return n+u}},t.startWaapiAnimation=De,t.statsBuffer=i,t.styleEffect=Bn,t.supportedWaapiEasing=Pe,t.supportsBrowserAnimation=We,t.supportsFlags=Me,t.supportsLinearEasing=ke,t.supportsPartialKeyframes=fn,t.supportsScrollTimeline=Ee,t.svgEffect=Ln,t.sync=zs,t.testValueType=Je,t.time=d,t.transform=Ss,t.transformAxis=Ci,t.transformBox=Oi,t.transformBoxPoints=Ti,t.transformPropOrder=le,t.transformProps=ue,t.transformValue=Es,t.transformValueTypes=ln,t.translateAxis=Li,t.unregisterSharedLayoutNode=_n,t.unstable_animateLayout=function(t,e,n){if(!jn)throw new Error("animateLayout: No layout node factory configured. Make sure to import from 'framer-motion' or call setLayoutNodeFactory() first.");const i=jn,s=gn(t),r="function"==typeof e?e:void 0,o="object"==typeof e?e:n??{},a={...o,transition:{...$n,...o.transition,duration:o.duration??o.transition?.duration??.3,ease:o.ease??o.transition?.ease}},l=function(t,e,n){const i=[...t].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),s=[],r=new Map;for(const t of i){if(!(t instanceof HTMLElement))continue;let i,o=t.parentElement;for(;o;){const t=r.get(o);if(t){i=t;break}o=o.parentElement}const a=Yn(t,i,e,n);s.push(a),r.set(t,a)}return s}(s,a,i);let u,c,d;const m={enter:(t,e)=>(u={keyframes:t,transition:e},m),exit:(t,e)=>(c={keyframes:t,transition:e},m),then:(t,e)=>(d||(d=qn(l,r,a,u,c)),d.then(e=>t(e)).catch(t=>{throw e&&e(t),t}))};return r&&queueMicrotask(()=>{d||(d=qn(l,r,a,u,c))}),m},t.vh=L,t.vw=C});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],i={value:null,addProjectionMetrics:null};function s(t,s){let r=!1,o=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>r=!0,c=n.reduce((t,e)=>(t[e]=function(t,e){let n=new Set,s=new Set,r=!1,o=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(e){a.has(e)&&(d.schedule(e),t()),c++,e(l)}const d={schedule:(t,e=!1,i=!1)=>{const o=i&&r?n:s;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{l=t,r?o=!0:(r=!0,[n,s]=[s,n],n.forEach(u),e&&i.value&&i.value.frameloop[e].push(c),c=0,n.clear(),r=!1,o&&(o=!1,d.process(t)))}};return d}(l,s?e:void 0),t),{}),{setup:u,read:d,resolveKeyframes:m,preUpdate:h,update:p,preRender:f,render:y,postRender:g}=c,v=()=>{const n=e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now();r=!1,e.MotionGlobalConfig.useManualTiming||(a.delta=o?1e3/60:Math.max(Math.min(n-a.timestamp,40),1)),a.timestamp=n,a.isProcessing=!0,u.process(a),d.process(a),m.process(a),h.process(a),p.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,r&&s&&(o=!1,t(v))};return{schedule:n.reduce((e,n)=>{const i=c[n];return e[n]=(e,n=!1,s=!1)=>(r||(r=!0,o=!0,a.isProcessing||t(v)),i.schedule(e,n,s)),e},{}),cancel:t=>{for(let e=0;e<n.length;e++)c[n[e]].cancel(t)},state:a,steps:c}}const{schedule:r,cancel:o,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let c;function u(){c=void 0}const d={now:()=>(void 0===c&&d.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),c),set:t=>{c=t,queueMicrotask(u)}},m={layout:0,mainThread:0,waapi:0},h=t=>e=>"string"==typeof e&&e.startsWith(t),p=h("--"),f=h("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},x={...b,transform:t=>e.clamp(0,1,t)},w={...b,default:1},T=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const E=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,A=(t,e)=>n=>Boolean("string"==typeof n&&E.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),M=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(S);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},k={...b,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},R={test:A("rgb","red"),parse:M("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+k.transform(t)+", "+k.transform(e)+", "+k.transform(n)+", "+T(x.transform(i))+")"};const P={test:A("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:R.transform},V=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),D=V("deg"),B=V("%"),L=V("px"),F=V("vh"),C=V("vw"),O=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),I={test:A("hsl","hue"),parse:M("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+B.transform(T(e))+", "+B.transform(T(n))+", "+T(x.transform(i))+")"},N={test:t=>R.test(t)||P.test(t)||I.test(t),parse:t=>R.test(t)?R.parse(t):I.test(t)?I.parse(t):P.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?R.transform(t):I.transform(t),getAnimatableNone:t=>{const e=N.parse(t);return e.alpha=0,N.transform(e)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const j="number",K="color",W=/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;function Y(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(W,t=>(N.test(t)?(i.color.push(r),s.push(K),n.push(N.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(j),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function X(t){return Y(t).values}function q(t){const{split:e,types:n}=Y(t),i=e.length;return t=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],void 0!==t[r]){const e=n[r];s+=e===j?T(t[r]):e===K?N.transform(t[r]):t[r]}return s}}const U=t=>"number"==typeof t?0:N.test(t)?N.getAnimatableNone(t):t;const z={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(S)?.length||0)+(t.match($)?.length||0)>0},parse:X,createTransformer:q,getAnimatableNone:function(t){const e=X(t);return q(t)(e.map(U))}};function G(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Z({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=G(a,i,t+1/3),r=G(a,i,t),o=G(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}function _(t,e){return n=>n>0?e:t}const H=(t,e,n)=>t+(e-t)*n,J=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Q=[P,R,I];function tt(t){const n=(i=t,Q.find(t=>t.test(i)));var i;if(e.warning(Boolean(n),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(t);return n===I&&(s=Z(s)),s}const et=(t,e)=>{const n=tt(t),i=tt(e);if(!n||!i)return _(t,e);const s={...n};return t=>(s.red=J(n.red,i.red,t),s.green=J(n.green,i.green,t),s.blue=J(n.blue,i.blue,t),s.alpha=H(n.alpha,i.alpha,t),R.transform(s))},nt=new Set(["none","hidden"]);function it(t,e){return nt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function st(t,e){return n=>H(t,e,n)}function rt(t){return"number"==typeof t?st:"string"==typeof t?y(t)?_:N.test(t)?et:lt:Array.isArray(t)?ot:"object"==typeof t?N.test(t)?et:at:_}function ot(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>rt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function at(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=rt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const lt=(t,n)=>{const i=z.createTransformer(n),s=Y(t),r=Y(n);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?nt.has(t)&&!r.values.length||nt.has(n)&&!s.values.length?it(t,n):e.pipe(ot(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(s,r),r.values),i):(e.warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),_(t,n))};function ct(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return H(t,e,n);return rt(t)(t,e)}const ut=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>r.update(e,t),stop:()=>o(e),now:()=>a.isProcessing?a.timestamp:d.now()}},dt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},mt=2e4;function ht(t){let e=0;let n=t.next(e);for(;!n.done&&e<mt;)e+=50,n=t.next(e);return e>=mt?1/0:e}function pt(t,n=100,i){const s=i({...t,keyframes:[0,n]}),r=Math.min(ht(s),mt);return{type:"keyframes",ease:t=>s.next(r*t).value/n,duration:e.millisecondsToSeconds(r)}}function ft(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}const yt=100,gt=10,vt=1,bt=0,xt=800,wt=.3,Tt=.3,St={granular:.01,default:2},Et={granular:.005,default:.5},At=.01,Mt=10,kt=.05,Rt=1,Pt=.001;function Vt({duration:t=xt,bounce:n=wt,velocity:i=bt,mass:s=vt}){let r,o;e.warning(t<=e.secondsToMilliseconds(Mt),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=e.clamp(kt,Rt,a),t=e.clamp(At,Mt,e.millisecondsToSeconds(t)),a<1?(r=e=>{const n=e*a,s=n*t,r=n-i,o=Bt(e,a),l=Math.exp(-s);return Pt-r/o*l},o=e=>{const n=e*a*t,s=n*i+i,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),c=Bt(Math.pow(e,2),a);return(-r(e)+Pt>0?-1:1)*((s-o)*l)/c}):(r=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,n){let i=n;for(let n=1;n<Dt;n++)i-=t(i)/e(i);return i}(r,o,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:yt,damping:gt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const Dt=12;function Bt(t,e){return t*Math.sqrt(1-e*e)}const Lt=["duration","bounce"],Ft=["stiffness","damping","mass"];function Ct(t,e){return e.some(e=>void 0!==t[e])}function Ot(t=Tt,n=wt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:s,restDelta:r}=i;const o=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:u,mass:d,duration:m,velocity:h,isResolvedFromDuration:p}=function(t){let n={velocity:bt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Ct(t,Ft)&&Ct(t,Lt))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),r=s*s,o=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:vt,stiffness:r,damping:o}}else{const e=Vt(t);n={...n,...e,mass:vt},n.isResolvedFromDuration=!0}return n}({...i,velocity:-e.millisecondsToSeconds(i.velocity||0)}),f=h||0,y=u/(2*Math.sqrt(c*d)),g=a-o,v=e.millisecondsToSeconds(Math.sqrt(c/d)),b=Math.abs(g)<5;let x;if(s||(s=b?St.granular:St.default),r||(r=b?Et.granular:Et.default),y<1){const t=Bt(v,y);x=e=>{const n=Math.exp(-y*v*e);return a-n*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)x=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);x=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return a-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:p&&m||null,next:t=>{const n=x(t);if(p)l.done=t>=m;else{let i=0===t?f:0;y<1&&(i=0===t?e.secondsToMilliseconds(f):ft(x,t,n));const o=Math.abs(i)<=s,c=Math.abs(a-n)<=r;l.done=o&&c}return l.value=l.done?a:n,l},toString:()=>{const t=Math.min(ht(w),mt),e=dt(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function It({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],m={done:!1,value:d},h=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let p=n*e;const f=d+p,y=void 0===o?f:o(f);y!==f&&(p=y-d);const g=t=>-p*Math.exp(-t/i),v=t=>y+g(t),b=t=>{const e=g(t),n=v(t);m.done=Math.abs(e)<=c,m.value=m.done?y:n};let x,w;const T=t=>{var e;(e=m.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(x=t,w=Ot({keyframes:[m.value,h(m.value)],velocity:ft(v,t,m.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,b(t),T(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&b(t),m)}}}function Nt(t,n,{clamp:i=!0,ease:s,mixer:r}={}){const o=t.length;if(e.invariant(o===n.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>n[0];if(2===o&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],r=i||e.MotionGlobalConfig.mix||ct,o=t.length-1;for(let i=0;i<o;i++){let o=r(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;o=e.pipe(t,o)}s.push(o)}return s}(n,s,r),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const r=e.progress(t[s],t[s+1],i);return l[s](r)};return i?n=>u(e.clamp(t[0],t[o-1],n)):u}function $t(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const r=e.progress(0,n,s);t.push(H(i,1,r))}}function jt(t){const e=[0];return $t(e,t.length-1),e}function Kt(t,e){return t.map(t=>t*e)}function Wt(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Yt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const r=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),o={done:!1,value:n[0]},a=Nt(Kt(i&&i.length===n.length?i:jt(n),t),n,{ease:Array.isArray(r)?r:Wt(n,r)});return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}Ot.applyToOptions=t=>{const n=pt(t,100,Ot);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};const Xt=t=>null!==t;function qt(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Xt),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const Ut={decay:It,inertia:It,tween:Yt,keyframes:Yt,spring:Ot};function zt(t){"string"==typeof t.type&&(t.type=Ut[t.type])}class Gt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Zt=t=>t/100;class _t extends Gt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==d.now()&&this.tick(d.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},m.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;zt(t);const{type:n=Yt,repeat:i=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Yt;l!==Yt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Zt,ct(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});"mirror"===r&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=ht(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:m,repeatDelay:h,type:p,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let b=this.currentTime,x=i;if(d){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,d+1);Boolean(n%2)&&("reverse"===m?(i=1-i,h&&(i-=h/a)):"mirror"===m&&(x=o)),b=e.clamp(0,1,i)*a}const w=v?{done:!1,value:u[0]}:x.next(b);r&&(w.value=r(w.value));let{done:T}=w;v||null===l||(T=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&p!==It&&(w.value=qt(u,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(d.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(d.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,m.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Ht(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Jt=t=>180*t/Math.PI,Qt=t=>{const e=Jt(Math.atan2(t[1],t[0]));return ee(e)},te={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qt,rotateZ:Qt,skewX:t=>Jt(Math.atan(t[1])),skewY:t=>Jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ee=t=>((t%=360)<0&&(t+=360),t),ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ie=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),se={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ne,scaleY:ie,scale:t=>(ne(t)+ie(t))/2,rotateX:t=>ee(Jt(Math.atan2(t[6],t[5]))),rotateY:t=>ee(Jt(Math.atan2(-t[2],t[0]))),rotateZ:Qt,rotate:Qt,skewX:t=>Jt(Math.atan(t[4])),skewY:t=>Jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function re(t){return t.includes("scale")?1:0}function oe(t,e){if(!t||"none"===t)return re(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=se,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=te,s=e}if(!s)return re(e);const r=i[e],o=s[1].split(",").map(ae);return"function"==typeof r?r(o):o[r]}function ae(t){return parseFloat(t.trim())}const le=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ce=(()=>new Set(le))(),ue=t=>t===b||t===L,de=new Set(["x","y","z"]),me=le.filter(t=>!de.has(t));const he={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>oe(e,"x"),y:(t,{transform:e})=>oe(e,"y")};he.translateX=he.x,he.translateY=he.y;const pe=new Set;let fe=!1,ye=!1,ge=!1;function ve(){if(ye){const t=Array.from(pe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return me.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ye=!1,fe=!1,pe.forEach(t=>t.complete(ge)),pe.clear()}function be(){pe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ye=!0)})}function xe(){ge=!0,be(),ve(),ge=!1}class we{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(pe.add(this),fe||(fe=!0,r.read(be),r.resolveKeyframes(ve))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}Ht(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),pe.delete(this)}cancel(){"scheduled"===this.state&&(pe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Te=t=>t.startsWith("--");function Se(t,e,n){Te(e)?t.style.setProperty(e,n):t.style[e]=n}const Ee=e.memo(()=>void 0!==window.ScrollTimeline),Ae={};function Me(t,n){const i=e.memo(t);return()=>Ae[n]??i()}const ke=Me(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Re=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Pe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Re([0,.65,.55,1]),circOut:Re([.55,0,1,.45]),backIn:Re([.31,.01,.66,-.59]),backOut:Re([.33,1.53,.69,.99])};function Ve(t,n){return t?"function"==typeof t?ke()?dt(t,n):"ease-out":e.isBezierDefinition(t)?Re(t):Array.isArray(t)?t.map(t=>Ve(t,n)||Pe.easeOut):Pe[t]:void 0}function De(t,e,n,{delay:s=0,duration:r=300,repeat:o=0,repeatType:a="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const h=Ve(l,r);Array.isArray(h)&&(d.easing=h),i.value&&m.waapi++;const p={delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};u&&(p.pseudoElement=u);const f=t.animate(d,p);return i.value&&f.finished.finally(()=>{m.waapi--}),f}function Be(t){return"function"==typeof t&&"applyToOptions"in t}function Le({type:t,...e}){return Be(t)&&ke()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Fe extends Gt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=o,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Le(t);this.animation=De(n,i,s,c,r),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=qt(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Se(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ee()?(this.animation.timeline=t,e.noop):n(this)}}const Ce={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Ce&&(t.ease=Ce[t.ease])}class Ie extends Fe{constructor(t){Oe(t),zt(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...o}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new _t({...o,autoplay:!1}),l=Math.max(10,d.now()-this.startTime),c=e.clamp(0,10,l-10);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const Ne=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!z.test(t)&&"0"!==t||t.startsWith("url(")));function $e(t){t.duration=0,t.type="keyframes"}const je=new Set(["opacity","clipPath","filter","transform"]),Ke=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function We(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Ke()&&n&&je.has(n)&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}class Ye{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Xe(this.animations,"duration")}get iterationDuration(){return Xe(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Xe(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class qe extends Fe{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Ue=new WeakMap;const ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ge(t){const e=ze.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Ze(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Ge(t);if(!s)return;const o=window.getComputedStyle(n).getPropertyValue(s);if(o){const t=o.trim();return e.isNumericalString(t)?parseFloat(t):t}return y(r)?Ze(r,n,i+1):r}function _e(t,e){return t?.[e]??t?.default??t}const He=new Set(["width","height","top","left","right","bottom",...le]),Je=t=>e=>e.test(t),Qe=[b,L,B,D,C,F,{test:t=>"auto"===t,parse:t=>t}],tn=t=>Qe.find(Je(t));function en(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const nn=new Set(["brightness","contrast","saturate","opacity"]);function sn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(S)||[];if(!i)return t;const s=n.replace(i,"");let r=nn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const rn=/\b([a-z-]*)\(.*?\)/gu,on={...z,getAnimatableNone:t=>{const e=t.match(rn);return e?e.map(sn).join(" "):t}},an={...b,transform:Math.round},ln={rotate:D,rotateX:D,rotateY:D,rotateZ:D,scale:w,scaleX:w,scaleY:w,scaleZ:w,skew:D,skewX:D,skewY:D,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:x,originX:O,originY:O,originZ:L},cn={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,backgroundPositionX:L,backgroundPositionY:L,...ln,zIndex:an,fillOpacity:x,strokeOpacity:x,numOctaves:an},un={...cn,color:N,backgroundColor:N,outlineColor:N,fill:N,stroke:N,borderColor:N,borderTopColor:N,borderRightColor:N,borderBottomColor:N,borderLeftColor:N,filter:on,WebkitFilter:on},dn=t=>un[t];function mn(t,e){let n=dn(t);return n!==on&&(n=z),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const hn=new Set(["auto","none","0"]);const pn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);const fn=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),yn=new Set(["opacity","clipPath","filter","transform"]);function gn(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function vn(t){return(e,n)=>{const i=gn(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const bn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class xn{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const i=e.get();this.latest[t]=s?bn(i,cn[t]):i,n&&r.render(n)};l();const c=e.on("change",l);i&&e.addDependent(i);const u=()=>{c(),n&&o(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function wn(t){const e=new WeakMap,n=[];return(i,s)=>{const r=e.get(i)??new xn;e.set(i,r);for(const e in s){const o=s[e],a=t(i,r,e,o);n.push(a)}return()=>{for(const t of n)t()}}}const Tn=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),r=s?n:n.startsWith("data")||n.startsWith("aria")?n.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`):n;const o=s?()=>{t[r]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(r):t.setAttribute(r,String(i))};return e.set(n,i,o)},Sn=vn(wn(Tn)),En=wn((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function An(t){return e.isObject(t)&&"offsetHeight"in t}const Mn={current:void 0};class kn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=d.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=d.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e.SubscriptionManager);const i=this.events[t].add(n);return"change"===t?()=>{i(),r.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Mn.current&&Mn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=d.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rn(t,e){return new kn(t,e)}const Pn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const Vn=new Set(["originX","originY","originZ"]),Dn=(t,e,n,i)=>{let s,r;return ce.has(n)?(e.get("transform")||(An(t)||e.get("transformBox")||Dn(t,e,"transformBox",new kn("fill-box")),e.set("transform",new kn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<le.length;i++){const s=le[i],r=t.latest[s];if(void 0===r)continue;let o=!0;o="number"==typeof r?r===(s.startsWith("scale")?1:0):0===parseFloat(r),o||(n=!1,e+=`${Pn[s]||s}(${t.latest[s]}) `)}return n?"none":e.trim()}(e)})),r=e.get("transform")):Vn.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new kn(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),r=e.get("transformOrigin")):s=Te(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,r)},Bn=vn(wn(Dn)),Ln=L.transform;const Fn=vn(wn((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return r.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>t.setAttribute("stroke-dashoffset",Ln(-e.latest[n]))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new kn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${Ln(n)} ${Ln(i??1-Number(n))}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Tn(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Dn:Tn)(t,e,n,i)}));const Cn=["[data-layout]","[data-layout-id]"];function On(t,e){const n=Cn.join(", "),i=new Map;t.querySelectorAll(n).forEach(t=>{i.set(t,t.getBoundingClientRect())}),e();const s=new Set(t.querySelectorAll(n)),r=[];s.forEach(t=>{!i.has(t)&&t instanceof HTMLElement&&r.push(t)});const o=[];return i.forEach((t,e)=>{!s.has(e)&&e instanceof HTMLElement&&o.push({element:e,bounds:t})}),{addedElements:r,removedElements:o}}function In(t){if(0===t.length)return document.body;if(1===t.length)return t[0].parentElement??document.body;const e=new Set;let n=t[0];for(;n;)e.add(n),n=n.parentElement;for(let i=1;i<t.length;i++)for(n=t[i];n;){if(e.has(n)){if(t.every(t=>n===t||n?.contains(t)))return n}n=n.parentElement}return document.body}function Nn(t,e,n){const i=t.cloneNode(!0);return i.style.position="fixed",i.style.top=`${e.top}px`,i.style.left=`${e.left}px`,i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.margin="0",i.style.pointerEvents="none",i.style.zIndex="9999",i.setAttribute("data-layout-exiting","true"),n.appendChild(i),{clone:i,cleanup:()=>{i.parentNode&&i.parentNode.removeChild(i)}}}const $n={duration:.3,ease:[.4,0,.2,1]};let jn=null;function Kn(t){jn=t}const Wn=new WeakMap;function Yn(t,e,n,i){let s=Wn.get(t);return s||(s=i.createProjectionNode(t,e,n),Wn.set(t,s)),s}function Xn(t,e,n){const{keyframes:i,transition:s}=e,r=s?.duration??n,o=Object.entries(i),a={},l={};for(const[t,e]of o)Array.isArray(e)?(a[t]=e[0],l[t]=e[e.length-1]):l[t]=e;for(const[e,n]of Object.entries(a))e in t.style&&(t.style[e]=n);const c=t.animate([a,l],{duration:1e3*r,easing:"string"==typeof s?.ease?s.ease:"ease-out",fill:"forwards"});return c.finished&&c.finished.then(()=>{c.commitStyles(),c.cancel()}),new qe(c)}function qn(t,e,n,i,s){const{keyframes:r,transition:o}=n,a=o?.duration??i,{clone:l,cleanup:c}=Nn(t,e,s),u=l.animate([{},r],{duration:1e3*a,easing:"string"==typeof o?.ease?o.ease:"ease-out",fill:"forwards"});return u.finished.then(c),new qe(u)}async function Un(t,e,n,i,s){const o=[];if(0===t.length&&!e)return new Ye(o);t.forEach(t=>t.willUpdate());const a=In(t.map(t=>t.instance).filter(t=>void 0!==t));let l=[],c=[];if(e){const t=On(a,e);l=t.addedElements,c=t.removedElements}const u=t[0]?.root;u&&u.didUpdate(),await new Promise(t=>{r.postRender(()=>t())});for(const e of t)e.currentAnimation&&o.push(e.currentAnimation);if(i&&l.length>0)for(const t of l){const e=Xn(t,i,n.duration??.3);o.push(e)}if(s&&c.length>0)for(const{element:t,bounds:e}of c){const i=qn(t,e,s,n.duration??.3,a);o.push(i)}return new Ye(o)}const zn="[data-layout], [data-layout-id]";class Gn{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t),t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Zn=new Map;function _n(t,e,n){Zn.has(t)||Zn.set(t,new Gn);const i=Zn.get(t);i.add(e),i.promote(e,n)}function Hn(t,e){const n=Zn.get(t);n&&(n.remove(e),0===n.members.length&&Zn.delete(t))}function Jn(t){const{ProjectionNode:e,VisualElement:n}=t;return{createProjectionNode(t,i,s={}){const r={},o=s.layoutId??t.dataset?.layoutId??void 0,a=new n({visualState:{latestValues:r,renderState:{transformOrigin:{},transform:{},style:{},vars:{}}},props:{}}),l=new e(r,i);if(l.setOptions({scheduleRender:()=>{a.scheduleRender&&a.scheduleRender()},visualElement:a,layout:!0,layoutId:o,transition:s.transition??{duration:s.duration??.3,ease:s.ease}}),l.mount(t),a.projection=l,o){_n(o,l);const t=l.unmount?.bind(l);l.unmount=()=>{Hn(o,l),t&&t()}}return l.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{l.resumeFrom&&(l.resumingFrom=l.resumeFrom,l.resumingFrom&&(l.resumingFrom.resumingFrom=void 0)),e&&(l.setAnimationOrigin(t),l.startAnimation(s.transition??{duration:s.duration??.3,ease:s.ease}))}),l},createVisualElement:(t,e={})=>new n({visualState:{latestValues:{},renderState:{transformOrigin:{},transform:{},style:{},vars:{}}},props:{}})}}const{schedule:Qn,cancel:ti}=s(queueMicrotask,!1),ei={x:!1,y:!1};function ni(){return ei.x||ei.y}function ii(t,e){const n=gn(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function si(t){return!("touch"===t.pointerType||ni())}const ri=(t,e)=>!!e&&(t===e||ri(t,e.parentElement)),oi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ai=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function li(t){return ai.has(t.tagName)||!0===t.isContentEditable}const ci=new WeakSet;function ui(t){return e=>{"Enter"===e.key&&t(e)}}function di(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function mi(t){return oi(t)&&!ni()}const hi=["TopLeft","TopRight","BottomLeft","BottomRight"],pi=hi.length,fi=t=>"string"==typeof t?parseFloat(t):t,yi=t=>"number"==typeof t||L.test(t);function gi(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const vi=xi(0,.5,e.circOut),bi=xi(.5,.95,e.noop);function xi(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function wi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ti(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Si(t,e){t.min=e.min,t.max=e.max}function Ei(t){return void 0===t||1===t}function Ai({scale:t,scaleX:e,scaleY:n}){return!Ei(t)||!Ei(e)||!Ei(n)}function Mi(t){return Ai(t)||ki(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ki(t){return Ri(t.x)||Ri(t.y)}function Ri(t){return t&&"0%"!==t}function Pi(t,e,n){return n+e*(t-n)}function Vi(t,e,n,i,s){return void 0!==s&&(t=Pi(t,s,i)),Pi(t,n,i)+e}function Di(t,e=0,n=1,i,s){t.min=Vi(t.min,e,n,i,s),t.max=Vi(t.max,e,n,i,s)}function Bi(t,{x:e,y:n}){Di(t.x,e.translate,e.scale,e.originPoint),Di(t.y,n.translate,n.scale,n.originPoint)}const Li=.999999999999,Fi=1.0000000000001;function Ci(t,e){t.min=t.min+e,t.max=t.max+e}function Oi(t,e,n,i,s=.5){Di(t,e,n,H(t.min,t.max,s),i)}function Ii(t,e){Oi(t.x,e.x,e.scaleX,e.scale,e.originX),Oi(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ni(t){return t.max-t.min}function $i(t,e,n,i=.5){t.origin=i,t.originPoint=H(e.min,e.max,t.origin),t.scale=Ni(n)/Ni(e),t.translate=H(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ji(t,e,n){t.min=n.min+e.min,t.max=t.min+Ni(e)}function Ki(t,e,n){t.min=e.min-n.min,t.max=t.min+Ni(e)}function Wi(t,e,n,i,s){return t=Pi(t-=e,1/n,i),void 0!==s&&(t=Pi(t,1/s,i)),t}function Yi(t,e=0,n=1,i=.5,s,r=t,o=t){if(B.test(e)){e=parseFloat(e);e=H(o.min,o.max,e/100)-o.min}if("number"!=typeof e)return;let a=H(r.min,r.max,i);t===r&&(a-=e),t.min=Wi(t.min,e,n,a,s),t.max=Wi(t.max,e,n,a,s)}function Xi(t,e,[n,i,s],r,o){Yi(t,e[n],e[i],e[s],e.scale,r,o)}const qi=["x","scaleX","originX"],Ui=["y","scaleY","originY"];const zi=()=>({translate:0,scale:1,origin:0,originPoint:0}),Gi=()=>({min:0,max:0});function Zi(t){return 0===t.translate&&1===t.scale}function _i(t,e){return t.min===e.min&&t.max===e.max}function Hi(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ji(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Qi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!L.test(t))return t;t=parseFloat(t)}return`${Ji(t,e.target.x)}% ${Ji(t,e.target.y)}%`}},ts={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=z.parse(t);if(s.length>5)return i;const r=z.createTransformer(t),o="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=H(a,l,.5);return"number"==typeof s[2+o]&&(s[2+o]/=c),"number"==typeof s[3+o]&&(s[3+o]/=c),r(s)}},es={borderRadius:{...Qi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qi,borderTopRightRadius:Qi,borderBottomLeftRadius:Qi,borderBottomRightRadius:Qi,boxShadow:ts};function ns(t,e){return wi(Ti(t.getBoundingClientRect(),e))}const is=(t,e)=>t.depth-e.depth;function ss(t){return e.isObject(t)&&"ownerSVGElement"in t}const rs=new WeakMap;let os;const as=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:ss(i)&&"getBBox"in i?i.getBBox()[e]:i[n],ls=as("inline","width","offsetWidth"),cs=as("block","height","offsetHeight");function us({target:t,borderBoxSize:e}){rs.get(t)?.forEach(n=>{n(t,{get width(){return ls(t,e)},get height(){return cs(t,e)}})})}function ds(t){t.forEach(us)}function ms(t,e){os||"undefined"!=typeof ResizeObserver&&(os=new ResizeObserver(ds));const n=gn(t);return n.forEach(t=>{let n=rs.get(t);n||(n=new Set,rs.set(t,n)),n.add(e),os?.observe(t)}),()=>{n.forEach(t=>{const n=rs.get(t);n?.delete(e),n?.size||os?.unobserve(t)})}}const hs=new Set;let ps;function fs(t){return hs.add(t),ps||(ps=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};hs.forEach(e=>e(t))},window.addEventListener("resize",ps)),()=>{hs.delete(t),hs.size||"function"!=typeof ps||(window.removeEventListener("resize",ps),ps=void 0)}}function ys(){const{value:t}=i;null!==t?(t.frameloop.rate.push(a.delta),t.animations.mainThread.push(m.mainThread),t.animations.waapi.push(m.waapi),t.animations.layout.push(m.layout)):o(ys)}function gs(t){return t.reduce((t,e)=>t+e,0)/t.length}function vs(t,e=gs){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const bs=t=>Math.round(1e3/t);function xs(){i.value=null,i.addProjectionMetrics=null}function ws(){const{value:t}=i;if(!t)throw new Error("Stats are not being measured");xs(),o(ys);const e={frameloop:{setup:vs(t.frameloop.setup),rate:vs(t.frameloop.rate),read:vs(t.frameloop.read),resolveKeyframes:vs(t.frameloop.resolveKeyframes),preUpdate:vs(t.frameloop.preUpdate),update:vs(t.frameloop.update),preRender:vs(t.frameloop.preRender),render:vs(t.frameloop.render),postRender:vs(t.frameloop.postRender)},animations:{mainThread:vs(t.animations.mainThread),waapi:vs(t.animations.waapi),layout:vs(t.animations.layout)},layoutProjection:{nodes:vs(t.layoutProjection.nodes),calculatedTargetDeltas:vs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:vs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=bs(n.min),n.max=bs(n.max),n.avg=bs(n.avg),[n.min,n.max]=[n.max,n.min],e}function Ts(t,e){const n=d.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(o(i),t(r-e))};return r.setup(i,!0),()=>o(i)}function Ss(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Es(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Nt(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function As(t){const e=[];Mn.current=e;const n=t();Mn.current=void 0;const i=Rn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>r.preRender(i,!1,!0),a=t.map(t=>t.on("change",s));e.on("destroy",()=>{a.forEach(t=>t()),o(i)})}(e,i,t),i}const Ms=t=>Boolean(t&&t.getVelocity);function ks(t,e,n){const i=t.get();let s,o=null,a=i;const l="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,c=()=>{o&&(o.stop(),o=null)};if(t.attach((e,i)=>{a=e,s=t=>i(Rs(t,l)),r.postRender(()=>{c(),o=new _t({keyframes:[Ps(t.get()),Ps(a)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}),t.events.animationStart?.notify(),o?.then(()=>{t.events.animationComplete?.notify()})})},c),Ms(e)){const n=e.on("change",e=>t.set(Rs(e,l))),i=t.on("destroy",n);return()=>{n(),i()}}return c}function Rs(t,e){return e?t+e:t}function Ps(t){return"number"==typeof t?t:parseFloat(t)}const Vs=[...Qe,N,z];function Ds(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Bs={},Ls=null;const Fs=(t,e)=>{Bs[t]=e},Cs=()=>{Ls||(Ls=document.createElement("style"),Ls.id="motion-view");let t="";for(const e in Bs){const n=Bs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}Ls.textContent=t,document.head.appendChild(Ls),Bs={}},Os=()=>{Ls&&Ls.parentElement&&Ls.parentElement.removeChild(Ls)};function Is(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ns(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function $s(){return document.getAnimations().filter(Ns)}const js=["layout","enter","exit","new","old"];function Ks(t){const{update:n,targets:i,options:s}=t;if(!document.startViewTransition)return new Promise(async t=>{await n(),t(new Ye([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||Fs(":root",{"view-transition-name":"none"}),Fs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Cs();const r=document.startViewTransition(async()=>{await n()});return r.finished.finally(()=>{Os()}),new Promise(t=>{r.ready.then(()=>{const n=$s(),r=[];i.forEach((t,n)=>{for(const i of js){if(!t[i])continue;const{keyframes:o,options:a}=t[i];for(let[t,l]of Object.entries(o)){if(!l)continue;const o={..._e(s,t),..._e(a,t)},c=Ds(i);if("opacity"===t&&!Array.isArray(l)){l=["new"===c?0:1,l]}"function"==typeof o.delay&&(o.delay=o.delay(0,1)),o.duration&&(o.duration=e.secondsToMilliseconds(o.duration)),o.delay&&(o.delay=e.secondsToMilliseconds(o.delay));const u=new Fe({...o,element:document.documentElement,name:t,pseudoElement:`::view-transition-${c}(${n})`,keyframes:l});r.push(u)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:o}=n;if(!o)continue;const a=Is(o);if(!a)continue;const l=i.get(a.layer);if(l)Ws(l,"enter")&&Ws(l,"exit")&&n.getKeyframes().some(t=>t.mixBlendMode)?r.push(new qe(t)):t.cancel();else{const i="group"===a.type?"layout":"";let o={..._e(s,i)};o.duration&&(o.duration=e.secondsToMilliseconds(o.duration)),o=Le(o);const l=Ve(o.ease,o.duration);n.updateTiming({delay:e.secondsToMilliseconds(o.delay??0),duration:o.duration,easing:l}),r.push(new qe(t))}}t(new Ye(r))})})}function Ws(t,e){return t?.[e]?.keyframes.opacity}let Ys=[],Xs=null;function qs(){Xs=null;const[t]=Ys;var n;t&&(n=t,e.removeItem(Ys,n),Xs=n,Ks(n).then(t=>{n.notifyReady(t),t.finished.finally(qs)}))}function Us(){for(let t=Ys.length-1;t>=0;t--){const e=Ys[t],{interrupt:n}=e.options;if("immediate"===n){const n=Ys.slice(0,t+1).map(t=>t.update),i=Ys.slice(t+1);e.update=()=>{n.forEach(t=>t())},Ys=[e,...i];break}}Xs&&"immediate"!==Ys[0]?.options.interrupt||qs()}class zs{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.notifyReady=e.noop,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...n},i=this,Ys.push(i),Qn.render(Us)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Gs=r,Zs=n.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.AsyncMotionValueAnimation=class extends Gt{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=d.now();const m={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:c,...u},h=c?.KeyframeResolver||we;this.keyframeResolver=new h(o,(t,e,n)=>this.onKeyframesResolved(t,e,m,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=d.now(),function(t,n,i,s){const r=t[0];if(null===r)return!1;if("display"===n||"visibility"===n)return!0;const o=t[t.length-1],a=Ne(r,n),l=Ne(o,n);return e.warning(a===l,`You are trying to animate ${n} from "${r}" to "${o}". "${a?o:r}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===i||Be(i))&&s)}(t,r,o,a)||(!e.MotionGlobalConfig.instantAnimations&&l||u?.(qt(t,i,n)),t[0]=t[t.length-1],$e(i),i.repeat=0);const m={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},h=!c&&We(m)?new Ie({...m,element:m.motionValue.owner.current}):new _t(m);h.finished.then(()=>this.notifyFinished()).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),xe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},t.DOMKeyframesResolver=class extends we{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),y(i))){const s=Ze(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!He.has(n)||2!==t.length)return;const[i,s]=t,r=tn(i),o=tn(s);if(v(i)!==v(s)&&he[n])this.needsMeasurement=!0;else if(r!==o)if(ue(r)&&ue(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else he[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||en(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!hn.has(e)&&Y(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=mn(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=he[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=he[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}},t.FlatTree=class{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}},t.GroupAnimation=Ye,t.GroupAnimationWithThen=class extends Ye{then(t,e){return this.finished.finally(t).then(()=>{})}},t.JSAnimation=_t,t.KeyframeResolver=we,t.MotionValue=kn,t.NativeAnimation=Fe,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=qe,t.NodeStack=Gn,t.ViewTransitionBuilder=zs,t.acceleratedValues=yn,t.activeAnimations=m,t.addAttrValue=Tn,t.addScaleCorrector=function(t){for(const e in t)es[e]=t[e],p(e)&&(es[e].isCSSVariable=!0)},t.addStyleValue=Dn,t.alpha=x,t.analyseComplexValue=Y,t.animateValue=function(t){return new _t(t)},t.animateView=function(t,e={}){return new zs(t,e)},t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=Di,t.applyBoxDelta=Bi,t.applyGeneratorOptions=Le,t.applyPointDelta=Vi,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&pn.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=function(t,e,n,i=!1){const s=n.length;if(!s)return;let r,o;e.x=e.y=1;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:s}=r.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ii(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Bi(t,o)),i&&Mi(r.latestValues)&&Ii(t,r.latestValues))}e.x<Fi&&e.x>Li&&(e.x=1),e.y<Fi&&e.y>Li&&(e.y=1)},t.aspectRatio=function(t){return Ni(t.x)/Ni(t.y)},t.attachSpring=ks,t.attrEffect=Sn,t.axisDeltaEquals=function(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint},t.axisEquals=_i,t.axisEqualsRounded=Hi,t.boxEquals=function(t,e){return _i(t.x,e.x)&&_i(t.y,e.y)},t.boxEqualsRounded=function(t,e){return Hi(t.x,e.x)&&Hi(t.y,e.y)},t.buildProjectionTransform=function(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:r,skewX:o,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),o&&(i+=`skewX(${o}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"},t.calcAxisDelta=$i,t.calcBoxDelta=function(t,e,n,i){$i(t.x,e.x,n.x,i?i.originX:void 0),$i(t.y,e.y,n.y,i?i.originY:void 0)},t.calcGeneratorDuration=ht,t.calcLength=Ni,t.calcRelativeAxis=ji,t.calcRelativeAxisPosition=Ki,t.calcRelativeBox=function(t,e,n){ji(t.x,e.x,n.x),ji(t.y,e.y,n.y)},t.calcRelativePosition=function(t,e,n){Ki(t.x,e.x,n.x),Ki(t.y,e.y,n.y)},t.cancelFrame=o,t.cancelMicrotask=ti,t.cancelSync=Zs,t.clearSharedLayoutRegistry=function(){Zn.clear()},t.collectMotionValues=Mn,t.color=N,t.compareByDepth=is,t.complex=z,t.containsCSSVariable=v,t.convertBoundingBoxToBox=wi,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Kt,t.copyAxisDeltaInto=function(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin},t.copyAxisInto=Si,t.copyBoxInto=function(t,e){Si(t.x,e.x),Si(t.y,e.y)},t.correctBorderRadius=Qi,t.correctBoxShadow=ts,t.createAxis=Gi,t.createAxisDelta=zi,t.createBox=()=>({x:{min:0,max:0},y:{min:0,max:0}}),t.createDelta=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),t.createGeneratorEasing=pt,t.createLayoutNodeFactory=Jn,t.createRenderBatcher=s,t.cubicBezierAsString=Re,t.defaultEasing=Wt,t.defaultOffset=jt,t.defaultTransformValue=re,t.defaultValueTypes=un,t.degrees=D,t.delay=Ts,t.delayInSeconds=function(t,n){return Ts(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=Qe,t.eachAxis=function(t){return[t("x"),t("y")]},t.fillOffset=$t,t.fillWildcards=Ht,t.findCommonAncestor=In,t.findDimensionValueType=tn,t.findValueType=t=>Vs.find(Je(t)),t.flushKeyframeResolvers=xe,t.frame=r,t.frameData=a,t.frameSteps=l,t.generateLinearEasing=dt,t.getAnimatableNone=mn,t.getAnimationMap=function(t){const e=Ue.get(t)||new Map;return Ue.set(t,e),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Te(e)?n.getPropertyValue(e):n[e]},t.getDefaultValueType=dn,t.getLayoutNodeFactory=function(){return jn},t.getMixer=rt,t.getOriginIndex=Ss,t.getSharedLayoutLead=function(t){const e=Zn.get(t);return e?.lead},t.getSharedLayoutStack=function(t){return Zn.get(t)},t.getValueAsType=bn,t.getValueTransition=_e,t.getVariableValue=Ze,t.getViewAnimationLayerInfo=Is,t.getViewAnimations=$s,t.globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1},t.has2DTranslate=ki,t.hasScale=Ai,t.hasSharedLayoutNodes=function(t){const e=Zn.get(t);return void 0!==e&&e.members.length>0},t.hasTransform=Mi,t.hex=P,t.hover=function(t,e,n={}){const[i,s,r]=ii(t,n),o=t=>{if(!si(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{si(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r},t.hsla=I,t.hslaToRgba=Z,t.inertia=It,t.initLayoutSystem=function(t){Kn(Jn(t))},t.interpolate=Nt,t.invisibleValues=nt,t.isCSSVariableName=p,t.isCSSVariableToken=y,t.isDeltaZero=function(t){return Zi(t.x)&&Zi(t.y)},t.isDragActive=ni,t.isDragging=ei,t.isElementKeyboardAccessible=li,t.isGenerator=Be,t.isHTMLElement=An,t.isMotionValue=Ms,t.isNear=function(t,e,n){return Math.abs(t-e)<=n},t.isNodeOrChild=ri,t.isPrimaryPointer=oi,t.isSVGElement=ss,t.isSVGSVGElement=function(t){return ss(t)&&"svg"===t.tagName},t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&ke()||!n||"string"==typeof n&&(n in Pe||ke())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.keyframes=Yt,t.makeAnimationInstant=$e,t.mapEasingToNativeEasing=Ve,t.mapValue=function(t,e,n,i){const s=Es(e,n,i);return As(()=>s(t.get()))},t.maxGeneratorDuration=mt,t.measurePageBox=function(t,e,n){const i=ns(t,n),{scroll:s}=e;return s&&(Ci(i.x,s.offset.x),Ci(i.y,s.offset.y)),i},t.measureViewportBox=ns,t.microtask=Qn,t.mix=ct,t.mixArray=ot,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=_,t.mixLinearColor=J,t.mixNumber=H,t.mixObject=at,t.mixValues=function(t,e,n,i,s,r){s?(t.opacity=H(0,n.opacity??1,vi(i)),t.opacityExit=H(e.opacity??1,0,bi(i))):r&&(t.opacity=H(e.opacity??1,n.opacity??1,i));for(let s=0;s<pi;s++){const r=`border${hi[s]}Radius`;let o=gi(e,r),a=gi(n,r);if(void 0===o&&void 0===a)continue;o||(o=0),a||(a=0);0===o||0===a||yi(o)===yi(a)?(t[r]=Math.max(H(fi(o),fi(a),i),0),(B.test(a)||B.test(o))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=H(e.rotate||0,n.rotate||0,i))},t.mixVisibility=it,t.motionValue=Rn,t.notifyExitAnimationComplete=function(t){const e=Zn.get(t);e&&e.exitAnimationComplete()},t.number=b,t.numberValueTypes=cn,t.observeMutation=On,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return r.preUpdate(i,!0),()=>o(i)},t.parseCSSVariable=Ge,t.parseValueFromTransform=oe,t.percent=B,t.pixelsToPercent=Ji,t.positionalKeys=He,t.preserveElementForExit=Nn,t.press=function(t,e,n={}){const[i,s,r]=ii(t,n),o=t=>{const i=t.currentTarget;if(!mi(t))return;ci.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ci.has(i)&&ci.delete(i),mi(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||ri(i,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),An(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ui(()=>{if(ci.has(n))return;di(n,"down");const t=ui(()=>{di(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>di(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),li(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r},t.progressPercentage=O,t.propEffect=En,t.px=L,t.readTransformValue=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return oe(n,e)},t.recordStats=function(){if(i.value)throw xs(),new Error("Stats are already being measured");const t=i;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},r.postRender(ys,!0),ws},t.registerSharedLayoutNode=_n,t.removeAxisDelta=Yi,t.removeAxisTransforms=Xi,t.removeBoxTransforms=function(t,e,n,i){Xi(t.x,e,qi,n?n.x:void 0,i?i.x:void 0),Xi(t.y,e,Ui,n?n.y:void 0,i?i.y:void 0)},t.removePointDelta=Wi,t.resize=function(t,e){return"function"==typeof t?fs(t):ms(t,e)},t.resolveElements=gn,t.rgbUnit=k,t.rgba=R,t.scale=w,t.scaleCorrectors=es,t.scalePoint=Pi,t.scheduleSharedLayoutRender=function(t){const e=Zn.get(t);e&&e.scheduleRender()},t.setDragLock=function(t){return"x"===t||"y"===t?ei[t]?null:(ei[t]=!0,()=>{ei[t]=!1}):ei.x||ei.y?null:(ei.x=ei.y=!0,()=>{ei.x=ei.y=!1})},t.setLayoutNodeFactory=Kn,t.setStyle=Se,t.spring=Ot,t.springValue=function(t,e){const n=Rn(Ms(t)?t.get():t);return ks(n,t,e),n},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(r,o)=>{const a="number"==typeof i?i:Ss(i,o),l=Math.abs(a-r);let c=t*l;if(s){const n=o*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=De,t.statsBuffer=i,t.styleEffect=Bn,t.supportedWaapiEasing=Pe,t.supportsBrowserAnimation=We,t.supportsFlags=Ae,t.supportsLinearEasing=ke,t.supportsPartialKeyframes=fn,t.supportsScrollTimeline=Ee,t.svgEffect=Fn,t.sync=Gs,t.testValueType=Je,t.time=d,t.transform=Es,t.transformAxis=Oi,t.transformBox=Ii,t.transformBoxPoints=Ti,t.transformPropOrder=le,t.transformProps=ce,t.transformValue=As,t.transformValueTypes=ln,t.translateAxis=Ci,t.unregisterSharedLayoutNode=Hn,t.unstable_animateLayout=function(t,e,n){if(!jn)throw new Error("animateLayout: No layout node factory configured. Make sure to import from 'framer-motion' or call setLayoutNodeFactory() first.");const i=jn;let s,r,o;if(t&&((a=t)instanceof Element||"string"==typeof a||Array.isArray(a)&&a.length>0&&a[0]instanceof Element||a instanceof NodeList)){const i=gn(t);s=[];for(const t of i){const e=t.querySelectorAll(zn);s.push(...Array.from(e)),t.matches(zn)&&s.push(t)}s=[...new Set(s)],r="function"==typeof e?e:void 0,o="object"==typeof e?e:n??{}}else s=Array.from(document.querySelectorAll(zn)),"function"==typeof t?(r=t,o=e??{}):(r="function"==typeof e?e:void 0,o=t??("object"==typeof e?e:{}));var a;const l={...o,transition:{...$n,...o.transition,duration:o.duration??o.transition?.duration??.3,ease:o.ease??o.transition?.ease}},c=function(t,e,n){const i=[...t].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),s=[],r=new Map;for(const t of i){if(!(t instanceof HTMLElement))continue;let i,o=t.parentElement;for(;o;){const t=r.get(o);if(t){i=t;break}o=o.parentElement}const a=Yn(t,i,e,n);s.push(a),r.set(t,a)}return s}(s,l,i);let u,d,m;const h={enter:(t,e)=>(u={keyframes:t,transition:e},h),exit:(t,e)=>(d={keyframes:t,transition:e},h),then:(t,e)=>(m||(m=Un(c,r,l,u,d)),m.then(e=>t(e)).catch(t=>{throw e&&e(t),t}))};return r&&queueMicrotask(()=>{m||(m=Un(c,r,l,u,d))}),h},t.vh=F,t.vw=C});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motion-dom",
|
|
3
|
-
"version": "12.27.0-alpha.
|
|
3
|
+
"version": "12.27.0-alpha.1",
|
|
4
4
|
"author": "Matt Perry",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/motiondivision/motion",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"maxSize": "1.8 kB"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "31897fd922dd5263045ab67258fc1f80575b4fe6"
|
|
40
40
|
}
|