UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

1 lines • 153 kB
!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({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null),x=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class w extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=t instanceof HTMLElement&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function T({children:t,isPresent:n,anchorX:s}){const o=e.useId(),r=e.useRef(null),a=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=e.useContext(x);return e.useInsertionEffect((()=>{const{width:t,height:e,top:i,left:u,right:c}=a.current;if(n||!r.current||!t||!e)return;const h="left"===s?`left: ${u}`:`right: ${c}`;r.current.dataset.motionPopId=o;const d=document.createElement("style");return l&&(d.nonce=l),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${h}px !important;\n top: ${i}px !important;\n }\n `),()=>{document.head.contains(d)&&document.head.removeChild(d)}}),[n]),d(w,{isPresent:n,childRef:r,sizeRef:a,children:i.cloneElement(t,{ref:r})})}const P=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:a,mode:l,anchorX:u})=>{const c=f(S),h=e.useId();let p=!0,m=e.useMemo((()=>(p=!1,{id:h,initial:n,isPresent:s,custom:r,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;o&&o()},register:t=>(c.set(t,!1),()=>c.delete(t))})),[s,c,o]);return a&&p&&(m={...m}),e.useMemo((()=>{c.forEach(((t,e)=>c.set(e,!1)))}),[s]),i.useEffect((()=>{!s&&!c.size&&o&&o()}),[s]),"popLayout"===l&&(t=d(T,{isPresent:s,anchorX:u,children:t})),d(v.Provider,{value:m,children:t})};function S(){return new Map}function b(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect((()=>{if(t)return o(r)}),[t]);const a=e.useCallback((()=>t&&s&&s(r)),[r,s,t]);return!i&&s?[!1,a]:[!0]}const E=t=>t.key||"";function A(t){const n=[];return e.Children.forEach(t,(t=>{e.isValidElement(t)&&n.push(t)})),n}const M=e.createContext(null);function V(t,e){-1===t.indexOf(e)&&t.push(e)}function C(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function R([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t}const D=(t,e,n)=>n>e?e:n<t?t:n;let k=()=>{},L=()=>{};const j={},B=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),O=t=>/^0[^.\s]+$/u.test(t);function F(t){let e;return()=>(void 0===e&&(e=t()),e)}const I=t=>t,U=(t,e)=>n=>e(t(n)),W=(...t)=>t.reduce(U),N=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class ${constructor(){this.subscriptions=[]}add(t){return V(this.subscriptions,t),()=>C(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const z=t=>1e3*t,H=t=>t/1e3;function X(t,e){return e?t*(1e3/e):0}const Y=new Set;const K=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},_=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function G(t,e,n,i){if(t===e&&n===i)return I;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=_(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:_(s(t),e,i)}const q=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Z=t=>e=>1-t(1-e),J=G(.33,1.53,.69,.99),Q=Z(J),tt=q(Q),et=t=>(t*=2)<1?.5*Q(t):.5*(2-Math.pow(2,-10*(t-1))),nt=t=>1-Math.sin(Math.acos(t)),it=Z(nt),st=q(nt),ot=G(.42,0,1,1),rt=G(0,0,.58,1),at=G(.42,0,.58,1);const lt=t=>Array.isArray(t)&&"number"!=typeof t[0];function ut(t,e){return lt(t)?t[K(0,t.length,e)]:t}const ct=t=>Array.isArray(t)&&"number"==typeof t[0],ht={linear:I,easeIn:ot,easeInOut:at,easeOut:rt,circIn:nt,circInOut:st,circOut:it,backIn:Q,backInOut:tt,backOut:J,anticipate:et},dt=t=>{if(ct(t)){t.length;const[e,n,i,s]=t;return G(e,n,i,s)}return"string"==typeof t?ht[t]:t},pt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],mt={value:null,addProjectionMetrics:null};function ft(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=pt.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){r.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&mt.value&&mt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const o=j.useManualTiming?s.timestamp:performance.now();n=!1,j.useManualTiming||(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),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:pt.reduce(((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e}),{}),cancel:t=>{for(let e=0;e<pt.length;e++)r[pt[e]].cancel(t)},state:s,steps:r}}const{schedule:gt,cancel:yt,state:vt,steps:xt}=ft("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:I,!0);let wt;function Tt(){wt=void 0}const Pt={now:()=>(void 0===wt&&Pt.set(vt.isProcessing||j.useManualTiming?vt.timestamp:performance.now()),wt),set:t=>{wt=t,queueMicrotask(Tt)}},St={layout:0,mainThread:0,waapi:0},bt=t=>e=>"string"==typeof e&&e.startsWith(t),Et=bt("--"),At=bt("var(--"),Mt=t=>!!At(t)&&Vt.test(t.split("/*")[0].trim()),Vt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ct={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Rt={...Ct,transform:t=>D(0,1,t)},Dt={...Ct,default:1},kt=t=>Math.round(1e5*t)/1e5,Lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const jt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bt=(t,e)=>n=>Boolean("string"==typeof n&&jt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ot=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Lt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ft={...Ct,transform:t=>Math.round((t=>D(0,255,t))(t))},It={test:Bt("rgb","red"),parse:Ot("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ft.transform(t)+", "+Ft.transform(e)+", "+Ft.transform(n)+", "+kt(Rt.transform(i))+")"};const Ut={test:Bt("#"),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:It.transform},Wt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Nt=Wt("deg"),$t=Wt("%"),zt=Wt("px"),Ht=Wt("vh"),Xt=Wt("vw"),Yt=(()=>({...$t,parse:t=>$t.parse(t)/100,transform:t=>$t.transform(100*t)}))(),Kt={test:Bt("hsl","hue"),parse:Ot("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+$t.transform(kt(e))+", "+$t.transform(kt(n))+", "+kt(Rt.transform(i))+")"},_t={test:t=>It.test(t)||Ut.test(t)||Kt.test(t),parse:t=>It.test(t)?It.parse(t):Kt.test(t)?Kt.parse(t):Ut.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?It.transform(t):Kt.transform(t)},Gt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const qt="number",Zt="color",Jt=/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 Qt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Jt,(t=>(_t.test(t)?(i.color.push(o),s.push(Zt),n.push(_t.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(qt),n.push(parseFloat(t))),++o,"${}"))).split("${}");return{values:n,split:r,indexes:i,types:s}}function te(t){return Qt(t).values}function ee(t){const{split:e,types:n}=Qt(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+=e===qt?kt(t[o]):e===Zt?_t.transform(t[o]):t[o]}return s}}const ne=t=>"number"==typeof t?0:t;const ie={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Lt)?.length||0)+(t.match(Gt)?.length||0)>0},parse:te,createTransformer:ee,getAnimatableNone:function(t){const e=te(t);return ee(t)(e.map(ne))}};function se(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 oe({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=se(a,i,t+1/3),o=se(a,i,t),r=se(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}}function re(t,e){return n=>n>0?e:t}const ae=(t,e,n)=>t+(e-t)*n,le=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},ue=[Ut,It,Kt];function ce(t){const e=(n=t,ue.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===Kt&&(i=oe(i)),i}const he=(t,e)=>{const n=ce(t),i=ce(e);if(!n||!i)return re(t,e);const s={...n};return t=>(s.red=le(n.red,i.red,t),s.green=le(n.green,i.green,t),s.blue=le(n.blue,i.blue,t),s.alpha=ae(n.alpha,i.alpha,t),It.transform(s))},de=new Set(["none","hidden"]);function pe(t,e){return de.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function me(t,e){return n=>ae(t,e,n)}function fe(t){return"number"==typeof t?me:"string"==typeof t?Mt(t)?re:_t.test(t)?he:ve:Array.isArray(t)?ge:"object"==typeof t?_t.test(t)?he:ye:re}function ge(t,e){const n=[...t],i=n.length,s=t.map(((t,n)=>fe(t)(t,e[n])));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ye(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=fe(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ve=(t,e)=>{const n=ie.createTransformer(e),i=Qt(t),s=Qt(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?de.has(t)&&!s.values.length||de.has(e)&&!i.values.length?pe(t,e):W(ge(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):re(t,e)};function xe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ae(t,e,n);return fe(t)(t,e)}const we=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>gt.update(e,t),stop:()=>yt(e),now:()=>vt.isProcessing?vt.timestamp:Pt.now()}},Te=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(e/(s-1))+", ";return`linear(${i.substring(0,i.length-2)})`},Pe=2e4;function Se(t){let e=0;let n=t.next(e);for(;!n.done&&e<Pe;)e+=50,n=t.next(e);return e>=Pe?1/0:e}function be(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Se(i),Pe);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:H(s)}}function Ee(t,e,n){const i=Math.max(e-5,0);return X(n-t(i),e-i)}const Ae=100,Me=10,Ve=1,Ce=0,Re=800,De=.3,ke=.3,Le={granular:.01,default:2},je={granular:.005,default:.5},Be=.01,Oe=10,Fe=.05,Ie=1,Ue=.001;function We({duration:t=Re,bounce:e=De,velocity:n=Ce,mass:i=Ve}){let s,o,r=1-e;r=D(Fe,Ie,r),t=D(Be,Oe,H(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=$e(e,r),l=Math.exp(-s);return Ue-o/a*l},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=$e(Math.pow(e,2),r);return(-s(e)+Ue>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<Ne;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=z(t),isNaN(a))return{stiffness:Ae,damping:Me,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Ne=12;function $e(t,e){return t*Math.sqrt(1-e*e)}const ze=["duration","bounce"],He=["stiffness","damping","mass"];function Xe(t,e){return e.some((e=>void 0!==t[e]))}function Ye(t=ke,e=De){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Ce,stiffness:Ae,damping:Me,mass:Ve,isResolvedFromDuration:!1,...t};if(!Xe(t,He)&&Xe(t,ze))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*D(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ve,stiffness:s,damping:o}}else{const n=We(t);e={...e,...n,mass:Ve},e.isResolvedFromDuration=!0}return e}({...n,velocity:-H(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*c)),g=r-o,y=H(Math.sqrt(l/c)),v=Math.abs(g)<5;let x;if(i||(i=v?Le.granular:Le.default),s||(s=v?je.granular:je.default),f<1){const t=$e(y,f);x=e=>{const n=Math.exp(-f*y*e);return r-n*((m+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0===t?m:0;f<1&&(n=0===t?z(m):Ee(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Se(w),Pe),e=Te((e=>w.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ke({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 y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let w,T;const P=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=Ye({keyframes:[d.value,p(d.value)],velocity:Ee(v,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return P(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),P(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function _e(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||j.mix||xe,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]||I:e;o=W(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=N(t[i],t[i+1],n);return a[i](s)};return n?e=>u(D(t[0],t[o-1],e)):u}function Ge(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=N(0,e,i);t.push(ae(n,1,s))}}function qe(t){const e=[0];return Ge(e,t.length-1),e}function Ze(t,e){return t.map((t=>t*e))}function Je(t,e){return t.map((()=>e||at)).splice(0,t.length-1)}function Qe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=lt(i)?i.map(dt):dt(i),o={done:!1,value:e[0]},r=_e(Ze(n&&n.length===e.length?n:qe(e),t),e,{ease:Array.isArray(s)?s:Je(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}Ye.applyToOptions=t=>{const e=be(t,100,Ye);return t.ease=e.ease,t.duration=z(e.duration),t.type="keyframes",t};const tn=t=>null!==t;function en(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(tn),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const nn={decay:Ke,inertia:Ke,tween:Qe,keyframes:Qe,spring:Ye};function sn(t){"string"==typeof t.type&&(t.type=nn[t.type])}class on{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const rn=t=>t/100;class an extends on{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(t=!0)=>{if(t){const{motionValue:t}=this.options;t&&t.updatedAt!==Pt.now()&&this.tick(Pt.now())}if(this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},St.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;sn(t);const{type:e=Qe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Qe;a!==Qe&&"number"!=typeof r[0]&&(this.mixKeyframes=W(rn,xe(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Se(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,x=n;if(c){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(x=o)),v=D(0,1,n)*r}const w=y?{done:!1,value:u[0]}:x.next(v);s&&(w.value=s(w.value));let{done:T}=w;y||null===a||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return P&&p!==Ke&&(w.value=en(u,this.options,f,this.speed)),m&&m(w.value),P&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return H(this.calculatedDuration)}get time(){return H(this.currentTime)}set time(t){t=z(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Pt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=H(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=we,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Pt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}teardown(){this.notifyFinished(),this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,St.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function ln(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const un=t=>180*t/Math.PI,cn=t=>{const e=un(Math.atan2(t[1],t[0]));return dn(e)},hn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:cn,rotateZ:cn,skewX:t=>un(Math.atan(t[1])),skewY:t=>un(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},dn=t=>((t%=360)<0&&(t+=360),t),pn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),mn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),fn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pn,scaleY:mn,scale:t=>(pn(t)+mn(t))/2,rotateX:t=>dn(un(Math.atan2(t[6],t[5]))),rotateY:t=>dn(un(Math.atan2(-t[2],t[0]))),rotateZ:cn,rotate:cn,skewX:t=>un(Math.atan(t[4])),skewY:t=>un(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function gn(t){return t.includes("scale")?1:0}function yn(t,e){if(!t||"none"===t)return gn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=fn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=hn,s=e}if(!s)return gn(e);const o=i[e],r=s[1].split(",").map(xn);return"function"==typeof o?o(r):r[o]}const vn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return yn(n,e)};function xn(t){return parseFloat(t.trim())}const wn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tn=(()=>new Set(wn))(),Pn=t=>t===Ct||t===zt,Sn=new Set(["x","y","z"]),bn=wn.filter((t=>!Sn.has(t)));const En={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>yn(e,"x"),y:(t,{transform:e})=>yn(e,"y")};En.translateX=En.x,En.translateY=En.y;const An=new Set;let Mn=!1,Vn=!1,Cn=!1;function Rn(){if(Vn){const t=Array.from(An).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 bn.forEach((n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Vn=!1,Mn=!1,An.forEach((t=>t.complete(Cn))),An.clear()}function Dn(){An.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Vn=!0)}))}function kn(){Cn=!0,Dn(),Rn(),Cn=!1}class Ln{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(An.add(this),Mn||(Mn=!0,gt.read(Dn),gt.resolveKeyframes(Rn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=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])}ln(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),An.delete(this)}cancel(){"scheduled"===this.state&&(An.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const jn=t=>t.startsWith("--");function Bn(t,e,n){jn(e)?t.style.setProperty(e,n):t.style[e]=n}const On=F((()=>void 0!==window.ScrollTimeline)),Fn={};function In(t,e){const n=F(t);return()=>Fn[e]??n()}const Un=In((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),Wn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Nn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wn([0,.65,.55,1]),circOut:Wn([.55,0,1,.45]),backIn:Wn([.31,.01,.66,-.59]),backOut:Wn([.33,1.53,.69,.99])};function $n(t,e){return t?"function"==typeof t?Un()?Te(t,e):"ease-out":ct(t)?Wn(t):Array.isArray(t)?t.map((t=>$n(t,e)||Nn.easeOut)):Nn[t]:void 0}function zn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=$n(a,s);Array.isArray(h)&&(c.easing=h),mt.value&&St.waapi++;const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return mt.value&&p.finished.finally((()=>{St.waapi--})),p}function Hn(t){return"function"==typeof t&&"applyToOptions"in t}function Xn({type:t,...e}){return Hn(t)&&Un()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Yn extends on{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,t.type;const l=Xn(t);this.animation=zn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=en(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):Bn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},this.animation.oncancel=()=>this.notifyFinished()}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return H(Number(t))}get time(){return H(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=z(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&On()?(this.animation.timeline=t,I):e(this)}}const Kn={anticipate:et,backInOut:tt,circInOut:st};function _n(t){"string"==typeof t.ease&&t.ease in Kn&&(t.ease=Kn[t.ease])}class Gn extends Yn{constructor(t){_n(t),sn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new an({...o,autoplay:!1}),a=z(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const qn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!ie.test(t)&&"0"!==t||t.startsWith("url(")));const Zn=new Set(["opacity","clipPath","filter","transform"]),Jn=F((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function Qn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Jn()&&n&&Zn.has(n)&&("transform"!==n||!l)&&!a&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class ti extends on{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Pt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||Ln;this.keyframeResolver=new d(r,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:u}=n;this.resolvedAt=Pt.now(),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||Hn(n))&&i)}(t,s,o,r)||(!j.instantAnimations&&a||u?.(en(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const c={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!l&&Qn(c)?new Gn({...c,element:c.motionValue.owner.current}):new an(c);h.finished.then((()=>this.notifyFinished())).catch(I),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(this.keyframeResolver?.resume(),kn()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class ei{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map((e=>e.attachTimeline(t)));return()=>{e.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){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")}}class ni extends ei{then(t,e){return this.finished.finally(t).then((()=>{}))}}class ii extends Yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const si=new WeakMap,oi=(t,e="")=>`${t}:${e}`;function ri(t){const e=si.get(t)||new Map;return si.set(t,e),e}const ai=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function li(t){const e=ai.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function ui(t,e,n=1){const[i,s]=li(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return B(t)?parseFloat(t):t}return Mt(s)?ui(s,e,n+1):s}function ci(t,e){return t?.[e]??t?.default??t}const hi=new Set(["width","height","top","left","right","bottom",...wn]),di=t=>e=>e.test(t),pi=[Ct,zt,$t,Nt,Xt,Ht,{test:t=>"auto"===t,parse:t=>t}],mi=t=>pi.find(di(t));const fi=new Set(["brightness","contrast","saturate","opacity"]);function gi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Lt)||[];if(!i)return t;const s=n.replace(i,"");let o=fi.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const yi=/\b([a-z-]*)\(.*?\)/gu,vi={...ie,getAnimatableNone:t=>{const e=t.match(yi);return e?e.map(gi).join(" "):t}},xi={...Ct,transform:Math.round},wi={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:Dt,scaleX:Dt,scaleY:Dt,scaleZ:Dt,skew:Nt,skewX:Nt,skewY:Nt,distance:zt,translateX:zt,translateY:zt,translateZ:zt,x:zt,y:zt,z:zt,perspective:zt,transformPerspective:zt,opacity:Rt,originX:Yt,originY:Yt,originZ:zt},Ti={borderWidth:zt,borderTopWidth:zt,borderRightWidth:zt,borderBottomWidth:zt,borderLeftWidth:zt,borderRadius:zt,radius:zt,borderTopLeftRadius:zt,borderTopRightRadius:zt,borderBottomRightRadius:zt,borderBottomLeftRadius:zt,width:zt,maxWidth:zt,height:zt,maxHeight:zt,top:zt,right:zt,bottom:zt,left:zt,padding:zt,paddingTop:zt,paddingRight:zt,paddingBottom:zt,paddingLeft:zt,margin:zt,marginTop:zt,marginRight:zt,marginBottom:zt,marginLeft:zt,backgroundPositionX:zt,backgroundPositionY:zt,...wi,zIndex:xi,fillOpacity:Rt,strokeOpacity:Rt,numOctaves:xi},Pi={...Ti,color:_t,backgroundColor:_t,outlineColor:_t,fill:_t,stroke:_t,borderColor:_t,borderTopColor:_t,borderRightColor:_t,borderBottomColor:_t,borderLeftColor:_t,filter:vi,WebkitFilter:vi},Si=t=>Pi[t];function bi(t,e){let n=Si(t);return n!==vi&&(n=ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ei=new Set(["auto","none","0"]);class Ai extends Ln{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(),Mt(i))){const s=ui(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!hi.has(n)||2!==t.length)return;const[i,s]=t,o=mi(i),r=mi(s);if(o!==r)if(Pn(o)&&Pn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else En[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||O(i)))&&n.push(e);var i;n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ei.has(e)&&Qt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=bi(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=En[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=En[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Mi=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function Vi(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&Mi.has(e)&&(t[n]=t[n]+"px")}const Ci=F((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),Ri=new Set(["opacity","clipPath","filter","transform"]);function Di(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}const ki={current:void 0};class Li{constructor(t,e={}){this.version="__VERSION__",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Pt.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Pt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new $);const n=this.events[t].add(e);return"change"===t?()=>{n(),gt.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ki.current&&ki.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Pt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return X(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ji(t,e){return new Li(t,e)}const Bi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Oi{constructor(){this.latest={},this.values=new Map}set(t,e,n,i){const s=this.values.get(t);s&&s.onRemove();const o=()=>{this.latest[t]=Bi(e.get(),Ti[t]),n&&gt.render(n)};o();const r=e.on("change",o);i&&e.addDependent(i);const a=()=>{r(),n&&yt(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:a}),a}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}const Fi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const Ii=new WeakMap;function Ui(t,e,n,i){let s,o;return Tn.has(n)?(e.get("transform")||e.set("transform",new Li("none"),(()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<wn.length;i++){const s=wn[i],o=t.latest[s];if(void 0===o)continue;let r=!0;r="number"==typeof o?o===(s.startsWith("scale")?1:0):0===parseFloat(o),r||(n=!1,e+=`${Fi[s]||s}(${t.latest[s]}) `)}return n?"none":e.trim()}(e)})),o=e.get("transform")):s=jn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)}const{schedule:Wi,cancel:Ni}=ft(queueMicrotask,!1),$i={x:!1,y:!1};function zi(){return $i.x||$i.y}function Hi(t){return"x"===t||"y"===t?$i[t]?null:($i[t]=!0,()=>{$i[t]=!1}):$i.x||$i.y?null:($i.x=$i.y=!0,()=>{$i.x=$i.y=!1})}function Xi(t,e){const n=Di(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Yi(t){return!("touch"===t.pointerType||zi())}function Ki(t,e,n={}){const[i,s,o]=Xi(t,n),r=t=>{if(!Yi(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{Yi(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach((t=>{t.addEventListener("pointerenter",r,s)})),o}const _i=(t,e)=>!!e&&(t===e||_i(t,e.parentElement)),Gi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,qi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Zi=new WeakSet;function Ji(t){return e=>{"Enter"===e.key&&t(e)}}function Qi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ts(t){return Gi(t)&&!zi()}function es(t,e,n={}){const[i,s,o]=Xi(t,n),r=t=>{const i=t.currentTarget;if(!ts(t))return;Zi.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Zi.has(i)&&Zi.delete(i),ts(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||_i(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Ji((()=>{if(Zi.has(n))return;Qi(n,"down");const t=Ji((()=>{Qi(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>Qi(n,"cancel")),e)}));n.addEventListener("keydown",i,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",i)),e)})(t,s))),e=t,qi.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),o}function ns(t,e){const n=window.getComputedStyle(t);return jn(e)?n.getPropertyValue(e):n[e]}function is(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return gt.preUpdate(i,!0),()=>yt(i)}function ss(){const{value:t}=mt;null!==t?(t.frameloop.rate.push(vt.delta),t.animations.mainThread.push(St.mainThread),t.animations.waapi.push(St.waapi),t.animations.layout.push(St.layout)):yt(ss)}function os(t){return t.reduce(((t,e)=>t+e),0)/t.length}function rs(t,e=os){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const as=t=>Math.round(1e3/t);function ls(){mt.value=null,mt.addProjectionMetrics=null}function us(){const{value:t}=mt;if(!t)throw new Error("Stats are not being measured");ls(),yt(ss);const e={frameloop:{setup:rs(t.frameloop.setup),rate:rs(t.frameloop.rate),read:rs(t.frameloop.read),resolveKeyframes:rs(t.frameloop.resolveKeyframes),preUpdate:rs(t.frameloop.preUpdate),update:rs(t.frameloop.update),preRender:rs(t.frameloop.preRender),render:rs(t.frameloop.render),postRender:rs(t.frameloop.postRender)},animations:{mainThread:rs(t.animations.mainThread),waapi:rs(t.animations.waapi),layout:rs(t.animations.layout)},layoutProjection:{nodes:rs(t.layoutProjection.nodes),calculatedTargetDeltas:rs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:rs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=as(n.min),n.max=as(n.max),n.avg=as(n.avg),[n.min,n.max]=[n.max,n.min],e}function cs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=_e(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function hs(t){const e=[];ki.current=e;const n=t();ki.current=void 0;const i=ji(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>gt.preRender(i,!1,!0),o=t.map((t=>t.on("change",s)));e.on("destroy",(()=>{o.forEach((t=>t())),yt(i)}))}(e,i,t),i}const ds=[...pi,_t,ie],ps=t=>ds.find(di(t));function ms(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let fs={},gs=null;const ys=(t,e)=>{fs[t]=e},vs=()=>{gs||(gs=document.createElement("style"),gs.id="motion-view");let t="";for(const e in fs){const n=fs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}gs.textContent=t,document.head.appendChild(gs),fs={}},xs=()=>{gs&&gs.parentElement&&gs.parentElement.removeChild(gs)};function ws(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ts(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const Ps=["layout","enter","exit","new","old"];function Ss(t){const{update:e,targets:n,options:i}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new ei([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ys(":root",{"view-transition-name":"none"}),ys("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),vs();const s=document.startViewTransition((async()=>{await e()}));return s.finished.finally((()=>{xs()})),new Promise((t=>{s.ready.then((()=>{const e=document.getAnimations().filter(Ts),s=[];n.forEach(((t,e)=>{for(const n of Ps){if(!t[n])continue;const{keyframes:o,options:r}=t[n];for(let[t,a]of Object.entries(o)){if(!a)continue;const o={...ci(i,t),...ci(r,t)},l=ms(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof o.delay&&(o.delay=o.delay(0,1)),o.duration&&(o.duration=z(o.duration)),o.delay&&(o.delay=z(o.delay));const u=new Yn({...o,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});s.push(u)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=ws(o);if(!r)continue;const a=n.get(r.layer);if(a)bs(a,"enter")&&bs(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?s.push(new ii(t)):t.cancel();else{const n="group"===r.type?"layout":"";let o={...ci(i,n)};o.duration&&(o.duration=z(o.duration)),o=Xn(o);const a=$n(o.ease,o.duration);e.updateTiming({delay:z(o.delay??0),duration:o.duration,easing:a}),s.push(new ii(t))}}t(new ei(s))}))}))}function bs(t,e){return t?.[e]?.keyframes.opacity}let Es=[],As=null;function Ms(){As=null;const[t]=Es;var e;t&&(C(Es,e=t),As=e,Ss(e).then((t=>{e.notifyReady(t),t.finished.finally(Ms)})))}function Vs(){for(let t=Es.length-1;t>=0;t--){const e=Es[t],{interrupt:n}=e.options;if("immediate"===n){const n=Es.slice(0,t+1).map((t=>t.update)),i=Es.slice(t+1);e.update=()=>{n.forEach((t=>t()))},Es=[e,...i];break}}As&&"immediate"!==Es[0]?.options.interrupt||Ms()}class Cs{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=I,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,Es.push(n),Wi.render(Vs)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Rs=gt,Ds=pt.reduce(((t,e)=>(t[e]=t=