framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 137 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var i,s={},r=null,c=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(c=e.ref),e)a.call(e,i)&&!u.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:c,props:s,_owner:l.current}}const h=r,d=c,p=c,m=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),f=e.createContext({}),g=e.createContext(null),v="undefined"!=typeof window,y=v?e.useLayoutEffect:e.useEffect,x=e.createContext({strict:!1}),P=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),w="data-"+P("framerAppearId"),T={skipAnimations:!1,useManualTiming:!1};const S=["read","resolveKeyframes","update","preRender","render","postRender"];function b(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=S.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{r=t,i?s=!0:(i=!0,[e,n]=[n,e],n.clear(),e.forEach(a),i=!1,s&&(s=!1,l.process(t)))}};return l}(o),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=r,p=()=>{const o=T.useManualTiming?s.timestamp:performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),h.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:S.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<S.length;e++)r[S[e]].cancel(t)},state:s,steps:r}}const{schedule:A,cancel:E}=b(queueMicrotask,!1);function C(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const V=e.createContext({});let M=!1;function R(t,n,i,s,o){var r;const{visualElement:a}=e.useContext(f),l=e.useContext(x),u=e.useContext(g),c=e.useContext(m).reducedMotion,h=e.useRef();s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:n,parent:a,props:i,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:c}));const d=h.current,p=e.useContext(V);!d||d.projection||!o||"html"!==d.type&&"svg"!==d.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&C(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(h.current,i,o,p),e.useInsertionEffect(()=>{d&&d.update(i,u)});const v=i[w],P=e.useRef(Boolean(v)&&!window.MotionHandoffIsComplete&&(null===(r=window.MotionHasOptimisedAnimation)||void 0===r?void 0:r.call(window,v)));return y(()=>{d&&(d.updateFeatures(),A.render(d.render),P.current&&d.animationState&&d.animationState.animateChanges())}),e.useEffect(()=>{d&&(!P.current&&d.animationState&&d.animationState.animateChanges(),P.current=!1,M||(M=!0,queueMicrotask(D)))}),d}function D(){window.MotionHandoffIsComplete=!0}function k(t,n,i){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):C(i)&&(i.current=e))},[n])}function L(t){return"string"==typeof t||Array.isArray(t)}function B(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const j=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],F=["initial",...j];function O(t){return B(t.animate)||F.some(e=>L(t[e]))}function I(t){return Boolean(O(t)||t.variants)}function U(t){const{initial:n,animate:i}=function(t,e){if(O(t)){const{initial:e,animate:n}=t;return{initial:!1===e||L(e)?e:void 0,animate:L(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(f));return e.useMemo(()=>({initial:n,animate:i}),[W(n),W(i)])}function W(t){return Array.isArray(t)?t.join(" "):t}const N={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"]},z={};for(const t in N)z[t]={isEnabled:e=>N[t].some(t=>!!e[t])};function $(t){for(const e in t)z[e]={...z[e],...t[e]}}const H=e.createContext({}),Y=Symbol.for("motionComponentSymbol"),X=t=>t;let G=X,K=X;function _({preloadedFeatures:t,createVisualElement:n,useRender:i,useVisualState:s,Component:o}){t&&$(t);const r=e.forwardRef((function(t,r){let a;const l={...e.useContext(m),...t,layoutId:q(t)},{isStatic:u}=l,c=U(t),h=s(t,u);if(!u&&v){e.useContext(x).strict;const t=function(t){const{drag:e,layout:n}=z;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(l);a=t.MeasureLayout,c.visualElement=R(o,h,l,n,t.ProjectionNode)}return p(f.Provider,{value:c,children:[a&&c.visualElement?d(a,{visualElement:c.visualElement,...l}):null,i(o,t,k(h,c.visualElement,r),h,u,c.visualElement)]})}));return r[Y]=o,r}function q({layoutId:t}){const n=e.useContext(H).id;return n&&void 0!==t?n+"-"+t:t}function Z(t){function e(e,n={}){return _(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const J=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Q(t){return"string"==typeof t&&!t.includes("-")&&!!(J.indexOf(t)>-1||/[A-Z]/u.test(t))}const tt={};function et(t){Object.assign(tt,t)}const nt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],it=new Set(nt);function st(t,{layout:e,layoutId:n}){return it.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!tt[t]||"opacity"===t)}const ot=t=>Boolean(t&&t.getVelocity),rt=(t,e)=>e&&"number"==typeof t?e.transform(t):t,at=(t,e,n)=>n>e?e:n<t?t:n,lt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ut={...lt,transform:t=>at(0,1,t)},ct={...lt,default:1},ht=t=>Math.round(1e5*t)/1e5,dt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,pt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,mt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function ft(t){return"string"==typeof t}const gt=t=>({test:e=>ft(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),vt=gt("deg"),yt=gt("%"),xt=gt("px"),Pt=gt("vh"),wt=gt("vw"),Tt={...yt,parse:t=>yt.parse(t)/100,transform:t=>yt.transform(100*t)},St={...lt,transform:Math.round},bt={borderWidth:xt,borderTopWidth:xt,borderRightWidth:xt,borderBottomWidth:xt,borderLeftWidth:xt,borderRadius:xt,radius:xt,borderTopLeftRadius:xt,borderTopRightRadius:xt,borderBottomRightRadius:xt,borderBottomLeftRadius:xt,width:xt,maxWidth:xt,height:xt,maxHeight:xt,size:xt,top:xt,right:xt,bottom:xt,left:xt,padding:xt,paddingTop:xt,paddingRight:xt,paddingBottom:xt,paddingLeft:xt,margin:xt,marginTop:xt,marginRight:xt,marginBottom:xt,marginLeft:xt,rotate:vt,rotateX:vt,rotateY:vt,rotateZ:vt,scale:ct,scaleX:ct,scaleY:ct,scaleZ:ct,skew:vt,skewX:vt,skewY:vt,distance:xt,translateX:xt,translateY:xt,translateZ:xt,x:xt,y:xt,z:xt,perspective:xt,transformPerspective:xt,opacity:ut,originX:Tt,originY:Tt,originZ:xt,zIndex:St,backgroundPositionX:xt,backgroundPositionY:xt,fillOpacity:ut,strokeOpacity:ut,numOctaves:St},At={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Et=nt.length;function Ct(t,e,n){let i="",s=!0;for(let o=0;o<Et;o++){const r=nt[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=rt(a,bt[r]);if(!l){s=!1;i+=`${At[r]||r}(${t}) `}n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}const Vt=t=>e=>"string"==typeof e&&e.startsWith(t),Mt=Vt("--"),Rt=Vt("var(--"),Dt=t=>!!Rt(t)&&kt.test(t.split("/*")[0].trim()),kt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Lt(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(it.has(t))r=!0;else if(Mt(t))s[t]=n;else{const e=rt(n,bt[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Ct(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Bt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jt(t,e,n){for(const i in e)ot(e[i])||st(i,n)||(t[i]=e[i])}function Ft(t,n){const i={};return jt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Lt(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function Ot(t,e){const n={},i=Ft(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const It=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ut(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||It.has(t)}let Wt=t=>!Ut(t);function Nt(t){t&&(Wt=e=>e.startsWith("on")?!Ut(e):t(e))}try{Nt(require("@emotion/is-prop-valid").default)}catch(t){}function zt(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Wt(s)||!0===n&&Ut(s)||!e&&!Ut(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}function $t(t,e,n){return"string"==typeof t?t:xt.transform(e+n*t)}const Ht={offset:"stroke-dashoffset",array:"stroke-dasharray"},Yt={offset:"strokeDashoffset",array:"strokeDasharray"};function Xt(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Lt(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${$t(e,t.x,t.width)} ${$t(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Ht:Yt;t[o.offset]=xt.transform(-i);const r=xt.transform(e),a=xt.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}const Gt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Kt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _t(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Xt(e,n,Kt(s),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};jt(e,t.style,t),o.style={...e,...o.style}}return o}function qt(t=!1){return(n,i,s,{latestValues:o},r)=>{const a=(Q(n)?_t:Ot)(i,o,r,n),l=zt(i,"string"==typeof n,t),u=n!==e.Fragment?{...l,...a,ref:s}:{},{children:c}=i,h=e.useMemo(()=>ot(c)?c.get():c,[c]);return e.createElement(n,{...u,children:h})}}function Zt(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}const Jt=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 Qt(t,e,n,i){Zt(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Jt.has(n)?n:P(n),e.attrs[n])}function te(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(ot(s[r])||e.style&&ot(e.style[r])||st(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return n&&s&&"string"==typeof s.willChange&&(n.applyWillChange=!1),o}function ee(t,e,n){const i=te(t,e,n);for(const n in t)if(ot(t[n])||ot(e[n])){i[-1!==nt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}function ne(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function ie(t,e,n,i){if("function"==typeof e){const[s,o]=ne(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=ne(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function se(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const oe=t=>Array.isArray(t);function re(t){const e=ot(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ae=new Set(["opacity","clipPath","filter","transform"]);function le(t){return it.has(t)?"transform":ae.has(t)?P(t):void 0}function ue(t,e){-1===t.indexOf(e)&&t.push(e)}function ce(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const he=t=>(n,i)=>{const s=e.useContext(f),o=e.useContext(g),r=()=>function({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:n,onMount:i},s,o,r,a){const l={latestValues:me(s,o,r,!a&&t,e),renderState:n()};return i&&(l.mount=t=>i(s,t,l)),l}(t,n,s,o,i);return i?r():se(r)};function de(t,e){const n=le(e);n&&ue(t,n)}function pe(t,e,n){const i=Array.isArray(e)?e:[e];for(let e=0;e<i.length;e++){const s=ie(t,i[e]);if(s){const{transitionEnd:t,transition:e,...i}=s;n(i,t)}}}function me(t,e,n,i,s){var o;const r={},a=[],l=i&&void 0===(null===(o=t.style)||void 0===o?void 0:o.willChange),u=s(t,{});for(const t in u)r[t]=re(u[t]);let{initial:c,animate:h}=t;const d=O(t),p=I(t);e&&p&&!d&&!1!==t.inherit&&(void 0===c&&(c=e.initial),void 0===h&&(h=e.animate));let m=!!n&&!1===n.initial;m=m||!1===c;const f=m?h:c;return f&&"boolean"!=typeof f&&!B(f)&&pe(t,f,(t,e)=>{for(const e in t){let n=t[e];if(Array.isArray(n)){n=n[m?n.length-1:0]}null!==n&&(r[e]=n)}for(const t in e)r[t]=e[t]}),l&&(h&&!1!==c&&!B(h)&&pe(t,h,t=>{for(const e in t)de(a,e)}),a.length&&(r.willChange=a.join(","))),r}const{schedule:fe,cancel:ge,state:ve,steps:ye}=b("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:X,!0),xe={useVisualState:he({scrapeMotionValuesFromProps:ee,createRenderState:Gt,onMount:(t,e,{renderState:n,latestValues:i})=>{fe.read(()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}}),fe.render(()=>{Xt(n,i,Kt(e.tagName),t.transformTemplate),Qt(e,n)})}})},Pe={useVisualState:he({applyWillChange:!0,scrapeMotionValuesFromProps:te,createRenderState:Bt})};function we(t,{forwardMotionProps:e=!1},n,i){return{...Q(t)?xe:Pe,preloadedFeatures:n,useRender:qt(e),createVisualElement:i,Component:t}}function Te(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Se=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function be(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Ae=t=>e=>Se(e)&&t(e,be(e));function Ee(t,e,n,i){return Te(t,e,Ae(n),i)}const Ce=(t,e)=>n=>e(t(n)),Ve=(...t)=>t.reduce(Ce);function Me(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Re=Me("dragHorizontal"),De=Me("dragVertical");function ke(t){let e=!1;if("y"===t)e=De();else if("x"===t)e=Re();else{const t=Re(),n=De();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Le(){const t=ke(!0);return!t||(t(),!1)}class Be{constructor(t){this.isMounted=!1,this.node=t}update(){}}function je(t,e){const n=e?"pointerenter":"pointerleave",i=e?"onHoverStart":"onHoverEnd";return Ee(t.current,n,(n,s)=>{if("touch"===n.pointerType||Le())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e);const r=o[i];r&&fe.postRender(()=>r(n,s))},{passive:!t.getProps()[i]})}const Fe=(t,e)=>!!e&&(t===e||Fe(t,e.parentElement));function Oe(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,be(n))}const Ie=new WeakMap,Ue=new WeakMap,We=t=>{const e=Ie.get(t.target);e&&e(t)},Ne=t=>{t.forEach(We)};function ze(t,e,n){const i=function({root:t,...e}){const n=t||document;Ue.has(n)||Ue.set(n,{});const i=Ue.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Ne,{root:t,...e})),i[s]}(e);return Ie.set(t,n),i.observe(t),()=>{Ie.delete(t),i.unobserve(t)}}const $e={some:0,all:1};const He={inView:{Feature:class extends Be{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:$e[i]};return ze(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Be{constructor(){super(...arguments),this.removeStartListeners=X,this.removeEndListeners=X,this.removeAccessibleListeners=X,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),i=Ee(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i,globalTapTarget:s}=this.node.getProps(),o=s||Fe(this.node.current,t.target)?n:i;o&&fe.update(()=>o(t,e))},{passive:!(n.onTap||n.onPointerUp)}),s=Ee(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ve(i,s),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=Te(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=Te(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&Oe("up",(t,e)=>{const{onTap:n}=this.node.getProps();n&&fe.postRender(()=>n(t,e))})}),Oe("down",(t,e)=>{this.startPress(t,e)})}),e=Te(this.node.current,"blur",()=>{this.isPressing&&Oe("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Ve(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&fe.postRender(()=>n(t,e))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Le()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&fe.postRender(()=>n(t,e))}mount(){const t=this.node.getProps(),e=Ee(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=Te(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ve(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Be{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ve(Te(this.node.current,"focus",()=>this.onFocus()),Te(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Be{mount(){this.unmount=Ve(je(this.node,!0),je(this.node,!1))}unmount(){}}}};function Ye(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function Xe(t,e,n){const i=t.getProps();return ie(i,e,void 0!==n?n:i.custom,t)}const Ge=t=>1e3*t,Ke=t=>t/1e3,_e={type:"spring",stiffness:500,damping:25,restSpeed:10},qe={type:"keyframes",duration:.8},Ze={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Je=(t,{keyframes:e})=>e.length>2?qe:it.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:_e:Ze;function Qe(t,e){return t[e]||t.default||t}const tn={current:!1},en=t=>null!==t;function nn(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(en),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}const sn=t=>/^0[^.\s]+$/u.test(t);const on=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function an(t,e,n=1){const[i,s]=function(t){const e=rn.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return on(t)?parseFloat(t):t}return Dt(s)?an(s,e,n+1):s}const ln=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),un=t=>t===lt||t===xt,cn=(t,e)=>parseFloat(t.split(", ")[e]),hn=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return cn(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?cn(e[1],t):0}},dn=new Set(["x","y","z"]),pn=nt.filter(t=>!dn.has(t));const mn={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:hn(4,13),y:hn(5,14)};mn.translateX=mn.x,mn.translateY=mn.y;const fn=t=>e=>e.test(t),gn=[lt,xt,yt,vt,wt,Pt,{test:t=>"auto"===t,parse:t=>t}],vn=t=>gn.find(fn(t)),yn=new Set;let xn=!1,Pn=!1;function wn(){if(Pn){const t=Array.from(yn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return pn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pn=!1,xn=!1,yn.forEach(t=>t.complete()),yn.clear()}function Tn(){yn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pn=!0)})}class Sn{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(yn.add(this),xn||(xn=!0,fe.read(Tn),fe.resolveKeyframes(wn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),yn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,yn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const bn=(t,e)=>n=>Boolean(ft(n)&&mt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),An=(t,e,n)=>i=>{if(!ft(i))return i;const[s,o,r,a]=i.match(dt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},En={...lt,transform:t=>Math.round((t=>at(0,255,t))(t))},Cn={test:bn("rgb","red"),parse:An("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+En.transform(t)+", "+En.transform(e)+", "+En.transform(n)+", "+ht(ut.transform(i))+")"};const Vn={test:bn("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Cn.transform},Mn={test:bn("hsl","hue"),parse:An("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+yt.transform(ht(e))+", "+yt.transform(ht(n))+", "+ht(ut.transform(i))+")"},Rn={test:t=>Cn.test(t)||Vn.test(t)||Mn.test(t),parse:t=>Cn.test(t)?Cn.parse(t):Mn.test(t)?Mn.parse(t):Vn.parse(t),transform:t=>ft(t)?t:t.hasOwnProperty("red")?Cn.transform(t):Mn.transform(t)};const Dn=/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 kn(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Dn,t=>(Rn.test(t)?(i.color.push(o),s.push("color"),n.push(Rn.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Ln(t){return kn(t).values}function Bn(t){const{split:e,types:n}=kn(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+="number"===e?ht(t[o]):"color"===e?Rn.transform(t[o]):t[o]}return s}}const jn=t=>"number"==typeof t?0:t;const Fn={test:function(t){var e,n;return isNaN(t)&&ft(t)&&((null===(e=t.match(dt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(pt))||void 0===n?void 0:n.length)||0)>0},parse:Ln,createTransformer:Bn,getAnimatableNone:function(t){const e=Ln(t);return Bn(t)(e.map(jn))}},On=new Set(["brightness","contrast","saturate","opacity"]);function In(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(dt)||[];if(!i)return t;const s=n.replace(i,"");let o=On.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Un=/\b([a-z-]*)\(.*?\)/gu,Wn={...Fn,getAnimatableNone:t=>{const e=t.match(Un);return e?e.map(In).join(" "):t}},Nn={...bt,color:Rn,backgroundColor:Rn,outlineColor:Rn,fill:Rn,stroke:Rn,borderColor:Rn,borderTopColor:Rn,borderRightColor:Rn,borderBottomColor:Rn,borderLeftColor:Rn,filter:Wn,WebkitFilter:Wn},zn=t=>Nn[t];function $n(t,e){let n=zn(t);return n!==Wn&&(n=Fn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Hn=new Set(["auto","none","0"]);class Yn extends Sn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Dt(i))){const s=an(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ln.has(n)||2!==t.length)return;const[i,s]=t,o=vn(i),r=vn(s);if(o!==r)if(un(o)&&un(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||sn(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Hn.has(e)&&kn(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=$n(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=mn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}function Xn(t){let e;return()=>(void 0===e&&(e=t()),e)}let Gn;function Kn(){Gn=void 0}const _n={now:()=>(void 0===Gn&&_n.set(ve.isProcessing||T.useManualTiming?ve.timestamp:performance.now()),Gn),set:t=>{Gn=t,queueMicrotask(Kn)}},qn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Fn.test(t)&&"0"!==t||t.startsWith("url(")));class Zn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=_n.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Tn(),wn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=_n.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=qn(s,e),a=qn(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||"spring"===n&&i)}(t,n,i,s)){if(tn.current||!o)return null==a||a(nn(t,this.options,e)),null==r||r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Jn(t,e){return e?t*(1e3/e):0}function Qn(t,e,n){const i=Math.max(e-5,0);return Jn(n-t(i),e-i)}function ti({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let s,o,r=1-e;r=at(.05,1,r),t=at(.01,10,Ke(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/ei(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=ei(Math.pow(e,2),r);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 i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=Ge(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function ei(t,e){return t*Math.sqrt(1-e*e)}const ni=["duration","bounce"],ii=["stiffness","damping","mass"];function si(t,e){return e.some(e=>void 0!==t[e])}function oi({keyframes:t,restDelta:e,restSpeed:n,...i}){const s=t[0],o=t[t.length-1],r={done:!1,value:s},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!si(t,ii)&&si(t,ni)){const n=ti(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...i,velocity:-Ke(i.velocity||0)}),p=h||0,m=l/(2*Math.sqrt(a*u)),f=o-s,g=Ke(Math.sqrt(a/u)),v=Math.abs(f)<5;let y;if(n||(n=v?.01:2),e||(e=v?.005:.5),m<1){const t=ei(g,m);y=e=>{const n=Math.exp(-m*g*e);return o-n*((p+m*g*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)y=t=>o-Math.exp(-g*t)*(f+(p+g*f)*t);else{const t=g*Math.sqrt(m*m-1);y=e=>{const n=Math.exp(-m*g*e),i=Math.min(t*e,300);return o-n*((p+m*g*f)*Math.sinh(i)+t*f*Math.cosh(i))/t}}return{calculatedDuration:d&&c||null,next:t=>{const i=y(t);if(d)r.done=t>=c;else{let s=0;m<1&&(s=0===t?Ge(p):Qn(y,t,i));const a=Math.abs(s)<=n,l=Math.abs(o-i)<=e;r.done=a&&l}return r.value=r.done?o:i,r}}}function ri({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const v=t=>-m*Math.exp(-t/i),y=t=>g+v(t),x=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let P,w;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,w=oi({keyframes:[d.value,p(d.value)],velocity:Qn(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==P||(e=!0,x(t),T(t)),void 0!==P&&t>=P?w.next(t-P):(!e&&x(t),d)}}}const ai=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function li(t,e,n,i){if(t===e&&n===i)return X;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=ai(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:ai(s(t),e,i)}const ui=li(.42,0,1,1),ci=li(0,0,.58,1),hi=li(.42,0,.58,1),di=t=>Array.isArray(t)&&"number"!=typeof t[0],pi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mi=t=>e=>1-t(1-e),fi=t=>1-Math.sin(Math.acos(t)),gi=mi(fi),vi=pi(fi),yi=li(.33,1.53,.69,.99),xi=mi(yi),Pi=pi(xi),wi=t=>(t*=2)<1?.5*xi(t):.5*(2-Math.pow(2,-10*(t-1))),Ti={linear:X,easeIn:ui,easeInOut:hi,easeOut:ci,circIn:fi,circInOut:vi,circOut:gi,backIn:xi,backInOut:Pi,backOut:yi,anticipate:wi},Si=t=>{if(Array.isArray(t)){K(4===t.length);const[e,n,i,s]=t;return li(e,n,i,s)}return"string"==typeof t?Ti[t]:t},bi=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Ai=(t,e,n)=>t+(e-t)*n;function Ei(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ci(t,e){return n=>n>0?e:t}const Vi=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Mi=[Vn,Cn,Mn];function Ri(t){const e=(n=t,Mi.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===Mn&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ei(a,i,t+1/3),o=Ei(a,i,t),r=Ei(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Di=(t,e)=>{const n=Ri(t),i=Ri(e);if(!n||!i)return Ci(t,e);const s={...n};return t=>(s.red=Vi(n.red,i.red,t),s.green=Vi(n.green,i.green,t),s.blue=Vi(n.blue,i.blue,t),s.alpha=Ai(n.alpha,i.alpha,t),Cn.transform(s))},ki=new Set(["none","hidden"]);function Li(t,e){return n=>Ai(t,e,n)}function Bi(t){return"number"==typeof t?Li:"string"==typeof t?Dt(t)?Ci:Rn.test(t)?Di:Oi:Array.isArray(t)?ji:"object"==typeof t?Rn.test(t)?Di:Fi:Ci}function ji(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Bi(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Fi(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Bi(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Oi=(t,e)=>{const n=Fn.createTransformer(e),i=kn(t),s=kn(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?ki.has(t)&&!s.values.length||ki.has(e)&&!i.values.length?function(t,e){return ki.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Ve(ji(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):Ci(t,e)};function Ii(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ai(t,e,n);return Bi(t)(t,e)}function Ui(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(K(o===e.length),1===o)return()=>e[0];if(2===o&&t[0]===t[1])return()=>e[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=function(t,e,n){const i=[],s=n||Ii,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||X:e;o=Ve(t,o)}i.push(o)}return i}(e,i,s),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=bi(t[n],t[n+1],e);return r[n](i)};return n?e=>l(at(t[0],t[o-1],e)):l}function Wi(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=bi(0,e,i);t.push(Ai(n,1,s))}}function Ni(t){const e=[0];return Wi(e,t.length-1),e}function zi({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=di(i)?i.map(Si):Si(i),o={done:!1,value:e[0]},r=Ui(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ni(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||hi).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}function $i(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const Hi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>fe.update(e,!0),stop:()=>ge(e),now:()=>ve.isProcessing?ve.timestamp:_n.now()}},Yi={decay:ri,inertia:ri,tween:zi,keyframes:zi,spring:oi},Xi=t=>t/100;class Gi extends Zn{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,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Sn;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=Yi[e]||zi;let a,l;r!==zi&&"number"!=typeof t[0]&&(a=Ve(Xi,Ii(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=$i(u));const{calculatedDuration:c}=u,h=c+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return s.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(x=o)),y=at(0,1,n)*c}const P=v?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:w}=P;v||null===l||(w=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&void 0!==i&&(P.value=nn(a,this.options,i)),f&&f(P.value),T&&this.finish(),P}get duration(){const{resolved:t}=this;return t?Ke(t.calculatedDuration):0}get time(){return Ke(this.currentTime)}set time(t){t=Ge(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=Ke(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Hi,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}function Ki(t){return new Gi(t)}const _i=t=>Array.isArray(t)&&"number"==typeof t[0];function qi(t){return Boolean(!t||"string"==typeof t&&t in Ji||_i(t)||Array.isArray(t)&&t.every(qi))}const Zi=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Ji={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zi([0,.65,.55,1]),circOut:Zi([.55,0,1,.45]),backIn:Zi([.31,.01,.66,-.59]),backOut:Zi([.33,1.53,.69,.99])};function Qi(t){return ts(t)||Ji.easeOut}function ts(t){return t?_i(t)?Zi(t):Array.isArray(t)?t.map(Qi):Ji[t]:void 0}function es(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=ts(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const ns=Xn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class is extends Zn{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new Yn(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:i=300,times:s,ease:o,type:r,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(c=this.options).type||!qi(c.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new Gi({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),i=c.duration,s=c.times,o=c.ease,r="keyframes"}var c;const h=es(a.owner.current,l,t,{...this.options,duration:i,times:s,ease:o});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(h.timeline=this.pendingTimeline,this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(nn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:s,type:r,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return Ke(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return Ke(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=Ge(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return X;const{animation:n}=e;n.timeline=t,n.onfinish=null}else this.pendingTimeline=t;return X}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new Gi({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),h=Ge(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;return ns()&&n&&ae.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}function ss(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return fe.update(i,!0),()=>ge(i)}const os=Xn(()=>void 0!==window.ScrollTimeline);class rs{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>{if(!os()||!e.attachTimeline)return e.pause(),ss(t=>{e.time=e.duration*t},t);e.attachTimeline(t)});return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const as=(t,e,n,i={},s,o,r)=>a=>{const l=Qe(i,t)||{},u=l.delay||i.delay||0;let{elapsed:c=0}=i;c-=Ge(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),r&&r()},onStop:r,name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||(h={...h,...Je(t,h)}),h.duration&&(h.duration=Ge(h.duration)),h.repeatDelay&&(h.repeatDelay=Ge(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),(tn.current||T.skipAnimations)&&(d=!0,h.duration=0,h.delay=0),d&&!o&&void 0!==e.get()){const t=nn(h.keyframes,l);if(void 0!==t)return fe.update(()=>{h.onUpdate(t),h.onComplete()}),new rs([])}return!o&&is.supports(h)?new is(h):new Gi(h)};class ls{constructor(