UNPKG

reactbits-animation

Version:

A comprehensive collection of beautiful, performant React animation components including bounce effects, click sparks, star borders, scroll-triggered animations, and fade transitions.

9 lines 2.84 MB
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("gsap"),r=require("gsap/ScrollTrigger"),i=require("react-dom/client"),o=require("react-dom");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s=a(t),l=a(i); /*! * SplitText 3.13.0 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle */ let c,u,d,h="undefined"!=typeof Intl?new Intl.Segmenter:0,p=e=>"string"==typeof e?p(document.querySelectorAll(e)):"length"in e?Array.from(e):[e],f=e=>p(e).filter(e=>e instanceof HTMLElement),m=[],g=function(){},v=/\s+/g,y=new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.","gu"),x={left:0,top:0,width:0,height:0},b=(e,t)=>{if(t){let n,r,i,o,a=new Set(e.join("").match(t)||m),s=e.length;if(a.size)for(;--s>-1;)for(i of(r=e[s],a))if(i.startsWith(r)&&i.length>r.length){for(n=0,o=r;i.startsWith(o+=e[s+ ++n])&&o.length<i.length;);if(n&&o.length===i.length){e[s]=i,e.splice(s+1,n);break}}}return e},w=e=>"inline"===window.getComputedStyle(e).display&&(e.style.display="inline-block"),S=(e,t,n)=>t.insertBefore("string"==typeof e?document.createTextNode(e):e,n),A=(e,t,n)=>{let r=t[e+"sClass"]||"",{tag:i="div",aria:o="auto",propIndex:a=!1}=t,s="line"===e?"block":"inline-block",l=r.indexOf("++")>-1,c=t=>{let c=document.createElement(i),u=n.length+1;return r&&(c.className=r+(l?" "+r+u:"")),a&&c.style.setProperty("--"+e,u+""),"none"!==o&&c.setAttribute("aria-hidden","true"),"span"!==i&&(c.style.position="relative",c.style.display=s),c.textContent=t,n.push(c),c};return l&&(r=r.replace("++","")),c.collection=n,c},C=(e,t,n,r,i,o,a,s,l,c)=>{var u;let d,p,f,g,y,x,A,E,T,M,_,P,R,I,D,k,B,O,F=Array.from(e.childNodes),L=0,{wordDelimiter:N,reduceWhiteSpace:z=!0,prepareText:U}=t,V=e.getBoundingClientRect(),H=V,j=!z&&"pre"===window.getComputedStyle(e).whiteSpace.substring(0,3),G=0,W=n.collection;for("object"==typeof N?(f=N.delimiter||N,p=N.replaceWith||""):p=""===N?"":N||" ",d=" "!==p;L<F.length;L++)if(g=F[L],3===g.nodeType){for(D=g.textContent||"",z?D=D.replace(v," "):j&&(D=D.replace(/\n/g,p+"\n")),U&&(D=U(D,e)),g.textContent=D,y=p||f?D.split(f||p):D.match(s)||m,B=y[y.length-1],E=d?" "===B.slice(-1):!B,B||y.pop(),H=V,A=d?" "===y[0].charAt(0):!y[0],A&&S(" ",e,g),y[0]||y.shift(),b(y,l),o&&c||(g.textContent=""),T=1;T<=y.length;T++)if(k=y[T-1],!z&&j&&"\n"===k.charAt(0)&&(null==(u=g.previousSibling)||u.remove(),S(document.createElement("br"),e,g),k=k.slice(1)),z||""!==k)if(" "===k)e.insertBefore(document.createTextNode(" "),g);else{if(d&&" "===k.charAt(0)&&S(" ",e,g),G&&1===T&&!A&&W.indexOf(G.parentNode)>-1?(x=W[W.length-1],x.appendChild(document.createTextNode(r?"":k))):(x=n(r?"":k),S(x,e,g),G&&1===T&&!A&&x.insertBefore(G,x.firstChild)),r)for(_=h?b([...h.segment(k)].map(e=>e.segment),l):k.match(s)||m,O=0;O<_.length;O++)x.appendChild(" "===_[O]?document.createTextNode(" "):r(_[O]));if(o&&c){if(D=g.textContent=D.substring(k.length+1,D.length),M=x.getBoundingClientRect(),M.top>H.top&&M.left<=H.left){for(P=e.cloneNode(),R=e.childNodes[0];R&&R!==x;)I=R,R=R.nextSibling,P.appendChild(I);e.parentNode.insertBefore(P,e),i&&w(P)}H=M}(T<y.length||E)&&S(T>=y.length?" ":d&&" "===k.slice(-1)?" "+p:p,e,g)}else S(p,e,g);e.removeChild(g),G=0}else 1===g.nodeType&&(a&&a.indexOf(g)>-1?(W.indexOf(g.previousSibling)>-1&&W[W.length-1].appendChild(g),G=g):(C(g,t,n,r,i,o,a,s,l,!0),G=0),i&&w(g))};const E=class e{constructor(e,t){this.isSplit=!1,d||T.register(window.gsap),this.elements=f(e),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=t,this._split=()=>this.isSplit&&this.split(this.vars);let n,r=[],i=()=>{let e,t=r.length;for(;t--;){e=r[t];let n=e.element.offsetWidth;if(n!==e.width)return e.width=n,void this._split()}};this._data={orig:r,obs:"undefined"!=typeof ResizeObserver&&new ResizeObserver(()=>{clearTimeout(n),n=setTimeout(i,200)})},g(this),this.split(t)}split(e){this.isSplit&&this.revert(),this.vars=e=e||this.vars||{};let t,{type:n="chars,words,lines",aria:r="auto",deepSlice:i=!0,smartWrap:o,onSplit:a,autoSplit:s=!1,specialChars:l,mask:c}=this.vars,d=n.indexOf("lines")>-1,h=n.indexOf("chars")>-1,m=n.indexOf("words")>-1,g=h&&!m&&!d,v=l&&("push"in l?new RegExp("(?:"+l.join("|")+")","gu"):l),b=v?new RegExp(v.source+"|"+y.source,"gu"):y,w=!!e.ignore&&f(e.ignore),{orig:S,animTime:E,obs:T}=this._data;return(h||m||d)&&(this.elements.forEach((t,n)=>{S[n]={element:t,html:t.innerHTML,ariaL:t.getAttribute("aria-label"),ariaH:t.getAttribute("aria-hidden")},"auto"===r?t.setAttribute("aria-label",(t.textContent||"").trim()):"hidden"===r&&t.setAttribute("aria-hidden","true");let a,s,l,c,u=[],f=[],y=[],E=h?A("char",e,u):null,T=A("word",e,f);if(C(t,e,T,E,g,i&&(d||g),w,b,v,!1),d){let n,r=p(t.childNodes),i=((e,t,n,r)=>{let i=A("line",n,r),o=window.getComputedStyle(e).textAlign||"left";return(n,r)=>{let a=i("");for(a.style.textAlign=o,e.insertBefore(a,t[n]);n<r;n++)a.appendChild(t[n]);a.normalize()}})(t,r,e,y),o=[],s=0,l=r.map(e=>1===e.nodeType?e.getBoundingClientRect():x),c=x;for(a=0;a<r.length;a++)n=r[a],1===n.nodeType&&("BR"===n.nodeName?(o.push(n),i(s,a+1),s=a+1,c=l[s]):(a&&l[a].top>c.top&&l[a].left<=c.left&&(i(s,a),s=a),c=l[a]));s<a&&i(s,a),o.forEach(e=>{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})}if(!m){for(a=0;a<f.length;a++)if(s=f[a],h||!s.nextSibling||3!==s.nextSibling.nodeType)if(o&&!d){for(l=document.createElement("span"),l.style.whiteSpace="nowrap";s.firstChild;)l.appendChild(s.firstChild);s.replaceWith(l)}else s.replaceWith(...s.childNodes);else c=s.nextSibling,c&&3===c.nodeType&&(c.textContent=(s.textContent||"")+(c.textContent||""),s.remove());f.length=0,t.normalize()}this.lines.push(...y),this.words.push(...f),this.chars.push(...u)}),c&&this[c]&&this.masks.push(...this[c].map(e=>{let t=e.cloneNode();return e.replaceWith(t),t.appendChild(e),e.className&&(t.className=e.className.replace(/(\b\w+\b)/g,"$1-mask")),t.style.overflow="clip",t}))),this.isSplit=!0,u&&(s?u.addEventListener("loadingdone",this._split):"loading"===u.status&&console.warn("SplitText called before fonts loaded")),(t=a&&a(this))&&t.totalTime&&(this._data.anim=E?t.totalTime(E):t),d&&s&&this.elements.forEach((e,t)=>{S[t].width=e.offsetWidth,T&&T.observe(e)}),this}revert(){var e,t;let{orig:n,anim:r,obs:i}=this._data;return i&&i.disconnect(),n.forEach(({element:e,html:t,ariaL:n,ariaH:r})=>{e.innerHTML=t,n?e.setAttribute("aria-label",n):e.removeAttribute("aria-label"),r?e.setAttribute("aria-hidden",r):e.removeAttribute("aria-hidden")}),this.chars.length=this.words.length=this.lines.length=n.length=this.masks.length=0,this.isSplit=!1,null==u||u.removeEventListener("loadingdone",this._split),r&&(this._data.animTime=r.totalTime(),r.revert()),null==(t=(e=this.vars).onRevert)||t.call(e,this),this}static create(t,n){return new e(t,n)}static register(e){c=c||e||window.gsap,c&&(p=c.utils.toArray,g=c.core.context||g),!d&&window.innerWidth>0&&(u=document.fonts,d=!0)}};E.version="3.13.0";let T=E;n.gsap.registerPlugin(r.ScrollTrigger,T);const M=t.createContext({});function _(e){const n=t.useRef(null);return null===n.current&&(n.current=e()),n.current}const P="undefined"!=typeof window,R=P?t.useLayoutEffect:t.useEffect,I=t.createContext(null);function D(e,t){-1===e.indexOf(t)&&e.push(t)}function k(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const B=(e,t,n)=>n>t?t:n<e?e:n;let O=()=>{},F=()=>{};"production"!==process.env.NODE_ENV&&(O=(e,t)=>{e||"undefined"==typeof console||console.warn(t)},F=(e,t)=>{if(!e)throw new Error(t)});const L={},N=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function z(e){return"object"==typeof e&&null!==e}const U=e=>/^0[^.\s]+$/u.test(e);function V(e){let t;return()=>(void 0===t&&(t=e()),t)}const H=e=>e,j=(e,t)=>n=>t(e(n)),G=(...e)=>e.reduce(j),W=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class X{constructor(){this.subscriptions=[]}add(e){return D(this.subscriptions,e),()=>k(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Y=e=>1e3*e,q=e=>e/1e3;function K(e,t){return t?e*(1e3/t):0}const Q=new Set;function J(e,t,n){e||Q.has(t)||(console.warn(t),Q.add(t))}const Z=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function $(e,t,n,r){if(e===t&&n===r)return H;const i=t=>function(e,t,n,r,i){let o,a,s=0;do{a=t+(n-t)/2,o=Z(a,r,i)-e,o>0?n=a:t=a}while(Math.abs(o)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:Z(i(e),t,r)}const ee=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,te=e=>t=>1-e(1-t),ne=$(.33,1.53,.69,.99),re=te(ne),ie=ee(re),oe=e=>(e*=2)<1?.5*re(e):.5*(2-Math.pow(2,-10*(e-1))),ae=e=>1-Math.sin(Math.acos(e)),se=te(ae),le=ee(ae),ce=$(.42,0,1,1),ue=$(0,0,.58,1),de=$(.42,0,.58,1),he=e=>Array.isArray(e)&&"number"!=typeof e[0];function pe(e,t){return he(e)?e[((e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e})(0,e.length,t)]:e}const fe=e=>Array.isArray(e)&&"number"==typeof e[0],me={linear:H,easeIn:ce,easeInOut:de,easeOut:ue,circIn:ae,circInOut:le,circOut:se,backIn:re,backInOut:ie,backOut:ne,anticipate:oe},ge=e=>{if(fe(e)){F(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return $(t,n,r,i)}return"string"==typeof e?(F(void 0!==me[e],`Invalid easing type '${e}'`),me[e]):e},ve=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ye(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=ve.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function s(t){o.has(t)&&(l.schedule(t),e()),t(a)}const l={schedule:(e,i=!1,a=!1)=>{const s=a&&r?t:n;return i&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{a=e,r?i=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,l.process(e)))}};return l}(o),e),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:f}=a,m=()=>{const o=L.useManualTiming?i.timestamp:performance.now();n=!1,L.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),p.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:ve.reduce((t,o)=>{const s=a[o];return t[o]=(t,o=!1,a=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(m)),s.schedule(t,o,a)),t},{}),cancel:e=>{for(let t=0;t<ve.length;t++)a[ve[t]].cancel(e)},state:i,steps:a}}const{schedule:xe,cancel:be,state:we,steps:Se}=ye("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:H,!0);let Ae;function Ce(){Ae=void 0}const Ee={now:()=>(void 0===Ae&&Ee.set(we.isProcessing||L.useManualTiming?we.timestamp:performance.now()),Ae),set:e=>{Ae=e,queueMicrotask(Ce)}},Te=e=>t=>"string"==typeof t&&t.startsWith(e),Me=Te("--"),_e=Te("var(--"),Pe=e=>!!_e(e)&&Re.test(e.split("/*")[0].trim()),Re=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ie={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},De={...Ie,transform:e=>B(0,1,e)},ke={...Ie,default:1},Be=e=>Math.round(1e5*e)/1e5,Oe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Fe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Le=(e,t)=>n=>Boolean("string"==typeof n&&Fe.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ne=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,o,a,s]=r.match(Oe);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},ze={...Ie,transform:e=>Math.round((e=>B(0,255,e))(e))},Ue={test:Le("rgb","red"),parse:Ne("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ze.transform(e)+", "+ze.transform(t)+", "+ze.transform(n)+", "+Be(De.transform(r))+")"};const Ve={test:Le("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:Ue.transform},He=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),je=He("deg"),Ge=He("%"),We=He("px"),Xe=He("vh"),Ye=He("vw"),qe=(()=>({...Ge,parse:e=>Ge.parse(e)/100,transform:e=>Ge.transform(100*e)}))(),Ke={test:Le("hsl","hue"),parse:Ne("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ge.transform(Be(t))+", "+Ge.transform(Be(n))+", "+Be(De.transform(r))+")"},Qe={test:e=>Ue.test(e)||Ve.test(e)||Ke.test(e),parse:e=>Ue.test(e)?Ue.parse(e):Ke.test(e)?Ke.parse(e):Ve.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Ue.transform(e):Ke.transform(e),getAnimatableNone:e=>{const t=Qe.parse(e);return t.alpha=0,Qe.transform(t)}},Je=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ze="number",$e="color",et=/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 tt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(et,e=>(Qe.test(e)?(r.color.push(o),i.push($e),n.push(Qe.parse(e))):e.startsWith("var(")?(r.var.push(o),i.push("var"),n.push(e)):(r.number.push(o),i.push(Ze),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:a,indexes:r,types:i}}function nt(e){return tt(e).values}function rt(e){const{split:t,types:n}=tt(e),r=t.length;return e=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],void 0!==e[o]){const t=n[o];i+=t===Ze?Be(e[o]):t===$e?Qe.transform(e[o]):e[o]}return i}}const it=e=>"number"==typeof e?0:Qe.test(e)?Qe.getAnimatableNone(e):e;const ot={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(Oe)?.length||0)+(e.match(Je)?.length||0)>0},parse:nt,createTransformer:rt,getAnimatableNone:function(e){const t=nt(e);return rt(e)(t.map(it))}};function at(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function st(e,t){return n=>n>0?t:e}const lt=(e,t,n)=>e+(t-e)*n,ct=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ut=[Ve,Ue,Ke];function dt(e){const t=(n=e,ut.find(e=>e.test(n)));var n;if(O(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===Ke&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,o=0,a=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=at(s,r,e+1/3),o=at(s,r,e),a=at(s,r,e-1/3)}else i=o=a=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:r}}(r)),r}const ht=(e,t)=>{const n=dt(e),r=dt(t);if(!n||!r)return st(e,t);const i={...n};return e=>(i.red=ct(n.red,r.red,e),i.green=ct(n.green,r.green,e),i.blue=ct(n.blue,r.blue,e),i.alpha=lt(n.alpha,r.alpha,e),Ue.transform(i))},pt=new Set(["none","hidden"]);function ft(e,t){return n=>lt(e,t,n)}function mt(e){return"number"==typeof e?ft:"string"==typeof e?Pe(e)?st:Qe.test(e)?ht:yt:Array.isArray(e)?gt:"object"==typeof e?Qe.test(e)?ht:vt:st}function gt(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>mt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function vt(e,t){const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=mt(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const yt=(e,t)=>{const n=ot.createTransformer(t),r=tt(e),i=tt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pt.has(e)&&!i.values.length||pt.has(t)&&!r.values.length?function(e,t){return pt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):G(gt(function(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][r[o]],s=e.values[a]??0;n[i]=s,r[o]++}return n}(r,i),i.values),n):(O(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),st(e,t))};function xt(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return lt(e,t,n);return mt(e)(e,t)}const bt=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>xe.update(t,e),stop:()=>be(t),now:()=>we.isProcessing?we.timestamp:Ee.now()}},wt=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(1e4*e(t/(i-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},St=2e4;function At(e){let t=0;let n=e.next(t);for(;!n.done&&t<St;)t+=50,n=e.next(t);return t>=St?1/0:t}function Ct(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(At(r),St);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:q(i)}}function Et(e,t,n){const r=Math.max(t-5,0);return K(n-e(r),t-r)}const Tt=100,Mt=10,_t=1,Pt=0,Rt=800,It=.3,Dt=.3,kt={granular:.01,default:2},Bt={granular:.005,default:.5},Ot=.01,Ft=10,Lt=.05,Nt=1,zt=.001;function Ut({duration:e=Rt,bounce:t=It,velocity:n=Pt,mass:r=_t}){let i,o;O(e<=Y(Ft),"Spring duration must be 10 seconds or less");let a=1-t;a=B(Lt,Nt,a),e=B(Ot,Ft,q(e)),a<1?(i=t=>{const r=t*a,i=r*e,o=r-n,s=Ht(t,a),l=Math.exp(-i);return zt-o/s*l},o=t=>{const r=t*a*e,o=r*n+n,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Ht(Math.pow(t,2),a);return(-i(t)+zt>0?-1:1)*((o-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<Vt;n++)r-=e(r)/t(r);return r}(i,o,5/e);if(e=Y(e),isNaN(s))return{stiffness:Tt,damping:Mt,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}const Vt=12;function Ht(e,t){return e*Math.sqrt(1-t*t)}const jt=["duration","bounce"],Gt=["stiffness","damping","mass"];function Wt(e,t){return t.some(t=>void 0!==e[t])}function Xt(e=Dt,t=It){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:Pt,stiffness:Tt,damping:Mt,mass:_t,isResolvedFromDuration:!1,...e};if(!Wt(e,Gt)&&Wt(e,jt))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,o=2*B(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:_t,stiffness:i,damping:o}}else{const n=Ut(e);t={...t,...n,mass:_t},t.isResolvedFromDuration=!0}return t}({...n,velocity:-q(n.velocity||0)}),f=h||0,m=c/(2*Math.sqrt(l*u)),g=a-o,v=q(Math.sqrt(l/u)),y=Math.abs(g)<5;let x;if(r||(r=y?kt.granular:kt.default),i||(i=y?Bt.granular:Bt.default),m<1){const e=Ht(v,m);x=t=>{const n=Math.exp(-m*v*t);return a-n*((f+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)x=e=>a-Math.exp(-v*e)*(g+(f+v*g)*e);else{const e=v*Math.sqrt(m*m-1);x=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return a-n*((f+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const b={calculatedDuration:p&&d||null,next:e=>{const t=x(e);if(p)s.done=e>=d;else{let n=0===e?f:0;m<1&&(n=0===e?Y(f):Et(x,e,t));const o=Math.abs(n)<=r,l=Math.abs(a-t)<=i;s.done=o&&l}return s.value=s.done?a:t,s},toString:()=>{const e=Math.min(At(b),St),t=wt(t=>b.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return b}function Yt({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=n*t;const m=d+f,g=void 0===a?m:a(m);g!==m&&(f=g-d);const v=e=>-f*Math.exp(-e/r),y=e=>g+v(e),x=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let b,w;const S=e=>{var t;(t=h.value,void 0!==s&&t<s||void 0!==l&&t>l)&&(b=e,w=Xt({keyframes:[h.value,p(h.value)],velocity:Et(y,e,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==b||(t=!0,x(e),S(e)),void 0!==b&&e>=b?w.next(e-b):(!t&&x(e),h)}}}function qt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(F(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],i=n||L.mix||xt,o=e.length-1;for(let n=0;n<o;n++){let o=i(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||H:t;o=G(e,o)}r.push(o)}return r}(t,r,i),l=s.length,c=n=>{if(a&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const i=W(e[r],e[r+1],n);return s[r](i)};return n?t=>c(B(e[0],e[o-1],t)):c}function Kt(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=W(0,t,r);e.push(lt(n,1,i))}}function Qt(e){const t=[0];return Kt(t,e.length-1),t}function Jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=he(r)?r.map(ge):ge(r),o={done:!1,value:t[0]},a=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Qt(t),e),s=qt(a,t,{ease:Array.isArray(i)?i:(l=t,c=i,l.map(()=>c||de).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}Xt.applyToOptions=e=>{const t=Ct(e,100,Xt);return e.ease=t.ease,e.duration=Y(t.duration),e.type="keyframes",e};const Zt=e=>null!==e;function $t(e,{repeat:t,repeatType:n="loop"},r,i=1){const o=e.filter(Zt),a=i<0||t&&"loop"!==n&&t%2==1?0:o.length-1;return a&&void 0!==r?r:o[a]}const en={decay:Yt,inertia:Yt,tween:Jt,keyframes:Jt,spring:Xt};function tn(e){"string"==typeof e.type&&(e.type=en[e.type])}class nn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const rn=e=>e/100;class on extends nn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Ee.now()&&this.tick(Ee.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;tn(e);const{type:t=Jt,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const s=t||Jt;"production"!==process.env.NODE_ENV&&s!==Jt&&F(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),s!==Jt&&"number"!=typeof a[0]&&(this.mixKeyframes=G(rn,xt(a[0],a[1])),a=[0,100]);const l=s({...e,keyframes:a});"mirror"===i&&(this.mirroredGenerator=s({...e,keyframes:[...a].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=At(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:d,repeatDelay:h,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let y=this.currentTime,x=n;if(u){const e=Math.min(this.currentTime,r)/a;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,u+1);Boolean(t%2)&&("reverse"===d?(n=1-n,h&&(n-=h/a)):"mirror"===d&&(x=o)),y=B(0,1,n)*a}const b=v?{done:!1,value:c[0]}:x.next(y);i&&(b.value=i(b.value));let{done:w}=b;v||null===s||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&p!==Yt&&(b.value=$t(c,this.options,m,this.speed)),f&&f(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return q(this.calculatedDuration)}get time(){return q(this.currentTime)}set time(e){e=Y(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Ee.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=q(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bt,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"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(Ee.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const an=e=>180*e/Math.PI,sn=e=>{const t=an(Math.atan2(e[1],e[0]));return cn(t)},ln={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:sn,rotateZ:sn,skewX:e=>an(Math.atan(e[1])),skewY:e=>an(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},cn=e=>((e%=360)<0&&(e+=360),e),un=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),hn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:un,scaleY:dn,scale:e=>(un(e)+dn(e))/2,rotateX:e=>cn(an(Math.atan2(e[6],e[5]))),rotateY:e=>cn(an(Math.atan2(-e[2],e[0]))),rotateZ:sn,rotate:sn,skewX:e=>an(Math.atan(e[4])),skewY:e=>an(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function pn(e){return e.includes("scale")?1:0}function fn(e,t){if(!e||"none"===e)return pn(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=hn,i=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ln,i=t}if(!i)return pn(t);const o=r[t],a=i[1].split(",").map(mn);return"function"==typeof o?o(a):a[o]}function mn(e){return parseFloat(e.trim())}const gn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vn=(()=>new Set(gn))(),yn=e=>e===Ie||e===We,xn=new Set(["x","y","z"]),bn=gn.filter(e=>!xn.has(e));const wn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>fn(t,"x"),y:(e,{transform:t})=>fn(t,"y")};wn.translateX=wn.x,wn.translateY=wn.y;const Sn=new Set;let An=!1,Cn=!1,En=!1;function Tn(){if(Cn){const e=Array.from(Sn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return bn.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Cn=!1,An=!1,Sn.forEach(e=>e.complete(En)),Sn.clear()}function Mn(){Sn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Cn=!0)})}class _n{constructor(e,t,n,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Sn.add(this),An||(An=!0,xe.read(Mn),xe.resolveKeyframes(Tn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=r?.get(),o=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,o);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=o),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Sn.delete(this)}cancel(){"scheduled"===this.state&&(Sn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Pn=V(()=>void 0!==window.ScrollTimeline),Rn={};function In(e,t){const n=V(e);return()=>Rn[t]??n()}const Dn=In(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),kn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Bn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kn([0,.65,.55,1]),circOut:kn([.55,0,1,.45]),backIn:kn([.31,.01,.66,-.59]),backOut:kn([.33,1.53,.69,.99])};function On(e,t){return e?"function"==typeof e?Dn()?wt(e,t):"ease-out":fe(e)?kn(e):Array.isArray(e)?e.map(e=>On(e,t)||Bn.easeOut):Bn[e]:void 0}function Fn(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:a="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=On(s,i);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};c&&(h.pseudoElement=c);return e.animate(u,h)}function Ln(e){return"function"==typeof e&&"applyToOptions"in e}class Nn extends nn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:s}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=o,this.options=e,F("string"!=typeof e.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:e,...t}){return Ln(e)&&Dn()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=Fn(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=$t(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(e):function(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}(t,n,e),this.animation.cancel()}s?.(),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(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return q(Number(e))}get time(){return q(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Y(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Pn()?(this.animation.timeline=e,H):t(this)}}const zn={anticipate:oe,backInOut:ie,circInOut:le};function Un(e){"string"==typeof e.ease&&e.ease in zn&&(e.ease=zn[e.ease])}class Vn extends Nn{constructor(e){Un(e),tn(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:i,...o}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const a=new on({...o,autoplay:!1}),s=Y(this.finishedTime??this.time);t.setWithVelocity(a.sample(s-10).value,a.sample(s).value,10),a.stop()}}const Hn=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ot.test(e)&&"0"!==e||e.startsWith("url(")));function jn(e){return z(e)&&"offsetHeight"in e}const Gn=new Set(["opacity","clipPath","filter","transform"]),Wn=V(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Xn extends nn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:s,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ee.now();const d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:o,name:s,motionValue:l,element:c,...u},h=c?.KeyframeResolver||_n;this.keyframeResolver=new h(a,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:s,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Ee.now(),function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],a=Hn(i,t),s=Hn(o,t);return O(a===s,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!(!a||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||Ln(n))&&r)}(e,i,o,a)||(!L.instantAnimations&&s||c?.($t(e,n,t)),e[0]=e[e.length-1],n.duration=0,n.repeat=0);const u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!l&&function(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:a}=e;if(!jn(t?.owner?.current))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return Wn()&&n&&Gn.has(n)&&("transform"!==n||!l)&&!s&&!r&&"mirror"!==i&&0!==o&&"inertia"!==a}(u)?new Vn({...u,element:u.motionValue.owner.current}):new on(u);d.finished.then(()=>this.notifyFinished()).catch(H),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),En=!0,Mn(),Tn(),En=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Yn{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){const t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class qn extends Yn{then(e,t){return this.finished.finally(e).then(()=>{})}}const Kn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Qn(e,t,n=1){F(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=function(e){const t=Kn.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const e=o.trim();return N(e)?parseFloat(e):e}return Pe(i)?Qn(i,t,n+1):i}function Jn(e,t){return e?.[t]??e?.default??e}const Zn=new Set(["width","height","top","left","right","bottom",...gn]),$n=e=>t=>t.test(e),er=[Ie,We,Ge,je,Ye,Xe,{test:e=>"auto"===e,parse:e=>e}],tr=e=>er.find($n(e));function nr(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||U(e))}const rr=new Set(["brightness","contrast","saturate","opacity"]);function ir(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Oe)||[];if(!r)return e;const i=n.replace(r,"");let o=rr.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const or=/\b([a-z-]*)\(.*?\)/gu,ar={...ot,getAnimatableNone:e=>{const t=e.match(or);return t?t.map(ir).join(" "):e}},sr={...Ie,transform:Math.round},lr={borderWidth:We,borderTopWidth:We,borderRightWidth:We,borderBottomWidth:We,borderLeftWidth:We,borderRadius:We,radius:We,borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomRightRadius:We,borderBottomLeftRadius:We,width:We,maxWidth:We,height:We,maxHeight:We,top:We,right:We,bottom:We,left:We,padding:We,paddingTop:We,paddingRight:We,paddingBottom:We,paddingLeft:We,margin:We,marginTop:We,marginRight:We,marginBottom:We,marginLeft:We,backgroundPositionX:We,backgroundPositionY:We,...{rotate:je,rotateX:je,rotateY:je,rotateZ:je,scale:ke,scaleX:ke,scaleY:ke,scaleZ:ke,skew:je,skewX:je,skewY:je,distance:We,translateX:We,translateY:We,translateZ:We,x:We,y:We,z:We,perspective:We,transformPerspective:We,opacity:De,originX:qe,originY:qe,originZ:We},zIndex:sr,fillOpacity:De,strokeOpacity:De,numOctaves:sr},cr={...lr,color:Qe,backgroundColor:Qe,outlineColor:Qe,fill:Qe,stroke:Qe,borderColor:Qe,borderTopColor:Qe,borderRightColor:Qe,borderBottomColor:Qe,borderLeftColor:Qe,filter:ar,WebkitFilter:ar},ur=e=>cr[e];function dr(e,t){let n=ur(e);return n!==ar&&(n=ot),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const hr=new Set(["auto","none","0"]);class pr extends _n{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Pe(r))){const i=Qn(r,t.current);void 0!==i&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Zn.has(n)||2!==e.length)return;const[r,i]=e,o=tr(r),a=tr(i);if(o!==a)if(yn(o)&&yn(a))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else wn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(null===e[t]||nr(e[t]))&&n.push(t);n.length&&function(e,t,n){let r,i=0;for(;i<e.length&&!r;){const t=e[i];"string"==typeof t&&!hr.has(t)&&tt(t).values.length&&(r=e[i]),i++}if(r&&n)for(const i of t)e[i]=dr(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=wn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const i=n.length-1,o=n[i];n[i]=wn[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}function fr(e,t,n){if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const r=n?.[e]??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const mr=(e,t)=>t&&"number"==typeof e?t.transform(e):e,gr={current:void 0};class vr{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Ee.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty();t&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Ee.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&J(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new X);const n=this.events[e].add(t);return"change"===e?()=>{n(),xe.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return gr.current&&gr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Ee.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return K(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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 yr(e,t){return new vr(e,t)}const{schedule:xr}=ye(queueMicrotask,!1),br={x:!1,y:!1};function wr(){return br.x||br.y}function Sr(e,t){const n=fr(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ar(e){return!("touch"===e.pointerType||wr())}const Cr=(e,t)=>!!t&&(e===t||Cr(e,t.parentElement)),Er=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Tr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Mr=new WeakSet;function _r(e){return t=>{"Enter"===t.key&&e(t)}}function Pr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Rr(e){return Er(e)&&!wr()}function Ir(e,t,n={}){const[r,i,o]=Sr(e,n),a=e=>{const r=e.currentTarget;if(!Rr(e))return;Mr.add(r);const o=t(r,e),a=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Mr.has(r)&&Mr.delete(r),Rr(e)&&"function"==typeof o&&o(e,{success:t})},s=e=>{a(e,r===window||r===document||n.useGlobalTarget||Cr(r,e.target))},l=e=>{a(e,!1)};window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",a,i),jn(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=_r(()=>{if(Mr.has(n))return;Pr(n,"down");const e=_r(()=>{Pr(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Pr(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,Tr.has(t.tagName)||-1!==t.tabIndex||e.hasAttribute("tabindex")||(e.tabIndex=0))}),o}function Dr(e){return z(e)&&"ownerSVGElement"in e}const kr=new WeakMap;let Br;const Or=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Dr(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Fr=Or("inline","width","offsetWidth"),Lr=Or("block","height","offsetHeight");function Nr({target:e,borderBoxSize:t}){kr.get(e)?.forEach(n=>{n(e,{get width(){return Fr(e,t)},get height(){return Lr(e,t)}})})}function zr(e){e.forEach(Nr)}function Ur(e,t){Br||"undefined"!=typeof ResizeObserver&&(Br=new ResizeObserver(zr));const n=fr(e);return n.forEach(e=>{let n=kr.get(e);n||(n=new Set,kr.set(e,n)),n.add(t),Br?.observe(e)}),()=>{n.forEach(e=>{const n=kr.get(e);n?.delete(t),n?.size||Br?.unobserve(e)})}}const Vr=new Set;let Hr;function jr(e){return Vr.add(e),Hr||(Hr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Vr.forEach(t=>t(e))},window.addEventListener("resize",Hr)),()=>{Vr.delete(e),Vr.size||"function"!=typeof Hr||(window.removeEventListener("resize",Hr),Hr=void 0)}}function Gr(e,t){let n;const r=()=>{const{currentTime:r}=t,i=(null===r?0:r.value)/100;n!==i&&e(i),n=i};return xe.preUpdate(r,!0),()=>be(r)}function Wr(e){return Dr(e)&&"svg"===e.tagName}const Xr=e=>Boolean(e&&e.getVelocity);function Yr(e,t){return t?e+t:e}function qr(e){return"number"==typeof e?e:parseFloat(e)}const Kr=[...er,Qe,ot],Qr=t.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Jr extends s.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=jn(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Zr({children:n,isPresent:r,anchorX:i}){const o=t.useId(),a=t.useRef(null),l=t.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=t.useContext(Qr);return t.useInsertionEffect(()=>{const{width:e,height:t,top:n,left:s,right:u}=l.current;if(r||!a.current||!e||!t)return;const d="left"===i?`left: ${s}`:`right: ${u}`;a.current.dataset.motionPopId=o;const h=document.createElement("style");return c&&(h.nonce=c),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${d}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.contains(h)&&document.head.removeChild(h)}},[r]),e.jsx(Jr,{isPresent:r,childRef:a,sizeRef:l,children:s.cloneElement(n,{ref:a})})}const $r=({children:n,initial:r,isPresent:i,onExitComplete:o,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const d=_(ei),h=t.useId();let p=!0,f=t.useMemo(()=>(p=!1,{id:h,initial:r,isPresent:i,custom:a,onExitComplete:e=>{d.set(e,!0);for(const e of d.values())if(!e)return;o&&o()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[i,d,o]);return l&&p&&(f={...f}),t.useMemo(()=>{d.forEach((e,t)=>d.set(t,!1))},[i]),s.useEffect(()=>{!i&&!d.size&&o&&o()},[i]),"popLayout"===c&&(n=e.jsx(Zr,{isPresent:i,anchorX:u,children:n})),e.jsx(I.Provider,{value:f,children:n})};function ei(){return