framer-motion 11.1.6 → 11.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{dom-entry-CjwSWZyY.js → dom-entry-BNd0N1D8.js} +19 -5
- package/dist/cjs/dom-entry.js +1 -1
- package/dist/cjs/index.js +13 -4
- package/dist/dom-entry.d.ts +6 -0
- package/dist/dom.js +1 -1
- package/dist/es/animation/interfaces/visual-element-target.mjs +16 -2
- package/dist/es/motion/utils/use-visual-state.mjs +1 -1
- package/dist/es/render/utils/animation-state.mjs +11 -2
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/render/utils/setters.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +31 -8
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +15 -5
- package/dist/projection.dev.js +2 -2
- package/dist/three-entry.d.ts +12 -4
- package/package.json +8 -8
|
@@ -3419,7 +3419,7 @@ class MotionValue {
|
|
|
3419
3419
|
* This will be replaced by the build step with the latest version number.
|
|
3420
3420
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
3421
3421
|
*/
|
|
3422
|
-
this.version = "11.
|
|
3422
|
+
this.version = "11.2.0-alpha.0";
|
|
3423
3423
|
/**
|
|
3424
3424
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
3425
3425
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -3713,7 +3713,7 @@ function setMotionValue(visualElement, key, value) {
|
|
|
3713
3713
|
}
|
|
3714
3714
|
function setTarget(visualElement, definition) {
|
|
3715
3715
|
const resolved = resolveVariant(visualElement, definition);
|
|
3716
|
-
let { transitionEnd = {}, transition = {}, ...target } = resolved || {};
|
|
3716
|
+
let { transitionEnd = {}, transitionFrom, transition = {}, ...target } = resolved || {};
|
|
3717
3717
|
target = { ...target, ...transitionEnd };
|
|
3718
3718
|
for (const key in target) {
|
|
3719
3719
|
const value = resolveFinalValueInKeyframes(target[key]);
|
|
@@ -3734,7 +3734,7 @@ function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {
|
|
3736
3736
|
var _a;
|
|
3737
|
-
let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
|
|
3737
|
+
let { transition = visualElement.getDefaultTransition(), transitionFrom, transitionEnd, ...target } = targetAndTransition;
|
|
3738
3738
|
const willChange = visualElement.getValue("willChange");
|
|
3739
3739
|
if (transitionOverride)
|
|
3740
3740
|
transition = transitionOverride;
|
|
@@ -3750,10 +3750,23 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
|
|
|
3750
3750
|
shouldBlockAnimation(animationTypeState, key))) {
|
|
3751
3751
|
continue;
|
|
3752
3752
|
}
|
|
3753
|
+
let transitionFromType;
|
|
3754
|
+
if (transitionFrom) {
|
|
3755
|
+
if (value.currentAnimationState) {
|
|
3756
|
+
transitionFromType = transitionFrom[value.currentAnimationState];
|
|
3757
|
+
}
|
|
3758
|
+
else {
|
|
3759
|
+
// This is the first time the value has been animated.
|
|
3760
|
+
const initialType = visualElement.getProps().initial || type === "animate"
|
|
3761
|
+
? "initial"
|
|
3762
|
+
: "animate";
|
|
3763
|
+
transitionFromType = transitionFrom[initialType];
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3753
3766
|
const valueTransition = {
|
|
3754
3767
|
delay,
|
|
3755
3768
|
elapsed: 0,
|
|
3756
|
-
...getValueTransition$1(transition || {}, key),
|
|
3769
|
+
...getValueTransition$1(transitionFromType || transition || {}, key),
|
|
3757
3770
|
};
|
|
3758
3771
|
/**
|
|
3759
3772
|
* If this is the first time a value is being animated, check
|
|
@@ -3774,6 +3787,7 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
|
|
|
3774
3787
|
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key)
|
|
3775
3788
|
? { type: false }
|
|
3776
3789
|
: valueTransition, visualElement, isHandoff));
|
|
3790
|
+
value.currentAnimationState = type || "animate";
|
|
3777
3791
|
const animation = value.animation;
|
|
3778
3792
|
if (animation) {
|
|
3779
3793
|
if (isWillChangeMotionValue(willChange)) {
|
|
@@ -4188,7 +4202,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
4188
4202
|
* and warn against mismatches.
|
|
4189
4203
|
*/
|
|
4190
4204
|
if (process.env.NODE_ENV === "development") {
|
|
4191
|
-
warnOnce(nextValue.version === "11.
|
|
4205
|
+
warnOnce(nextValue.version === "11.2.0-alpha.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.0-alpha.0 may not work as expected.`);
|
|
4192
4206
|
}
|
|
4193
4207
|
}
|
|
4194
4208
|
else if (isMotionValue(prevValue)) {
|
package/dist/cjs/dom-entry.js
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var domEntry = require('./dom-entry-
|
|
7
|
+
var domEntry = require('./dom-entry-BNd0N1D8.js');
|
|
8
8
|
|
|
9
9
|
function _interopNamespaceDefault(e) {
|
|
10
10
|
var n = Object.create(null);
|
|
@@ -636,7 +636,7 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
636
636
|
const resolved = domEntry.resolveVariantFromProps(props, definition);
|
|
637
637
|
if (!resolved)
|
|
638
638
|
return;
|
|
639
|
-
const { transitionEnd, transition, ...target } = resolved;
|
|
639
|
+
const { transitionEnd, transitionFrom, transition, ...target } = resolved;
|
|
640
640
|
for (const key in target) {
|
|
641
641
|
let valueTarget = target[key];
|
|
642
642
|
if (Array.isArray(valueTarget)) {
|
|
@@ -1251,7 +1251,7 @@ function createAnimationState(visualElement) {
|
|
|
1251
1251
|
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
|
|
1252
1252
|
: undefined);
|
|
1253
1253
|
if (resolved) {
|
|
1254
|
-
const { transition, transitionEnd, ...target } = resolved;
|
|
1254
|
+
const { transition, transitionEnd, transitionFrom, ...target } = resolved;
|
|
1255
1255
|
acc = { ...acc, ...target, ...transitionEnd };
|
|
1256
1256
|
}
|
|
1257
1257
|
return acc;
|
|
@@ -1483,7 +1483,16 @@ function createAnimationState(visualElement) {
|
|
|
1483
1483
|
// @ts-expect-error - @mattgperry to figure if we should do something here
|
|
1484
1484
|
fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;
|
|
1485
1485
|
});
|
|
1486
|
-
|
|
1486
|
+
const { initial } = props;
|
|
1487
|
+
if (initial && typeof initial !== "boolean") {
|
|
1488
|
+
const { transition, transitionFrom } = domEntry.resolveVariant(visualElement, Array.isArray(initial) ? initial[0] : initial) || {};
|
|
1489
|
+
fallbackAnimation.transition = transition;
|
|
1490
|
+
fallbackAnimation.transitionFrom = transitionFrom;
|
|
1491
|
+
}
|
|
1492
|
+
animations.push({
|
|
1493
|
+
animation: fallbackAnimation,
|
|
1494
|
+
options: { type: "initial" },
|
|
1495
|
+
});
|
|
1487
1496
|
}
|
|
1488
1497
|
let shouldAnimate = Boolean(animations.length);
|
|
1489
1498
|
if (isInitialRender &&
|
package/dist/dom-entry.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ interface FrameData {
|
|
|
38
38
|
isProcessing: boolean;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit";
|
|
42
|
+
|
|
41
43
|
/**
|
|
42
44
|
* @public
|
|
43
45
|
*/
|
|
@@ -505,6 +507,10 @@ declare class MotionValue<V = any> {
|
|
|
505
507
|
* A reference to the currently-controlling animation.
|
|
506
508
|
*/
|
|
507
509
|
animation?: AnimationPlaybackControls;
|
|
510
|
+
/**
|
|
511
|
+
* The current animation type of the `MotionValue`.
|
|
512
|
+
*/
|
|
513
|
+
currentAnimationState?: AnimationType | "initial";
|
|
508
514
|
setCurrent(current: V): void;
|
|
509
515
|
setPrevFrameValue(prevFrameValue?: V | undefined): void;
|
|
510
516
|
/**
|
package/dist/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t,n=!1;class s{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const r=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:i,cancel:o,state:a,steps:l}=function(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=r.reduce((t,e)=>(t[e]=function(t){let e=new s,n=new s,r=0,i=!1,o=!1;const a=new WeakSet,l={schedule:(t,s=!1,o=!1)=>{const l=o&&i,u=l?e:n;return s&&a.add(t),u.add(t)&&l&&i&&(r=e.order.length),t},cancel:t=>{n.remove(t),a.delete(t)},process:s=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];a.has(r)&&(l.schedule(r),t()),r(s)}i=!1,o&&(o=!1,l.process(s))}}};return l}(()=>n=!0),t),{}),l=t=>{a[t].process(o)},u=()=>{const s=performance.now();n=!1,o.delta=i?1e3/60:Math.max(Math.min(s-o.timestamp,40),1),o.timestamp=s,o.isProcessing=!0,r.forEach(l),o.isProcessing=!1,n&&e&&(i=!1,t(u))};return{schedule:r.reduce((e,s)=>{const r=a[s];return e[s]=(e,s=!1,a=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(u)),r.schedule(e,s,a)),e},{}),cancel:t=>r.forEach(e=>a[e].cancel(t)),state:o,steps:a}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);function u(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class c{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>u(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let r=0;r<s;r++){const s=this.subscriptions[r];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function h(t,e){return e?t*(1e3/e):0}let d;function p(){d=void 0}const f={now:()=>(void 0===d&&f.set(a.isProcessing||n?a.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(p)}};class m{constructor(t,e={}){var n;this.version="11.1.6",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=f.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=f.now()}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new c);const n=this.events[t].add(e);return"change"===t?()=>{n(),i.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=f.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return h(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function g(t,e){return new m(t,e)}let v=e,y=e;function w(t,e,n){var s;if("string"==typeof t){let r=document;e&&(y(Boolean(e.current)),r=e.current),n?(null!==(s=n[t])&&void 0!==s||(n[t]=r.querySelectorAll(t)),t=n[t]):t=r.querySelectorAll(t)}else t instanceof Element&&(t=[t]);return Array.from(t||[])}const b=new WeakMap;function x(t,e){let n;const s=()=>{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return i.update(s,!0),()=>o(s)}function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=T(()=>void 0!==window.ScrollTimeline);class S{constructor(t){this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}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=>{if(!V()||!e.attachTimeline)return e.pause(),x(t=>{e.time=e.duration*t},t);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 duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}stop(){this.runAll("stop")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const A=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],M=new Set(A),P=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),k="data-"+P("framerAppearId"),C=t=>1e3*t,E=t=>t/1e3,F={type:"spring",stiffness:500,damping:25,restSpeed:10},O={type:"keyframes",duration:.8},R={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},B=(t,{keyframes:e})=>e.length>2?O:M.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:F:R;function I(t,e){return t[e]||t.default||t}const L=t=>null!==t;function D(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(L),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}const W=t=>/^0[^.\s]+$/u.test(t);const N=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),K=t=>e=>"string"==typeof e&&e.startsWith(t),j=K("--"),z=K("var(--"),$=t=>!!z(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,U=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y(t,e,n=1){const[s,r]=function(t){const e=U.exec(t);if(!e)return[,];const[,n,s,r]=e;return["--"+(null!=n?n:s),r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return N(t)?parseFloat(t):t}return $(r)?Y(r,e,n+1):r}const q=(t,e,n)=>n>e?e:n<t?t:n,X={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={...X,transform:t=>q(0,1,t)},Z={...X,default:1},_=t=>Math.round(1e5*t)/1e5,J=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function et(t){return"string"==typeof t}const nt=t=>({test:e=>et(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),st=nt("deg"),rt=nt("%"),it=nt("px"),ot=nt("vh"),at=nt("vw"),lt={...rt,parse:t=>rt.parse(t)/100,transform:t=>rt.transform(100*t)},ut=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ct=t=>t===X||t===it,ht=(t,e)=>parseFloat(t.split(", ")[e]),dt=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/u);if(r)return ht(r[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?ht(e[1],t):0}},pt=new Set(["x","y","z"]),ft=A.filter(t=>!pt.has(t));const mt={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:dt(4,13),y:dt(5,14)};mt.translateX=mt.x,mt.translateY=mt.y;const gt=t=>e=>e.test(t),vt=[X,it,rt,st,at,ot,{test:t=>"auto"===t,parse:t=>t}],yt=t=>vt.find(gt(t)),wt=new Set;let bt=!1,xt=!1;function Tt(){if(xt){const t=Array.from(wt).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 ft.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.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])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}xt=!1,bt=!1,wt.forEach(t=>t.complete()),wt.clear()}function Vt(){wt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xt=!0)})}class St{constructor(t,e,n,s,r,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(wt.add(this),bt||(bt=!0,i.read(Vt),i.resolveKeyframes(Tt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r<t.length;r++)if(null===t[r])if(0===r){const r=null==s?void 0:s.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){const s=n.readValue(e,i);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=i),s&&void 0===r&&s.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),wt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,wt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const At=(t,e)=>n=>Boolean(et(n)&&tt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Mt=(t,e,n)=>s=>{if(!et(s))return s;const[r,i,o,a]=s.match(J);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Pt={...X,transform:t=>Math.round((t=>q(0,255,t))(t))},kt={test:At("rgb","red"),parse:Mt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Pt.transform(t)+", "+Pt.transform(e)+", "+Pt.transform(n)+", "+_(G.transform(s))+")"};const Ct={test:At("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:kt.transform},Et={test:At("hsl","hue"),parse:Mt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+rt.transform(_(e))+", "+rt.transform(_(n))+", "+_(G.transform(s))+")"},Ft={test:t=>kt.test(t)||Ct.test(t)||Et.test(t),parse:t=>kt.test(t)?kt.parse(t):Et.test(t)?Et.parse(t):Ct.parse(t),transform:t=>et(t)?t:t.hasOwnProperty("red")?kt.transform(t):Et.transform(t)};const Ot=/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 Rt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Ot,t=>(Ft.test(t)?(s.color.push(i),r.push("color"),n.push(Ft.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push("number"),n.push(parseFloat(t))),++i,"${}")).split("${}");return{values:n,split:o,indexes:s,types:r}}function Bt(t){return Rt(t).values}function It(t){const{split:e,types:n}=Rt(t),s=e.length;return t=>{let r="";for(let i=0;i<s;i++)if(r+=e[i],void 0!==t[i]){const e=n[i];r+="number"===e?_(t[i]):"color"===e?Ft.transform(t[i]):t[i]}return r}}const Lt=t=>"number"==typeof t?0:t;const Dt={test:function(t){var e,n;return isNaN(t)&&et(t)&&((null===(e=t.match(J))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Q))||void 0===n?void 0:n.length)||0)>0},parse:Bt,createTransformer:It,getAnimatableNone:function(t){const e=Bt(t);return It(t)(e.map(Lt))}},Wt=new Set(["brightness","contrast","saturate","opacity"]);function Nt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(J)||[];if(!s)return t;const r=n.replace(s,"");let i=Wt.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Kt=/\b([a-z-]*)\(.*?\)/gu,jt={...Dt,getAnimatableNone:t=>{const e=t.match(Kt);return e?e.map(Nt).join(" "):t}},zt={...X,transform:Math.round},$t={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:Z,scaleX:Z,scaleY:Z,scaleZ:Z,skew:st,skewX:st,skewY:st,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:G,originX:lt,originY:lt,originZ:it,zIndex:zt,backgroundPositionX:it,backgroundPositionY:it,fillOpacity:G,strokeOpacity:G,numOctaves:zt},Ht={...$t,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:jt,WebkitFilter:jt},Ut=t=>Ht[t];function Yt(t,e){let n=Ut(t);return n!==jt&&(n=Dt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}class qt extends St{constructor(t,e,n,s){super(t,e,n,s,null==s?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){const s=t[n];if("string"==typeof s&&$(s)){const r=Y(s,e.current);void 0!==r&&(t[n]=r),n===t.length-1&&(this.finalKeyframe=s)}}if(!ut.has(n)||2!==t.length)return this.resolveNoneKeyframes();const[s,r]=t,i=yt(s),o=yt(r);if(i!==o)if(ct(i)&&ct(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||W(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,r=void 0;for(;s<t.length&&!r;)"string"==typeof t[s]&&"none"!==t[s]&&"0"!==t[s]&&(r=t[s]),s++;if(r&&n)for(const s of e)t[s]=Yt(n,r)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=mt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Xt=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Dt.test(t)&&"0"!==t||t.startsWith("url(")));class Gt{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,...o},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(Vt(),Tt()),this._resolved}onKeyframesResolved(t,e){this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,s){const r=t[0];if(null===r)return!1;const i=t[t.length-1],o=Xt(r,e),a=Xt(i,e);return!(!o||!a)&&(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"===n&&s)}(t,n,s,r)){if(!i)return null==a||a(D(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Zt(t,e,n){const s=Math.max(e-5,0);return h(n-t(s),e-s)}function _t({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let r,i,o=1-e;o=q(.05,1,o),t=q(.01,10,E(t)),o<1?(r=e=>{const s=e*o,r=s*t;return.001-(s-n)/Jt(e,o)*Math.exp(-r)},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=Jt(Math.pow(e,2),o);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(r,i,5/t);if(t=C(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function Jt(t,e){return t*Math.sqrt(1-e*e)}const Qt=["duration","bounce"],te=["stiffness","damping","mass"];function ee(t,e){return e.some(e=>void 0!==t[e])}function ne({keyframes:t,restDelta:e,restSpeed:n,...s}){const r=t[0],i=t[t.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!ee(t,te)&&ee(t,Qt)){const n=_t(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...s,velocity:-E(s.velocity||0)}),p=h||0,f=l/(2*Math.sqrt(a*u)),m=i-r,g=E(Math.sqrt(a/u)),v=Math.abs(m)<5;let y;if(n||(n=v?.01:2),e||(e=v?.005:.5),f<1){const t=Jt(g,f);y=e=>{const n=Math.exp(-f*g*e);return i-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)y=t=>i-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);y=e=>{const n=Math.exp(-f*g*e),s=Math.min(t*e,300);return i-n*((p+f*g*m)*Math.sinh(s)+t*m*Math.cosh(s))/t}}return{calculatedDuration:d&&c||null,next:t=>{const s=y(t);if(d)o.done=t>=c;else{let r=p;0!==t&&(r=f<1?Zt(y,t,s):0);const a=Math.abs(r)<=n,l=Math.abs(i-s)<=e;o.done=a&&l}return o.value=o.done?i:s,o}}}function se({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,x;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,x=ne({keyframes:[d.value,p(d.value)],velocity:Zt(y,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),T(t)),void 0!==b&&t>=b?x.next(t-b):(!e&&w(t),d)}}}const re=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ie(t,n,s,r){if(t===n&&s===r)return e;const i=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=re(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:re(i(t),n,r)}const oe=ie(.42,0,1,1),ae=ie(0,0,.58,1),le=ie(.42,0,.58,1),ue=t=>Array.isArray(t)&&"number"!=typeof t[0],ce=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,he=t=>e=>1-t(1-e),de=t=>1-Math.sin(Math.acos(t)),pe=he(de),fe=ce(de),me=ie(.33,1.53,.69,.99),ge=he(me),ve=ce(ge),ye=t=>(t*=2)<1?.5*ge(t):.5*(2-Math.pow(2,-10*(t-1))),we={linear:e,easeIn:oe,easeInOut:le,easeOut:ae,circIn:de,circInOut:fe,circOut:pe,backIn:ge,backInOut:ve,backOut:me,anticipate:ye},be=t=>{if(Array.isArray(t)){y(4===t.length);const[e,n,s,r]=t;return ie(e,n,s,r)}return"string"==typeof t?we[t]:t},xe=(t,e)=>n=>e(t(n)),Te=(...t)=>t.reduce(xe),Ve=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},Se=(t,e,n)=>t+(e-t)*n;function Ae(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}const Me=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Pe=[Ct,kt,Et];function ke(t){const e=(n=t,Pe.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Et&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Ae(a,s,t+1/3),i=Ae(a,s,t),o=Ae(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const Ce=(t,e)=>{const n=ke(t),s=ke(e),r={...n};return t=>(r.red=Me(n.red,s.red,t),r.green=Me(n.green,s.green,t),r.blue=Me(n.blue,s.blue,t),r.alpha=Se(n.alpha,s.alpha,t),kt.transform(r))};function Ee(t,e){return n=>n>0?e:t}function Fe(t,e){return n=>Se(t,e,n)}function Oe(t){return"number"==typeof t?Fe:"string"==typeof t?$(t)?Ee:Ft.test(t)?Ce:Ie:Array.isArray(t)?Re:"object"==typeof t?Ft.test(t)?Ce:Be:Ee}function Re(t,e){const n=[...t],s=n.length,r=t.map((t,n)=>Oe(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=r[e](t);return n}}function Be(t,e){const n={...t,...e},s={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(s[r]=Oe(t[r])(t[r],e[r]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Ie=(t,e)=>{const n=Dt.createTransformer(e),s=Rt(t),r=Rt(e);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?Te(Re(function(t,e){var n;const s=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][r[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[i]=l,r[o]++}return s}(s,r),r.values),n):Ee(t,e)};function Le(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Se(t,e,n);return Oe(t)(t,e)}function De(t,n,{clamp:s=!0,ease:r,mixer:i}={}){const o=t.length;if(y(o===n.length),1===o)return()=>n[0];if(2===o&&t[0]===t[1])return()=>n[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const a=function(t,n,s){const r=[],i=s||Le,o=t.length-1;for(let s=0;s<o;s++){let o=i(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Te(t,o)}r.push(o)}return r}(n,r,i),l=a.length,u=e=>{let n=0;if(l>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=Ve(t[n],t[n+1],e);return a[n](s)};return s?e=>u(q(t[0],t[o-1],e)):u}function We(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=Ve(0,e,s);t.push(Se(n,1,r))}}function Ne(t){const e=[0];return We(e,t.length-1),e}function Ke({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=ue(s)?s.map(be):be(s),i={done:!1,value:e[0]},o=De(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ne(e),t),e,{ease:Array.isArray(r)?r:(a=e,l=r,a.map(()=>l||le).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(i.value=o(e),i.done=e>=t,i)}}function je(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const ze=t=>{const e=({timestamp:e})=>t(e);return{start:()=>i.update(e,!0),stop:()=>o(e),now:()=>a.isProcessing?a.timestamp:f.now()}},$e={decay:se,inertia:se,tween:Ke,keyframes:Ke,spring:ne},He=t=>t/100;class Ue extends Gt{constructor({KeyframeResolver:t=St,...e}){super(e),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:n,motionValue:s,keyframes:r}=this.options,i=(t,e)=>this.onKeyframesResolved(t,e);n&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(r,i,n,s):this.resolver=new t(r,i,n,s),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:i=0}=this.options,o=$e[e]||Ke;let a,l;o!==Ke&&"number"!=typeof t[0]&&(a=Te(He,Le(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=je(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=r;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=i)),y=q(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:x}=b;v||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return T&&void 0!==s&&(b.value=D(a,this.options,s)),m&&m(b.value),T&&this.finish(),b}get duration(){const{resolved:t}=this;return t?E(t.calculatedDuration):0}get time(){return E(this.currentTime)}set time(t){t=C(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=E(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ze,onPlay:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ye=t=>Array.isArray(t)&&"number"==typeof t[0];function qe(t){return Boolean(!t||"string"==typeof t&&t in Ge||Ye(t)||Array.isArray(t)&&t.every(qe))}const Xe=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xe([0,.65,.55,1]),circOut:Xe([.55,0,1,.45]),backIn:Xe([.31,.01,.66,-.59]),backOut:Xe([.33,1.53,.69,.99])};function Ze(t){return _e(t)||Ge.easeOut}function _e(t){return t?Ye(t)?Xe(t):Array.isArray(t)?t.map(Ze):Ge[t]:void 0}const Je=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Qe=new Set(["opacity","clipPath","filter","transform"]);class tn extends Gt{constructor(t){super(t);const{name:e,motionValue:n,keyframes:s}=this.options;this.resolver=new qt(s,(t,e)=>this.onKeyframesResolved(t,e),e,n),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:r,ease:i,type:o,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||"backgroundColor"===u.name||!qe(u.ease)){const{onComplete:e,onUpdate:n,motionValue:a,...l}=this.options,u=function(t,e){const n=new Ue({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,l);1===(t=u.keyframes).length&&(t[1]=t[0]),s=u.duration,r=u.times,i=u.ease,o="keyframes"}var u;const c=function(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=_e(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"})}(a.owner.current,l,t,{...this.options,duration:s,times:r,ease:i});return c.startTime=f.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(D(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:r,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return E(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return E(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=C(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;s.timeline=t,s.onfinish=null}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:r,ease:i,times:o}=t;if("idle"!==e.playState&&"finished"!==e.playState){if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,...l}=this.options,u=new Ue({...l,keyframes:n,duration:s,type:r,ease:i,times:o,isGenerator:!0}),c=C(this.time);t.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}this.cancel()}}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;return Je()&&n&&Qe.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const en=(t,e,n,s={},r,o)=>a=>{const l=I(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=C(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||(h={...h,...B(t,h)}),h.duration&&(h.duration=C(h.duration)),h.repeatDelay&&(h.repeatDelay=C(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),d&&!o&&void 0!==e.get()){const t=D(h.keyframes,l);if(void 0!==t)return void i.update(()=>{h.onUpdate(t),h.onComplete()})}return!o&&tn.supports(h)?new tn(h):new Ue(h)},nn=t=>Boolean(t&&t.getVelocity);function sn(t){return Boolean(nn(t)&&t.add)}const rn=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function on(t,e,n,s={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),e}function an(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,g(n))}function ln(t,e){const n=function(t,e,n){const s=t.getProps();return on(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){an(t,e,rn(i[e]))}}function un({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function cn(t,e,{delay:n=0,transitionOverride:s,type:r}={}){var o;let{transition:a=t.getDefaultTransition(),transitionEnd:l,...u}=e;const c=t.getValue("willChange");s&&(a=s);const h=[],d=r&&t.animationState&&t.animationState.getState()[r];for(const e in u){const s=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),r=u[e];if(void 0===r||d&&un(d,e))continue;const i={delay:n,elapsed:0,...I(a||{},e)};let l=!1;if(window.HandoffAppearAnimations){const n=t.getProps()[k];if(n){const t=window.HandoffAppearAnimations(n,e);null!==t&&(i.elapsed=t,l=!0)}}s.start(en(e,s,r,t.shouldReduceMotion&&M.has(e)?{type:!1}:i,t,l));const p=s.animation;p&&(sn(c)&&(c.add(e),p.then(()=>c.remove(e))),h.push(p))}return l&&Promise.all(h).then(()=>{i.update(()=>{l&&ln(t,l)})}),h}const hn={};function dn(t,{layout:e,layoutId:n}){return M.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!hn[t]||"opacity"===t)}function pn(t,e,n){var s;const{style:r}=t,i={};for(const o in r)(nn(r[o])||e.style&&nn(e.style[o])||dn(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(i[o]=r[o]);return i}const fn="undefined"!=typeof document,mn={current:null},gn={current:!1};function vn(t){return"string"==typeof t||Array.isArray(t)}const yn=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function wn(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||yn.some(e=>vn(t[e]));var e}const bn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},xn={};for(const t in bn)xn[t]={isEnabled:e=>bn[t].some(t=>!!e[t])};const Tn=[...vt,Ft,Dt],Vn=Object.keys(xn),Sn=Vn.length,An=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Mn=yn.length;class Pn extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.resolveKeyframes=(t,e,n,s)=>new this.KeyframeResolver(t,e,n,s,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=St,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>i.render(this.render,!1,!0);const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=wn(e),this.isVariantNode=function(t){return Boolean(wn(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&nn(e)&&(e.set(l[t],!1),sn(c)&&c.add(t))}}mount(t){this.current=t,b.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),gn.current||function(){if(gn.current=!0,fn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mn.current=t.matches;t.addListener(e),e()}else mn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||mn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var t;b.delete(this.current),this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const e in this.features)null===(t=this.features[e])||void 0===t||t.unmount();this.current=null}bindToMotionValue(t,e){const n=M.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&i.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,r){let i,o;for(let t=0;t<Sn;t++){const n=Vn[t],{isEnabled:s,Feature:r,ProjectionNode:a,MeasureLayout:l}=xn[n];a&&(i=a),s(e)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),l&&(o=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&i){this.projection=new i(this.latestValues,function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(this.parent));const{layoutId:t,layout:n,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||o&&(a=o,a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}var a;return o}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<An.length;e++){const n=An[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){const{willChange:s}=e;for(const r in e){const i=e[r],o=n[r];if(nn(i))t.addValue(r,i),sn(s)&&s.add(r);else if(nn(o))t.addValue(r,g(i,{owner:t})),sn(s)&&s.remove(r);else if(o!==i)if(t.hasValue(r)){const e=t.getValue(r);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,g(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Mn;t++){const n=yn[t],s=this.props[n];(vn(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=g(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var r;return null!=s&&("string"==typeof s&&(N(s)||W(s))?s=parseFloat(s):(r=s,!Tn.find(gt(r))&&Dt.test(e)&&(s=Yt(t,e))),this.setBaseTarget(t,nn(s)?s.get():s)),nn(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const r=on(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);r&&(s=r[t])}if(n&&void 0!==s)return s;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||nn(r)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new c),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=qt}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}}const kn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cn=A.length;const En=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function Fn(t,e,n,s){const{style:r,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(j(t)){i[t]=n;continue}const s=$t[t],h=En(n,s);if(M.has(t)){if(l=!0,o[t]=h,!c)continue;n!==(s.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=h):r[t]=h}if(e.transform||(l||s?r.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,r){let i="";for(let e=0;e<Cn;e++){const n=A[e];if(void 0!==t[n]){i+=`${kn[n]||n}(${t[n]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),r?i=r(t,s?"":i):n&&s&&(i="none"),i}(t.transform,n,c,s):r.transform&&(r.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;r.transformOrigin=`${t} ${e} ${n}`}}function On(t,e,n){return"string"==typeof t?t:it.transform(e+n*t)}const Rn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bn={offset:"strokeDashoffset",array:"strokeDasharray"};function In(t,{attrX:e,attrY:n,attrScale:s,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h,d){if(Fn(t,u,c,d),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:f,dimensions:m}=t;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==r||void 0!==i||f.transform)&&(f.transformOrigin=function(t,e,n){return`${On(e,t.x,t.width)} ${On(n,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==i?i:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==s&&(p.scale=s),void 0!==o&&function(t,e,n=1,s=0,r=!0){t.pathLength=1;const i=r?Rn:Bn;t[i.offset]=it.transform(-s);const o=it.transform(e),a=it.transform(n);t[i.array]=`${o} ${a}`}(p,o,a,l,!1)}const Ln=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Dn(t,{style:e,vars:n},s,r){Object.assign(t.style,e,r&&r.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class Wn extends Pn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(M.has(e)){const t=Ut(e);return t&&t.default||0}return e=Ln.has(e)?e:P(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=pn(t,e,n);for(const n in t)if(nn(t[n])||nn(e[n])){s[-1!==A.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}build(t,e,n,s){In(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Dn(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Ln.has(n)?n:P(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class Nn extends Pn{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(M.has(e)){const t=Ut(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),r=(j(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,s){Fn(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return pn(t,e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;nn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){Dn(t,e,n,s)}}function Kn(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Wn(e,{enableHardwareAcceleration:!1}):new Nn(e,{enableHardwareAcceleration:!0});n.mount(t),b.set(t,n)}function jn(t,e,n){const s=nn(t)?t:g(t);return s.start(en("",s,e,n)),s.animation}function zn(t,e=100){const n=ne({keyframes:[0,e],...t}),s=Math.min(je(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:E(s)}}function $n(t,e,n,s){var r;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(r=s.get(e))&&void 0!==r?r:t}const Hn=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function Un(t,e){return ue(t)?t[Hn(0,t.length,e)]:t}function Yn(t,e,n,s,r,i){!function(t,e,n){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<n&&(u(t,r),s--)}}(t,r,i);for(let o=0;o<e.length;o++)t.push({value:e[o],at:Se(r,i,s[o]),easing:Un(n,o)})}function qn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Xn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Gn(t,e){return e[t]||(e[t]=[]),e[t]}function Zn(t){return Array.isArray(t)?t:[t]}function _n(t,e){return t[e]?{...t,...t[e]}:{...t}}const Jn=t=>"number"==typeof t,Qn=t=>t.every(Jn);function ts(t,e,n,s){const r=w(t,s),i=r.length,o=[];for(let t=0;t<i;t++){const s=r[t];b.has(s)||Kn(s);const a=b.get(s),l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,i)),o.push(...cn(a,{...e,transition:l},{}))}return new S(o)}function es(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s){const r=e.duration||.3,i=new Map,o=new Map,a={},l=new Map;let u=0,c=0,h=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){l.set(i,c);continue}if(!Array.isArray(i)){l.set(i.name,$n(c,i.at,u,l));continue}let[d,p,f={}]=i;void 0!==f.at&&(c=$n(c,f.at,u,l));let m=0;const g=(t,n,s,i=0,o=0)=>{const a=Zn(t),{delay:l=0,times:u=Ne(a),type:d="keyframes",...p}=n;let{ease:f=e.ease||"easeOut",duration:g}=n;const v="function"==typeof l?l(i,o):l,y=a.length;if(y<=2&&"spring"===d){let t=100;if(2===y&&Qn(a)){const e=a[1]-a[0];t=Math.abs(e)}const e={...p};void 0!==g&&(e.duration=C(g));const n=zn(e,t);f=n.ease,g=n.duration}null!=g||(g=r);const w=c+v,b=w+g;1===u.length&&0===u[0]&&(u[1]=1);const x=u.length-a.length;x>0&&We(u,x),1===a.length&&a.unshift(null),Yn(s,a,f,u,w,b),m=Math.max(v+g,m),h=Math.max(b,h)};if(nn(d)){g(p,f,Gn("default",Xn(d,o)))}else{const t=w(d,s,a),e=t.length;for(let n=0;n<e;n++){p=p,f=f;const s=Xn(t[n],o);for(const t in p)g(p[t],_n(f,t),Gn(t,s),n,e)}}u=c,c+=m}return o.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(qn);const a=[],l=[],u=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),l.push(Ve(0,h,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),i.has(s)||i.set(s,{keyframes:{},transition:{}});const c=i.get(s);c.keyframes[r]=a,c.transition[r]={...e,duration:h,ease:u,times:l,...n}}}),i}(t,e,n).forEach(({keyframes:t,transition:e},n)=>{let r;r=nn(n)?jn(n,t.default,e.default):ts(n,t,e),s.push(r)}),new S(s)}const ns=t=>function(e,n,s){let r;var i;return i=e,r=Array.isArray(i)&&Array.isArray(i[0])?es(e,n,t):function(t){return"object"==typeof t&&!Array.isArray(t)}(n)?ts(e,n,s,t):jn(e,n,s),t&&t.animations.push(r),r},ss=ns(),rs=new WeakMap;let is;function os({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=rs.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function as(t){t.forEach(os)}function ls(t,e){is||"undefined"!=typeof ResizeObserver&&(is=new ResizeObserver(as));const n=w(t);return n.forEach(t=>{let n=rs.get(t);n||(n=new Set,rs.set(t,n)),n.add(e),null==is||is.observe(t)}),()=>{n.forEach(t=>{const n=rs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==is||is.unobserve(t)})}}const us=new Set;let cs;function hs(t){return us.add(t),cs||(cs=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};us.forEach(t=>t(e))},window.addEventListener("resize",cs)),()=>{us.delete(t),!us.size&&cs&&(cs=void 0)}}const ds={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ps(t,e,n,s){const r=n[e],{length:i,position:o}=ds[e],a=r.current,l=n.time;r.current=t["scroll"+o],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Ve(0,r.scrollLength,r.current);const u=s-l;r.velocity=u>50?0:h(r.current-a,u)}const fs={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ms={start:0,center:.5,end:1};function gs(t,e,n=0){let s=0;if(t in ms&&(t=ms[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const vs=[0,0];function ys(t,e,n,s){let r=Array.isArray(t)?t:vs,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,ms[t]?t:"0"]),i=gs(r[0],n,s),o=gs(r[1],e),i-o}const ws={x:0,y:0};function bs(t,e,n){const{offset:s=fs.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):ws,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ys(s[t],u[o],l[o],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=De(e[i].offset,Ne(s)),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function xs(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){ps(t,"x",e,n),ps(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&bs(t,n,s)},notify:()=>e(n)}}const Ts=new WeakMap,Vs=new WeakMap,Ss=new WeakMap,As=t=>t===document.documentElement?window:t;function Ms(t,{container:e=document.documentElement,...n}={}){let s=Ss.get(e);s||(s=new Set,Ss.set(e,s));const r=xs(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(r),!Ts.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(a.timestamp)},r=()=>{for(const t of s)t.notify()},o=()=>{i.read(t,!1,!0),i.read(n,!1,!0),i.update(r,!1,!0)};Ts.set(e,o);const c=As(e);window.addEventListener("resize",o,{passive:!0}),e!==document.documentElement&&Vs.set(e,(u=o,"function"==typeof(l=e)?hs(l):ls(l,u))),c.addEventListener("scroll",o,{passive:!0})}var l,u;const c=Ts.get(e);return i.read(c,!1,!0),()=>{var t;o(c);const n=Ss.get(e);if(!n)return;if(n.delete(r),n.size)return;const s=Ts.get(e);Ts.delete(e),s&&(As(e).removeEventListener("scroll",s),null===(t=Vs.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const Ps=new Map;function ks({source:t=document.documentElement,axis:e="y"}={}){Ps.has(t)||Ps.set(t,{});const n=Ps.get(t);return n[e]||(n[e]=V()?new ScrollTimeline({source:t,axis:e}):function({source:t,axis:e="y"}){const n={value:0},s=Ms(t=>{n.value=100*t[e].progress},{container:t,axis:e});return{currentTime:n,cancel:s}}({source:t,axis:e})),n[e]}const Cs={some:0,all:1};const Es=(t,e)=>Math.abs(t-e);const Fs=i,Os=r.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.MotionValue=m,t.animate=ss,t.anticipate=ye,t.backIn=ge,t.backInOut=ve,t.backOut=me,t.cancelFrame=o,t.cancelSync=Os,t.circIn=de,t.circInOut=fe,t.circOut=pe,t.clamp=q,t.createScopedAnimate=ns,t.cubicBezier=ie,t.delay=function(t,e){const n=f.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(o(s),t(i-e))};return i.read(s,!0),()=>o(s)},t.distance=Es,t.distance2D=function(t,e){const n=Es(t.x,e.x),s=Es(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=oe,t.easeInOut=le,t.easeOut=ae,t.frame=i,t.frameData=a,t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const i=w(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof r?r:Cs[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()},t.interpolate=De,t.invariant=y,t.mirrorEasing=ce,t.mix=Le,t.motionValue=g,t.pipe=Te,t.progress=Ve,t.reverseEasing=he,t.scroll=function(t,e){const n=ks(e);return"function"==typeof t?x(t,n):t.attachTimeline(n)},t.scrollInfo=Ms,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=be(s)(l/e)*e}return e+l}},t.steps=l,t.sync=Fs,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=De(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.warning=v,t.wrap=Hn}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t,n=!1;class s{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const r=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:i,cancel:o,state:a,steps:l}=function(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=r.reduce((t,e)=>(t[e]=function(t){let e=new s,n=new s,r=0,i=!1,o=!1;const a=new WeakSet,l={schedule:(t,s=!1,o=!1)=>{const l=o&&i,u=l?e:n;return s&&a.add(t),u.add(t)&&l&&i&&(r=e.order.length),t},cancel:t=>{n.remove(t),a.delete(t)},process:s=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];a.has(r)&&(l.schedule(r),t()),r(s)}i=!1,o&&(o=!1,l.process(s))}}};return l}(()=>n=!0),t),{}),l=t=>{a[t].process(o)},u=()=>{const s=performance.now();n=!1,o.delta=i?1e3/60:Math.max(Math.min(s-o.timestamp,40),1),o.timestamp=s,o.isProcessing=!0,r.forEach(l),o.isProcessing=!1,n&&e&&(i=!1,t(u))};return{schedule:r.reduce((e,s)=>{const r=a[s];return e[s]=(e,s=!1,a=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(u)),r.schedule(e,s,a)),e},{}),cancel:t=>r.forEach(e=>a[e].cancel(t)),state:o,steps:a}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);function u(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class c{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>u(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let r=0;r<s;r++){const s=this.subscriptions[r];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function h(t,e){return e?t*(1e3/e):0}let d;function p(){d=void 0}const f={now:()=>(void 0===d&&f.set(a.isProcessing||n?a.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(p)}};class m{constructor(t,e={}){var n;this.version="11.2.0-alpha.0",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=f.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=f.now()}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new c);const n=this.events[t].add(e);return"change"===t?()=>{n(),i.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=f.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return h(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function g(t,e){return new m(t,e)}let v=e,y=e;function w(t,e,n){var s;if("string"==typeof t){let r=document;e&&(y(Boolean(e.current)),r=e.current),n?(null!==(s=n[t])&&void 0!==s||(n[t]=r.querySelectorAll(t)),t=n[t]):t=r.querySelectorAll(t)}else t instanceof Element&&(t=[t]);return Array.from(t||[])}const b=new WeakMap;function x(t,e){let n;const s=()=>{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return i.update(s,!0),()=>o(s)}function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=T(()=>void 0!==window.ScrollTimeline);class S{constructor(t){this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}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=>{if(!V()||!e.attachTimeline)return e.pause(),x(t=>{e.time=e.duration*t},t);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 duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}stop(){this.runAll("stop")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const A=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],M=new Set(A),P=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),k="data-"+P("framerAppearId"),C=t=>1e3*t,F=t=>t/1e3,E={type:"spring",stiffness:500,damping:25,restSpeed:10},O={type:"keyframes",duration:.8},R={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},B=(t,{keyframes:e})=>e.length>2?O:M.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:E:R;function I(t,e){return t[e]||t.default||t}const L=t=>null!==t;function D(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(L),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}const W=t=>/^0[^.\s]+$/u.test(t);const N=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),K=t=>e=>"string"==typeof e&&e.startsWith(t),j=K("--"),z=K("var(--"),$=t=>!!z(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,U=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y(t,e,n=1){const[s,r]=function(t){const e=U.exec(t);if(!e)return[,];const[,n,s,r]=e;return["--"+(null!=n?n:s),r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return N(t)?parseFloat(t):t}return $(r)?Y(r,e,n+1):r}const q=(t,e,n)=>n>e?e:n<t?t:n,X={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={...X,transform:t=>q(0,1,t)},Z={...X,default:1},_=t=>Math.round(1e5*t)/1e5,J=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function et(t){return"string"==typeof t}const nt=t=>({test:e=>et(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),st=nt("deg"),rt=nt("%"),it=nt("px"),ot=nt("vh"),at=nt("vw"),lt={...rt,parse:t=>rt.parse(t)/100,transform:t=>rt.transform(100*t)},ut=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ct=t=>t===X||t===it,ht=(t,e)=>parseFloat(t.split(", ")[e]),dt=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/u);if(r)return ht(r[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?ht(e[1],t):0}},pt=new Set(["x","y","z"]),ft=A.filter(t=>!pt.has(t));const mt={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:dt(4,13),y:dt(5,14)};mt.translateX=mt.x,mt.translateY=mt.y;const gt=t=>e=>e.test(t),vt=[X,it,rt,st,at,ot,{test:t=>"auto"===t,parse:t=>t}],yt=t=>vt.find(gt(t)),wt=new Set;let bt=!1,xt=!1;function Tt(){if(xt){const t=Array.from(wt).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 ft.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.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])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}xt=!1,bt=!1,wt.forEach(t=>t.complete()),wt.clear()}function Vt(){wt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xt=!0)})}class St{constructor(t,e,n,s,r,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(wt.add(this),bt||(bt=!0,i.read(Vt),i.resolveKeyframes(Tt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r<t.length;r++)if(null===t[r])if(0===r){const r=null==s?void 0:s.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){const s=n.readValue(e,i);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=i),s&&void 0===r&&s.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),wt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,wt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const At=(t,e)=>n=>Boolean(et(n)&&tt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Mt=(t,e,n)=>s=>{if(!et(s))return s;const[r,i,o,a]=s.match(J);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Pt={...X,transform:t=>Math.round((t=>q(0,255,t))(t))},kt={test:At("rgb","red"),parse:Mt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Pt.transform(t)+", "+Pt.transform(e)+", "+Pt.transform(n)+", "+_(G.transform(s))+")"};const Ct={test:At("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:kt.transform},Ft={test:At("hsl","hue"),parse:Mt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+rt.transform(_(e))+", "+rt.transform(_(n))+", "+_(G.transform(s))+")"},Et={test:t=>kt.test(t)||Ct.test(t)||Ft.test(t),parse:t=>kt.test(t)?kt.parse(t):Ft.test(t)?Ft.parse(t):Ct.parse(t),transform:t=>et(t)?t:t.hasOwnProperty("red")?kt.transform(t):Ft.transform(t)};const Ot=/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 Rt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Ot,t=>(Et.test(t)?(s.color.push(i),r.push("color"),n.push(Et.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push("number"),n.push(parseFloat(t))),++i,"${}")).split("${}");return{values:n,split:o,indexes:s,types:r}}function Bt(t){return Rt(t).values}function It(t){const{split:e,types:n}=Rt(t),s=e.length;return t=>{let r="";for(let i=0;i<s;i++)if(r+=e[i],void 0!==t[i]){const e=n[i];r+="number"===e?_(t[i]):"color"===e?Et.transform(t[i]):t[i]}return r}}const Lt=t=>"number"==typeof t?0:t;const Dt={test:function(t){var e,n;return isNaN(t)&&et(t)&&((null===(e=t.match(J))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Q))||void 0===n?void 0:n.length)||0)>0},parse:Bt,createTransformer:It,getAnimatableNone:function(t){const e=Bt(t);return It(t)(e.map(Lt))}},Wt=new Set(["brightness","contrast","saturate","opacity"]);function Nt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(J)||[];if(!s)return t;const r=n.replace(s,"");let i=Wt.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Kt=/\b([a-z-]*)\(.*?\)/gu,jt={...Dt,getAnimatableNone:t=>{const e=t.match(Kt);return e?e.map(Nt).join(" "):t}},zt={...X,transform:Math.round},$t={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:Z,scaleX:Z,scaleY:Z,scaleZ:Z,skew:st,skewX:st,skewY:st,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:G,originX:lt,originY:lt,originZ:it,zIndex:zt,backgroundPositionX:it,backgroundPositionY:it,fillOpacity:G,strokeOpacity:G,numOctaves:zt},Ht={...$t,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:jt,WebkitFilter:jt},Ut=t=>Ht[t];function Yt(t,e){let n=Ut(t);return n!==jt&&(n=Dt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}class qt extends St{constructor(t,e,n,s){super(t,e,n,s,null==s?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){const s=t[n];if("string"==typeof s&&$(s)){const r=Y(s,e.current);void 0!==r&&(t[n]=r),n===t.length-1&&(this.finalKeyframe=s)}}if(!ut.has(n)||2!==t.length)return this.resolveNoneKeyframes();const[s,r]=t,i=yt(s),o=yt(r);if(i!==o)if(ct(i)&&ct(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||W(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,r=void 0;for(;s<t.length&&!r;)"string"==typeof t[s]&&"none"!==t[s]&&"0"!==t[s]&&(r=t[s]),s++;if(r&&n)for(const s of e)t[s]=Yt(n,r)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=mt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Xt=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Dt.test(t)&&"0"!==t||t.startsWith("url(")));class Gt{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,...o},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(Vt(),Tt()),this._resolved}onKeyframesResolved(t,e){this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,s){const r=t[0];if(null===r)return!1;const i=t[t.length-1],o=Xt(r,e),a=Xt(i,e);return!(!o||!a)&&(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"===n&&s)}(t,n,s,r)){if(!i)return null==a||a(D(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Zt(t,e,n){const s=Math.max(e-5,0);return h(n-t(s),e-s)}function _t({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let r,i,o=1-e;o=q(.05,1,o),t=q(.01,10,F(t)),o<1?(r=e=>{const s=e*o,r=s*t;return.001-(s-n)/Jt(e,o)*Math.exp(-r)},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=Jt(Math.pow(e,2),o);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(r,i,5/t);if(t=C(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function Jt(t,e){return t*Math.sqrt(1-e*e)}const Qt=["duration","bounce"],te=["stiffness","damping","mass"];function ee(t,e){return e.some(e=>void 0!==t[e])}function ne({keyframes:t,restDelta:e,restSpeed:n,...s}){const r=t[0],i=t[t.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!ee(t,te)&&ee(t,Qt)){const n=_t(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...s,velocity:-F(s.velocity||0)}),p=h||0,f=l/(2*Math.sqrt(a*u)),m=i-r,g=F(Math.sqrt(a/u)),v=Math.abs(m)<5;let y;if(n||(n=v?.01:2),e||(e=v?.005:.5),f<1){const t=Jt(g,f);y=e=>{const n=Math.exp(-f*g*e);return i-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)y=t=>i-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);y=e=>{const n=Math.exp(-f*g*e),s=Math.min(t*e,300);return i-n*((p+f*g*m)*Math.sinh(s)+t*m*Math.cosh(s))/t}}return{calculatedDuration:d&&c||null,next:t=>{const s=y(t);if(d)o.done=t>=c;else{let r=p;0!==t&&(r=f<1?Zt(y,t,s):0);const a=Math.abs(r)<=n,l=Math.abs(i-s)<=e;o.done=a&&l}return o.value=o.done?i:s,o}}}function se({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,x;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,x=ne({keyframes:[d.value,p(d.value)],velocity:Zt(y,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),T(t)),void 0!==b&&t>=b?x.next(t-b):(!e&&w(t),d)}}}const re=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ie(t,n,s,r){if(t===n&&s===r)return e;const i=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=re(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:re(i(t),n,r)}const oe=ie(.42,0,1,1),ae=ie(0,0,.58,1),le=ie(.42,0,.58,1),ue=t=>Array.isArray(t)&&"number"!=typeof t[0],ce=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,he=t=>e=>1-t(1-e),de=t=>1-Math.sin(Math.acos(t)),pe=he(de),fe=ce(de),me=ie(.33,1.53,.69,.99),ge=he(me),ve=ce(ge),ye=t=>(t*=2)<1?.5*ge(t):.5*(2-Math.pow(2,-10*(t-1))),we={linear:e,easeIn:oe,easeInOut:le,easeOut:ae,circIn:de,circInOut:fe,circOut:pe,backIn:ge,backInOut:ve,backOut:me,anticipate:ye},be=t=>{if(Array.isArray(t)){y(4===t.length);const[e,n,s,r]=t;return ie(e,n,s,r)}return"string"==typeof t?we[t]:t},xe=(t,e)=>n=>e(t(n)),Te=(...t)=>t.reduce(xe),Ve=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},Se=(t,e,n)=>t+(e-t)*n;function Ae(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}const Me=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Pe=[Ct,kt,Ft];function ke(t){const e=(n=t,Pe.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Ft&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Ae(a,s,t+1/3),i=Ae(a,s,t),o=Ae(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const Ce=(t,e)=>{const n=ke(t),s=ke(e),r={...n};return t=>(r.red=Me(n.red,s.red,t),r.green=Me(n.green,s.green,t),r.blue=Me(n.blue,s.blue,t),r.alpha=Se(n.alpha,s.alpha,t),kt.transform(r))};function Fe(t,e){return n=>n>0?e:t}function Ee(t,e){return n=>Se(t,e,n)}function Oe(t){return"number"==typeof t?Ee:"string"==typeof t?$(t)?Fe:Et.test(t)?Ce:Ie:Array.isArray(t)?Re:"object"==typeof t?Et.test(t)?Ce:Be:Fe}function Re(t,e){const n=[...t],s=n.length,r=t.map((t,n)=>Oe(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=r[e](t);return n}}function Be(t,e){const n={...t,...e},s={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(s[r]=Oe(t[r])(t[r],e[r]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Ie=(t,e)=>{const n=Dt.createTransformer(e),s=Rt(t),r=Rt(e);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?Te(Re(function(t,e){var n;const s=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][r[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[i]=l,r[o]++}return s}(s,r),r.values),n):Fe(t,e)};function Le(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Se(t,e,n);return Oe(t)(t,e)}function De(t,n,{clamp:s=!0,ease:r,mixer:i}={}){const o=t.length;if(y(o===n.length),1===o)return()=>n[0];if(2===o&&t[0]===t[1])return()=>n[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const a=function(t,n,s){const r=[],i=s||Le,o=t.length-1;for(let s=0;s<o;s++){let o=i(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Te(t,o)}r.push(o)}return r}(n,r,i),l=a.length,u=e=>{let n=0;if(l>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=Ve(t[n],t[n+1],e);return a[n](s)};return s?e=>u(q(t[0],t[o-1],e)):u}function We(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=Ve(0,e,s);t.push(Se(n,1,r))}}function Ne(t){const e=[0];return We(e,t.length-1),e}function Ke({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=ue(s)?s.map(be):be(s),i={done:!1,value:e[0]},o=De(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ne(e),t),e,{ease:Array.isArray(r)?r:(a=e,l=r,a.map(()=>l||le).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(i.value=o(e),i.done=e>=t,i)}}function je(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const ze=t=>{const e=({timestamp:e})=>t(e);return{start:()=>i.update(e,!0),stop:()=>o(e),now:()=>a.isProcessing?a.timestamp:f.now()}},$e={decay:se,inertia:se,tween:Ke,keyframes:Ke,spring:ne},He=t=>t/100;class Ue extends Gt{constructor({KeyframeResolver:t=St,...e}){super(e),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:n,motionValue:s,keyframes:r}=this.options,i=(t,e)=>this.onKeyframesResolved(t,e);n&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(r,i,n,s):this.resolver=new t(r,i,n,s),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:i=0}=this.options,o=$e[e]||Ke;let a,l;o!==Ke&&"number"!=typeof t[0]&&(a=Te(He,Le(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=je(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=r;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=i)),y=q(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:x}=b;v||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return T&&void 0!==s&&(b.value=D(a,this.options,s)),m&&m(b.value),T&&this.finish(),b}get duration(){const{resolved:t}=this;return t?F(t.calculatedDuration):0}get time(){return F(this.currentTime)}set time(t){t=C(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=F(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ze,onPlay:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ye=t=>Array.isArray(t)&&"number"==typeof t[0];function qe(t){return Boolean(!t||"string"==typeof t&&t in Ge||Ye(t)||Array.isArray(t)&&t.every(qe))}const Xe=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xe([0,.65,.55,1]),circOut:Xe([.55,0,1,.45]),backIn:Xe([.31,.01,.66,-.59]),backOut:Xe([.33,1.53,.69,.99])};function Ze(t){return _e(t)||Ge.easeOut}function _e(t){return t?Ye(t)?Xe(t):Array.isArray(t)?t.map(Ze):Ge[t]:void 0}const Je=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Qe=new Set(["opacity","clipPath","filter","transform"]);class tn extends Gt{constructor(t){super(t);const{name:e,motionValue:n,keyframes:s}=this.options;this.resolver=new qt(s,(t,e)=>this.onKeyframesResolved(t,e),e,n),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:r,ease:i,type:o,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||"backgroundColor"===u.name||!qe(u.ease)){const{onComplete:e,onUpdate:n,motionValue:a,...l}=this.options,u=function(t,e){const n=new Ue({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,l);1===(t=u.keyframes).length&&(t[1]=t[0]),s=u.duration,r=u.times,i=u.ease,o="keyframes"}var u;const c=function(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=_e(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"})}(a.owner.current,l,t,{...this.options,duration:s,times:r,ease:i});return c.startTime=f.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(D(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:r,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return F(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return F(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=C(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;s.timeline=t,s.onfinish=null}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:r,ease:i,times:o}=t;if("idle"!==e.playState&&"finished"!==e.playState){if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,...l}=this.options,u=new Ue({...l,keyframes:n,duration:s,type:r,ease:i,times:o,isGenerator:!0}),c=C(this.time);t.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}this.cancel()}}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;return Je()&&n&&Qe.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const en=(t,e,n,s={},r,o)=>a=>{const l=I(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=C(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||(h={...h,...B(t,h)}),h.duration&&(h.duration=C(h.duration)),h.repeatDelay&&(h.repeatDelay=C(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),d&&!o&&void 0!==e.get()){const t=D(h.keyframes,l);if(void 0!==t)return void i.update(()=>{h.onUpdate(t),h.onComplete()})}return!o&&tn.supports(h)?new tn(h):new Ue(h)},nn=t=>Boolean(t&&t.getVelocity);function sn(t){return Boolean(nn(t)&&t.add)}const rn=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function on(t,e,n,s={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),e}function an(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,g(n))}function ln(t,e){const n=function(t,e,n){const s=t.getProps();return on(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}(t,e);let{transitionEnd:s={},transitionFrom:r,transition:i={},...o}=n||{};o={...o,...s};for(const e in o){an(t,e,rn(o[e]))}}function un({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function cn(t,e,{delay:n=0,transitionOverride:s,type:r}={}){var o;let{transition:a=t.getDefaultTransition(),transitionFrom:l,transitionEnd:u,...c}=e;const h=t.getValue("willChange");s&&(a=s);const d=[],p=r&&t.animationState&&t.animationState.getState()[r];for(const e in c){const s=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),i=c[e];if(void 0===i||p&&un(p,e))continue;let u;if(l)if(s.currentAnimationState)u=l[s.currentAnimationState];else{u=l[t.getProps().initial||"animate"===r?"initial":"animate"]}const f={delay:n,elapsed:0,...I(u||a||{},e)};let m=!1;if(window.HandoffAppearAnimations){const n=t.getProps()[k];if(n){const t=window.HandoffAppearAnimations(n,e);null!==t&&(f.elapsed=t,m=!0)}}s.start(en(e,s,i,t.shouldReduceMotion&&M.has(e)?{type:!1}:f,t,m)),s.currentAnimationState=r||"animate";const g=s.animation;g&&(sn(h)&&(h.add(e),g.then(()=>h.remove(e))),d.push(g))}return u&&Promise.all(d).then(()=>{i.update(()=>{u&&ln(t,u)})}),d}const hn={};function dn(t,{layout:e,layoutId:n}){return M.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!hn[t]||"opacity"===t)}function pn(t,e,n){var s;const{style:r}=t,i={};for(const o in r)(nn(r[o])||e.style&&nn(e.style[o])||dn(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(i[o]=r[o]);return i}const fn="undefined"!=typeof document,mn={current:null},gn={current:!1};function vn(t){return"string"==typeof t||Array.isArray(t)}const yn=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function wn(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||yn.some(e=>vn(t[e]));var e}const bn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},xn={};for(const t in bn)xn[t]={isEnabled:e=>bn[t].some(t=>!!e[t])};const Tn=[...vt,Et,Dt],Vn=Object.keys(xn),Sn=Vn.length,An=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Mn=yn.length;class Pn extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.resolveKeyframes=(t,e,n,s)=>new this.KeyframeResolver(t,e,n,s,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=St,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>i.render(this.render,!1,!0);const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=wn(e),this.isVariantNode=function(t){return Boolean(wn(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&nn(e)&&(e.set(l[t],!1),sn(c)&&c.add(t))}}mount(t){this.current=t,b.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),gn.current||function(){if(gn.current=!0,fn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mn.current=t.matches;t.addListener(e),e()}else mn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||mn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var t;b.delete(this.current),this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const e in this.features)null===(t=this.features[e])||void 0===t||t.unmount();this.current=null}bindToMotionValue(t,e){const n=M.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&i.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,r){let i,o;for(let t=0;t<Sn;t++){const n=Vn[t],{isEnabled:s,Feature:r,ProjectionNode:a,MeasureLayout:l}=xn[n];a&&(i=a),s(e)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),l&&(o=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&i){this.projection=new i(this.latestValues,function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(this.parent));const{layoutId:t,layout:n,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||o&&(a=o,a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}var a;return o}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<An.length;e++){const n=An[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){const{willChange:s}=e;for(const r in e){const i=e[r],o=n[r];if(nn(i))t.addValue(r,i),sn(s)&&s.add(r);else if(nn(o))t.addValue(r,g(i,{owner:t})),sn(s)&&s.remove(r);else if(o!==i)if(t.hasValue(r)){const e=t.getValue(r);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,g(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Mn;t++){const n=yn[t],s=this.props[n];(vn(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=g(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var r;return null!=s&&("string"==typeof s&&(N(s)||W(s))?s=parseFloat(s):(r=s,!Tn.find(gt(r))&&Dt.test(e)&&(s=Yt(t,e))),this.setBaseTarget(t,nn(s)?s.get():s)),nn(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const r=on(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);r&&(s=r[t])}if(n&&void 0!==s)return s;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||nn(r)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new c),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=qt}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}}const kn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cn=A.length;const Fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function En(t,e,n,s){const{style:r,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(j(t)){i[t]=n;continue}const s=$t[t],h=Fn(n,s);if(M.has(t)){if(l=!0,o[t]=h,!c)continue;n!==(s.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=h):r[t]=h}if(e.transform||(l||s?r.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,r){let i="";for(let e=0;e<Cn;e++){const n=A[e];if(void 0!==t[n]){i+=`${kn[n]||n}(${t[n]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),r?i=r(t,s?"":i):n&&s&&(i="none"),i}(t.transform,n,c,s):r.transform&&(r.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;r.transformOrigin=`${t} ${e} ${n}`}}function On(t,e,n){return"string"==typeof t?t:it.transform(e+n*t)}const Rn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bn={offset:"strokeDashoffset",array:"strokeDasharray"};function In(t,{attrX:e,attrY:n,attrScale:s,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h,d){if(En(t,u,c,d),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:f,dimensions:m}=t;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==r||void 0!==i||f.transform)&&(f.transformOrigin=function(t,e,n){return`${On(e,t.x,t.width)} ${On(n,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==i?i:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==s&&(p.scale=s),void 0!==o&&function(t,e,n=1,s=0,r=!0){t.pathLength=1;const i=r?Rn:Bn;t[i.offset]=it.transform(-s);const o=it.transform(e),a=it.transform(n);t[i.array]=`${o} ${a}`}(p,o,a,l,!1)}const Ln=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Dn(t,{style:e,vars:n},s,r){Object.assign(t.style,e,r&&r.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class Wn extends Pn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(M.has(e)){const t=Ut(e);return t&&t.default||0}return e=Ln.has(e)?e:P(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=pn(t,e,n);for(const n in t)if(nn(t[n])||nn(e[n])){s[-1!==A.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}build(t,e,n,s){In(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Dn(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Ln.has(n)?n:P(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class Nn extends Pn{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(M.has(e)){const t=Ut(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),r=(j(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,s){En(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return pn(t,e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;nn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){Dn(t,e,n,s)}}function Kn(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Wn(e,{enableHardwareAcceleration:!1}):new Nn(e,{enableHardwareAcceleration:!0});n.mount(t),b.set(t,n)}function jn(t,e,n){const s=nn(t)?t:g(t);return s.start(en("",s,e,n)),s.animation}function zn(t,e=100){const n=ne({keyframes:[0,e],...t}),s=Math.min(je(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:F(s)}}function $n(t,e,n,s){var r;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(r=s.get(e))&&void 0!==r?r:t}const Hn=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function Un(t,e){return ue(t)?t[Hn(0,t.length,e)]:t}function Yn(t,e,n,s,r,i){!function(t,e,n){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<n&&(u(t,r),s--)}}(t,r,i);for(let o=0;o<e.length;o++)t.push({value:e[o],at:Se(r,i,s[o]),easing:Un(n,o)})}function qn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Xn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Gn(t,e){return e[t]||(e[t]=[]),e[t]}function Zn(t){return Array.isArray(t)?t:[t]}function _n(t,e){return t[e]?{...t,...t[e]}:{...t}}const Jn=t=>"number"==typeof t,Qn=t=>t.every(Jn);function ts(t,e,n,s){const r=w(t,s),i=r.length,o=[];for(let t=0;t<i;t++){const s=r[t];b.has(s)||Kn(s);const a=b.get(s),l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,i)),o.push(...cn(a,{...e,transition:l},{}))}return new S(o)}function es(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s){const r=e.duration||.3,i=new Map,o=new Map,a={},l=new Map;let u=0,c=0,h=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){l.set(i,c);continue}if(!Array.isArray(i)){l.set(i.name,$n(c,i.at,u,l));continue}let[d,p,f={}]=i;void 0!==f.at&&(c=$n(c,f.at,u,l));let m=0;const g=(t,n,s,i=0,o=0)=>{const a=Zn(t),{delay:l=0,times:u=Ne(a),type:d="keyframes",...p}=n;let{ease:f=e.ease||"easeOut",duration:g}=n;const v="function"==typeof l?l(i,o):l,y=a.length;if(y<=2&&"spring"===d){let t=100;if(2===y&&Qn(a)){const e=a[1]-a[0];t=Math.abs(e)}const e={...p};void 0!==g&&(e.duration=C(g));const n=zn(e,t);f=n.ease,g=n.duration}null!=g||(g=r);const w=c+v,b=w+g;1===u.length&&0===u[0]&&(u[1]=1);const x=u.length-a.length;x>0&&We(u,x),1===a.length&&a.unshift(null),Yn(s,a,f,u,w,b),m=Math.max(v+g,m),h=Math.max(b,h)};if(nn(d)){g(p,f,Gn("default",Xn(d,o)))}else{const t=w(d,s,a),e=t.length;for(let n=0;n<e;n++){p=p,f=f;const s=Xn(t[n],o);for(const t in p)g(p[t],_n(f,t),Gn(t,s),n,e)}}u=c,c+=m}return o.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(qn);const a=[],l=[],u=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),l.push(Ve(0,h,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),i.has(s)||i.set(s,{keyframes:{},transition:{}});const c=i.get(s);c.keyframes[r]=a,c.transition[r]={...e,duration:h,ease:u,times:l,...n}}}),i}(t,e,n).forEach(({keyframes:t,transition:e},n)=>{let r;r=nn(n)?jn(n,t.default,e.default):ts(n,t,e),s.push(r)}),new S(s)}const ns=t=>function(e,n,s){let r;var i;return i=e,r=Array.isArray(i)&&Array.isArray(i[0])?es(e,n,t):function(t){return"object"==typeof t&&!Array.isArray(t)}(n)?ts(e,n,s,t):jn(e,n,s),t&&t.animations.push(r),r},ss=ns(),rs=new WeakMap;let is;function os({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=rs.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function as(t){t.forEach(os)}function ls(t,e){is||"undefined"!=typeof ResizeObserver&&(is=new ResizeObserver(as));const n=w(t);return n.forEach(t=>{let n=rs.get(t);n||(n=new Set,rs.set(t,n)),n.add(e),null==is||is.observe(t)}),()=>{n.forEach(t=>{const n=rs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==is||is.unobserve(t)})}}const us=new Set;let cs;function hs(t){return us.add(t),cs||(cs=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};us.forEach(t=>t(e))},window.addEventListener("resize",cs)),()=>{us.delete(t),!us.size&&cs&&(cs=void 0)}}const ds={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ps(t,e,n,s){const r=n[e],{length:i,position:o}=ds[e],a=r.current,l=n.time;r.current=t["scroll"+o],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Ve(0,r.scrollLength,r.current);const u=s-l;r.velocity=u>50?0:h(r.current-a,u)}const fs={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ms={start:0,center:.5,end:1};function gs(t,e,n=0){let s=0;if(t in ms&&(t=ms[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const vs=[0,0];function ys(t,e,n,s){let r=Array.isArray(t)?t:vs,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,ms[t]?t:"0"]),i=gs(r[0],n,s),o=gs(r[1],e),i-o}const ws={x:0,y:0};function bs(t,e,n){const{offset:s=fs.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):ws,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ys(s[t],u[o],l[o],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=De(e[i].offset,Ne(s)),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function xs(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){ps(t,"x",e,n),ps(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&bs(t,n,s)},notify:()=>e(n)}}const Ts=new WeakMap,Vs=new WeakMap,Ss=new WeakMap,As=t=>t===document.documentElement?window:t;function Ms(t,{container:e=document.documentElement,...n}={}){let s=Ss.get(e);s||(s=new Set,Ss.set(e,s));const r=xs(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(r),!Ts.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(a.timestamp)},r=()=>{for(const t of s)t.notify()},o=()=>{i.read(t,!1,!0),i.read(n,!1,!0),i.update(r,!1,!0)};Ts.set(e,o);const c=As(e);window.addEventListener("resize",o,{passive:!0}),e!==document.documentElement&&Vs.set(e,(u=o,"function"==typeof(l=e)?hs(l):ls(l,u))),c.addEventListener("scroll",o,{passive:!0})}var l,u;const c=Ts.get(e);return i.read(c,!1,!0),()=>{var t;o(c);const n=Ss.get(e);if(!n)return;if(n.delete(r),n.size)return;const s=Ts.get(e);Ts.delete(e),s&&(As(e).removeEventListener("scroll",s),null===(t=Vs.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const Ps=new Map;function ks({source:t=document.documentElement,axis:e="y"}={}){Ps.has(t)||Ps.set(t,{});const n=Ps.get(t);return n[e]||(n[e]=V()?new ScrollTimeline({source:t,axis:e}):function({source:t,axis:e="y"}){const n={value:0},s=Ms(t=>{n.value=100*t[e].progress},{container:t,axis:e});return{currentTime:n,cancel:s}}({source:t,axis:e})),n[e]}const Cs={some:0,all:1};const Fs=(t,e)=>Math.abs(t-e);const Es=i,Os=r.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.MotionValue=m,t.animate=ss,t.anticipate=ye,t.backIn=ge,t.backInOut=ve,t.backOut=me,t.cancelFrame=o,t.cancelSync=Os,t.circIn=de,t.circInOut=fe,t.circOut=pe,t.clamp=q,t.createScopedAnimate=ns,t.cubicBezier=ie,t.delay=function(t,e){const n=f.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(o(s),t(i-e))};return i.read(s,!0),()=>o(s)},t.distance=Fs,t.distance2D=function(t,e){const n=Fs(t.x,e.x),s=Fs(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=oe,t.easeInOut=le,t.easeOut=ae,t.frame=i,t.frameData=a,t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const i=w(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof r?r:Cs[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()},t.interpolate=De,t.invariant=y,t.mirrorEasing=ce,t.mix=Le,t.motionValue=g,t.pipe=Te,t.progress=Ve,t.reverseEasing=he,t.scroll=function(t,e){const n=ks(e);return"function"==typeof t?x(t,n):t.attachTimeline(n)},t.scrollInfo=Ms,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=be(s)(l/e)*e}return e+l}},t.steps=l,t.sync=Es,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=De(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.warning=v,t.wrap=Hn}));
|
|
@@ -19,7 +19,7 @@ function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
|
|
|
19
19
|
}
|
|
20
20
|
function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {
|
|
21
21
|
var _a;
|
|
22
|
-
let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
|
|
22
|
+
let { transition = visualElement.getDefaultTransition(), transitionFrom, transitionEnd, ...target } = targetAndTransition;
|
|
23
23
|
const willChange = visualElement.getValue("willChange");
|
|
24
24
|
if (transitionOverride)
|
|
25
25
|
transition = transitionOverride;
|
|
@@ -35,10 +35,23 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
|
|
|
35
35
|
shouldBlockAnimation(animationTypeState, key))) {
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
|
+
let transitionFromType;
|
|
39
|
+
if (transitionFrom) {
|
|
40
|
+
if (value.currentAnimationState) {
|
|
41
|
+
transitionFromType = transitionFrom[value.currentAnimationState];
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// This is the first time the value has been animated.
|
|
45
|
+
const initialType = visualElement.getProps().initial || type === "animate"
|
|
46
|
+
? "initial"
|
|
47
|
+
: "animate";
|
|
48
|
+
transitionFromType = transitionFrom[initialType];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
38
51
|
const valueTransition = {
|
|
39
52
|
delay,
|
|
40
53
|
elapsed: 0,
|
|
41
|
-
...getValueTransition(transition || {}, key),
|
|
54
|
+
...getValueTransition(transitionFromType || transition || {}, key),
|
|
42
55
|
};
|
|
43
56
|
/**
|
|
44
57
|
* If this is the first time a value is being animated, check
|
|
@@ -59,6 +72,7 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
|
|
|
59
72
|
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key)
|
|
60
73
|
? { type: false }
|
|
61
74
|
: valueTransition, visualElement, isHandoff));
|
|
75
|
+
value.currentAnimationState = type || "animate";
|
|
62
76
|
const animation = value.animation;
|
|
63
77
|
if (animation) {
|
|
64
78
|
if (isWillChangeMotionValue(willChange)) {
|
|
@@ -54,7 +54,7 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
54
54
|
const resolved = resolveVariantFromProps(props, definition);
|
|
55
55
|
if (!resolved)
|
|
56
56
|
return;
|
|
57
|
-
const { transitionEnd, transition, ...target } = resolved;
|
|
57
|
+
const { transitionEnd, transitionFrom, transition, ...target } = resolved;
|
|
58
58
|
for (const key in target) {
|
|
59
59
|
let valueTarget = target[key];
|
|
60
60
|
if (Array.isArray(valueTarget)) {
|
|
@@ -25,7 +25,7 @@ function createAnimationState(visualElement) {
|
|
|
25
25
|
? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
|
|
26
26
|
: undefined);
|
|
27
27
|
if (resolved) {
|
|
28
|
-
const { transition, transitionEnd, ...target } = resolved;
|
|
28
|
+
const { transition, transitionEnd, transitionFrom, ...target } = resolved;
|
|
29
29
|
acc = { ...acc, ...target, ...transitionEnd };
|
|
30
30
|
}
|
|
31
31
|
return acc;
|
|
@@ -257,7 +257,16 @@ function createAnimationState(visualElement) {
|
|
|
257
257
|
// @ts-expect-error - @mattgperry to figure if we should do something here
|
|
258
258
|
fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;
|
|
259
259
|
});
|
|
260
|
-
|
|
260
|
+
const { initial } = props;
|
|
261
|
+
if (initial && typeof initial !== "boolean") {
|
|
262
|
+
const { transition, transitionFrom } = resolveVariant(visualElement, Array.isArray(initial) ? initial[0] : initial) || {};
|
|
263
|
+
fallbackAnimation.transition = transition;
|
|
264
|
+
fallbackAnimation.transitionFrom = transitionFrom;
|
|
265
|
+
}
|
|
266
|
+
animations.push({
|
|
267
|
+
animation: fallbackAnimation,
|
|
268
|
+
options: { type: "initial" },
|
|
269
|
+
});
|
|
261
270
|
}
|
|
262
271
|
let shouldAnimate = Boolean(animations.length);
|
|
263
272
|
if (isInitialRender &&
|
|
@@ -22,7 +22,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
22
22
|
* and warn against mismatches.
|
|
23
23
|
*/
|
|
24
24
|
if (process.env.NODE_ENV === "development") {
|
|
25
|
-
warnOnce(nextValue.version === "11.
|
|
25
|
+
warnOnce(nextValue.version === "11.2.0-alpha.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.0-alpha.0 may not work as expected.`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
else if (isMotionValue(prevValue)) {
|
|
@@ -16,7 +16,7 @@ function setMotionValue(visualElement, key, value) {
|
|
|
16
16
|
}
|
|
17
17
|
function setTarget(visualElement, definition) {
|
|
18
18
|
const resolved = resolveVariant(visualElement, definition);
|
|
19
|
-
let { transitionEnd = {}, transition = {}, ...target } = resolved || {};
|
|
19
|
+
let { transitionEnd = {}, transitionFrom, transition = {}, ...target } = resolved || {};
|
|
20
20
|
target = { ...target, ...transitionEnd };
|
|
21
21
|
for (const key in target) {
|
|
22
22
|
const value = resolveFinalValueInKeyframes(target[key]);
|
package/dist/es/value/index.mjs
CHANGED
|
@@ -34,7 +34,7 @@ class MotionValue {
|
|
|
34
34
|
* This will be replaced by the build step with the latest version number.
|
|
35
35
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
36
36
|
*/
|
|
37
|
-
this.version = "11.
|
|
37
|
+
this.version = "11.2.0-alpha.0";
|
|
38
38
|
/**
|
|
39
39
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
40
40
|
* if the value is numerical, but we might be able to widen the scope here and support
|