motion-v 0.1.0 → 0.2.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/index.cjs +1 -0
- package/dist/index.js +1280 -1097
- package/dist/src/components/Motion.d.ts +2 -7
- package/dist/src/components/type.d.ts +25 -0
- package/dist/src/{state/features → features}/feature.d.ts +1 -1
- package/dist/src/{state/features → features}/gestures/base.d.ts +2 -2
- package/dist/src/features/gestures/drag/index.d.ts +12 -0
- package/dist/src/features/gestures/drag/types.d.ts +144 -0
- package/dist/src/{state/features → features}/gestures/hover.d.ts +2 -2
- package/dist/src/{state/features → features}/gestures/in-view.d.ts +2 -2
- package/dist/src/{state/features → features}/gestures/index.d.ts +1 -0
- package/dist/src/{state/features → features}/gestures/press.d.ts +2 -2
- package/dist/src/features/gestures/types.d.ts +29 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/state/motion-state.d.ts +4 -3
- package/dist/src/state/style.d.ts +2 -1
- package/dist/src/state/types.d.ts +22 -3
- package/dist/src/state/utils.d.ts +9 -6
- package/dist/src/types/framer-motion.d.ts +104 -0
- package/dist/src/types/index.d.ts +3 -14
- package/dist/src/types/transform.d.ts +47 -0
- package/dist/src/utils/events.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/motion-value.d.ts +2 -0
- package/dist/src/utils/use-animation-frame.d.ts +2 -0
- package/dist/src/value/index.d.ts +5 -0
- package/dist/src/value/use-combine-values.d.ts +6 -0
- package/dist/src/value/use-computed.d.ts +2 -0
- package/dist/src/value/use-motion-template.d.ts +21 -0
- package/dist/src/value/use-motion-value-event.d.ts +3 -0
- package/dist/src/value/use-scroll.d.ts +12 -0
- package/dist/src/value/use-spring.d.ts +3 -0
- package/dist/src/value/use-time.d.ts +1 -0
- package/dist/src/value/use-transform.d.ts +58 -0
- package/dist/src/value/use-velocity.d.ts +13 -0
- package/package.json +10 -4
- package/dist/index.umd.cjs +0 -1
- package/dist/src/components/utils.d.ts +0 -3
- package/dist/src/state/features/gestures/types.d.ts +0 -9
- /package/dist/src/{state/features → features}/events.d.ts +0 -0
- /package/dist/src/{state/features → features}/index.d.ts +0 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue");function Zs(e,t){e.indexOf(t)===-1&&e.push(t)}function Kn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Wn{constructor(){this.subscriptions=[]}add(t){return Zs(this.subscriptions,t),()=>Kn(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ue(e,t){return t?e*(1e3/t):0}const je=new Set;function Ft(e,t,n){e||je.has(t)||(console.warn(t),je.add(t))}const Js={skipAnimations:!1,useManualTiming:!1},K=e=>e;function Qs(e){let t=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),e()),u(o)}const l={schedule:(u,c=!1,f=!1)=>{const m=f&&s?t:n;return c&&r.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[t,n]=[n,t],n.clear(),t.forEach(a),s=!1,i&&(i=!1,l.process(u))}};return l}const it=["read","resolveKeyframes","update","preRender","render","postRender"],ti=40;function ei(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=it.reduce((y,v)=>(y[v]=Qs(r),y),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,ti),1),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},g=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:it.reduce((y,v)=>{const V=o[v];return y[v]=(x,T=!1,M=!1)=>(n||g(),V.schedule(x,T,M)),y},{}),cancel:y=>{for(let v=0;v<it.length;v++)o[it[v]].cancel(y)},state:i,steps:o}}const{schedule:E,cancel:R,state:Y,steps:ni}=ei(typeof requestAnimationFrame<"u"?requestAnimationFrame:K,!0);let St;function si(){St=void 0}const N={now:()=>(St===void 0&&N.set(Y.isProcessing||Js.useManualTiming?Y.timestamp:performance.now()),St),set:e=>{St=e,queueMicrotask(si)}},He=30,ii=e=>!isNaN(parseFloat(e)),k={current:void 0};class _n{constructor(t,n={}){this.version="11.11.11",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=N.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=N.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ii(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Wn);const s=this.events[t].add(n);return t==="change"?()=>{s(),E.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return k.current&&k.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>He)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,He);return ue(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 B(e,t){return new _n(e,t)}function Ot(e){let t;return()=>(t===void 0&&(t=e()),t)}const kn=Ot(()=>window.ScrollTimeline!==void 0);class ce{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t,n){const s=this.animations.map(i=>kn()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].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 startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const F=e=>e*1e3,I=e=>e/1e3,ri=5;function Gn(e,t,n){const s=Math.max(t-ri,0);return ue(n-e(s),t-s)}exports.warning=K;exports.invariant=K;process.env.NODE_ENV!=="production"&&(exports.warning=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},exports.invariant=(e,t)=>{if(!e)throw new Error(t)});const z=(e,t,n)=>n>t?t:n<e?e:n,_t=.001,oi=.01,Ye=10,ai=.05,li=1;function ui({duration:e=800,bounce:t=.25,velocity:n=0,mass:s=1}){let i,r;exports.warning(e<=F(Ye),"Spring duration must be 10 seconds or less");let o=1-t;o=z(ai,li,o),e=z(oi,Ye,I(e)),o<1?(i=u=>{const c=u*o,f=c*e,h=c-n,m=Ht(u,o),g=Math.exp(-f);return _t-h/m*g},r=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),S=Ht(Math.pow(u,2),o);return(-i(u)+_t>0?-1:1)*((h-m)*g)/S}):(i=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-_t+c*f},r=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=fi(i,r,a);if(e=F(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const ci=12;function fi(e,t,n){let s=n;for(let i=1;i<ci;i++)s=s-e(s)/t(s);return s}function Ht(e,t){return e*Math.sqrt(1-t*t)}const hi=["duration","bounce"],di=["stiffness","damping","mass"];function qe(e,t){return t.some(n=>e[n]!==void 0)}function pi(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!qe(e,di)&&qe(e,hi)){const n=ui(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function Dt({keyframes:e,restDelta:t,restSpeed:n,...s}){const i=e[0],r=e[e.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:f,isResolvedFromDuration:h}=pi({...s,velocity:-I(s.velocity||0)}),m=f||0,g=l/(2*Math.sqrt(a*u)),S=r-i,w=I(Math.sqrt(a/u)),y=Math.abs(S)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let v;if(g<1){const V=Ht(w,g);v=x=>{const T=Math.exp(-g*w*x);return r-T*((m+g*w*S)/V*Math.sin(V*x)+S*Math.cos(V*x))}}else if(g===1)v=V=>r-Math.exp(-w*V)*(S+(m+w*S)*V);else{const V=w*Math.sqrt(g*g-1);v=x=>{const T=Math.exp(-g*w*x),M=Math.min(V*x,300);return r-T*((m+g*w*S)*Math.sinh(M)+V*S*Math.cosh(M))/V}}return{calculatedDuration:h&&c||null,next:V=>{const x=v(V);if(h)o.done=V>=c;else{let T=0;g<1&&(T=V===0?F(m):Gn(v,V,x));const M=Math.abs(T)<=n,O=Math.abs(r-x)<=t;o.done=M&&O}return o.value=o.done?r:x,o}}}const Yt=2e4;function zn(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Yt;)t+=n,s=e.next(t);return t>=Yt?1/0:t}function Un(e,t=100,n){const s=n({...e,keyframes:[0,t]}),i=Math.min(zn(s),Yt);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:I(i)}}const pt=(e,t,n)=>e+(t-e)*n,Q=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};function jn(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=Q(0,t,s);e.push(pt(n,1,i))}}function fe(e){const t=[0];return jn(t,e.length-1),t}const P=e=>!!(e&&e.getVelocity);function Bt(e,t,n){var s;if(typeof e=="string"){let i=document;t&&(exports.invariant(!!t.current,"Scope provided, but no element detected."),i=t.current),n?((s=n[e])!==null&&s!==void 0||(n[e]=i.querySelectorAll(e)),e=n[e]):e=i.querySelectorAll(e)}else e instanceof Element&&(e=[e]);return Array.from(e||[])}function he(e){return typeof e=="object"&&!Array.isArray(e)}function Hn(e,t,n,s){return typeof e=="string"&&he(t)?Bt(e,n,s):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function mt(e){return typeof e=="function"}function Xe(e,t,n,s){var i;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:(i=s.get(t))!==null&&i!==void 0?i:e}const Yn=(e,t,n)=>{const s=t-e;return((n-e)%s+s)%s+e},qn=e=>Array.isArray(e)&&typeof e[0]!="number";function mi(e,t){return qn(e)?e[Yn(0,e.length,t)]:e}function gi(e,t,n){for(let s=0;s<e.length;s++){const i=e[s];i.at>t&&i.at<n&&(Kn(e,i),s--)}}function yi(e,t,n,s,i,r){gi(e,i,r);for(let o=0;o<t.length;o++)e.push({value:t[o],at:pt(i,r,s[o]),easing:mi(n,o)})}function vi(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const bi="easeInOut";function wi(e,{defaultTransition:t={},...n}={},s,i){const r=t.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,f=0,h=0;for(let m=0;m<e.length;m++){const g=e[m];if(typeof g=="string"){u.set(g,f);continue}else if(!Array.isArray(g)){u.set(g.name,Xe(f,g.at,c,u));continue}let[S,w,y={}]=g;y.at!==void 0&&(f=Xe(f,y.at,c,u));let v=0;const V=(x,T,M,O=0,b=0)=>{const A=Si(x),{delay:D=0,times:U=fe(A),type:Wt="keyframes",...qs}=T;let{ease:Le=t.ease||"easeOut",duration:L}=T;const Ne=typeof D=="function"?D(O,b):D,$e=A.length,Ke=mt(Wt)?Wt:i==null?void 0:i[Wt];if($e<=2&&Ke){let Ge=100;if($e===2&&xi(A)){const Xs=A[1]-A[0];Ge=Math.abs(Xs)}const ze={...qs};L!==void 0&&(ze.duration=F(L));const Ue=Un(ze,Ge,Ke);Le=Ue.ease,L=Ue.duration}L??(L=r);const We=f+Ne,_e=We+L;U.length===1&&U[0]===0&&(U[1]=1);const ke=U.length-A.length;ke>0&&jn(U,ke),A.length===1&&A.unshift(null),yi(M,A,Le,U,We,_e),v=Math.max(Ne+L,v),h=Math.max(_e,h)};if(P(S)){const x=Ze(S,a);V(w,y,Je("default",x))}else{const x=Hn(S,w,s,l),T=x.length;for(let M=0;M<T;M++){w=w,y=y;const O=x[M],b=Ze(O,a);for(const A in w)V(w[A],Ti(y,A),Je(A,b),M,T)}}c=f,f+=v}return a.forEach((m,g)=>{for(const S in m){const w=m[S];w.sort(vi);const y=[],v=[],V=[];for(let T=0;T<w.length;T++){const{at:M,value:O,easing:b}=w[T];y.push(O),v.push(Q(0,h,M)),V.push(b||"easeOut")}v[0]!==0&&(v.unshift(0),y.unshift(y[0]),V.unshift(bi)),v[v.length-1]!==1&&(v.push(1),y.push(null)),o.has(g)||o.set(g,{keyframes:{},transition:{}});const x=o.get(g);x.keyframes[S]=y,x.transition[S]={...t,duration:h,ease:V,times:v,...n}}}),o}function Ze(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Je(e,t){return t[e]||(t[e]=[]),t[e]}function Si(e){return Array.isArray(e)?e:[e]}function Ti(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const Vi=e=>typeof e=="number",xi=e=>e.every(Vi),$=new WeakMap,gt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],q=new Set(gt),Ai={type:"spring",stiffness:500,damping:25,restSpeed:10},Mi=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ei={type:"keyframes",duration:.8},Ci={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pi=(e,{keyframes:t})=>t.length>2?Ei:q.has(e)?e.startsWith("scale")?Mi(t[1]):Ai:Ci;function de(e,t){return e?e[t]||e.default||e:void 0}const Fi=e=>e!==null;function yt(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(Fi),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const Xn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Oi=1e-7,Di=12;function Bi(e,t,n,s,i){let r,o,a=0;do o=t+(n-t)/2,r=Xn(o,s,i)-e,r>0?n=o:t=o;while(Math.abs(r)>Oi&&++a<Di);return o}function tt(e,t,n,s){if(e===t&&n===s)return K;const i=r=>Bi(r,0,1,e,n);return r=>r===0||r===1?r:Xn(i(r),t,s)}const pe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,me=e=>t=>1-e(1-t),ge=tt(.33,1.53,.69,.99),It=me(ge),ye=pe(It),ve=e=>(e*=2)<1?.5*It(e):.5*(2-Math.pow(2,-10*(e-1))),Rt=e=>1-Math.sin(Math.acos(e)),Zn=me(Rt),be=pe(Rt),Jn=e=>/^0[^.\s]+$/u.test(e);function Ii(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Jn(e):!0}const Qn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ts=e=>t=>typeof t=="string"&&t.startsWith(e),es=ts("--"),Ri=ts("var(--"),we=e=>Ri(e)?Li.test(e.split("/*")[0].trim()):!1,Li=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ni=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $i(e){const t=Ni.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}const Ki=4;function ns(e,t,n=1){exports.invariant(n<=Ki,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[s,i]=$i(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return Qn(o)?parseFloat(o):o}return we(i)?ns(i,t,n+1):i}const et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},lt={...et,transform:e=>z(0,1,e)},bt={...et,default:1},vt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),W=vt("deg"),Z=vt("%"),d=vt("px"),Wi=vt("vh"),_i=vt("vw"),Qe={...Z,parse:e=>Z.parse(e)/100,transform:e=>Z.transform(e*100)},ki=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),tn=e=>e===et||e===d,en=(e,t)=>parseFloat(e.split(", ")[t]),nn=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return en(i[1],t);{const r=s.match(/^matrix\((.+)\)$/u);return r?en(r[1],e):0}},Gi=new Set(["x","y","z"]),zi=gt.filter(e=>!Gi.has(e));function Ui(e){const t=[];return zi.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const J={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:nn(4,13),y:nn(5,14)};J.translateX=J.x;J.translateY=J.y;const ss=e=>t=>t.test(e),ji={test:e=>e==="auto",parse:e=>e},is=[et,d,Z,W,_i,Wi,ji],sn=e=>is.find(ss(e)),H=new Set;let qt=!1,Xt=!1;function rs(){if(Xt){const e=Array.from(H).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=Ui(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Xt=!1,qt=!1,H.forEach(e=>e.complete()),H.clear()}function os(){H.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Xt=!0)})}function Hi(){os(),rs()}class Se{constructor(t,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(H.add(this),qt||(qt=!0,E.read(os),E.resolveKeyframes(rs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let r=0;r<t.length;r++)if(t[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),H.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,H.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ot=e=>Math.round(e*1e5)/1e5,Te=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yi(e){return e==null}const qi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ve=(e,t)=>n=>!!(typeof n=="string"&&qi.test(n)&&n.startsWith(e)||t&&!Yi(n)&&Object.prototype.hasOwnProperty.call(n,t)),as=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Te);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Xi=e=>z(0,255,e),kt={...et,transform:e=>Math.round(Xi(e))},j={test:Ve("rgb","red"),parse:as("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+kt.transform(e)+", "+kt.transform(t)+", "+kt.transform(n)+", "+ot(lt.transform(s))+")"};function Zi(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Zt={test:Ve("#"),parse:Zi,transform:j.transform},X={test:Ve("hsl","hue"),parse:as("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Z.transform(ot(t))+", "+Z.transform(ot(n))+", "+ot(lt.transform(s))+")"},C={test:e=>j.test(e)||Zt.test(e)||X.test(e),parse:e=>j.test(e)?j.parse(e):X.test(e)?X.parse(e):Zt.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?j.transform(e):X.transform(e)},Ji=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Qi(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Te))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ji))===null||n===void 0?void 0:n.length)||0)>0}const ls="number",us="color",tr="var",er="var(",rn="${}",nr=/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 ut(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(nr,l=>(C.test(l)?(s.color.push(r),i.push(us),n.push(C.parse(l))):l.startsWith(er)?(s.var.push(r),i.push(tr),n.push(l)):(s.number.push(r),i.push(ls),n.push(parseFloat(l))),++r,rn)).split(rn);return{values:n,split:a,indexes:s,types:i}}function cs(e){return ut(e).values}function fs(e){const{split:t,types:n}=ut(e),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=n[o];a===ls?r+=ot(i[o]):a===us?r+=C.transform(i[o]):r+=i[o]}return r}}const sr=e=>typeof e=="number"?0:e;function ir(e){const t=cs(e);return fs(e)(t.map(sr))}const nt={test:Qi,parse:cs,createTransformer:fs,getAnimatableNone:ir},rr=new Set(["brightness","contrast","saturate","opacity"]);function or(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Te)||[];if(!s)return e;const i=n.replace(s,"");let r=rr.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const ar=/\b([a-z-]*)\(.*?\)/gu,Jt={...nt,getAnimatableNone:e=>{const t=e.match(ar);return t?t.map(or).join(" "):e}},Qt={borderWidth:d,borderTopWidth:d,borderRightWidth:d,borderBottomWidth:d,borderLeftWidth:d,borderRadius:d,radius:d,borderTopLeftRadius:d,borderTopRightRadius:d,borderBottomRightRadius:d,borderBottomLeftRadius:d,width:d,maxWidth:d,height:d,maxHeight:d,top:d,right:d,bottom:d,left:d,padding:d,paddingTop:d,paddingRight:d,paddingBottom:d,paddingLeft:d,margin:d,marginTop:d,marginRight:d,marginBottom:d,marginLeft:d,backgroundPositionX:d,backgroundPositionY:d},lr={rotate:W,rotateX:W,rotateY:W,rotateZ:W,scale:bt,scaleX:bt,scaleY:bt,scaleZ:bt,skew:W,skewX:W,skewY:W,distance:d,translateX:d,translateY:d,translateZ:d,x:d,y:d,z:d,perspective:d,transformPerspective:d,opacity:lt,originX:Qe,originY:Qe,originZ:d},on={...et,transform:Math.round},xe={...Qt,...lr,zIndex:on,size:d,fillOpacity:lt,strokeOpacity:lt,numOctaves:on},ur={...xe,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:Jt,WebkitFilter:Jt},Ae=e=>ur[e];function hs(e,t){let n=Ae(e);return n!==Jt&&(n=nt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cr=new Set(["auto","none","0"]);function fr(e,t,n){let s=0,i;for(;s<e.length&&!i;){const r=e[s];typeof r=="string"&&!cr.has(r)&&ut(r).values.length&&(i=e[s]),s++}if(i&&n)for(const r of t)e[r]=hs(n,i)}class ds extends Se{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),we(u))){const c=ns(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!ki.has(s)||t.length!==2)return;const[i,r]=t,o=sn(i),a=sn(r);if(o!==a)if(tn(o)&&tn(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)Ii(t[i])&&s.push(i);s.length&&fr(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=J[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=J[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const an=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nt.test(e)||e==="0")&&!e.startsWith("url("));function hr(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function dr(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],o=an(i,t),a=an(r,t);return exports.warning(o===a,`You are trying to animate ${t} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`),!o||!a?!1:hr(e)||(n==="spring"||mt(n))&&s}const pr=40;class ps{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=N.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>pr?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Hi(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=N.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!dr(t,s,i,r))if(o)this.options.duration=0;else{l==null||l(yt(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function te({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],h={done:!1,value:f},m=b=>a!==void 0&&b<a||l!==void 0&&b>l,g=b=>a===void 0?l:l===void 0||Math.abs(a-b)<Math.abs(l-b)?a:l;let S=n*t;const w=f+S,y=o===void 0?w:o(w);y!==w&&(S=y-f);const v=b=>-S*Math.exp(-b/s),V=b=>y+v(b),x=b=>{const A=v(b),D=V(b);h.done=Math.abs(A)<=u,h.value=h.done?y:D};let T,M;const O=b=>{m(h.value)&&(T=b,M=Dt({keyframes:[h.value,g(h.value)],velocity:Gn(V,b,h.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return O(0),{calculatedDuration:null,next:b=>{let A=!1;return!M&&T===void 0&&(A=!0,x(b),O(b)),T!==void 0&&b>=T?M.next(b-T):(!A&&x(b),h)}}}const ms=tt(.42,0,1,1),gs=tt(0,0,.58,1),Me=tt(.42,0,.58,1),Ee=e=>Array.isArray(e)&&typeof e[0]=="number",ln={linear:K,easeIn:ms,easeInOut:Me,easeOut:gs,circIn:Rt,circInOut:be,circOut:Zn,backIn:It,backInOut:ye,backOut:ge,anticipate:ve},ee=e=>{if(Ee(e)){exports.invariant(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,s,i]=e;return tt(t,n,s,i)}else if(typeof e=="string")return exports.invariant(ln[e]!==void 0,`Invalid easing type '${e}'`),ln[e];return e},mr=(e,t)=>n=>t(e(n)),Lt=(...e)=>e.reduce(mr);function Gt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,o=0;if(!t)i=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Gt(l,a,e+1/3),r=Gt(l,a,e),o=Gt(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function At(e,t){return n=>n>0?t:e}const zt=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},yr=[Zt,j,X],vr=e=>yr.find(t=>t.test(e));function un(e){const t=vr(e);if(exports.warning(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===X&&(n=gr(n)),n}const cn=(e,t)=>{const n=un(e),s=un(t);if(!n||!s)return At(e,t);const i={...n};return r=>(i.red=zt(n.red,s.red,r),i.green=zt(n.green,s.green,r),i.blue=zt(n.blue,s.blue,r),i.alpha=pt(n.alpha,s.alpha,r),j.transform(i))},ne=new Set(["none","hidden"]);function br(e,t){return ne.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wr(e,t){return n=>pt(e,t,n)}function Ce(e){return typeof e=="number"?wr:typeof e=="string"?we(e)?At:C.test(e)?cn:Vr:Array.isArray(e)?ys:typeof e=="object"?C.test(e)?cn:Sr:At}function ys(e,t){const n=[...e],s=n.length,i=e.map((r,o)=>Ce(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Sr(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=Ce(e[i])(e[i],t[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Tr(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],a=e.indexes[o][i[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;s[r]=l,i[o]++}return s}const Vr=(e,t)=>{const n=nt.createTransformer(t),s=ut(e),i=ut(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ne.has(e)&&!i.values.length||ne.has(t)&&!s.values.length?br(e,t):Lt(ys(Tr(s,i),i.values),n):(exports.warning(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),At(e,t))};function Pe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?pt(e,t,n):Ce(e)(e,t)}function xr(e,t,n){const s=[],i=n||Pe,r=e.length-1;for(let o=0;o<r;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||K:t;a=Lt(l,a)}s.push(a)}return s}function Nt(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const r=e.length;if(exports.invariant(r===t.length,"Both input and output ranges must be the same length"),r===1)return()=>t[0];if(r===2&&e[0]===e[1])return()=>t[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=xr(t,s,i),a=o.length,l=u=>{let c=0;if(a>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const f=Q(e[c],e[c+1],u);return o[c](f)};return n?u=>l(z(e[0],e[r-1],u)):l}function Ar(e,t){return e.map(n=>n*t)}function Mr(e,t){return e.map(()=>t||Me).splice(0,e.length-1)}function ct({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=qn(s)?s.map(ee):ee(s),r={done:!1,value:t[0]},o=Ar(n&&n.length===t.length?n:fe(t),e),a=Nt(o,t,{ease:Array.isArray(i)?i:Mr(t,i)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}const Er=e=>{const t=({timestamp:n})=>e(n);return{start:()=>E.update(t,!0),stop:()=>R(t),now:()=>Y.isProcessing?Y.timestamp:N.now()}},Cr={decay:te,inertia:te,tween:ct,keyframes:ct,spring:Dt},Pr=e=>e/100;class $t extends ps{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Se,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(r,a,n,s,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=mt(n)?n:Cr[n]||ct;let l,u;a!==ct&&typeof t[0]!="number"&&(process.env.NODE_ENV!=="production"&&exports.invariant(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l=Lt(Pr,Pe(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});r==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=zn(c));const{calculatedDuration:f}=c,h=f+i,m=h*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:b}=this.options;return{done:!0,value:b[b.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=s;if(this.startTime===null)return r.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:S,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let V=this.currentTime,x=r;if(m){const b=Math.min(this.currentTime,c)/f;let A=Math.floor(b),D=b%1;!D&&b>=1&&(D=1),D===1&&A--,A=Math.min(A,m+1),!!(A%2)&&(g==="reverse"?(D=1-D,S&&(D-=S/f)):g==="mirror"&&(x=o)),V=z(0,1,D)*f}const T=v?{done:!1,value:l[0]}:x.next(V);a&&(T.value=a(T.value));let{done:M}=T;!v&&u!==null&&(M=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return O&&i!==void 0&&(T.value=yt(l,this.options,i)),w&&w(T.value),O&&this.finish(),T}get duration(){const{resolved:t}=this;return t?I(t.calculatedDuration):0}get time(){return I(this.currentTime)}set time(t){t=F(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=I(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Er,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&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)}}function Fr(e){return new $t(e)}const Or=new Set(["opacity","clipPath","filter","transform"]),Dr=10,Br=(e,t)=>{let n="";const s=Math.max(Math.round(t/Dr),2);for(let i=0;i<s;i++)n+=e(Q(0,s-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`},Ir={linearEasing:void 0};function Rr(e,t){const n=Ot(e);return()=>{var s;return(s=Ir[t])!==null&&s!==void 0?s:n()}}const ft=Rr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function vs(e){return!!(typeof e=="function"&&ft()||!e||typeof e=="string"&&(e in se||ft())||Ee(e)||Array.isArray(e)&&e.every(vs))}const rt=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,se={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:rt([0,.65,.55,1]),circOut:rt([.55,0,1,.45]),backIn:rt([.31,.01,.66,-.59]),backOut:rt([.33,1.53,.69,.99])};function bs(e,t){if(e)return typeof e=="function"&&ft()?Br(e,t):Ee(e)?rt(e):Array.isArray(e)?e.map(n=>bs(n,t)||se.easeOut):se[e]}function ws(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=bs(a,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function Mt(e,t){e.timeline=t,e.onfinish=null}const Ss=Ot(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Et=10,Lr=2e4;function Nr(e){return mt(e.type)||e.type==="spring"||!vs(e.ease)}function $r(e,t){const n=new $t({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let r=0;for(;!s.done&&r<Lr;)s=n.sample(r),i.push(s.value),r+=Et;return{times:void 0,keyframes:i,duration:r-Et,ease:"linear"}}const Ts={anticipate:ve,backInOut:ye,circInOut:be};function Kr(e){return e in Ts}class fn extends ps{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new ds(r,(o,a)=>this.onKeyframesResolved(o,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){var s;let{duration:i=300,times:r,ease:o,type:a,motionValue:l,name:u,startTime:c}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(typeof o=="string"&&ft()&&Kr(o)&&(o=Ts[o]),Nr(this.options)){const{onComplete:h,onUpdate:m,motionValue:g,element:S,...w}=this.options,y=$r(t,w);t=y.keyframes,t.length===1&&(t[1]=t[0]),i=y.duration,r=y.times,o=y.ease,a="keyframes"}const f=ws(l.owner.current,u,t,{...this.options,duration:i,times:r,ease:o});return f.startTime=c??this.calcStartTime(),this.pendingTimeline?(Mt(f,this.pendingTimeline),this.pendingTimeline=void 0):f.onfinish=()=>{const{onComplete:h}=this.options;l.set(yt(t,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:f,duration:i,times:r,type:a,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return I(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return I(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=F(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return K;const{animation:s}=n;Mt(s,t)}return K}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:r,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:f,element:h,...m}=this.options,g=new $t({...m,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),S=F(this.time);u.setWithVelocity(g.sample(S-Et).value,g.sample(S).value,Et)}const{onStop:l}=this.options;l&&l(),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:n,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=t;return Ss()&&s&&Or.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}function Wr({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const Vs=(e,t,n,s={},i,r)=>o=>{const a=de(s,e)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-F(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:r?void 0:i};Wr(a)||(c={...c,...Pi(e,c)}),c.duration&&(c.duration=F(c.duration)),c.repeatDelay&&(c.repeatDelay=F(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),f&&!r&&t.get()!==void 0){const h=yt(c.keyframes,a);if(h!==void 0)return E.update(()=>{c.onUpdate(h),c.onComplete()}),new ce([])}return!r&&fn.supports(c)?new fn(c):new $t(c)},_r=e=>Array.isArray(e),kr=e=>_r(e)?e[e.length-1]||0:e;function hn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function xs(e,t,n,s){if(typeof t=="function"){const[i,r]=hn(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=hn(s);t=t(n!==void 0?n:e.custom,i,r)}return t}function Gr(e,t,n){const s=e.getProps();return xs(s,t,s.custom,e)}function zr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,B(n))}function Ur(e,t){const n=Gr(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=kr(r[o]);zr(e,o,a)}}const Fe=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),jr="framerAppearId",Hr="data-"+Fe(jr);function Yr(e){return e.props[Hr]}function qr(e){return!!(P(e)&&e.add)}function Xr(e,t){const n=e.getValue("willChange");if(qr(n))return n.add(t)}function Zr({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Jr(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;s&&(o=s);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const h=e.getValue(f,(r=e.latestValues[f])!==null&&r!==void 0?r:null),m=l[f];if(m===void 0||c&&Zr(c,f))continue;const g={delay:n,...de(o||{},f)};let S=!1;if(window.MotionHandoffAnimation){const y=Yr(e);if(y){const v=window.MotionHandoffAnimation(y,f,E);v!==null&&(g.startTime=v,S=!0)}}Xr(e,f),h.start(Vs(f,h,m,e.shouldReduceMotion&&q.has(f)?{type:!1}:g,e,S));const w=h.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{E.update(()=>{a&&Ur(e,a)})}),u}function Qr(e){return e instanceof SVGElement&&e.tagName!=="svg"}const to={};function eo(e,{layout:t,layoutId:n}){return q.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!to[e]||e==="opacity")}function As(e,t,n){var s;const{style:i}=e,r={};for(const o in i)(P(i[o])||t.style&&P(t.style[o])||eo(o,e)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function no(e,t,n){const s=As(e,t,n);for(const i in e)if(P(e[i])||P(t[i])){const r=gt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}const so=typeof window<"u",ie={current:null},Ms={current:!1};function io(){if(Ms.current=!0,!!so)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ie.current=e.matches;e.addListener(t),t()}else ie.current=!1}function ro(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function oo(e){return typeof e=="string"||Array.isArray(e)}const ao=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lo=["initial",...ao];function Es(e){return ro(e.animate)||lo.some(t=>oo(e[t]))}function uo(e){return!!(Es(e)||e.variants)}function co(e,t,n){for(const s in t){const i=t[s],r=n[s];if(P(i))e.addValue(s,i),process.env.NODE_ENV==="development"&&Ft(i.version==="11.11.11",`Attempting to mix Framer Motion versions ${i.version} with 11.11.11 may not work as expected.`);else if(P(r))e.addValue(s,B(i,{owner:e}));else if(r!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,B(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const dn={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"]},re={};for(const e in dn)re[e]={isEnabled:t=>dn[e].some(n=>!!t[n])};const fo=[...is,C,nt],ho=e=>fo.find(ss(e)),pn=()=>({min:0,max:0}),Oe=()=>({x:pn(),y:pn()}),mn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cs{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Se,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.renderScheduledAt=0,this.scheduleRender=()=>{const h=N.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,E.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Es(n),this.isVariantNode=uo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const m=f[h];l[h]!==void 0&&P(m)&&m.set(l[h],!1)}}mount(t){this.current=t,$.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((n,s)=>this.bindToMotionValue(s,n)),Ms.current||io(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ie.current,process.env.NODE_ENV!=="production"&&Ft(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){$.delete(this.current),this.projection&&this.projection.unmount(),R(this.notifyUpdate),R(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=q.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&E.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in re){const n=re[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Oe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<mn.length;s++){const i=mn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=co(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}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=B(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Qn(i)||Jn(i))?i=parseFloat(i):!ho(i)&&nt.test(n)&&(i=hs(t,n)),this.setBaseTarget(t,P(i)?i.get():i)),P(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=xs(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!P(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Wn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ps extends Cs{constructor(){super(...arguments),this.KeyframeResolver=ds}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}}const Fs=(e,t)=>t&&typeof e=="number"?t.transform(e):e,po={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mo=gt.length;function go(e,t,n){let s="",i=!0;for(let r=0;r<mo;r++){const o=gt[r],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Fs(a,xe[o]);if(!l){i=!1;const c=po[o]||o;s+=`${c}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Os(e,t,n){const{style:s,vars:i,transformOrigin:r}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(q.has(l)){o=!0;continue}else if(es(l)){i[l]=u;continue}else{const c=Fs(u,xe[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(t.transform||(o||n?s.transform=go(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function gn(e,t,n){return typeof e=="string"?e:d.transform(t+n*e)}function yo(e,t,n){const s=gn(t,e.x,e.width),i=gn(n,e.y,e.height);return`${s} ${i}`}const vo={offset:"stroke-dashoffset",array:"stroke-dasharray"},bo={offset:"strokeDashoffset",array:"strokeDasharray"};function wo(e,t,n=1,s=0,i=!0){e.pathLength=1;const r=i?vo:bo;e[r.offset]=d.transform(-s);const o=d.transform(t),a=d.transform(n);e[r.array]=`${o} ${a}`}function So(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(Os(e,u,f),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:g}=e;h.transform&&(g&&(m.transform=h.transform),delete h.transform),g&&(i!==void 0||r!==void 0||m.transform)&&(m.transformOrigin=yo(g,i!==void 0?i:.5,r!==void 0?r:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),o!==void 0&&wo(h,o,a,l,!1)}const Ds=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 Bs(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const r in n)e.style.setProperty(r,n[r])}function To(e,t,n,s){Bs(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Ds.has(i)?i:Fe(i),t.attrs[i])}const Vo=e=>typeof e=="string"&&e.toLowerCase()==="svg";class xo extends Ps{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Oe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(q.has(n)){const s=Ae(n);return s&&s.default||0}return n=Ds.has(n)?n:Fe(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return no(t,n,s)}build(t,n,s){So(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){To(t,n,s,i)}mount(t){this.isSVGTag=Vo(t.tagName),super.mount(t)}}function Ao({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Mo(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Eo(e,t){return Ao(Mo(e.getBoundingClientRect(),t))}function Co(e){return window.getComputedStyle(e)}class Po extends Ps{constructor(){super(...arguments),this.type="html",this.renderInstance=Bs}readValueFromInstance(t,n){if(q.has(n)){const s=Ae(n);return s&&s.default||0}else{const s=Co(t),i=(es(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Eo(t,n)}build(t,n,s){Os(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return As(t,n,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;P(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Fo(e,t){return e in t}class Oo extends Cs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Fo(n,t)){const s=t[n];if(typeof s=="string"||typeof s=="number")return s}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Oe()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function Is(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Qr(e)?new xo(t):new Po(t);n.mount(e),$.set(e,n)}function Do(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Oo(t);n.mount(e),$.set(e,n)}function Bo(e,t,n){const s=P(e)?e:B(e);return s.start(Vs("",s,t,n)),s.animation}function Io(e,t){return P(e)||typeof e=="number"||typeof e=="string"&&!he(t)}function Rs(e,t,n,s){const i=[];if(Io(e,t))i.push(Bo(e,he(t)&&t.default||t,n&&(n.default||n)));else{const r=Hn(e,t,s),o=r.length;exports.invariant(!!o,"No valid elements provided.");for(let a=0;a<o;a++){const l=r[a],u=l instanceof Element?Is:Do;$.has(l)||u(l);const c=$.get(l),f={...n};"delay"in f&&typeof f.delay=="function"&&(f.delay=f.delay(a,o)),i.push(...Jr(c,{...t,transition:f},{}))}}return i}function Ro(e,t,n){const s=[];return wi(e,t,n,{spring:Dt}).forEach(({keyframes:r,transition:o},a)=>{s.push(...Rs(a,r,o))}),s}function Lo(e){return Array.isArray(e)&&Array.isArray(e[0])}function Ls(e){function t(n,s,i){let r=[];Lo(n)?r=Ro(n,s,e):r=Rs(n,s,i,e);const o=new ce(r);return e&&e.animations.push(o),o}return t}const Ns=Ls();function No(e,t,n){e.style.setProperty(`--${t}`,n)}function $o(e,t,n){e.style[t]=n}const Ko=Ot(()=>{try{document.createElement("div").animate({opacity:[1]})}catch{return!1}return!0}),Tt=new WeakMap;function Wo(e,t,n){for(let s=0;s<t.length;s++)t[s]===null&&(t[s]=s===0?n():t[s-1]),typeof t[s]=="number"&&Qt[e]&&(t[s]=Qt[e].transform(t[s]));!Ko()&&t.length<2&&t.unshift(n())}const yn="easeOut";function vn(e){const t=Tt.get(e)||new Map;return Tt.set(e,t),Tt.get(e)}class _o{constructor(t,n,s,i){const r=n.startsWith("--");this.setValue=r?No:$o,this.options=i,this.updateFinishedPromise(),exports.invariant(typeof i.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "framer-motion"?`);const o=vn(t).get(n);o&&o.stop();const a=()=>n.startsWith("--")?t.style.getPropertyValue(n):window.getComputedStyle(t)[n];if(Array.isArray(s)||(s=[s]),Wo(n,s,a),mt(i.type)){const u=Un(i,100,i.type);i.ease=ft()?u.ease:yn,i.duration=F(u.duration),i.type="keyframes"}else i.ease=i.ease||yn;this.removeAnimation=()=>{var u;return(u=Tt.get(t))===null||u===void 0?void 0:u.delete(n)};const l=()=>{this.setValue(t,n,yt(s,this.options)),this.cancel(),this.resolveFinishedPromise()};Ss()?(this.animation=ws(t,n,s,i),i.autoplay===!1&&this.animation.pause(),this.animation.onfinish=l,this.pendingTimeline&&Mt(this.animation,this.pendingTimeline),vn(t).set(n,this)):l()}get duration(){return I(this.options.duration||300)}get time(){var t;return this.animation?I(((t=this.animation)===null||t===void 0?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=F(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}play(){this.state==="finished"&&this.updateFinishedPromise(),this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){!this.animation||this.state==="idle"||this.state==="finished"||(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}complete(){this.animation&&this.animation.finish()}cancel(){this.removeAnimation();try{this.animation&&this.animation.cancel()}catch{}}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}attachTimeline(t){return this.animation?Mt(this.animation,t):this.pendingTimeline=t,K}}function ko(e,t,n,s){const i=Bt(e,s),r=i.length;exports.invariant(!!r,"No valid element provided.");const o=[];for(let a=0;a<r;a++){const l=i[a],u={...n};typeof u.delay=="function"&&(u.delay=u.delay(a,r));for(const c in t){const f=t[c],h={...de(n,c)};h.duration=h.duration?F(h.duration):h.duration,h.delay=F(h.delay||0),o.push(new _o(l,c,f,h))}}return o}const Go=e=>{function t(n,s,i){return new ce(ko(n,s,i,e))}return t},zo=Go(),Vt=new WeakMap;let _;function Uo(e,t){if(t){const{inlineSize:n,blockSize:s}=t[0];return{width:n,height:s}}else return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}function jo({target:e,contentRect:t,borderBoxSize:n}){var s;(s=Vt.get(e))===null||s===void 0||s.forEach(i=>{i({target:e,contentSize:t,get size(){return Uo(e,n)}})})}function Ho(e){e.forEach(jo)}function Yo(){typeof ResizeObserver>"u"||(_=new ResizeObserver(Ho))}function qo(e,t){_||Yo();const n=Bt(e);return n.forEach(s=>{let i=Vt.get(s);i||(i=new Set,Vt.set(s,i)),i.add(t),_==null||_.observe(s)}),()=>{n.forEach(s=>{const i=Vt.get(s);i==null||i.delete(t),i!=null&&i.size||_==null||_.unobserve(s)})}}const xt=new Set;let at;function Xo(){at=()=>{const e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};xt.forEach(n=>n(t))},window.addEventListener("resize",at)}function Zo(e){return xt.add(e),at||Xo(),()=>{xt.delete(e),!xt.size&&at&&(at=void 0)}}function Jo(e,t){return typeof e=="function"?Zo(e):qo(e,t)}const Qo=50,bn=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),ta=()=>({time:0,x:bn(),y:bn()}),ea={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function wn(e,t,n,s){const i=n[t],{length:r,position:o}=ea[t],a=i.current,l=n.time;i.current=e[`scroll${o}`],i.scrollLength=e[`scroll${r}`]-e[`client${r}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=Q(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>Qo?0:ue(i.current-a,u)}function na(e,t,n){wn(e,"x",t,n),wn(e,"y",t,n),t.time=n}function sa(e,t){const n={x:0,y:0};let s=e;for(;s&&s!==t;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s.tagName==="svg"){const i=s.getBoundingClientRect();s=s.parentElement;const r=s.getBoundingClientRect();n.x+=i.left-r.left,n.y+=i.top-r.top}else if(s instanceof SVGGraphicsElement){const{x:i,y:r}=s.getBBox();n.x+=i,n.y+=r;let o=null,a=s.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=s.parentNode;s=o}else break;return n}const ia={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},oe={start:0,center:.5,end:1};function Sn(e,t,n=0){let s=0;if(e in oe&&(e=oe[e]),typeof e=="string"){const i=parseFloat(e);e.endsWith("px")?s=i:e.endsWith("%")?e=i/100:e.endsWith("vw")?s=i/100*document.documentElement.clientWidth:e.endsWith("vh")?s=i/100*document.documentElement.clientHeight:e=i}return typeof e=="number"&&(s=t*e),n+s}const ra=[0,0];function oa(e,t,n,s){let i=Array.isArray(e)?e:ra,r=0,o=0;return typeof e=="number"?i=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?i=e.split(" "):i=[e,oe[e]?e:"0"]),r=Sn(i[0],n,s),o=Sn(i[1],t),r-o}const aa={x:0,y:0};function la(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function ua(e,t,n){const{offset:s=ia.All}=n,{target:i=e,axis:r="y"}=n,o=r==="y"?"height":"width",a=i!==e?sa(i,e):aa,l=i===e?{width:e.scrollWidth,height:e.scrollHeight}:la(i),u={width:e.clientWidth,height:e.clientHeight};t[r].offset.length=0;let c=!t[r].interpolate;const f=s.length;for(let h=0;h<f;h++){const m=oa(s[h],u[o],l[o],a[r]);!c&&m!==t[r].interpolatorOffsets[h]&&(c=!0),t[r].offset[h]=m}c&&(t[r].interpolate=Nt(t[r].offset,fe(s)),t[r].interpolatorOffsets=[...t[r].offset]),t[r].progress=t[r].interpolate(t[r].current)}function ca(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let s=t;for(;s&&s!==e;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight,process.env.NODE_ENV!=="production"&&e&&t&&t!==e&&Ft(getComputedStyle(e).position!=="static","Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.")}function fa(e,t,n,s={}){return{measure:()=>ca(e,s.target,n),update:i=>{na(e,n,i),(s.offset||s.target)&&ua(e,n,s)},notify:()=>t(n)}}const st=new WeakMap,Tn=new WeakMap,Ut=new WeakMap,Vn=e=>e===document.documentElement?window:e;function Kt(e,{container:t=document.documentElement,...n}={}){let s=Ut.get(t);s||(s=new Set,Ut.set(t,s));const i=ta(),r=fa(t,e,i,n);if(s.add(r),!st.has(t)){const a=()=>{for(const h of s)h.measure()},l=()=>{for(const h of s)h.update(Y.timestamp)},u=()=>{for(const h of s)h.notify()},c=()=>{E.read(a,!1,!0),E.read(l,!1,!0),E.update(u,!1,!0)};st.set(t,c);const f=Vn(t);window.addEventListener("resize",c,{passive:!0}),t!==document.documentElement&&Tn.set(t,Jo(t,c)),f.addEventListener("scroll",c,{passive:!0})}const o=st.get(t);return E.read(o,!1,!0),()=>{var a;R(o);const l=Ut.get(t);if(!l||(l.delete(r),l.size))return;const u=st.get(t);st.delete(t),u&&(Vn(t).removeEventListener("scroll",u),(a=Tn.get(t))===null||a===void 0||a(),window.removeEventListener("resize",u))}}function $s(e,t){let n;const s=()=>{const{currentTime:i}=t,o=(i===null?0:i.value)/100;n!==o&&e(o),n=o};return E.update(s,!0),()=>R(s)}function ha({source:e,container:t,axis:n="y"}){e&&(t=e);const s={value:0},i=Kt(r=>{s.value=r[n].progress*100},{container:t,axis:n});return{currentTime:s,cancel:i}}const jt=new Map;function Ks({source:e,container:t=document.documentElement,axis:n="y"}={}){e&&(t=e),jt.has(t)||jt.set(t,{});const s=jt.get(t);return s[n]||(s[n]=kn()?new ScrollTimeline({source:t,axis:n}):ha({source:t,axis:n})),s[n]}function da(e){return e.length===2}function Ws(e){return e&&(e.target||e.offset)}function pa(e,t){return da(e)||Ws(t)?Kt(n=>{e(n[t.axis].progress,n)},t):$s(e,Ks(t))}function ma(e,t){if(Ws(t))return e.pause(),Kt(n=>{e.time=e.duration*n[t.axis].progress},t);{const n=Ks(t);return e.attachTimeline(n,s=>(s.pause(),$s(i=>{s.time=s.duration*i},n)))}}function _s(e,{axis:t="y",...n}={}){const s={axis:t,...n};return typeof e=="function"?pa(e,s):ma(e,s)}const ga={some:0,all:1};function ks(e,t,{root:n,margin:s,amount:i="some"}={}){const r=Bt(e),o=new WeakMap,a=u=>{u.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const h=t(c);typeof h=="function"?o.set(c.target,h):l.unobserve(c.target)}else f&&(f(c),o.delete(c.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof i=="number"?i:ga[i]});return r.forEach(u=>l.observe(u)),()=>l.disconnect()}function ya(e,t="end"){return n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const s=n*e,i=t==="end"?Math.floor(s):Math.ceil(s);return z(0,1,i/e)}}function va(e,t){if(e==="first")return 0;{const n=t-1;return e==="last"?n:n/2}}function ba(e=.1,{startDelay:t=0,from:n=0,ease:s}={}){return(i,r)=>{const o=typeof n=="number"?n:va(n,r),a=Math.abs(o-i);let l=e*a;if(s){const u=r*e;l=ee(s)(l/u)*u}return t+l}}const wa=e=>e&&typeof e=="object"&&e.mix,Sa=e=>wa(e)?e.mix:void 0;function Gs(...e){const t=!Array.isArray(e[0]),n=t?0:-1,s=e[0+n],i=e[1+n],r=e[2+n],o=e[3+n],a=Nt(i,r,{mixer:Sa(r[0]),...o});return t?a(s):a}function Ta(e,t){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=t&&(R(s),e(r-t))};return E.read(s,!0),()=>R(s)}function Va(e,t){return Ta(e,F(t))}const ae=(e,t)=>Math.abs(e-t);function xa(e,t){const n=ae(e.x,t.x),s=ae(e.y,t.y);return Math.sqrt(n**2+s**2)}const Aa=E,Ma=it.reduce((e,t)=>(e[t]=n=>R(n),e),{});function Ea(e){return typeof e=="function"?e():p.unref(e)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xn=e=>typeof e<"u";function Ca(e){var t;const n=Ea(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Pa(){const e=p.ref(),t=p.computed(()=>{var n,s;return["#text","#comment"].includes((n=e.value)==null?void 0:n.$el.nodeName)?(s=e.value)==null?void 0:s.$el.nextElementSibling:Ca(e)});return{primitiveElement:e,currentElement:t}}function De(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,s=Symbol(n);return[o=>{const a=p.inject(s,o);if(a||a===null)return a;throw new Error(`Injection \`${s.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(p.provide(s,o),o)]}function ht(e){return!!(e&&e.getVelocity)}const[Fa,Oa]=De("Motion"),[Da,Sl]=De("AnimatePresenceContext");function An(e,t){if(typeof e=="object")return e;if(e&&t)return t[e]}function Ba(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!Ia(e,t):e!==t}function Ia(e,t){const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}function Ra(e,t){!e.includes(t)&&e.push(t)}function La(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1)}function Na(e,t){return e[t]?{...e,...e[t]}:{...e}}function Mn(e){return e==null?void 0:e.startsWith("--")}function $a(){}const Ka=e=>e;function Wa(e){return typeof e=="number"}const _a=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],ka=new Set(_a);function En(e){return ka.has(e)}const Cn={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:e=>`${e}deg`},Ga={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:e=>`${e}px`},rotate:Cn,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Ka},skew:Cn},za=["translate","scale","rotate","skew"],Ua=["","X","Y","Z"],Be=new Map,Ct=["x","y","z"];za.forEach(e=>{Ua.forEach(t=>{Ct.push(e+t),Be.set(e+t,Ga[e])})});const ja=new Set(Ct),Ha=e=>ja.has(e),Pn={x:"translateX",y:"translateY",z:"translateZ"};function Ya([e],[t]){return Ct.indexOf(e)-Ct.indexOf(t)}function qa(e,[t,n]){return`${e} ${t}(${n})`}function Xa(e){return e.sort(Ya).reduce(qa,"").trim()}const Za={translate:[0,0],rotate:0,scale:1,skew:0,x:0,y:0,z:0},zs={get:(e,t)=>{let n=Mn(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!=="0"){const s=Be.get(t);s&&(n=s.initialValue)}return n},set:(e,t,n)=>{Mn(t)?e.style.setProperty(t,n):e.style[t]=n}};function wt(e){var s;const t={},n=[];for(let i in e){let r=e[i];r=ht(r)?r.get():r,Ha(i)&&i in Pn&&(i=Pn[i]);let o=Array.isArray(r)?r[0]:r;const a=Be.get(i);a?(o=Wa(r)?(s=a.toDefaultUnit)==null?void 0:s.call(a,r):r,n.push([i,o])):t[i]=o}return n.length&&(t.transform=Xa(n)),t}function Us(e){return e?e.flatMap(t=>t.type===p.Fragment?Us(t.children):[t]):[]}const Ja=p.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var l,u;if(!n.default)return null;const s=Us(n.default()),i=s.findIndex(c=>c.type!==p.Comment);if(i===-1)return s;const r=s[i];(l=r.props)==null||delete l.ref;const o=r.props?p.mergeProps(t,r.props):t;t.class&&((u=r.props)!=null&&u.class)&&delete r.props.class;const a=p.cloneVNode(r,o);for(const c in o)c.startsWith("on")&&(a.props||(a.props={}),a.props[c]=o[c]);return s.length===1?a:(s[i]=a,s)}}}),Qa=p.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const s=e.asChild?"template":e.as;return typeof s=="string"&&["area","img","input"].includes(s)?()=>p.h(s,t):s!=="template"?()=>p.h(e.as,t,{default:n.default}):()=>p.h(Ja,t,{default:n.default})}});var js=function(){},Hs=function(){};process.env.NODE_ENV!=="production"&&(js=function(e,t){!e&&typeof console<"u"&&console.warn(t)},Hs=function(e,t){if(!e)throw new Error(t)});class Ys{constructor(t){this.state=t}update(){}}class tl{constructor(t){this.features=[],this.features=[new el(t),new nl(t),new sl(t),new il(t)]}mount(){this.features.forEach(t=>t.mount())}unmount(){this.features.forEach(t=>t.unmount())}update(){this.features.forEach(t=>t.update())}}function dt(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:n}}))}class Ie extends Ys{updateGestureSubscriptions(){const t=this.isActive();t&&!this.removeGestureSubscriptions?this.removeGestureSubscriptions=this.subscribeEvents():!t&&this.removeGestureSubscriptions&&(this.removeGestureSubscriptions(),this.removeGestureSubscriptions=void 0)}unmount(){var t;(t=this.removeGestureSubscriptions)==null||t.call(this)}}function Fn(e,t,n){return s=>{s.pointerType&&s.pointerType!=="mouse"||(n(),dt(e,t,s))}}class el extends Ie{isActive(){return!!this.state.getOptions().hover}constructor(t){super(t),this.subscribeEvents=()=>{const n=this.state.getElement(),s=Fn(n,"hoverstart",()=>{this.state.setActive("hover",!0)}),i=Fn(n,"hoverend",()=>{this.state.setActive("hover",!1)});return n.addEventListener("pointerenter",s),n.addEventListener("pointerleave",i),()=>{n.removeEventListener("pointerenter",s),n.removeEventListener("pointerleave",i)}}}mount(){this.updateGestureSubscriptions()}update(){this.updateGestureSubscriptions()}}class nl extends Ie{isActive(){return!!this.state.getOptions().press}constructor(t){super(t),this.subscribeEvents=()=>{const n=this.state.getElement(),s=r=>{this.state.setActive("press",!1),dt(n,"pressend",r),window.removeEventListener("pointerup",s)},i=r=>{this.state.setActive("press",!0),dt(n,"pressstart",r),window.addEventListener("pointerup",s)};return n.addEventListener("pointerdown",i),()=>{n.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",s)}}}mount(){this.updateGestureSubscriptions()}update(){this.updateGestureSubscriptions()}}class sl extends Ie{isActive(){return!!this.state.getOptions().inView}constructor(t){super(t),this.subscribeEvents=()=>{var r;const n=this.state.getElement(),{once:s,...i}=((r=this.state.getOptions())==null?void 0:r.inViewOptions)||{};return ks(n,o=>{if(this.state.setActive("inView",!0),dt(n,"viewenter",o),!s)return a=>{this.state.setActive("inView",!1),dt(n,"viewleave",a)}},i)}}mount(){this.updateGestureSubscriptions()}update(){this.updateGestureSubscriptions()}}class il extends Ys{constructor(){super(...arguments),this.handlers={}}mount(){const t=this.state.getElement();t&&(this.handlers.motionstart=n=>{var i,r;const s=n.detail.target;(r=(i=this.state.getOptions()).onMotionStart)==null||r.call(i,s)},this.handlers.motioncomplete=n=>{var i,r;const s=n.detail.target;(r=(i=this.state.getOptions()).onMotionComplete)==null||r.call(i,s)},this.handlers.hoverstart=n=>{var i,r;const s=n.detail;(r=(i=this.state.getOptions()).onHoverStart)==null||r.call(i,s)},this.handlers.hoverend=n=>{var i,r;const s=n.detail;(r=(i=this.state.getOptions()).onHoverEnd)==null||r.call(i,s)},this.handlers.pressstart=n=>{var i,r;const s=n.detail;(r=(i=this.state.getOptions()).onPressStart)==null||r.call(i,s)},this.handlers.pressend=n=>{var i,r;const s=n.detail;(r=(i=this.state.getOptions()).onPressEnd)==null||r.call(i,s)},this.handlers.viewenter=n=>{var i,r;const s=n.detail.target;(r=(i=this.state.getOptions()).onViewEnter)==null||r.call(i,s)},this.handlers.viewleave=n=>{var i,r;const s=n.detail.target;(r=(i=this.state.getOptions()).onViewLeave)==null||r.call(i,s)},Object.entries(this.handlers).forEach(([n,s])=>{t.addEventListener(n,s)}))}unmount(){const t=this.state.getElement();t&&Object.entries(this.handlers).forEach(([n,s])=>{s&&(t.removeEventListener(n,s),delete this.handlers[n])})}}let G;const On=e=>e.next(),rl=e=>e.animateUpdates();function ol(){if(!G)return;const e=G.sort(ll).map(rl);e.forEach(On),e.forEach(On),G=void 0}function Dn(e){G?Ra(G,e):(G=[e],requestAnimationFrame(ol))}function al(e){G&&La(G,e)}function ll(e,t){return e.getDepth()-t.getDepth()}function Bn(e,t,n){return new CustomEvent(e,{detail:{target:t,isExit:n}})}const In=["initial","animate","inView","hover","press","exit","drag"],Pt=new WeakMap;class ul{constructor(t,n){this.element=null,this.context={},this.activeStates={initial:!0,animate:!0},this.options=t,this.parent=n,this.depth=(n==null?void 0:n.depth)+1||0,this.initContext();const s=t.initial===!1?"animate":"initial";this.featureManager=new tl(this),this.initTarget(s)}initContext(){var t;for(const n of In)this.context[n]=typeof this.options[n]=="string"?this.options[n]:(t=this.parent)==null?void 0:t.context[n]}initTarget(t){this.baseTarget=An(this.options[t]||this.context[t],this.options.variants)||{},this.target={...this.baseTarget}}get initial(){return xn(this.options.initial)?this.options.initial:this.context.initial}mount(t){var s;Hs(!!t,"Animation state must be mounted with valid Element"),this.element=t,Pt.set(t,this),$.get(t)||Is(t);const n=$.get(t);if(this.visualElement=n,n.triggerBuild(),n.update(this.options,(s=this.parent)==null?void 0:s.context),typeof this.initial=="object")for(const i in this.initial)n.setStaticValue(i,this.initial[i]);else if(typeof this.initial=="string"&&this.options.variants)for(const i in this.options.variants[this.initial])n.setStaticValue(i,this.options.variants[this.initial][i]);this.featureManager.mount()}unmount(){var t;Pt.delete(this.element),al(this),(t=$.get(this.element))==null||t.unmount(),this.featureManager.unmount()}update(t){var n;this.options=t,this.visualElement.update(this.options,(n=this.parent)==null?void 0:n.context),this.featureManager.update(),Dn(this)}setActive(t,n){this.element&&(this.activeStates[t]=n,Dn(this))}*animateUpdates(){const t=this.target;this.target={};const n={};for(const l of In){if(!this.activeStates[l])continue;const u=An(xn(this.options[l])?this.options[l]:this.context[l],this.options.variants);if(!u)continue;const c={...t,...u};for(const f in c)f!=="transition"&&(this.target[f]=u[f],n[f]=Na(u.transition??this.options.transition??{},f))}const s=new Set([...Object.keys(this.target),...Object.keys(t)]),i=[];s.forEach(l=>{var u;this.target[l]===void 0&&(this.target[l]=this.baseTarget[l]),Ba(t[l],this.target[l])&&((u=this.baseTarget)[l]??(u[l]=zs.get(this.element,l)),i.push(()=>Ns(this.element,{[l]:this.target[l]==="none"?Za[l]:this.target[l]},n[l]||{})))}),yield;const r=i.map(l=>l()).filter(Boolean);if(!r.length)return;const o=this.target;this.element.dispatchEvent(Bn("motionstart",o));const a=this.activeStates.exit;Promise.all(r).then(()=>{this.element.dispatchEvent(Bn("motioncomplete",{...o},a))}).catch($a)}isMounted(){return!!this.element}getDepth(){return this.depth}getOptions(){return this.options}getElement(){return this.element}getTarget(){return this.target}}const cl=p.defineComponent({name:"Motion",inheritAttrs:!0,__name:"Motion",props:p.mergeDefaults({as:{},asChild:{type:Boolean},inViewOptions:{},inView:{},press:{},hover:{},initial:{type:[String,Object,Boolean]},animate:{},exit:{},variants:{},style:{},transformTemplate:{type:Function},transition:{},onMotionStart:{type:Function},onMotionComplete:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},onPressStart:{type:Function},onPressEnd:{type:Function},onViewEnter:{type:Function},onViewLeave:{type:Function}},{as:"div",asChild:!1,initial:void 0,animate:void 0,hover:void 0,inView:void 0}),setup(e){const t=e,{initial:n}=Da({initial:p.ref(void 0)}),s=Fa(null),i=new ul({...t},s);Oa(i);const{primitiveElement:r,currentElement:o}=Pa();p.onMounted(()=>{i.mount(o.value),En(t.as)&&zs.set(o.value,"opacity",""),i.update({...t,style:{...wt(i.getTarget()),...t.style},initial:n.value===!1?n.value:t.initial===!0?void 0:t.initial})}),p.onUnmounted(()=>{}),p.onUpdated(()=>{i.update({...t,initial:n.value===!1?n.value:t.initial===!0?void 0:t.initial})});function a(){return En(t.as)&&!i.isMounted()?{opacity:0}:i.isMounted()?wt(t.style):{...wt(t.style),...wt(i.getTarget())}}return(l,u)=>(p.openBlock(),p.createBlock(p.unref(Qa),{ref_key:"primitiveElement",ref:r,as:l.as,"as-child":l.asChild,style:p.normalizeStyle(a())},{default:p.withCtx(()=>[p.renderSlot(l.$slots,"default")]),_:3},8,["as","as-child","style"]))}}),le=new WeakMap;function Rn(e){const t=le.get(e);t&&e.removeEventListener("motioncomplete",t),le.delete(e)}const[Tl,fl]=De("AnimatePresenceContext"),hl=p.defineComponent({name:"AnimatePresence",inheritAttrs:!1,__name:"AnimatePresence",props:{mode:{default:"sync"},initial:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},as:{}},setup(e){const t=e,{initial:n}=p.toRefs(t);fl({initial:n});function s(r){const o=Pt.get(r);o&&(Rn(r),o.setActive("exit",!1))}function i(r,o){const a=Pt.get(r);if(!a)return o();a.setActive("exit",!0),Rn(r);function l(u){var c;(c=u==null?void 0:u.detail)!=null&&c.isExit&&o()}le.set(r,l),r.addEventListener("motioncomplete",l)}return(r,o)=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(r.multiple?p.TransitionGroup:p.Transition),p.mergeProps({tag:r.multiple?r.as:void 0,css:!1,mode:r.mode==="wait"?"out-in":void 0},r.$attrs,{onEnter:s,onLeave:i}),{default:p.withCtx(()=>[p.renderSlot(r.$slots,"default")]),_:3},16,["tag","mode"]))}});function Re(e){const t=B(e()),n=()=>t.set(e()),s=()=>E.preRender(n,!1,!0);let i;const r=a=>{i=a.map(l=>l.on("change",s))},o=()=>{i.forEach(a=>a()),R(n)};return p.onUnmounted(()=>{o()}),{subscribe:r,unsubscribe:o,value:t}}function dl(e){k.current=[];const{value:t,subscribe:n,unsubscribe:s}=Re(e);return n(k.current),k.current=void 0,p.onBeforeUpdate(()=>{s(),k.current=[],e(),n(k.current),k.current=void 0}),t}function pl(e,t,n,s){if(typeof e=="function")return dl(e);const i=typeof t=="function"?t:Gs(t,n,s);return Array.isArray(e)?Ln(e,i):Ln([e],([r])=>i(r))}function Ln(e,t){const n=[],{value:s,subscribe:i}=Re(()=>{n.length=0;const r=e.length;for(let o=0;o<r;o++)n[o]=e[o].get();return t(n)});return i(e),s}function ml(e){let t=0;const n=({timestamp:i,delta:r})=>{t||(t=i),e(i-t,r)},s=()=>R(n);p.onBeforeUpdate(()=>{s(),E.update(n,!0)}),p.onUnmounted(()=>s()),E.update(n,!0)}function gl(){const e=B(0);return ml(t=>e.set(t)),e}function yl(e,...t){const n=e.length;function s(){let o="";for(let a=0;a<n;a++){o+=e[a];const l=t[a];l&&(o+=ht(l)?l.get():l)}return o}const{value:i,subscribe:r}=Re(s);return r(t.filter(ht)),i}function Nn(e){return typeof e=="number"?e:parseFloat(e)}function vl(e,t={}){let n=null;const s=B(ht(e)?Nn(e.get()):e);let i=s.get(),r=()=>{};const o=()=>{n&&(n.stop(),n=null)},a=()=>{const l=n;(l==null?void 0:l.time)===0&&l.sample(Y.delta),o(),n=Fr({keyframes:[s.get(),i],velocity:s.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...t,onUpdate:r})};return p.watch(()=>JSON.stringify(t),()=>{const l=s.attach((u,c)=>(i=u,r=c,E.update(a),s.get()),o);p.onBeforeUnmount(()=>l())},{immediate:!0}),ht(e)&&e.on("change",l=>{s.set(Nn(l))}),s}function $n(e,t){js(!!(!t||t.value),`You have defined a ${e} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref.`)}function bl(){return{scrollX:B(0),scrollY:B(0),scrollXProgress:B(0),scrollYProgress:B(0)}}function wl({container:e,target:t,...n}={}){const s=bl();let i;const r=()=>{i==null||i(),i=_s((o,{x:a,y:l})=>{s.scrollX.set(a.current),s.scrollXProgress.set(a.progress),s.scrollY.set(l.current),s.scrollYProgress.set(l.progress)},{...n,container:(e==null?void 0:e.value)??void 0,target:(t==null?void 0:t.value)??void 0})};return p.onMounted(()=>{$n("target",t),$n("container",e),r()}),p.onUnmounted(()=>i==null?void 0:i()),p.watch(()=>[e==null?void 0:e.value,t==null?void 0:t.value,n.offset],r),s}exports.AnimatePresence=hl;exports.Motion=cl;exports.MotionValue=_n;exports.animate=Ns;exports.animateMini=zo;exports.anticipate=ve;exports.backIn=It;exports.backInOut=ye;exports.backOut=ge;exports.cancelFrame=R;exports.cancelSync=Ma;exports.circIn=Rt;exports.circInOut=be;exports.circOut=Zn;exports.clamp=z;exports.createScopedAnimate=Ls;exports.cubicBezier=tt;exports.delay=Va;exports.distance=ae;exports.distance2D=xa;exports.easeIn=ms;exports.easeInOut=Me;exports.easeOut=gs;exports.frame=E;exports.frameData=Y;exports.frameSteps=ni;exports.inView=ks;exports.inertia=te;exports.interpolate=Nt;exports.keyframes=ct;exports.mirrorEasing=pe;exports.mix=Pe;exports.motionValue=B;exports.pipe=Lt;exports.progress=Q;exports.reverseEasing=me;exports.scroll=_s;exports.scrollInfo=Kt;exports.spring=Dt;exports.stagger=ba;exports.steps=ya;exports.sync=Aa;exports.transform=Gs;exports.useMotionTemplate=yl;exports.useScroll=wl;exports.useSpring=vl;exports.useTime=gl;exports.useTransform=pl;exports.wrap=Yn;
|