framer-motion 8.3.2 → 8.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -6
- package/dist/es/gestures/use-hover-gesture.mjs +1 -4
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +3 -6
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +2 -2
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/package.json +2 -2
package/dist/projection.dev.js
CHANGED
|
@@ -1901,7 +1901,7 @@
|
|
|
1901
1901
|
* This will be replaced by the build step with the latest version number.
|
|
1902
1902
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
1903
1903
|
*/
|
|
1904
|
-
this.version = "8.3.
|
|
1904
|
+
this.version = "8.3.3";
|
|
1905
1905
|
/**
|
|
1906
1906
|
* Duration, in milliseconds, since last updating frame.
|
|
1907
1907
|
*
|
|
@@ -5062,7 +5062,7 @@
|
|
|
5062
5062
|
* and warn against mismatches.
|
|
5063
5063
|
*/
|
|
5064
5064
|
{
|
|
5065
|
-
warnOnce(nextValue.version === "8.3.
|
|
5065
|
+
warnOnce(nextValue.version === "8.3.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.3.3 may not work as expected.`);
|
|
5066
5066
|
}
|
|
5067
5067
|
}
|
|
5068
5068
|
else if (isMotionValue(prevValue)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as t,useId as e,useEffect as n,useCallback as r,useMemo as s,useRef as o,createElement as i}from"react";import{P as a,q as l,t as u,u as c,v as h,w as p,x as d,y as f,z as m,A as v,B as g,C as y,D as V,E as b,F as w,r as A,G as C,d as M,H as S,I as x,n as T,J as E,c as P,K as k,i as F,f as I,b as O,m as D,a as N,L as B,g as R,p as j,M as U,N as L,s as z,h as $,o as q,j as H,k as W}from"./size-rollup-dom-animation-assets.js";function K(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const G=t=>/^0[^.\s]+$/.test(t),Y={delta:0,timestamp:0},X="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Z="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(X()),1/60*1e3);let J=!0,_=!1,Q=!1;const tt=["read","update","preRender","render","postRender"],et=tt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,s=!1,o=!1;const i=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&s,u=l?e:n;return o&&i.add(t),-1===u.indexOf(t)&&(u.push(t),l&&s&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:l=>{if(s)o=!0;else{if(s=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(l),i.has(r)&&(a.schedule(r),t())}s=!1,o&&(o=!1,a.process(l))}}};return a}(()=>_=!0),t),{}),nt=tt.reduce((t,e)=>{const n=et[e];return t[e]=(t,e=!1,r=!1)=>(_||it(),n.schedule(t,e,r)),t},{}),rt=tt.reduce((t,e)=>(t[e]=et[e].cancel,t),{});tt.reduce((t,e)=>(t[e]=()=>et[e].process(Y),t),{});const st=t=>et[t].process(Y),ot=t=>{_=!1,Y.delta=J?1/60*1e3:Math.max(Math.min(t-Y.timestamp,40),1),Y.timestamp=t,Q=!0,tt.forEach(st),Q=!1,_&&(J=!1,Z(ot))},it=()=>{_=!0,J=!0,Q||Z(ot)};class at{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let s=0;s<r;s++){const r=this.subscriptions[s];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lt(t,e){return e?t*(1e3/e):0}class ut{constructor(t,e={}){var n;this.version="8.3.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=Y;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,nt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>nt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new at);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.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=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?lt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ct(t,e){return new ut(t,e)}const ht=(t,e)=>n=>Boolean(l(n)&&u.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),pt=(t,e,n)=>r=>{if(!l(r))return r;const[s,o,i,a]=r.match(c);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},dt={...d,transform:t=>Math.round((t=>f(0,255,t))(t))},ft={test:ht("rgb","red"),parse:pt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+dt.transform(t)+", "+dt.transform(e)+", "+dt.transform(n)+", "+h(p.transform(r))+")"};const mt={test:ht("#"),parse:function(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:ft.transform},vt={test:ht("hsl","hue"),parse:pt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+m.transform(h(e))+", "+m.transform(h(n))+", "+h(p.transform(r))+")"},gt={test:t=>ft.test(t)||mt.test(t)||vt.test(t),parse:t=>ft.test(t)?ft.parse(t):vt.test(t)?vt.parse(t):mt.parse(t),transform:t=>l(t)?t:t.hasOwnProperty("red")?ft.transform(t):vt.transform(t)};function yt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,r=0;const s=t.match(v);s&&(n=s.length,t=t.replace(v,"${c}"),e.push(...s.map(gt.parse)));const o=t.match(c);return o&&(r=o.length,t=t.replace(c,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,numNumbers:r,tokenised:t}}function Vt(t){return yt(t).values}function bt(t){const{values:e,numColors:n,tokenised:r}=yt(t),s=e.length;return t=>{let e=r;for(let r=0;r<s;r++)e=e.replace(r<n?"${c}":"${n}",r<n?gt.transform(t[r]):h(t[r]));return e}}const wt=t=>"number"==typeof t?0:t;const At={test:function(t){var e,n;return isNaN(t)&&l(t)&&((null===(e=t.match(c))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(v))||void 0===n?void 0:n.length)||0)>0},parse:Vt,createTransformer:bt,getAnimatableNone:function(t){const e=Vt(t);return bt(t)(e.map(wt))}},Ct=new Set(["brightness","contrast","saturate","opacity"]);function Mt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(c)||[];if(!r)return t;const s=n.replace(r,"");let o=Ct.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+s+")"}const St=/([a-z-]*)\(.*?\)/g,xt={...At,getAnimatableNone:t=>{const e=t.match(St);return e?e.map(Mt).join(" "):t}},Tt={...g,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:xt,WebkitFilter:xt},Et=t=>Tt[t];function Pt(t,e){var n;let r=Et(t);return r!==xt&&(r=At),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const kt=t=>e=>e.test(t),Ft=[d,y,m,V,b,w,{test:t=>"auto"===t,parse:t=>t}],It=t=>Ft.find(kt(t)),Ot=[...Ft,gt,At],Dt=t=>Ot.find(kt(t));function Nt(t,e,n){const r=t.getProps();return A(r,e,void 0!==n?n:r.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))}function Bt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ct(n))}function Rt(t,e){if(!e)return;return(e[t]||e.default||e).from}function jt(t){return Boolean(M(t)&&t.add)}function Ut(t,e){const{MotionAppearAnimations:n}=window,r=((t,e)=>`${t}: ${e}`)(t,S.has(e)?"transform":e),s=n&&n.get(r);return s?(nt.render(()=>{try{s.cancel(),n.delete(r)}catch(t){}}),s.currentTime||0):0}const Lt="data-"+x("framerAppearId");const zt=t=>1e3*t,$t=!1,qt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ht=t=>e=>1-t(1-e),Wt=t=>t*t,Kt=Ht(Wt),Gt=qt(Wt),Yt=(t,e,n)=>-n*t+n*e+t;function Xt(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 Zt=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},Jt=[mt,ft,vt];function _t(t){const e=(n=t,Jt.find(t=>t.test(n)));var n;let r=e.parse(t);return e===vt&&(r=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let s=0,o=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;s=Xt(a,r,t+1/3),o=Xt(a,r,t),i=Xt(a,r,t-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(r)),r}const Qt=(t,e)=>{const n=_t(t),r=_t(e),s={...n};return t=>(s.red=Zt(n.red,r.red,t),s.green=Zt(n.green,r.green,t),s.blue=Zt(n.blue,r.blue,t),s.alpha=Yt(n.alpha,r.alpha,t),ft.transform(s))},te=(t,e)=>n=>e(t(n)),ee=(...t)=>t.reduce(te);function ne(t,e){return"number"==typeof t?n=>Yt(t,e,n):gt.test(t)?Qt(t,e):oe(t,e)}const re=(t,e)=>{const n=[...t],r=n.length,s=t.map((t,n)=>ne(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=s[e](t);return n}},se=(t,e)=>{const n={...t,...e},r={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(r[s]=ne(t[s],e[s]));return t=>{for(const e in r)n[e]=r[e](t);return n}},oe=(t,e)=>{const n=At.createTransformer(e),r=yt(t),s=yt(e);return r.numColors===s.numColors&&r.numNumbers>=s.numNumbers?ee(re(r.values,s.values),n):n=>""+(n>0?e:t)},ie=(t,e)=>n=>Yt(t,e,n);function ae(t,e,n){const r=[],s=n||("number"==typeof(o=t[0])?ie:"string"==typeof o?gt.test(o)?Qt:oe:Array.isArray(o)?re:"object"==typeof o?se:ie);var o;const i=t.length-1;for(let n=0;n<i;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=ee(t,o)}r.push(o)}return r}function le(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const o=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const i=ae(e,r,s),a=i.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=((t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r})(t[n],t[n+1],e);return i[n](r)};return n?e=>l(f(t[0],t[o-1],e)):l}const ue=t=>t,ce=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function he(t,e,n,r){if(t===e&&n===r)return ue;const s=e=>function(t,e,n,r,s){let o,i,a=0;do{i=e+(n-e)/2,o=ce(i,r,s)-t,o>0?n=i:e=i}while(Math.abs(o)>1e-7&&++a<12);return i}(e,0,1,t,n);return t=>0===t||1===t?t:ce(s(t),e,r)}const pe=t=>1-Math.sin(Math.acos(t)),de=Ht(pe),fe=qt(de),me=he(.33,1.53,.69,.99),ve=Ht(me),ge=qt(ve),ye={linear:ue,easeIn:Wt,easeInOut:Gt,easeOut:Kt,circIn:pe,circInOut:fe,circOut:de,backIn:ve,backInOut:ge,backOut:me,anticipate:t=>(t*=2)<1?.5*ve(t):.5*(2-Math.pow(2,-10*(t-1)))},Ve=t=>{if(Array.isArray(t)){t.length;const[e,n,r,s]=t;return he(e,n,r,s)}return"string"==typeof t?ye[t]:t};function be({keyframes:t,ease:e=Gt,times:n,duration:r=300}){t=[...t];const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Ve):Ve(e),o={done:!1,value:t[0]},i=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),r);function a(){return le(i,t,{ease:Array.isArray(s)?s:(e=t,n=s,e.map(()=>n||Gt).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=r,o),flipTarget:()=>{t.reverse(),l=a()}}}function we({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,o,i=1-e;i=f(.05,1,i),t=f(.01,10,t/1e3),i<1?(s=e=>{const r=e*i,s=r*t;return.001-(r-n)/Ae(e,i)*Math.exp(-s)},o=e=>{const r=e*i*t,o=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=Ae(Math.pow(e,2),i);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(s,o,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function Ae(t,e){return t*Math.sqrt(1-e*e)}const Ce=["duration","bounce"],Me=["stiffness","damping","mass"];function Se(t,e){return e.some(e=>void 0!==t[e])}function xe({keyframes:t,restSpeed:e=2,restDelta:n=.01,...r}){let s=t[0],o=t[t.length-1];const i={done:!1,value:s},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Se(t,Me)&&Se(t,Ce)){const n=we(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r);let d=Te,f=c?-c/1e3:0;const m=l/(2*Math.sqrt(a*u));function v(){const t=o-s,e=Math.sqrt(a/u)/1e3;if(void 0===n&&(n=Math.min(Math.abs(o-s)/100,.4)),m<1){const n=Ae(e,m);d=r=>{const s=Math.exp(-m*e*r);return o-s*((f+m*e*t)/n*Math.sin(n*r)+t*Math.cos(n*r))}}else if(1===m)d=n=>o-Math.exp(-e*n)*(t+(f+e*t)*n);else{const n=e*Math.sqrt(m*m-1);d=r=>{const s=Math.exp(-m*e*r),i=Math.min(n*r,300);return o-s*((f+m*e*t)*Math.sinh(i)+n*t*Math.cosh(i))/n}}}return v(),{next:t=>{const r=d(t);if(p)i.done=t>=h;else{let s=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);s=lt(r-d(e),t-e)}else s=0;const a=Math.abs(s)<=e,l=Math.abs(o-r)<=n;i.done=a&&l}return i.value=i.done?o:r,i},flipTarget:()=>{f=-f,[s,o]=[o,s],v()}}}xe.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Te=t=>0;const Ee={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:r=350,restDelta:s=.5,modifyTarget:o}){const i=t[0],a={done:!1,value:i};let l=n*e;const u=i+l,c=void 0===o?u:o(u);return c!==u&&(l=c-i),{next:t=>{const e=-l*Math.exp(-t/r);return a.done=!(e>s||e<-s),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:be,tween:be,spring:xe};function Pe(t,e,n=0){return t-e-n}const ke=t=>{const e=({delta:e})=>t(e);return{start:()=>nt.update(e,!0),stop:()=>rt.update(e)}};function Fe({duration:t,driver:e=ke,elapsed:n=0,repeat:r=0,repeatType:s="loop",repeatDelay:o=0,keyframes:i,autoplay:a=!0,onPlay:l,onStop:u,onComplete:c,onRepeat:h,onUpdate:p,type:d="keyframes",...f}){var m,v;const g=n;let y,V,b=0,w=t,A=!1,C=!0;const M=Ee[i.length>2?"keyframes":d]||be,S=i[0],x=i[i.length-1];let T={done:!1,value:S};(null===(v=(m=M).needsInterpolation)||void 0===v?void 0:v.call(m,S,x))&&(V=le([0,100],[S,x],{clamp:!1}),i=[0,100]);const E=M({...f,duration:t,keyframes:i});function P(){b++,"reverse"===s?(C=b%2==0,n=function(t,e=0,n=0,r=!0){return r?Pe(e+-t,e,n):e-(t-e)+n}(n,w,o,C)):(n=Pe(n,w,o),"mirror"===s&&E.flipTarget()),A=!1,h&&h()}function k(t){C||(t=-t),n+=t,A||(T=E.next(Math.max(0,n)),V&&(T.value=V(T.value)),A=C?T.done:n<=0),p&&p(T.value),A&&(0===b&&(w=void 0!==w?w:n),b<r?function(t,e,n,r){return r?t>=e+n:t<=-n}(n,w,o,C)&&P():(y&&y.stop(),c&&c()))}return a&&(l&&l(),y=e(k),y.start()),{stop:()=>{u&&u(),y&&y.stop()},sample:e=>{n=g;const r=t&&"number"==typeof t?Math.max(.5*t,50):50;let s=0;for(k(0);s<=e;){const t=e-s;k(Math.min(t,r)),s+=r}return T}}}const Ie=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Oe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ie([0,.65,.55,1]),circOut:Ie([.55,0,1,.45]),backIn:Ie([.31,.01,.66,-.59]),backOut:Ie([.33,1.53,.69,.99])};function De(t){if(t)return Array.isArray(t)?Ie(t):Oe[t]}const Ne={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Be={},Re={};for(const t in Ne)Re[t]=()=>(void 0===Be[t]&&(Be[t]=Ne[t]()),Be[t]);const je=new Set(["opacity"]);function Ue(t,e,{onUpdate:n,onComplete:r,...s}){if(!(Re.waapi()&&je.has(e)&&!s.repeatDelay&&"mirror"!==s.repeatType&&0!==s.damping))return!1;let{keyframes:o,duration:i=300,elapsed:a=0,ease:l}=s;if("spring"===s.type||!(!(u=s.ease)||Array.isArray(u)||"string"==typeof u&&Oe[u])){if(s.repeat===1/0)return;const t=Fe(s);let e={done:!1,value:o[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;o=n,i=r-10,l="linear"}var u;const c=function(t,e,n,{delay:r=0,duration:s,repeat:o=0,repeatType:i="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:r,duration:s,easing:De(a),fill:"both",iterations:o+1,direction:"reverse"===i?"alternate":"normal"})}(t.owner.current,e,o,{...s,delay:-a,duration:i,ease:l});return c.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,s)),r&&r()},()=>{const{currentTime:e}=c;if(e){const n=Fe({...s,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}nt.update(()=>c.cancel())}}function Le({keyframes:t,elapsed:e,onUpdate:n,onComplete:r}){const s=()=>(n&&n(t[t.length-1]),r&&r(),()=>{});return e?function(t,e){const n=performance.now(),r=({timestamp:s})=>{const o=s-n;o>=e&&(rt.read(r),t(o-e))};return nt.read(r,!0),()=>rt.read(r)}(s,-e):s()}const ze=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),$e=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),qe=()=>({type:"keyframes",ease:"linear",duration:.3}),He={type:"keyframes",duration:.8},We={x:ze,y:ze,z:ze,rotate:ze,rotateX:ze,rotateY:ze,rotateZ:ze,scaleX:$e,scaleY:$e,scale:$e,opacity:qe,backgroundColor:qe,color:qe,default:$e},Ke=(t,{keyframes:e})=>{if(e.length>2)return He;return(We[t]||We.default)(e[1])},Ge=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!At.test(e)||e.startsWith("url(")));function Ye(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Xe(t){return"number"==typeof t?0:Pt("",t)}const Ze=(t,e,n,r={})=>s=>{const o=function(t,e){return t[e]||t.default||t}(r,t)||{},i=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=zt(i);const l=function(t,e,n,r){const s=Ge(e,n);let o=void 0!==r.from?r.from:t.get();return"none"===o&&s&&"string"==typeof n?o=Pt(e,n):Ye(o)&&"string"==typeof n?o=Xe(n):!Array.isArray(n)&&Ye(n)&&"string"==typeof o&&(n=Xe(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),u=l[0],c=l[l.length-1],h=Ge(t,u),p=Ge(t,c);let d={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{s(),o.onComplete&&o.onComplete()}};if(!h||!p||$t||!1===o.type)return Le(d);if("inertia"===o.type){const t=function({keyframes:t,velocity:e=0,min:n,max:r,power:s=.8,timeConstant:o=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:p,onStop:d}){const f=t[0];let m;function v(t){return void 0!==n&&t<n||void 0!==r&&t>r}function g(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function y(t){null==m||m.stop(),m=Fe({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:p,onStop:d})}function V(t){y({type:"spring",stiffness:i,damping:a,restDelta:l,...t})}if(v(f))V({velocity:e,keyframes:[f,g(f)]});else{let t=s*e+f;void 0!==u&&(t=u(t));const r=g(t),i=r===n?-1:1;let a,c;const h=t=>{a=c,c=t,e=lt(t-a,Y.delta),(1===i&&t>r||-1===i&&t<r)&&V({keyframes:[t,r],velocity:e})};y({type:"decay",keyframes:[f,0],velocity:e,timeConstant:o,power:s,restDelta:l,modifyTarget:u,onUpdate:v(t)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(d);return()=>t.stop()}(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(o)||(d={...d,...Ke(t,d)}),d.duration&&(d.duration=zt(d.duration)),d.repeatDelay&&(d.repeatDelay=zt(d.repeatDelay));const f=e.owner,m=f&&f.current;if(f&&m instanceof HTMLElement&&!(null==f?void 0:f.getProps().onUpdate)){const n=Ue(e,t,d);if(n)return n}const v=Fe(d);return()=>v.stop()};function Je(t,e,n={}){var r;const s=Nt(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const i=s?()=>_e(t,s,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:s=0,staggerChildren:i,staggerDirection:a}=o;return function(t,e,n=0,r=0,s=1,o){const i=[],a=(t.variantChildren.size-1)*r,l=1===s?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Qe).forEach((t,r)=>{t.notify("AnimationStart",e),i.push(Je(t,e,{...o,delay:n+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,s+r,i,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function _e(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var o;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");r&&(i=r);const c=[],h=s&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[s]);for(const e in l){const r=t.getValue(e),s=l[e];if(!r||void 0===s||h&&tn(h,e))continue;let o={delay:n,elapsed:0,...i};if(t.shouldReduceMotion&&S.has(e)&&(o={...o,type:!1,delay:0}),!r.hasAnimated){const n=t.getProps()[Lt];n&&(o.elapsed=Ut(n,e))}let a=r.start(Ze(e,r,s,o));jt(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Nt(t,e);let{transitionEnd:r={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o){Bt(t,e,C(o[e]))}}(t,a)})}function Qe(t,e){return t.sortNodePosition(e)}function tn({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var en;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(en||(en={}));const nn=[en.Animate,en.InView,en.Focus,en.Hover,en.Tap,en.Drag,en.Exit],rn=[...nn].reverse(),sn=nn.length;function on(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Je(t,e,n));r=Promise.all(s)}else if("string"==typeof e)r=Je(t,e,n);else{const s="function"==typeof e?Nt(t,e,n.custom):e;r=_e(t,s,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function an(t){let e=on(t);const n={[en.Animate]:un(!0),[en.InView]:un(),[en.Hover]:un(),[en.Tap]:un(),[en.Drag]:un(),[en.Focus]:un(),[en.Exit]:un()};let r=!0;const s=(e,n)=>{const r=Nt(t,n);if(r){const{transition:t,transitionEnd:n,...s}=r;e={...e,...s,...n}}return e};function o(o,i){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let h={},p=1/0;for(let e=0;e<sn;e++){const d=rn[e],f=n[d],m=void 0!==a[d]?a[d]:l[d],v=P(m),g=d===i?f.isActive:null;!1===g&&(p=e);let y=m===l[d]&&m!==a[d]&&v;if(y&&r&&t.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...h},!f.isActive&&null===g||!m&&!f.prevProp||T(m)||"boolean"==typeof m)continue;const V=ln(f.prevProp,m);let b=V||d===i&&f.isActive&&!y&&v||e>p&&v;const w=Array.isArray(m)?m:[m];let A=w.reduce(s,{});!1===g&&(A={});const{prevResolvedValues:C={}}=f,M={...C,...A},S=t=>{b=!0,c.delete(t),f.needsAnimating[t]=!0};for(const t in M){const e=A[t],n=C[t];h.hasOwnProperty(t)||(e!==n?E(e)&&E(n)?!K(e,n)||V?S(t):f.protectedKeys[t]=!0:void 0!==e?S(t):c.add(t):void 0!==e&&c.has(t)?S(t):f.protectedKeys[t]=!0)}f.prevProp=m,f.prevResolvedValues=A,f.isActive&&(h={...h,...A}),r&&t.blockInitialAnimation&&(b=!1),b&&!y&&u.push(...w.map(t=>({animation:t,options:{type:d,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),u.push({animation:e})}let d=Boolean(u.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),r=!1,d?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,s){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(s,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function ln(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!K(e,t)}function un(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const cn=t=>e=>(t(e),null),hn={animation:cn(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=an(t)),T(e)&&n(()=>e.subscribe(t),[e])}),exit:cn(r=>{const{custom:s,visualElement:o}=r,[i,l]=function(){const r=t(a);if(null===r)return[!0,null];const{isPresent:s,onExitComplete:o,register:i}=r,l=e();return n(()=>i(l),[]),!s&&o?[!1,()=>o&&o(l)]:[!0]}(),u=t(a);n(()=>{o.isPresent=i;const t=o.animationState&&o.animationState.setActive(en.Exit,!i,{custom:u&&u.custom||s});t&&!i&&t.then(l)},[i])})};function pn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function dn(t,e,r,s){n(()=>{const n=t.current;if(r&&n)return pn(n,e,r,s)},[t,e,r,s])}const fn=t=>e=>(t=>!1!==t.isPrimary)(e)&&t(e,function(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}(e));function mn(t,e,n,r){return pn(t,e,fn(n),r)}function vn(t,e,n,r){return dn(t,e,n&&fn(n),r)}function gn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const yn=gn("dragHorizontal"),Vn=gn("dragVertical");function bn(){const t=function(t){let e=!1;if("y"===t)e=Vn();else if("x"===t)e=yn();else{const t=yn(),n=Vn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function wn(t,e,n){return(r,s)=>{(function(t){return"pen"!==t.type&&"touch"!==t.type})(r)&&!bn()&&(t.animationState&&t.animationState.setActive(en.Hover,e),n&&n(r,s))}}const An=(t,e)=>!!e&&(t===e||An(t,e.parentElement));const Cn=new WeakMap,Mn=new WeakMap,Sn=t=>{const e=Cn.get(t.target);e&&e(t)},xn=t=>{t.forEach(Sn)};function Tn(t,e,n){const r=function({root:t,...e}){const n=t||document;Mn.has(n)||Mn.set(n,{});const r=Mn.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(xn,{root:t,...e})),r[s]}(e);return Cn.set(t,n),r.observe(t),()=>{Cn.delete(t),r.unobserve(t)}}const En={some:0,all:1};function Pn(t,e,r,{root:s,margin:o,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==s?void 0:s.current,rootMargin:o,threshold:"number"==typeof i?i:En[i]};return Tn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(en.InView,n);const s=r.getProps(),o=n?s.onViewportEnter:s.onViewportLeave;o&&o(t)})},[t,s,o,i])}function kn(t,e,r,{fallback:s=!0}){n(()=>{t&&s&&requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(en.InView,!0)})},[t])}const Fn={inView:cn((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:r,viewport:s={}}){const i=o({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||r);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?kn:Pn)(a,i.current,t,s)})),tap:cn((function({onTap:t,onTapStart:e,onTapCancel:s,whileTap:i,visualElement:a,...l}){const u=t||e||s||i,c=o(!1),h=o(null),p={passive:!(e||t||s||l.onPointerDown)};function d(){h.current&&h.current(),h.current=null}function f(){return d(),c.current=!1,a.animationState&&a.animationState.setActive(en.Tap,!1),!bn()}function m(t,e){var n,r,s,o;f()&&(An(a.current,t.target)?null===(o=(s=a.getProps()).onTap)||void 0===o||o.call(s,t,e):null===(r=(n=a.getProps()).onTapCancel)||void 0===r||r.call(n,t,e))}function v(t,e){var n,r;f()&&(null===(r=(n=a.getProps()).onTapCancel)||void 0===r||r.call(n,t,e))}const g=r((t,e)=>{var n,r;d(),c.current||(c.current=!0,h.current=ee(mn(window,"pointerup",m,p),mn(window,"pointercancel",v,p)),a.animationState&&a.animationState.setActive(en.Tap,!0),null===(r=(n=a.getProps()).onTapStart)||void 0===r||r.call(n,t,e))},[Boolean(e),a]);var y;vn(a,"pointerdown",u?g:void 0,p),y=d,n(()=>()=>y(),[])})),focus:cn((function({whileFocus:t,visualElement:e}){const{animationState:n}=e,s=r(()=>{n&&n.setActive(en.Focus,!0)},[n]),o=r(()=>{n&&n.setActive(en.Focus,!1)},[n]);dn(e,"focus",t?s:void 0),dn(e,"blur",t?o:void 0)})),hover:cn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){vn(r,"pointerenter",s(()=>t||n?wn(r,!0,t):void 0,[t,Boolean(n),r]),{passive:!t}),vn(r,"pointerleave",s(()=>e||n?wn(r,!1,e):void 0,[t,Boolean(n),r]),{passive:!e})}))};function In(t){return"string"==typeof t&&t.startsWith("var(--")}const On=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Dn(t,e,n=1){const[r,s]=function(t){const e=On.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);return o?o.trim():In(s)?Dn(s,e,n+1):s}const Nn=new Set(["width","height","top","left","right","bottom","x","y"]),Bn=t=>Nn.has(t),Rn=t=>t===d||t===y;var jn;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(jn||(jn={}));const Un=(t,e)=>parseFloat(t.split(", ")[e]),Ln=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/);if(s)return Un(s[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?Un(e[1],t):0}},zn=new Set(["x","y","z"]),$n=k.filter(t=>!zn.has(t));const qn={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:Ln(4,13),y:Ln(5,14)},Hn=(t,e,n={},r={})=>{e={...e},r={...r};const s=Object.keys(e).filter(Bn);let o=[],i=!1;const a=[];if(s.forEach(s=>{const l=t.getValue(s);if(!t.hasValue(s))return;let u=n[s],c=It(u);const h=e[s];let p;if(E(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=It(u);for(let n=e;n<t;n++)p?It(h[n]):p=It(h[n])}else p=It(h);if(c!==p)if(Rn(c)&&Rn(p)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[s]=parseFloat(h):Array.isArray(h)&&p===y&&(e[s]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==p?void 0:p.transform)&&(0===u||0===h)?0===u?l.set(p.transform(u)):e[s]=c.transform(h):(i||(o=function(t){const e=[];return $n.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(s),r[s]=void 0!==r[s]?r[s]:e[s],l.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,s=((t,e,n)=>{const r=e.measureViewportBox(),s=e.current,o=getComputedStyle(s),{display:i}=o,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=qn[t](r,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=qn[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),F&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:r}}return{target:e,transitionEnd:r}};function Wn(t,e,n,r){return(t=>Object.keys(t).some(Bn))(e)?Hn(t,e,n,r):{target:e,transitionEnd:r}}const Kn=(t,e,n,r)=>{const s=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!In(e))return;const n=Dn(e,r);n&&t.set(n)});for(const t in e){const s=e[t];if(!In(s))continue;const o=Dn(s,r);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,r);return Wn(t,e=s.target,n,r=s.transitionEnd)},Gn={current:null},Yn={current:!1};const Xn=Object.keys(I),Zn=Xn.length,Jn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const _n=["initial",...nn],Qn=_n.length;class tr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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=()=>nt.render(this.render,!1,!0);const{latestValues:o,renderState:i}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=O(e),this.isVariantNode=D(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e,{});for(const t in l){const e=l[t];void 0!==o[t]&&M(e)&&(e.set(o[t],!1),jt(a)&&a.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Yn.current||function(){if(Yn.current=!0,F)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Gn.current=t.matches;t.addListener(e),e()}else Gn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Gn.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),rt.update(this.notifyUpdate),rt.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=S.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,s,o,a){const l=[];for(let t=0;t<Zn;t++){const n=Xn[t],{isEnabled:r,Component:s}=I[n];r(e)&&s&&l.push(i(s,{key:n,...e,visualElement:this}))}if(!this.projection&&o){this.projection=new o(s,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:i,layoutScroll:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||i&&N(i),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:a,layoutScroll:l})}return l}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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const e=this.props;this.props=t;for(let e=0;e<Jn.length;e++){const n=Jn[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const s in e){const o=e[s],i=n[s];if(M(o))t.addValue(s,o),jt(r)&&r.add(s);else if(M(i))t.addValue(s,ct(o,{owner:t})),jt(r)&&r.remove(s);else if(i!==o)if(t.hasValue(s)){const e=t.getValue(s);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(s);t.addValue(s,ct(void 0!==e?e:o))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,e),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<Qn;t++){const e=_n[t],n=this.props[e];(P(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=ct(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=A(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||M(s)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new at),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},s){let o=function(t,e,n){var r;const s={};for(const o in t){const t=Rt(o,e);s[o]=void 0!==t?t:null===(r=n.getValue(o))||void 0===r?void 0:r.get()}return s}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),s){!function(t,e,n){var r,s;const o=Object.keys(e).filter(e=>!t.hasValue(e)),i=o.length;if(i)for(let a=0;a<i;a++){const i=o[a],l=e[i];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(s=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==s?s:e[i]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||G(u))?u=parseFloat(u):!Dt(u)&&At.test(l)&&(u=Pt(i,l)),t.addValue(i,ct(u,{owner:t})),void 0===n[i]&&(n[i]=u),null!==u&&t.setBaseTarget(i,u))}}(this,n,o);const t=Kn(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class er extends tr{readValueFromInstance(t,e){if(S.has(e)){const t=Et(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),s=(B(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){R(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return j(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;M(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,r){U(t,e,n,r)}}class nr extends tr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return S.has(e)?(null===(n=Et(e))||void 0===n?void 0:n.default)||0:(e=L.has(e)?e:x(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return z(t,e)}build(t,e,n,r){$(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){q(t,e,n,r)}mount(t){this.isSVGTag=H(t.tagName),super.mount(t)}}const rr={renderer:(t,e)=>W(t)?new nr(e,{enableHardwareAcceleration:!1}):new er(e,{enableHardwareAcceleration:!0}),...hn,...Fn};export{rr as domAnimation};
|
|
1
|
+
import{useContext as t,useId as e,useEffect as n,useCallback as r,useMemo as s,useRef as o,createElement as i}from"react";import{P as a,q as l,t as u,u as c,v as h,w as p,x as d,y as f,z as m,A as v,B as g,C as y,D as V,E as b,F as w,r as A,G as C,d as M,H as S,I as x,n as T,J as E,c as P,K as k,i as F,f as I,b as O,m as D,a as N,L as B,g as R,p as j,M as U,N as L,s as z,h as $,o as q,j as H,k as W}from"./size-rollup-dom-animation-assets.js";function K(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const G=t=>/^0[^.\s]+$/.test(t),Y={delta:0,timestamp:0},X="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Z="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(X()),1/60*1e3);let J=!0,_=!1,Q=!1;const tt=["read","update","preRender","render","postRender"],et=tt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,s=!1,o=!1;const i=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&s,u=l?e:n;return o&&i.add(t),-1===u.indexOf(t)&&(u.push(t),l&&s&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:l=>{if(s)o=!0;else{if(s=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(l),i.has(r)&&(a.schedule(r),t())}s=!1,o&&(o=!1,a.process(l))}}};return a}(()=>_=!0),t),{}),nt=tt.reduce((t,e)=>{const n=et[e];return t[e]=(t,e=!1,r=!1)=>(_||it(),n.schedule(t,e,r)),t},{}),rt=tt.reduce((t,e)=>(t[e]=et[e].cancel,t),{});tt.reduce((t,e)=>(t[e]=()=>et[e].process(Y),t),{});const st=t=>et[t].process(Y),ot=t=>{_=!1,Y.delta=J?1/60*1e3:Math.max(Math.min(t-Y.timestamp,40),1),Y.timestamp=t,Q=!0,tt.forEach(st),Q=!1,_&&(J=!1,Z(ot))},it=()=>{_=!0,J=!0,Q||Z(ot)};class at{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let s=0;s<r;s++){const r=this.subscriptions[s];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lt(t,e){return e?t*(1e3/e):0}class ut{constructor(t,e={}){var n;this.version="8.3.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=Y;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,nt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>nt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new at);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.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=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?lt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ct(t,e){return new ut(t,e)}const ht=(t,e)=>n=>Boolean(l(n)&&u.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),pt=(t,e,n)=>r=>{if(!l(r))return r;const[s,o,i,a]=r.match(c);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},dt={...d,transform:t=>Math.round((t=>f(0,255,t))(t))},ft={test:ht("rgb","red"),parse:pt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+dt.transform(t)+", "+dt.transform(e)+", "+dt.transform(n)+", "+h(p.transform(r))+")"};const mt={test:ht("#"),parse:function(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:ft.transform},vt={test:ht("hsl","hue"),parse:pt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+m.transform(h(e))+", "+m.transform(h(n))+", "+h(p.transform(r))+")"},gt={test:t=>ft.test(t)||mt.test(t)||vt.test(t),parse:t=>ft.test(t)?ft.parse(t):vt.test(t)?vt.parse(t):mt.parse(t),transform:t=>l(t)?t:t.hasOwnProperty("red")?ft.transform(t):vt.transform(t)};function yt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,r=0;const s=t.match(v);s&&(n=s.length,t=t.replace(v,"${c}"),e.push(...s.map(gt.parse)));const o=t.match(c);return o&&(r=o.length,t=t.replace(c,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,numNumbers:r,tokenised:t}}function Vt(t){return yt(t).values}function bt(t){const{values:e,numColors:n,tokenised:r}=yt(t),s=e.length;return t=>{let e=r;for(let r=0;r<s;r++)e=e.replace(r<n?"${c}":"${n}",r<n?gt.transform(t[r]):h(t[r]));return e}}const wt=t=>"number"==typeof t?0:t;const At={test:function(t){var e,n;return isNaN(t)&&l(t)&&((null===(e=t.match(c))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(v))||void 0===n?void 0:n.length)||0)>0},parse:Vt,createTransformer:bt,getAnimatableNone:function(t){const e=Vt(t);return bt(t)(e.map(wt))}},Ct=new Set(["brightness","contrast","saturate","opacity"]);function Mt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(c)||[];if(!r)return t;const s=n.replace(r,"");let o=Ct.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+s+")"}const St=/([a-z-]*)\(.*?\)/g,xt={...At,getAnimatableNone:t=>{const e=t.match(St);return e?e.map(Mt).join(" "):t}},Tt={...g,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:xt,WebkitFilter:xt},Et=t=>Tt[t];function Pt(t,e){var n;let r=Et(t);return r!==xt&&(r=At),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const kt=t=>e=>e.test(t),Ft=[d,y,m,V,b,w,{test:t=>"auto"===t,parse:t=>t}],It=t=>Ft.find(kt(t)),Ot=[...Ft,gt,At],Dt=t=>Ot.find(kt(t));function Nt(t,e,n){const r=t.getProps();return A(r,e,void 0!==n?n:r.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))}function Bt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ct(n))}function Rt(t,e){if(!e)return;return(e[t]||e.default||e).from}function jt(t){return Boolean(M(t)&&t.add)}function Ut(t,e){const{MotionAppearAnimations:n}=window,r=((t,e)=>`${t}: ${e}`)(t,S.has(e)?"transform":e),s=n&&n.get(r);return s?(nt.render(()=>{try{s.cancel(),n.delete(r)}catch(t){}}),s.currentTime||0):0}const Lt="data-"+x("framerAppearId");const zt=t=>1e3*t,$t=!1,qt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ht=t=>e=>1-t(1-e),Wt=t=>t*t,Kt=Ht(Wt),Gt=qt(Wt),Yt=(t,e,n)=>-n*t+n*e+t;function Xt(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 Zt=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},Jt=[mt,ft,vt];function _t(t){const e=(n=t,Jt.find(t=>t.test(n)));var n;let r=e.parse(t);return e===vt&&(r=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let s=0,o=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;s=Xt(a,r,t+1/3),o=Xt(a,r,t),i=Xt(a,r,t-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(r)),r}const Qt=(t,e)=>{const n=_t(t),r=_t(e),s={...n};return t=>(s.red=Zt(n.red,r.red,t),s.green=Zt(n.green,r.green,t),s.blue=Zt(n.blue,r.blue,t),s.alpha=Yt(n.alpha,r.alpha,t),ft.transform(s))},te=(t,e)=>n=>e(t(n)),ee=(...t)=>t.reduce(te);function ne(t,e){return"number"==typeof t?n=>Yt(t,e,n):gt.test(t)?Qt(t,e):oe(t,e)}const re=(t,e)=>{const n=[...t],r=n.length,s=t.map((t,n)=>ne(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=s[e](t);return n}},se=(t,e)=>{const n={...t,...e},r={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(r[s]=ne(t[s],e[s]));return t=>{for(const e in r)n[e]=r[e](t);return n}},oe=(t,e)=>{const n=At.createTransformer(e),r=yt(t),s=yt(e);return r.numColors===s.numColors&&r.numNumbers>=s.numNumbers?ee(re(r.values,s.values),n):n=>""+(n>0?e:t)},ie=(t,e)=>n=>Yt(t,e,n);function ae(t,e,n){const r=[],s=n||("number"==typeof(o=t[0])?ie:"string"==typeof o?gt.test(o)?Qt:oe:Array.isArray(o)?re:"object"==typeof o?se:ie);var o;const i=t.length-1;for(let n=0;n<i;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=ee(t,o)}r.push(o)}return r}function le(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const o=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const i=ae(e,r,s),a=i.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=((t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r})(t[n],t[n+1],e);return i[n](r)};return n?e=>l(f(t[0],t[o-1],e)):l}const ue=t=>t,ce=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function he(t,e,n,r){if(t===e&&n===r)return ue;const s=e=>function(t,e,n,r,s){let o,i,a=0;do{i=e+(n-e)/2,o=ce(i,r,s)-t,o>0?n=i:e=i}while(Math.abs(o)>1e-7&&++a<12);return i}(e,0,1,t,n);return t=>0===t||1===t?t:ce(s(t),e,r)}const pe=t=>1-Math.sin(Math.acos(t)),de=Ht(pe),fe=qt(de),me=he(.33,1.53,.69,.99),ve=Ht(me),ge=qt(ve),ye={linear:ue,easeIn:Wt,easeInOut:Gt,easeOut:Kt,circIn:pe,circInOut:fe,circOut:de,backIn:ve,backInOut:ge,backOut:me,anticipate:t=>(t*=2)<1?.5*ve(t):.5*(2-Math.pow(2,-10*(t-1)))},Ve=t=>{if(Array.isArray(t)){t.length;const[e,n,r,s]=t;return he(e,n,r,s)}return"string"==typeof t?ye[t]:t};function be({keyframes:t,ease:e=Gt,times:n,duration:r=300}){t=[...t];const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Ve):Ve(e),o={done:!1,value:t[0]},i=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),r);function a(){return le(i,t,{ease:Array.isArray(s)?s:(e=t,n=s,e.map(()=>n||Gt).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=r,o),flipTarget:()=>{t.reverse(),l=a()}}}function we({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,o,i=1-e;i=f(.05,1,i),t=f(.01,10,t/1e3),i<1?(s=e=>{const r=e*i,s=r*t;return.001-(r-n)/Ae(e,i)*Math.exp(-s)},o=e=>{const r=e*i*t,o=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=Ae(Math.pow(e,2),i);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(s,o,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function Ae(t,e){return t*Math.sqrt(1-e*e)}const Ce=["duration","bounce"],Me=["stiffness","damping","mass"];function Se(t,e){return e.some(e=>void 0!==t[e])}function xe({keyframes:t,restSpeed:e=2,restDelta:n=.01,...r}){let s=t[0],o=t[t.length-1];const i={done:!1,value:s},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Se(t,Me)&&Se(t,Ce)){const n=we(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r);let d=Te,f=c?-c/1e3:0;const m=l/(2*Math.sqrt(a*u));function v(){const t=o-s,e=Math.sqrt(a/u)/1e3;if(void 0===n&&(n=Math.min(Math.abs(o-s)/100,.4)),m<1){const n=Ae(e,m);d=r=>{const s=Math.exp(-m*e*r);return o-s*((f+m*e*t)/n*Math.sin(n*r)+t*Math.cos(n*r))}}else if(1===m)d=n=>o-Math.exp(-e*n)*(t+(f+e*t)*n);else{const n=e*Math.sqrt(m*m-1);d=r=>{const s=Math.exp(-m*e*r),i=Math.min(n*r,300);return o-s*((f+m*e*t)*Math.sinh(i)+n*t*Math.cosh(i))/n}}}return v(),{next:t=>{const r=d(t);if(p)i.done=t>=h;else{let s=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);s=lt(r-d(e),t-e)}else s=0;const a=Math.abs(s)<=e,l=Math.abs(o-r)<=n;i.done=a&&l}return i.value=i.done?o:r,i},flipTarget:()=>{f=-f,[s,o]=[o,s],v()}}}xe.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Te=t=>0;const Ee={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:r=350,restDelta:s=.5,modifyTarget:o}){const i=t[0],a={done:!1,value:i};let l=n*e;const u=i+l,c=void 0===o?u:o(u);return c!==u&&(l=c-i),{next:t=>{const e=-l*Math.exp(-t/r);return a.done=!(e>s||e<-s),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:be,tween:be,spring:xe};function Pe(t,e,n=0){return t-e-n}const ke=t=>{const e=({delta:e})=>t(e);return{start:()=>nt.update(e,!0),stop:()=>rt.update(e)}};function Fe({duration:t,driver:e=ke,elapsed:n=0,repeat:r=0,repeatType:s="loop",repeatDelay:o=0,keyframes:i,autoplay:a=!0,onPlay:l,onStop:u,onComplete:c,onRepeat:h,onUpdate:p,type:d="keyframes",...f}){var m,v;const g=n;let y,V,b=0,w=t,A=!1,C=!0;const M=Ee[i.length>2?"keyframes":d]||be,S=i[0],x=i[i.length-1];let T={done:!1,value:S};(null===(v=(m=M).needsInterpolation)||void 0===v?void 0:v.call(m,S,x))&&(V=le([0,100],[S,x],{clamp:!1}),i=[0,100]);const E=M({...f,duration:t,keyframes:i});function P(){b++,"reverse"===s?(C=b%2==0,n=function(t,e=0,n=0,r=!0){return r?Pe(e+-t,e,n):e-(t-e)+n}(n,w,o,C)):(n=Pe(n,w,o),"mirror"===s&&E.flipTarget()),A=!1,h&&h()}function k(t){C||(t=-t),n+=t,A||(T=E.next(Math.max(0,n)),V&&(T.value=V(T.value)),A=C?T.done:n<=0),p&&p(T.value),A&&(0===b&&(w=void 0!==w?w:n),b<r?function(t,e,n,r){return r?t>=e+n:t<=-n}(n,w,o,C)&&P():(y&&y.stop(),c&&c()))}return a&&(l&&l(),y=e(k),y.start()),{stop:()=>{u&&u(),y&&y.stop()},sample:e=>{n=g;const r=t&&"number"==typeof t?Math.max(.5*t,50):50;let s=0;for(k(0);s<=e;){const t=e-s;k(Math.min(t,r)),s+=r}return T}}}const Ie=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Oe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ie([0,.65,.55,1]),circOut:Ie([.55,0,1,.45]),backIn:Ie([.31,.01,.66,-.59]),backOut:Ie([.33,1.53,.69,.99])};function De(t){if(t)return Array.isArray(t)?Ie(t):Oe[t]}const Ne={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Be={},Re={};for(const t in Ne)Re[t]=()=>(void 0===Be[t]&&(Be[t]=Ne[t]()),Be[t]);const je=new Set(["opacity"]);function Ue(t,e,{onUpdate:n,onComplete:r,...s}){if(!(Re.waapi()&&je.has(e)&&!s.repeatDelay&&"mirror"!==s.repeatType&&0!==s.damping))return!1;let{keyframes:o,duration:i=300,elapsed:a=0,ease:l}=s;if("spring"===s.type||!(!(u=s.ease)||Array.isArray(u)||"string"==typeof u&&Oe[u])){if(s.repeat===1/0)return;const t=Fe(s);let e={done:!1,value:o[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;o=n,i=r-10,l="linear"}var u;const c=function(t,e,n,{delay:r=0,duration:s,repeat:o=0,repeatType:i="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:r,duration:s,easing:De(a),fill:"both",iterations:o+1,direction:"reverse"===i?"alternate":"normal"})}(t.owner.current,e,o,{...s,delay:-a,duration:i,ease:l});return c.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,s)),r&&r()},()=>{const{currentTime:e}=c;if(e){const n=Fe({...s,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}nt.update(()=>c.cancel())}}function Le({keyframes:t,elapsed:e,onUpdate:n,onComplete:r}){const s=()=>(n&&n(t[t.length-1]),r&&r(),()=>{});return e?function(t,e){const n=performance.now(),r=({timestamp:s})=>{const o=s-n;o>=e&&(rt.read(r),t(o-e))};return nt.read(r,!0),()=>rt.read(r)}(s,-e):s()}const ze=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),$e=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),qe=()=>({type:"keyframes",ease:"linear",duration:.3}),He={type:"keyframes",duration:.8},We={x:ze,y:ze,z:ze,rotate:ze,rotateX:ze,rotateY:ze,rotateZ:ze,scaleX:$e,scaleY:$e,scale:$e,opacity:qe,backgroundColor:qe,color:qe,default:$e},Ke=(t,{keyframes:e})=>{if(e.length>2)return He;return(We[t]||We.default)(e[1])},Ge=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!At.test(e)||e.startsWith("url(")));function Ye(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Xe(t){return"number"==typeof t?0:Pt("",t)}const Ze=(t,e,n,r={})=>s=>{const o=function(t,e){return t[e]||t.default||t}(r,t)||{},i=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=zt(i);const l=function(t,e,n,r){const s=Ge(e,n);let o=void 0!==r.from?r.from:t.get();return"none"===o&&s&&"string"==typeof n?o=Pt(e,n):Ye(o)&&"string"==typeof n?o=Xe(n):!Array.isArray(n)&&Ye(n)&&"string"==typeof o&&(n=Xe(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),u=l[0],c=l[l.length-1],h=Ge(t,u),p=Ge(t,c);let d={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{s(),o.onComplete&&o.onComplete()}};if(!h||!p||$t||!1===o.type)return Le(d);if("inertia"===o.type){const t=function({keyframes:t,velocity:e=0,min:n,max:r,power:s=.8,timeConstant:o=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:p,onStop:d}){const f=t[0];let m;function v(t){return void 0!==n&&t<n||void 0!==r&&t>r}function g(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function y(t){null==m||m.stop(),m=Fe({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:p,onStop:d})}function V(t){y({type:"spring",stiffness:i,damping:a,restDelta:l,...t})}if(v(f))V({velocity:e,keyframes:[f,g(f)]});else{let t=s*e+f;void 0!==u&&(t=u(t));const r=g(t),i=r===n?-1:1;let a,c;const h=t=>{a=c,c=t,e=lt(t-a,Y.delta),(1===i&&t>r||-1===i&&t<r)&&V({keyframes:[t,r],velocity:e})};y({type:"decay",keyframes:[f,0],velocity:e,timeConstant:o,power:s,restDelta:l,modifyTarget:u,onUpdate:v(t)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(d);return()=>t.stop()}(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(o)||(d={...d,...Ke(t,d)}),d.duration&&(d.duration=zt(d.duration)),d.repeatDelay&&(d.repeatDelay=zt(d.repeatDelay));const f=e.owner,m=f&&f.current;if(f&&m instanceof HTMLElement&&!(null==f?void 0:f.getProps().onUpdate)){const n=Ue(e,t,d);if(n)return n}const v=Fe(d);return()=>v.stop()};function Je(t,e,n={}){var r;const s=Nt(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const i=s?()=>_e(t,s,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:s=0,staggerChildren:i,staggerDirection:a}=o;return function(t,e,n=0,r=0,s=1,o){const i=[],a=(t.variantChildren.size-1)*r,l=1===s?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Qe).forEach((t,r)=>{t.notify("AnimationStart",e),i.push(Je(t,e,{...o,delay:n+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,s+r,i,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function _e(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var o;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");r&&(i=r);const c=[],h=s&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[s]);for(const e in l){const r=t.getValue(e),s=l[e];if(!r||void 0===s||h&&tn(h,e))continue;let o={delay:n,elapsed:0,...i};if(t.shouldReduceMotion&&S.has(e)&&(o={...o,type:!1,delay:0}),!r.hasAnimated){const n=t.getProps()[Lt];n&&(o.elapsed=Ut(n,e))}let a=r.start(Ze(e,r,s,o));jt(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Nt(t,e);let{transitionEnd:r={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o){Bt(t,e,C(o[e]))}}(t,a)})}function Qe(t,e){return t.sortNodePosition(e)}function tn({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var en;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(en||(en={}));const nn=[en.Animate,en.InView,en.Focus,en.Hover,en.Tap,en.Drag,en.Exit],rn=[...nn].reverse(),sn=nn.length;function on(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Je(t,e,n));r=Promise.all(s)}else if("string"==typeof e)r=Je(t,e,n);else{const s="function"==typeof e?Nt(t,e,n.custom):e;r=_e(t,s,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function an(t){let e=on(t);const n={[en.Animate]:un(!0),[en.InView]:un(),[en.Hover]:un(),[en.Tap]:un(),[en.Drag]:un(),[en.Focus]:un(),[en.Exit]:un()};let r=!0;const s=(e,n)=>{const r=Nt(t,n);if(r){const{transition:t,transitionEnd:n,...s}=r;e={...e,...s,...n}}return e};function o(o,i){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let h={},p=1/0;for(let e=0;e<sn;e++){const d=rn[e],f=n[d],m=void 0!==a[d]?a[d]:l[d],v=P(m),g=d===i?f.isActive:null;!1===g&&(p=e);let y=m===l[d]&&m!==a[d]&&v;if(y&&r&&t.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...h},!f.isActive&&null===g||!m&&!f.prevProp||T(m)||"boolean"==typeof m)continue;const V=ln(f.prevProp,m);let b=V||d===i&&f.isActive&&!y&&v||e>p&&v;const w=Array.isArray(m)?m:[m];let A=w.reduce(s,{});!1===g&&(A={});const{prevResolvedValues:C={}}=f,M={...C,...A},S=t=>{b=!0,c.delete(t),f.needsAnimating[t]=!0};for(const t in M){const e=A[t],n=C[t];h.hasOwnProperty(t)||(e!==n?E(e)&&E(n)?!K(e,n)||V?S(t):f.protectedKeys[t]=!0:void 0!==e?S(t):c.add(t):void 0!==e&&c.has(t)?S(t):f.protectedKeys[t]=!0)}f.prevProp=m,f.prevResolvedValues=A,f.isActive&&(h={...h,...A}),r&&t.blockInitialAnimation&&(b=!1),b&&!y&&u.push(...w.map(t=>({animation:t,options:{type:d,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),u.push({animation:e})}let d=Boolean(u.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),r=!1,d?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,s){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(s,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function ln(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!K(e,t)}function un(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const cn=t=>e=>(t(e),null),hn={animation:cn(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=an(t)),T(e)&&n(()=>e.subscribe(t),[e])}),exit:cn(r=>{const{custom:s,visualElement:o}=r,[i,l]=function(){const r=t(a);if(null===r)return[!0,null];const{isPresent:s,onExitComplete:o,register:i}=r,l=e();return n(()=>i(l),[]),!s&&o?[!1,()=>o&&o(l)]:[!0]}(),u=t(a);n(()=>{o.isPresent=i;const t=o.animationState&&o.animationState.setActive(en.Exit,!i,{custom:u&&u.custom||s});t&&!i&&t.then(l)},[i])})};function pn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function dn(t,e,r,s){n(()=>{const n=t.current;if(r&&n)return pn(n,e,r,s)},[t,e,r,s])}const fn=t=>e=>(t=>!1!==t.isPrimary)(e)&&t(e,function(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}(e));function mn(t,e,n,r){return pn(t,e,fn(n),r)}function vn(t,e,n,r){return dn(t,e,n&&fn(n),r)}function gn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const yn=gn("dragHorizontal"),Vn=gn("dragVertical");function bn(){const t=function(t){let e=!1;if("y"===t)e=Vn();else if("x"===t)e=yn();else{const t=yn(),n=Vn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function wn(t,e,n){return(r,s)=>{"touch"===r.type||bn()||(t.animationState&&t.animationState.setActive(en.Hover,e),n&&n(r,s))}}const An=(t,e)=>!!e&&(t===e||An(t,e.parentElement));const Cn=new WeakMap,Mn=new WeakMap,Sn=t=>{const e=Cn.get(t.target);e&&e(t)},xn=t=>{t.forEach(Sn)};function Tn(t,e,n){const r=function({root:t,...e}){const n=t||document;Mn.has(n)||Mn.set(n,{});const r=Mn.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(xn,{root:t,...e})),r[s]}(e);return Cn.set(t,n),r.observe(t),()=>{Cn.delete(t),r.unobserve(t)}}const En={some:0,all:1};function Pn(t,e,r,{root:s,margin:o,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==s?void 0:s.current,rootMargin:o,threshold:"number"==typeof i?i:En[i]};return Tn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(en.InView,n);const s=r.getProps(),o=n?s.onViewportEnter:s.onViewportLeave;o&&o(t)})},[t,s,o,i])}function kn(t,e,r,{fallback:s=!0}){n(()=>{t&&s&&requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(en.InView,!0)})},[t])}const Fn={inView:cn((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:r,viewport:s={}}){const i=o({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||r);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?kn:Pn)(a,i.current,t,s)})),tap:cn((function({onTap:t,onTapStart:e,onTapCancel:s,whileTap:i,visualElement:a,...l}){const u=t||e||s||i,c=o(!1),h=o(null),p={passive:!(e||t||s||l.onPointerDown)};function d(){h.current&&h.current(),h.current=null}function f(){return d(),c.current=!1,a.animationState&&a.animationState.setActive(en.Tap,!1),!bn()}function m(t,e){var n,r,s,o;f()&&(An(a.current,t.target)?null===(o=(s=a.getProps()).onTap)||void 0===o||o.call(s,t,e):null===(r=(n=a.getProps()).onTapCancel)||void 0===r||r.call(n,t,e))}function v(t,e){var n,r;f()&&(null===(r=(n=a.getProps()).onTapCancel)||void 0===r||r.call(n,t,e))}const g=r((t,e)=>{var n,r;d(),c.current||(c.current=!0,h.current=ee(mn(window,"pointerup",m,p),mn(window,"pointercancel",v,p)),a.animationState&&a.animationState.setActive(en.Tap,!0),null===(r=(n=a.getProps()).onTapStart)||void 0===r||r.call(n,t,e))},[Boolean(e),a]);var y;vn(a,"pointerdown",u?g:void 0,p),y=d,n(()=>()=>y(),[])})),focus:cn((function({whileFocus:t,visualElement:e}){const{animationState:n}=e,s=r(()=>{n&&n.setActive(en.Focus,!0)},[n]),o=r(()=>{n&&n.setActive(en.Focus,!1)},[n]);dn(e,"focus",t?s:void 0),dn(e,"blur",t?o:void 0)})),hover:cn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){vn(r,"pointerenter",s(()=>t||n?wn(r,!0,t):void 0,[t,Boolean(n),r]),{passive:!t}),vn(r,"pointerleave",s(()=>e||n?wn(r,!1,e):void 0,[t,Boolean(n),r]),{passive:!e})}))};function In(t){return"string"==typeof t&&t.startsWith("var(--")}const On=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Dn(t,e,n=1){const[r,s]=function(t){const e=On.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);return o?o.trim():In(s)?Dn(s,e,n+1):s}const Nn=new Set(["width","height","top","left","right","bottom","x","y"]),Bn=t=>Nn.has(t),Rn=t=>t===d||t===y;var jn;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(jn||(jn={}));const Un=(t,e)=>parseFloat(t.split(", ")[e]),Ln=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/);if(s)return Un(s[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?Un(e[1],t):0}},zn=new Set(["x","y","z"]),$n=k.filter(t=>!zn.has(t));const qn={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:Ln(4,13),y:Ln(5,14)},Hn=(t,e,n={},r={})=>{e={...e},r={...r};const s=Object.keys(e).filter(Bn);let o=[],i=!1;const a=[];if(s.forEach(s=>{const l=t.getValue(s);if(!t.hasValue(s))return;let u=n[s],c=It(u);const h=e[s];let p;if(E(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=It(u);for(let n=e;n<t;n++)p?It(h[n]):p=It(h[n])}else p=It(h);if(c!==p)if(Rn(c)&&Rn(p)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[s]=parseFloat(h):Array.isArray(h)&&p===y&&(e[s]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==p?void 0:p.transform)&&(0===u||0===h)?0===u?l.set(p.transform(u)):e[s]=c.transform(h):(i||(o=function(t){const e=[];return $n.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(s),r[s]=void 0!==r[s]?r[s]:e[s],l.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,s=((t,e,n)=>{const r=e.measureViewportBox(),s=e.current,o=getComputedStyle(s),{display:i}=o,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=qn[t](r,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=qn[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),F&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:r}}return{target:e,transitionEnd:r}};function Wn(t,e,n,r){return(t=>Object.keys(t).some(Bn))(e)?Hn(t,e,n,r):{target:e,transitionEnd:r}}const Kn=(t,e,n,r)=>{const s=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!In(e))return;const n=Dn(e,r);n&&t.set(n)});for(const t in e){const s=e[t];if(!In(s))continue;const o=Dn(s,r);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,r);return Wn(t,e=s.target,n,r=s.transitionEnd)},Gn={current:null},Yn={current:!1};const Xn=Object.keys(I),Zn=Xn.length,Jn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const _n=["initial",...nn],Qn=_n.length;class tr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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=()=>nt.render(this.render,!1,!0);const{latestValues:o,renderState:i}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=O(e),this.isVariantNode=D(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e,{});for(const t in l){const e=l[t];void 0!==o[t]&&M(e)&&(e.set(o[t],!1),jt(a)&&a.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Yn.current||function(){if(Yn.current=!0,F)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Gn.current=t.matches;t.addListener(e),e()}else Gn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Gn.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),rt.update(this.notifyUpdate),rt.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=S.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,s,o,a){const l=[];for(let t=0;t<Zn;t++){const n=Xn[t],{isEnabled:r,Component:s}=I[n];r(e)&&s&&l.push(i(s,{key:n,...e,visualElement:this}))}if(!this.projection&&o){this.projection=new o(s,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:i,layoutScroll:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||i&&N(i),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:a,layoutScroll:l})}return l}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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const e=this.props;this.props=t;for(let e=0;e<Jn.length;e++){const n=Jn[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const s in e){const o=e[s],i=n[s];if(M(o))t.addValue(s,o),jt(r)&&r.add(s);else if(M(i))t.addValue(s,ct(o,{owner:t})),jt(r)&&r.remove(s);else if(i!==o)if(t.hasValue(s)){const e=t.getValue(s);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(s);t.addValue(s,ct(void 0!==e?e:o))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,e),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<Qn;t++){const e=_n[t],n=this.props[e];(P(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=ct(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=A(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||M(s)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new at),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},s){let o=function(t,e,n){var r;const s={};for(const o in t){const t=Rt(o,e);s[o]=void 0!==t?t:null===(r=n.getValue(o))||void 0===r?void 0:r.get()}return s}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),s){!function(t,e,n){var r,s;const o=Object.keys(e).filter(e=>!t.hasValue(e)),i=o.length;if(i)for(let a=0;a<i;a++){const i=o[a],l=e[i];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(s=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==s?s:e[i]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||G(u))?u=parseFloat(u):!Dt(u)&&At.test(l)&&(u=Pt(i,l)),t.addValue(i,ct(u,{owner:t})),void 0===n[i]&&(n[i]=u),null!==u&&t.setBaseTarget(i,u))}}(this,n,o);const t=Kn(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class er extends tr{readValueFromInstance(t,e){if(S.has(e)){const t=Et(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),s=(B(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){R(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return j(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;M(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,r){U(t,e,n,r)}}class nr extends tr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return S.has(e)?(null===(n=Et(e))||void 0===n?void 0:n.default)||0:(e=L.has(e)?e:x(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return z(t,e)}build(t,e,n,r){$(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){q(t,e,n,r)}mount(t){this.isSVGTag=H(t.tagName),super.mount(t)}}const rr={renderer:(t,e)=>W(t)?new nr(e,{enableHardwareAcceleration:!1}):new er(e,{enableHardwareAcceleration:!0}),...hn,...Fn};export{rr as domAnimation};
|