import{a as e,i as t,n,r}from"./rolldown-runtime-Cyuzqnbw.js";import{w as i,x as a}from"./react-Cthodp0K.js";var o=a(),s=e(i(),1),c=(0,s.createContext)({});function l(e){let t=(0,s.useRef)(null);return t.current===null&&(t.current=e()),t.current}var u=typeof window<`u`?s.useLayoutEffect:s.useEffect,d=(0,s.createContext)(null);function f(e,t){e.indexOf(t)===-1&&e.push(t)}function p(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var m=(e,t,n)=>n>t?t:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_=e=>typeof e==`object`&&!!e,v=e=>/^0[^.\s]+$/u.test(e);function y(e){let t;return()=>(t===void 0&&(t=e()),t)}var b=e=>e,x=(...e)=>e.reduce((e,t)=>n=>t(e(n))),S=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},C=class{constructor(){this.subscriptions=[]}add(e){return f(this.subscriptions,e),()=>p(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;ie*1e3,T=e=>e/1e3,E=(e,t)=>t?1e3/t*e:0,D=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ee=1e-7,te=12;function ne(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=D(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>ee&&++sne(t,0,1,e,n);return e=>e===0||e===1?e:D(i(e),t,r)}var ie=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ae=e=>t=>1-e(1-t),oe=re(.33,1.53,.69,.99),se=ae(oe),ce=ie(se),le=e=>e>=1?1:(e*=2)<1?.5*se(e):.5*(2-2**(-10*(e-1))),ue=e=>1-Math.sin(Math.acos(e)),de=ae(ue),fe=ie(ue),pe=re(.42,0,1,1),me=re(0,0,.58,1),he=re(.42,0,.58,1),ge=e=>Array.isArray(e)&&typeof e[0]!=`number`,_e=e=>Array.isArray(e)&&typeof e[0]==`number`,ve={linear:b,easeIn:pe,easeInOut:he,easeOut:me,circIn:ue,circInOut:fe,circOut:de,backIn:se,backInOut:ce,backOut:oe,anticipate:le},ye=e=>typeof e==`string`,be=e=>{if(_e(e)){e.length;let[t,n,r,i]=e;return re(t,n,r,i)}else if(ye(e))return ve[e],`${e}`,ve[e];return e},xe=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Se(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Ce=40;function we(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=xe.reduce((e,t)=>(e[t]=Se(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,g=()=>{let a=h.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Ce),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},_=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:xe.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||_(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t(Ee===void 0&&j.set(A.isProcessing||h.useManualTiming?A.timestamp:performance.now()),Ee),set:e=>{Ee=e,queueMicrotask(De)}},Oe=e=>t=>typeof t==`string`&&t.startsWith(e),ke=Oe(`--`),Ae=Oe(`var(--`),je=e=>Ae(e)?Me.test(e.split(`/*`)[0].trim()):!1,Me=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ne(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var Pe={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Fe={...Pe,transform:e=>m(0,1,e)},Ie={...Pe,default:1},Le=e=>Math.round(e*1e5)/1e5,Re=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ze(e){return e==null}var Be=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ve=(e,t)=>n=>!!(typeof n==`string`&&Be.test(n)&&n.startsWith(e)||t&&!ze(n)&&Object.prototype.hasOwnProperty.call(n,t)),He=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Re);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ue=e=>m(0,255,e),We={...Pe,transform:e=>Math.round(Ue(e))},Ge={test:Ve(`rgb`,`red`),parse:He(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+We.transform(e)+`, `+We.transform(t)+`, `+We.transform(n)+`, `+Le(Fe.transform(r))+`)`};function Ke(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}}var qe={test:Ve(`#`),parse:Ke,transform:Ge.transform},Je=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),M=Je(`deg`),N=Je(`%`),P=Je(`px`),Ye=Je(`vh`),Xe=Je(`vw`),Ze={...N,parse:e=>N.parse(e)/100,transform:e=>N.transform(e*100)},Qe={test:Ve(`hsl`,`hue`),parse:He(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+N.transform(Le(t))+`, `+N.transform(Le(n))+`, `+Le(Fe.transform(r))+`)`},F={test:e=>Ge.test(e)||qe.test(e)||Qe.test(e),parse:e=>Ge.test(e)?Ge.parse(e):Qe.test(e)?Qe.parse(e):qe.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ge.transform(e):Qe.transform(e),getAnimatableNone:e=>{let t=F.parse(e);return t.alpha=0,F.transform(t)}},$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function et(e){return isNaN(e)&&typeof e==`string`&&(e.match(Re)?.length||0)+(e.match($e)?.length||0)>0}var tt=`number`,nt=`color`,rt=`var`,it=`var(`,at="${}",ot=/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 st(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ot,e=>(F.test(e)?(r.color.push(a),i.push(nt),n.push(F.parse(e))):e.startsWith(it)?(r.var.push(a),i.push(rt),n.push(e)):(r.number.push(a),i.push(tt),n.push(parseFloat(e))),++a,at)).split(at),indexes:r,types:i}}function ct(e){return st(e).values}function lt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;atypeof e==`number`?0:F.test(e)?F.getAnimatableNone(e):e,ft=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:dt(e);function pt(e){let t=st(e);return lt(t)(t.values.map((e,n)=>ft(e,t.split[n])))}var I={test:et,parse:ct,createTransformer:ut,getAnimatableNone:pt};function mt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ht({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=mt(s,r,e+1/3),a=mt(s,r,e),o=mt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function gt(e,t){return n=>n>0?t:e}var L=(e,t,n)=>e+(t-e)*n,_t=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},vt=[qe,Ge,Qe],yt=e=>vt.find(t=>t.test(e));function bt(e){let t=yt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Qe&&(n=ht(n)),n}var xt=(e,t)=>{let n=bt(e),r=bt(t);if(!n||!r)return gt(e,t);let i={...n};return e=>(i.red=_t(n.red,r.red,e),i.green=_t(n.green,r.green,e),i.blue=_t(n.blue,r.blue,e),i.alpha=L(n.alpha,r.alpha,e),Ge.transform(i))},St=new Set([`none`,`hidden`]);function Ct(e,t){return St.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wt(e,t){return n=>L(e,t,n)}function Tt(e){return typeof e==`number`?wt:typeof e==`string`?je(e)?gt:F.test(e)?xt:kt:Array.isArray(e)?Et:typeof e==`object`?F.test(e)?xt:Dt:gt}function Et(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Tt(e)(e,t[n]));return e=>{for(let t=0;t{for(let t in r)n[t]=r[t](e);return n}}function Ot(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i{let n=I.createTransformer(t),r=st(e),i=st(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?St.has(e)&&!i.values.length||St.has(t)&&!r.values.length?Ct(e,t):x(Et(Ot(r,i),i.values),n):(`${e}${t}`,gt(e,t))};function At(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?L(e,t,n):Tt(e)(e,t)}var jt=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>O.update(t,e),stop:()=>k(t),now:()=>A.isProcessing?A.timestamp:j.now()}},Mt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t=2e4?1/0:t}function Ft(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Pt(r),Nt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:T(i)}}var R={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function It(e,t){return e*Math.sqrt(1-t*t)}var Lt=12;function Rt(e,t,n){let r=n;for(let n=1;n{let r=t*o,i=r*e,a=r-n,s=It(t,o),c=Math.exp(-i);return zt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=It(t**2,o);return(-i(t)+zt>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Rt(i,a,s);if(e=w(e),isNaN(c))return{stiffness:R.stiffness,damping:R.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Vt=[`duration`,`bounce`],Ht=[`stiffness`,`damping`,`mass`];function Ut(e,t){return t.some(t=>e[t]!==void 0)}function Wt(e){let t={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...e};if(!Ut(e,Ht)&&Ut(e,Vt))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*m(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:R.mass,stiffness:i,damping:a}}else{let n=Bt({...e,velocity:0});t={...t,...n,mass:R.mass},t.isResolvedFromDuration=!0}return t}function Gt(e=R.visualDuration,t=R.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Wt({...n,velocity:-T(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=T(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?R.restSpeed.granular:R.restSpeed.default,i||=v?R.restDelta.granular:R.restDelta.default;let y,b,x,S,C,E;if(h<1)x=It(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,E=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+E*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let D={calculatedDuration:p&&d||null,velocity:e=>w(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=w(t*(C*n+E*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=w(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Pt(D),Nt),t=Mt(t=>D.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return D}Gt.applyToOptions=e=>{let t=Ft(e,100,Gt);return e.ease=t.ease,e.duration=w(t.duration),e.type=`keyframes`,e};var Kt=5;function qt(e,t,n){let r=Math.max(t-Kt,0);return E(n-e(r),t-r)}function Jt({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&ec,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Gt({keyframes:[f.value,m(f.value)],velocity:qt(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Yt(e,t,n){let r=[],i=n||h.mix||At,a=e.length-1;for(let n=0;nt[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Yt(t,r,i),c=s.length,l=n=>{if(o&&n1)for(;rl(m(e[0],e[a-1],t)):l}function Zt(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=S(0,t,r);e.push(L(n,1,i))}}function Qt(e){let t=[0];return Zt(t,e.length-1),t}function $t(e,t){return e.map(e=>e*t)}function en(e,t){return e.map(()=>t||he).splice(0,e.length-1)}function tn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ge(r)?r.map(be):be(r),a={done:!1,value:t[0]},o=Xt($t(n&&n.length===t.length?n:Qt(t),e),t,{ease:Array.isArray(i)?i:en(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var nn=e=>e!==null;function rn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(nn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var an={decay:Jt,inertia:Jt,tween:tn,keyframes:tn,spring:Gt};function on(e){typeof e.type==`string`&&(e.type=an[e.type])}var sn=class{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)}},cn=e=>e/100,ln=class extends sn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;on(e);let{type:t=tn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||tn;s!==tn&&typeof o[0]!=`number`&&(this.mixKeyframes=x(cn,At(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Pt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:h,finalKeyframe:g}=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);let _=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?_<0:_>r;this.currentTime=Math.max(_,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,b=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(b=a)),y=m(0,1,n)*o}let x;v?(this.delayState.value=l[0],x=this.delayState):x=b.next(y),i&&!v&&(x.value=i(x.value));let{done:S}=x;!v&&s!==null&&(S=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let C=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&S);return C&&p!==Jt&&(x.value=rn(l,this.options,g,this.speed)),h&&h(x.value),C&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return T(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+T(e)}get time(){return T(this.currentTime)}set time(e){e=w(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return qt(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(j.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=T(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=jt,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(j.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&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(),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)}};function un(e){for(let t=1;te*180/Math.PI,dn=e=>pn(z(Math.atan2(e[1],e[0]))),fn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dn,rotateZ:dn,skewX:e=>z(Math.atan(e[1])),skewY:e=>z(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},pn=e=>(e%=360,e<0&&(e+=360),e),mn=dn,hn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),gn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),_n={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hn,scaleY:gn,scale:e=>(hn(e)+gn(e))/2,rotateX:e=>pn(z(Math.atan2(e[6],e[5]))),rotateY:e=>pn(z(Math.atan2(-e[2],e[0]))),rotateZ:mn,rotate:mn,skewX:e=>z(Math.atan(e[4])),skewY:e=>z(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vn(e){return+!!e.includes(`scale`)}function yn(e,t){if(!e||e===`none`)return vn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=_n,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=fn,i=t}if(!i)return vn(t);let a=r[t],o=i[1].split(`,`).map(xn);return typeof a==`function`?a(o):o[a]}var bn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return yn(n,t)};function xn(e){return parseFloat(e.trim())}var Sn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Cn=new Set([...Sn,`pathRotation`]),wn=e=>e===Pe||e===P,Tn=new Set([`x`,`y`,`z`]),En=Sn.filter(e=>!Tn.has(e));function Dn(e){let t=[];return En.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var B={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-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})=>yn(t,`x`),y:(e,{transform:t})=>yn(t,`y`)};B.translateX=B.x,B.translateY=B.y;var V=new Set,On=!1,kn=!1,An=!1;function jn(){if(kn){let e=Array.from(V).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Dn(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}kn=!1,On=!1,V.forEach(e=>e.complete(An)),V.clear()}function Mn(){V.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(kn=!0)})}function Nn(){An=!0,Mn(),jn(),An=!1}var Pn=class{constructor(e,t,n,r,i,a=!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=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(V.add(this),On||(On=!0,O.read(Mn),O.resolveKeyframes(jn))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}un(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),V.delete(this)}cancel(){this.state===`scheduled`&&(V.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Fn=e=>e.startsWith(`--`);function In(e,t,n){Fn(t)?e.style.setProperty(t,n):e.style[t]=n}var Ln={};function Rn(e,t){let n=y(e);return()=>Ln[t]??n()}var zn=Rn(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Bn=Rn(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Vn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Hn={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Vn([0,.65,.55,1]),circOut:Vn([.55,0,1,.45]),backIn:Vn([.31,.01,.66,-.59]),backOut:Vn([.33,1.53,.69,.99])};function Un(e,t){if(e)return typeof e==`function`?Bn()?Mt(e,t):`ease-out`:_e(e)?Vn(e):Array.isArray(e)?e.map(e=>Un(e,t)||Hn.easeOut):Hn[e]}function Wn(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Un(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Gn(e){return typeof e==`function`&&`applyToOptions`in e}function Kn({type:e,...t}){return Gn(e)&&Bn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var qn=class extends sn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Kn(e);this.animation=Wn(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=rn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),In(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return T(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+T(e)}get time(){return T(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=w(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&zn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),b):r(this)}},Jn={anticipate:le,backInOut:ce,circInOut:fe};function Yn(e){return e in Jn}function Xn(e){typeof e.ease==`string`&&Yn(e.ease)&&(e.ease=Jn[e.ease])}var Zn=10,Qn=class extends qn{constructor(e){Xn(e),on(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new ln({...a,autoplay:!1}),s=Math.max(Zn,j.now()-this.startTime),c=m(0,Zn,s-Zn),l=o.sample(s).value,{name:u}=this.options;i&&u&&In(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},$n=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(I.test(e)||e===`0`)&&!e.startsWith(`url(`));function er(e){let t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,`animate`));function cr(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return sr()&&n&&(rr.has(n)||or.has(n)&&ar(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var lr=40,ur=class extends sn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=j.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Pn;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=j.now();let u=!0;tr(e,i,a,o)||(u=!1,(h.instantAnimations||!s)&&l?.(rn(e,n,t)),e[0]=e[e.length-1],nr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>lr?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&cr(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Qn({...d,element:p})}catch{m=new ln(d)}else m=new ln(d);m.finished.then(()=>{this.notifyFinished()}).catch(b),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}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(),Nn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}};function dr(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var fr=30,pr=e=>!isNaN(parseFloat(e)),mr={current:void 0},hr=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=j.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=j.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new C);let n=this.events[e].add(t);return e===`change`?()=>{n(),O.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}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||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return mr.current&&mr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>fr)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,fr);return E(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 gr(e,t){return new hr(e,t)}function _r(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function vr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:_r(n,e)}var yr={type:`spring`,stiffness:500,damping:25,restSpeed:10},br=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xr={type:`keyframes`,duration:.8},Sr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Cr=(e,{keyframes:t})=>t.length>2?xr:Cn.has(e)?e.startsWith(`scale`)?br(t[1]):yr:Sr,wr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Tr(e){for(let t in e)if(!wr.has(t))return!0;return!1}var Er=(e,t,n,r={},i,a)=>o=>{let s=vr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=w(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Tr(s)||Object.assign(u,Cr(e,u)),u.duration&&=w(u.duration),u.repeatDelay&&=w(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(nr(u),u.delay===0&&(d=!0)),(h.instantAnimations||h.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,nr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=rn(u.keyframes,s);if(e!==void 0){O.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ln(u):new ur(u)},Dr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Or(e){let t=Dr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function kr(e,t,n=1){`${e}`;let[r,i]=Or(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return g(e)?parseFloat(e):e}return je(i)?kr(i,t,n+1):i}function Ar(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function jr(e,t,n,r){if(typeof t==`function`){let[i,a]=Ar(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Ar(r);t=t(n===void 0?e.custom:n,i,a)}return t}function H(e,t,n){let r=e.getProps();return jr(r,t,n===void 0?r.custom:n,e)}var Mr=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Sn]),Nr=e=>Array.isArray(e);function Pr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,gr(n))}function Fr(e){return Nr(e)?e[e.length-1]||0:e}function Ir(e,t){let{transitionEnd:n={},transition:r={},...i}=H(e,t)||{};i={...i,...n};for(let t in i)Pr(e,t,Fr(i[t]))}var U=e=>!!(e&&e.getVelocity);function Lr(e){return!!(U(e)&&e.add)}function Rr(e,t){let n=e.getValue(`willChange`);if(Lr(n))return n.add(t);if(!n&&h.WillChange){let n=new h.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function zr(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Br=`data-`+zr(`framerAppearId`);function Vr(e){return e.props[Br]}function Hr({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ur(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?_r(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Hr(f,t))continue;let o={delay:n,...vr(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){O.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Vr(e);if(n){let e=window.MotionHandoffAnimation(n,t,O);e!==null&&(o.startTime=e,p=!0)}}Rr(e,t);let m=l??e.shouldReduceMotion;r.start(Er(t,r,i,m&&Mr.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>O.update(()=>{o&&Ir(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Wr(e,t,n={}){let r=H(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Ur(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Gr(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Gr(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Wr(c,t,{...o,delay:n+(typeof r==`function`?0:r)+dr(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Kr(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Wr(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Wr(e,t,n);else{let i=typeof t==`function`?H(e,t,n.custom):t;r=Promise.all(Ur(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var qr={test:e=>e===`auto`,parse:e=>e},Jr=e=>t=>t.test(e),Yr=[Pe,P,N,M,Xe,Ye,qr],Xr=e=>Yr.find(Jr(e));function Zr(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||v(e)}var Qr=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function $r(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Re)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Qr.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var ei=/\b([a-z-]*)\(.*?\)/gu,ti={...I,getAnimatableNone:e=>{let t=e.match(ei);return t?t.map($r).join(` `):e}},ni={...I,getAnimatableNone:e=>{let t=I.parse(e);return I.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},ri={...Pe,transform:Math.round},ii={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,rotate:M,pathRotation:M,rotateX:M,rotateY:M,rotateZ:M,scale:Ie,scaleX:Ie,scaleY:Ie,scaleZ:Ie,skew:M,skewX:M,skewY:M,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Fe,originX:Ze,originY:Ze,originZ:P,zIndex:ri,fillOpacity:Fe,strokeOpacity:Fe,numOctaves:ri},ai={...ii,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:ti,WebkitFilter:ti,mask:ni,WebkitMask:ni},oi=e=>ai[e],si=new Set([ti,ni]);function ci(e,t){let n=oi(e);return si.has(n)||(n=I),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var li=new Set([`auto`,`none`,`0`]);function ui(e,t,n){let r=0,i;for(;r{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function fi(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var pi=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function mi(e){return _(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:hi,cancel:gi}=we(queueMicrotask,!1),W={x:!1,y:!1};function _i(){return W.x||W.y}function vi(e){return e===`x`||e===`y`?W[e]?null:(W[e]=!0,()=>{W[e]=!1}):W.x||W.y?null:(W.x=W.y=!0,()=>{W.x=W.y=!1})}function yi(e,t){let n=fi(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function bi(e){return!(e.pointerType===`touch`||_i())}function xi(e,t,n={}){let[r,i,a]=yi(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!bi(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Si=(e,t)=>t?e===t?!0:Si(e,t.parentElement):!1,Ci=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,wi=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ti(e){return wi.has(e.tagName)||e.isContentEditable===!0}var Ei=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Di(e){return Ei.has(e.tagName)||e.isContentEditable===!0}var Oi=new WeakSet;function ki(e){return t=>{t.key===`Enter`&&e(t)}}function Ai(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ji=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ki(()=>{if(Oi.has(n))return;Ai(n,`down`);let e=ki(()=>{Ai(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Ai(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Mi(e){return Ci(e)&&!_i()}var Ni=new WeakSet;function Pi(e,t,n={}){let[r,i,a]=yi(e,n),o=e=>{let r=e.currentTarget;if(!Mi(e)||Ni.has(e))return;Oi.add(r),n.stopPropagation&&Ni.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Oi.has(r)&&Oi.delete(r),Mi(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Si(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),mi(e)&&(e.addEventListener(`focus`,e=>ji(e,i)),!Ti(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Fi(e){return _(e)&&`ownerSVGElement`in e}var Ii=new WeakMap,Li,Ri=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Fi(r)&&`getBBox`in r?r.getBBox()[t]:r[n],zi=Ri(`inline`,`width`,`offsetWidth`),Bi=Ri(`block`,`height`,`offsetHeight`);function Vi({target:e,borderBoxSize:t}){Ii.get(e)?.forEach(n=>{n(e,{get width(){return zi(e,t)},get height(){return Bi(e,t)}})})}function Hi(e){e.forEach(Vi)}function Ui(){typeof ResizeObserver>`u`||(Li=new ResizeObserver(Hi))}function Wi(e,t){Li||Ui();let n=fi(e);return n.forEach(e=>{let n=Ii.get(e);n||(n=new Set,Ii.set(e,n)),n.add(t),Li?.observe(e)}),()=>{n.forEach(e=>{let n=Ii.get(e);n?.delete(t),n?.size||Li?.unobserve(e)})}}var Gi=new Set,Ki;function qi(){Ki=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gi.forEach(t=>t(e))},window.addEventListener(`resize`,Ki)}function Ji(e){return Gi.add(e),Ki||qi(),()=>{Gi.delete(e),!Gi.size&&typeof Ki==`function`&&(window.removeEventListener(`resize`,Ki),Ki=void 0)}}function Yi(e,t){return typeof e==`function`?Ji(e):Wi(e,t)}var Xi={value:null,addProjectionMetrics:null};function Zi(e){return Fi(e)&&e.tagName===`svg`}var Qi=[...Yr,F,I],$i=e=>Qi.find(Jr(e)),ea=()=>({translate:0,scale:1,origin:0,originPoint:0}),ta=()=>({x:ea(),y:ea()}),na=()=>({min:0,max:0}),G=()=>({x:na(),y:na()}),ra=new WeakMap;function ia(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function aa(e){return typeof e==`string`||Array.isArray(e)}var oa=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],sa=[`initial`,...oa];function ca(e){return ia(e.animate)||sa.some(t=>aa(e[t]))}function la(e){return!!(ca(e)||e.variants)}function ua(e,t,n){for(let r in t){let i=t[r],a=n[r];if(U(i))e.addValue(r,i);else if(U(a))e.addValue(r,gr(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,gr(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var da={current:null},fa={current:!1},pa=typeof window<`u`;function ma(){if(fa.current=!0,pa)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>da.current=e.matches;e.addEventListener(`change`,t),t()}else da.current=!1}var ha=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],ga={};function _a(e){ga=e}function va(){return ga}var ya=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=j.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(fa.current||ma(),this.shouldReduceMotion=da.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),k(this.notifyUpdate),k(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&rr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new qn({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:w(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Cn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&O.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ga){let t=ga[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=gr(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(g(n)||v(n))?n=parseFloat(n):!$i(n)&&I.test(t)&&(n=ci(e,t)),this.setBaseTarget(e,U(n)?n.get():n)),U(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=jr(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!U(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new C),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){hi.render(this.render)}},ba=class extends ya{constructor(){super(...arguments),this.KeyframeResolver=di}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;U(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},K=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function xa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sa({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ca(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function wa(e){return e===void 0||e===1}function Ta({scale:e,scaleX:t,scaleY:n}){return!wa(e)||!wa(t)||!wa(n)}function q(e){return Ta(e)||Ea(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ea(e){return Da(e.x)||Da(e.y)}function Da(e){return e&&e!==`0%`}function Oa(e,t,n){return n+t*(e-n)}function ka(e,t,n,r,i){return i!==void 0&&(e=Oa(e,i,r)),Oa(e,n,r)+t}function Aa(e,t=0,n=1,r,i){e.min=ka(e.min,t,n,r,i),e.max=ka(e.max,t,n,r,i)}function ja(e,{x:t,y:n}){Aa(e.x,t.translate,t.scale,t.originPoint),Aa(e.y,n.translate,n.scale,n.originPoint)}var Ma=.999999999999,Na=1.0000000000001;function Pa(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;sMa&&(t.x=1),t.yMa&&(t.y=1)}function J(e,t){e.min+=t,e.max+=t}function Fa(e,t,n,r,i=.5){Aa(e,t,n,L(e.min,e.max,i),r)}function Ia(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function La(e,t,n){let r=n??e;Fa(e.x,Ia(t.x,r.x),t.scaleX,t.scale,t.originX),Fa(e.y,Ia(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ra(e,t){return xa(Ca(e.getBoundingClientRect(),t))}function za(e,t,n){let r=Ra(e,n),{scroll:i}=t;return i&&(J(r.x,i.offset.x),J(r.y,i.offset.y)),r}var Ba={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Va=Sn.length;function Ha(e,t,n){let r=``,i=!0;for(let a=0;a{if(!t.target)return e;if(typeof e==`string`)if(P.test(e))e=parseFloat(e);else return e;return`${Ga(e,t.target.x)}% ${Ga(e,t.target.y)}%`}},qa={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=I.parse(e);if(i.length>5)return r;let a=I.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=L(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Ja={borderRadius:{...Ka,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ka,borderTopRightRadius:Ka,borderBottomLeftRadius:Ka,borderBottomRightRadius:Ka,boxShadow:qa};function Ya(e,{layout:t,layoutId:n}){return Cn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ja[e]||e===`opacity`)}function Xa(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(U(r[t])||i&&U(i[t])||Ya(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Za(e){return window.getComputedStyle(e)}var Qa=class extends ba{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Wa}readValueFromInstance(e,t){if(Cn.has(t))return this.projection?.isProjecting?vn(t):bn(e,t);{let n=Za(e),r=(ke(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ra(e,t)}build(e,t,n){Ua(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Xa(e,t,n)}},$a={offset:`stroke-dashoffset`,array:`stroke-dasharray`},eo={offset:`strokeDashoffset`,array:`strokeDasharray`};function to(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?$a:eo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var no=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ro(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ua(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of no)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&to(d,i,a,o,!1)}var io=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ao=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function oo(e,t,n,r){Wa(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(io.has(n)?n:zr(n),t.attrs[n])}function so(e,t,n){let r=Xa(e,t,n);for(let n in e)if(U(e[n])||U(t[n])){let t=Sn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var co=class extends ba{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=G}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Cn.has(t)){let e=oi(t);return e&&e.default||0}return t=io.has(t)?t:zr(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return so(e,t,n)}build(e,t,n){ro(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){oo(e,t,n,r)}mount(e){this.isSVGTag=ao(e.tagName),super.mount(e)}},lo=sa.length;function uo(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&uo(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>Kr(e,t,n)))}function go(e){let t=ho(e),n=vo(),r=!0,i=!1,a=t=>(n,r)=>{let i=H(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=uo(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;tf&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Nr(t)&&Nr(n)?!fo(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=H(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=dr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=H(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=vo(),i=!0}}}function _o(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fo(t,e):!1}function Y(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vo(){return{animate:Y(!0),whileInView:Y(),whileHover:Y(),whileTap:Y(),whileDrag:Y(),whileFocus:Y(),exit:Y()}}function yo(e,t){e.min=t.min,e.max=t.max}function X(e,t){yo(e.x,t.x),yo(e.y,t.y)}function bo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var xo=.9999,So=1.0001,Co=-.01,wo=.01;function Z(e){return e.max-e.min}function To(e,t,n){return Math.abs(e-t)<=n}function Eo(e,t,n,r=.5){e.origin=r,e.originPoint=L(t.min,t.max,e.origin),e.scale=Z(n)/Z(t),e.translate=L(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xo&&e.scale<=So||isNaN(e.scale))&&(e.scale=1),(e.translate>=Co&&e.translate<=wo||isNaN(e.translate))&&(e.translate=0)}function Do(e,t,n,r){Eo(e.x,t.x,n.x,r?r.originX:void 0),Eo(e.y,t.y,n.y,r?r.originY:void 0)}function Oo(e,t,n,r=0){e.min=(r?L(n.min,n.max,r):n.min)+t.min,e.max=e.min+Z(t)}function ko(e,t,n,r){Oo(e.x,t.x,n.x,r?.x),Oo(e.y,t.y,n.y,r?.y)}function Ao(e,t,n,r=0){let i=r?L(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Z(t)}function jo(e,t,n,r){Ao(e.x,t.x,n.x,r?.x),Ao(e.y,t.y,n.y,r?.y)}function Mo(e,t,n,r,i){return e-=t,e=Oa(e,1/n,r),i!==void 0&&(e=Oa(e,1/i,r)),e}function No(e,t=0,n=1,r=.5,i,a=e,o=e){if(N.test(t)&&(t=parseFloat(t),t=L(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=L(a.min,a.max,r);e===a&&(s-=t),e.min=Mo(e.min,t,n,s,i),e.max=Mo(e.max,t,n,s,i)}function Po(e,t,[n,r,i],a,o){No(e,t[n],t[r],t[i],t.scale,a,o)}var Fo=[`x`,`scaleX`,`originX`],Io=[`y`,`scaleY`,`originY`];function Lo(e,t,n,r){Po(e.x,t,Fo,n?n.x:void 0,r?r.x:void 0),Po(e.y,t,Io,n?n.y:void 0,r?r.y:void 0)}function Ro(e){return e.translate===0&&e.scale===1}function zo(e){return Ro(e.x)&&Ro(e.y)}function Bo(e,t){return e.min===t.min&&e.max===t.max}function Vo(e,t){return Bo(e.x,t.x)&&Bo(e.y,t.y)}function Ho(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uo(e,t){return Ho(e.x,t.x)&&Ho(e.y,t.y)}function Wo(e){return Z(e.x)/Z(e.y)}function Go(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Q(e){return[e(`x`),e(`y`)]}function Ko(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var qo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Jo=qo.length,Yo=e=>typeof e==`string`?parseFloat(e):e,Xo=e=>typeof e==`number`||P.test(e);function Zo(e,t,n,r,i,a){i?(e.opacity=L(0,n.opacity??1,$o(r)),e.opacityExit=L(t.opacity??1,0,es(r))):a&&(e.opacity=L(t.opacity??1,n.opacity??1,r));for(let i=0;irt?1:n(S(e,t,r))}function ns(e,t,n){let r=U(e)?e:gr(e);return r.start(Er(``,r,t,n)),r.animation}function rs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var is=(e,t)=>e.depth-t.depth,as=class{constructor(){this.children=[],this.isDirty=!1}add(e){f(this.children,e),this.isDirty=!0}remove(e){p(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(e)}};function os(e,t){let n=j.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(k(r),e(a-t))};return O.setup(r,!0),()=>k(r)}function ss(e){return U(e)?e.get():e}var cs=class{constructor(){this.members=[]}add(e){f(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(p(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(p(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},ls={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},us=[``,`X`,`Y`,`Z`],ds=1e3,fs=0;function ps(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ms(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Vr(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,O,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ms(r)}function hs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=fs++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xi.value&&($.nodes=$.calculatedTargetDeltas=$.calculatedProjections=0),this.nodes.forEach(vs),this.nodes.forEach(Ds),this.nodes.forEach(Os),this.nodes.forEach(ys),Xi.addProjectionMetrics&&Xi.addProjectionMetrics($)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;O.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=os(i,250),ls.hasAnimatedSinceResize&&(ls.hasAnimatedSinceResize=!1,this.nodes.forEach(Es)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Fs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Uo(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...vr(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Es(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),k(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ks),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ms(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Z(this.snapshot.measuredBox.x)&&!Z(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=L(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=L(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(js(o.x,e.x,n),js(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jo(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ns(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Vo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=G(),X(f,this.relativeTarget)),c&&(this.animationValues=a,Zo(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(k(this.pendingAnimation),void 0),this.pendingAnimation=O.update(()=>{ls.hasAnimatedSinceResize=!0,this.motionValue||=gr(0),this.motionValue.jump(0,!1),this.currentAnimation=ns(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ds),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Bs(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||G();let t=Z(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Z(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}X(t,n),La(t,i),Do(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new cs),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ps(`z`,e,r,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(xs),this.root.sharedNodes.clear()}}}function gs(e){e.updateLayout()}function _s(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Q(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Z(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;yo(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Bs(i,t.layoutBox,n)&&Q(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Z(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=ta();Do(o,n,t.layoutBox);let s=ta();a?Do(s,e.applyTransform(r,!0),t.measuredBox):Do(s,n,t.layoutBox);let c=!zo(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=G();jo(s,t.layoutBox,i.layoutBox,o);let c=G();jo(c,n,a.layoutBox,o),Uo(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function vs(e){Xi.value&&$.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function ys(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function bs(e){e.clearSnapshot()}function xs(e){e.clearMeasurements()}function Ss(e){e.isLayoutDirty=!0,e.updateLayout()}function Cs(e){e.isLayoutDirty=!1}function ws(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Ts(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Es(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ds(e){e.resolveTargetDelta()}function Os(e){e.calcProjection()}function ks(e){e.resetSkewAndRotation()}function As(e){e.removeLeadSnapshot()}function js(e,t,n){e.translate=L(t.translate,0,n),e.scale=L(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ms(e,t,n,r){e.min=L(t.min,n.min,r),e.max=L(t.max,n.max,r)}function Ns(e,t,n,r){Ms(e.x,t.x,n.x,r),Ms(e.y,t.y,n.y,r)}function Ps(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Fs={duration:.45,ease:[.4,0,.1,1]},Is=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ls=Is(`applewebkit/`)&&!Is(`chrome/`)?Math.round:b;function Rs(e){e.min=Ls(e.min),e.max=Ls(e.max)}function zs(e){Rs(e.x),Rs(e.y)}function Bs(e,t,n){return e===`position`||e===`preserve-aspect`&&!To(Wo(t),Wo(n),.2)}function Vs(e){return e!==e.root&&e.scroll?.wasRoot}var Hs=hs({attachResizeListener:(e,t)=>rs(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Us={current:void 0},Ws=hs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Us.current){let e=new Hs({});e.mount(window),e.setOptions({layoutScroll:!0}),Us.current=e}return Us.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Gs=(0,s.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Ks(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function qs(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ks(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{width:e,height:o,top:s,left:f,right:p,bottom:m,direction:h}=u.current;if(t||a===!1||!l.current||!e||!o)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${s}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(` [data-motion-pop-id="${c}"] { position: absolute !important; width: ${e}px !important; height: ${o}px !important; ${_}px !important; ${v}px !important; } `),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,o.jsx)(Ys,{isPresent:t,childRef:l,sizeRef:u,pop:a,children:a===!1?e:s.cloneElement(e,{ref:f})})}var Zs=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:c,anchorX:f,anchorY:p,root:m})=>{let h=l(Qs),g=(0,s.useId)(),_=(0,s.useRef)(n),v=(0,s.useRef)(r);u(()=>{_.current=n,v.current=r});let y=!0,b=(0,s.useMemo)(()=>(y=!1,{id:g,initial:t,isPresent:n,custom:i,onExitComplete:e=>{h.set(e,!0);for(let e of h.values())if(!e)return;r&&r()},register:e=>(h.set(e,!1),()=>{h.delete(e),!_.current&&!h.size&&v.current?.()})}),[n,h,r]);return a&&y&&(b={...b}),(0,s.useMemo)(()=>{h.forEach((e,t)=>h.set(t,!1))},[n]),s.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),e=(0,o.jsx)(Xs,{pop:c===`popLayout`,isPresent:n,anchorX:f,anchorY:p,root:m,children:e}),(0,o.jsx)(d.Provider,{value:b,children:e})};function Qs(){return new Map}function $s(e=!0){let t=(0,s.useContext)(d);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,s.useId)();(0,s.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,s.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var ec=e=>e.key||``;function tc(e){let t=[];return s.Children.forEach(e,e=>{(0,s.isValidElement)(e)&&t.push(e)}),t}var nc=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:d=!1,anchorX:f=`left`,anchorY:p=`top`,root:m})=>{let[h,g]=$s(d),_=(0,s.useMemo)(()=>tc(e),[e]),v=d&&!h?[]:_.map(ec),y=(0,s.useRef)(!0),b=(0,s.useRef)(_),x=l(()=>new Map),S=(0,s.useRef)(new Set),[C,w]=(0,s.useState)(_),[T,E]=(0,s.useState)(_);u(()=>{y.current=!1,b.current=_;for(let e=0;e{let s=ec(e),c=d&&!h?!1:_===T||v.includes(s);return(0,o.jsx)(Zs,{isPresent:c,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:m,onExitComplete:c?void 0:()=>{if(S.current.has(s))return;if(x.has(s))S.current.add(s),x.set(s,!0);else return;let e=!0;x.forEach(t=>{t||(e=!1)}),e&&(ee?.(),E(b.current),d&&g?.(),r&&r())},anchorX:f,anchorY:p,children:e},s)})})},rc=(0,s.createContext)({strict:!1}),ic={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},ac=!1;function oc(){if(ac)return;let e={};for(let t in ic)e[t]={isEnabled:e=>ic[t].some(t=>!!e[t])};_a(e),ac=!0}function sc(){return oc(),va()}function cc(e){let t=sc();for(let n in e)t[n]={...t[n],...e[n]};_a(t)}var lc=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function uc(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||lc.has(e)}var dc=r({default:()=>fc}),fc,pc=n((()=>{throw fc={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),mc=e=>!uc(e);function hc(e){typeof e==`function`&&(mc=t=>t.startsWith(`on`)?!uc(t):e(t))}try{hc((pc(),t(dc)).default)}catch{}function gc(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||U(e[i])||(mc(i)||n===!0&&uc(i)||!t&&!uc(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var _c=(0,s.createContext)({});function vc(e,t){if(ca(e)){let{initial:t,animate:n}=e;return{initial:t===!1||aa(t)?t:void 0,animate:aa(n)?n:void 0}}return e.inherit===!1?{}:t}function yc(e){let{initial:t,animate:n}=vc(e,(0,s.useContext)(_c));return(0,s.useMemo)(()=>({initial:t,animate:n}),[bc(t),bc(n)])}function bc(e){return Array.isArray(e)?e.join(` `):e}var xc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sc(e,t,n){for(let r in t)!U(t[r])&&!Ya(r,n)&&(e[r]=t[r])}function Cc({transformTemplate:e},t){return(0,s.useMemo)(()=>{let n=xc();return Ua(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wc(e,t){let n=e.style||{},r={};return Sc(r,n,e),Object.assign(r,Cc(e,t)),r}function Tc(e,t){let n={},r=wc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Ec=()=>({...xc(),attrs:{}});function Dc(e,t,n,r){let i=(0,s.useMemo)(()=>{let n=Ec();return ro(n,t,ao(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Sc(t,e.style,e),i.style={...t,...i.style}}return i}var Oc=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function kc(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Oc.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ac(e,t,n,{latestValues:r},i,a=!1,o){let c=(o??kc(e)?Dc:Tc)(t,r,i,e),l=gc(t,typeof e==`string`,a),u=e===s.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,s.useMemo)(()=>U(d)?d.get():d,[d]);return(0,s.createElement)(e,{...u,children:f})}function jc({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Mc(n,r,i,e),renderState:t()}}function Mc(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=ss(a[e]);let{initial:o,animate:s}=e,c=ca(e),l=la(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ia(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{let r=(0,s.useContext)(_c),i=(0,s.useContext)(d),a=()=>jc(e,t,r,i);return n?a():l(a)},Pc=Nc({scrapeMotionValuesFromProps:Xa,createRenderState:xc}),Fc=Nc({scrapeMotionValuesFromProps:so,createRenderState:Ec}),Ic=Symbol.for(`motionComponentSymbol`);function Lc(e,t,n){let r=(0,s.useRef)(n);(0,s.useInsertionEffect)(()=>{r.current=n});let i=(0,s.useRef)(null);return(0,s.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var Rc=(0,s.createContext)({});function zc(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Bc(e,t,n,r,i,a){let{visualElement:o}=(0,s.useContext)(_c),c=(0,s.useContext)(rc),l=(0,s.useContext)(d),f=(0,s.useContext)(Gs),p=f.reducedMotion,m=f.skipAnimations,h=(0,s.useRef)(null),g=(0,s.useRef)(!1);r||=c.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:a}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));let _=h.current,v=(0,s.useContext)(Rc);_&&!_.projection&&i&&(_.type===`html`||_.type===`svg`)&&Vc(h.current,n,i,v);let y=(0,s.useRef)(!1);(0,s.useInsertionEffect)(()=>{_&&y.current&&_.update(n,l)});let b=n[Br],x=(0,s.useRef)(!!b&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return u(()=>{g.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),x.current&&_.animationState&&_.animationState.animateChanges())}),(0,s.useEffect)(()=>{_&&(!x.current&&_.animationState&&_.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),!1),_.enteringChildren=void 0)}),_}function Vc(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Hc(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&zc(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Hc(e){if(e)return e.options.allowProjection===!1?Hc(e.parent):e.projection}function Uc(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&cc(r);let a=n?n===`svg`:kc(e),c=a?Fc:Pc;function l(n,l){let u,d={...(0,s.useContext)(Gs),...n,layoutId:Wc(n)},{isStatic:f}=d,p=yc(n),m=c(n,f);if(!f&&typeof window<`u`){Gc(d,r);let t=Kc(d);u=t.MeasureLayout,p.visualElement=Bc(e,m,d,i,t.ProjectionNode,a)}return(0,o.jsxs)(_c.Provider,{value:p,children:[u&&p.visualElement?(0,o.jsx)(u,{visualElement:p.visualElement,...d}):null,Ac(e,n,Lc(m,p.visualElement,l),m,f,t,a)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,s.forwardRef)(l);return u[Ic]=e,u}function Wc({layoutId:e}){let t=(0,s.useContext)(c).id;return t&&e!==void 0?t+`-`+e:e}function Gc(e,t){(0,s.useContext)(rc).strict}function Kc(e){let{drag:t,layout:n}=sc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function qc(e,t){if(typeof Proxy>`u`)return Uc;let n=new Map,r=(n,r)=>Uc(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Uc(a,void 0,e,t)),n.get(a))})}var Jc=(e,t)=>t.isSVG??kc(e)?new co(t):new Qa(t,{allowProjection:e!==s.Fragment}),Yc=class extends K{constructor(e){super(e),e.animationState||=go(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ia(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Xc=0,Zc={animation:{Feature:Yc},exit:{Feature:class extends K{constructor(){super(...arguments),this.id=Xc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=H(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Qc(e){return{point:{x:e.pageX,y:e.pageY}}}var $c=e=>t=>Ci(t)&&e(t,Qc(t));function el(e,t,n,r){return rs(e,t,$c(n),r)}var tl=({current:e})=>e?e.ownerDocument.defaultView:null,nl=(e,t)=>Math.abs(e-t);function rl(e,t){let n=nl(e.x,t.x),r=nl(e.y,t.y);return Math.sqrt(n**2+r**2)}var il=new Set([`auto`,`scroll`]),al=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ol(this.lastRawMoveEventInfo,this.transformPagePoint));let e=cl(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=rl(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=A;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ol(t,this.transformPagePoint),O.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=cl(e.type===`pointercancel`?this.lastMoveEventInfo:ol(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ci(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=ol(Qc(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=A;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,cl(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=x(el(this.contextWindow,`pointermove`,this.handlePointerMove,d),el(this.contextWindow,`pointerup`,this.handlePointerUp,d),el(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(il.has(e.overflowX)||il.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),O.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),k(this.updatePoint)}};function ol(e,t){return t?{point:t(e.point)}:e}function sl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cl({point:e},t){return{point:e,delta:sl(e,ul(t)),offset:sl(e,ll(t)),velocity:dl(t,.1)}}function ll(e){return e[0]}function ul(e){return e[e.length-1]}function dl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=ul(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>w(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>w(t)*2&&(r=e[1]);let a=T(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fl(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?L(n,e,r.max):Math.min(e,n)),e}function pl(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function ml(e,{top:t,left:n,bottom:r,right:i}){return{x:pl(e.x,n,i),y:pl(e.y,t,r)}}function hl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=S(t.min,t.max-r,e.min):r>i&&(n=S(e.min,e.max-i,t.min)),m(0,1,n)}function vl(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var yl=.35;function bl(e=yl){return e===!1?e=0:e===!0&&(e=yl),{x:xl(e,`left`,`right`),y:xl(e,`top`,`bottom`)}}function xl(e,t,n){return{min:Sl(e,t),max:Sl(e,n)}}function Sl(e,t){return typeof e==`number`?e:e[t]||0}var Cl=new WeakMap,wl=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=G(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Qc(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vi(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Q(e=>{let t=this.getAxisMotionValue(e).get()||0;if(N.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Z(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&O.update(()=>i(e,t),!1,!0),Rr(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Ol(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&O.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new al(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:tl(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&O.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Dl(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=fl(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&zc(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=ml(n.layoutBox,e):this.constraints=!1,this.elastic=bl(t),r!==this.constraints&&!zc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Q(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=vl(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!zc(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=za(n,r.root,this.visualElement.getTransformPagePoint()),a=gl(r.layout.layoutBox,i);if(t){let e=t(Sa(a));this.hasMutatedConstraints=!!e,e&&(a=xa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Q(o=>{if(!Dl(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Rr(this.visualElement,e),n.start(Er(e,n,0,t,this.visualElement,!1))}stopAnimation(){Q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Q(t=>{let{drag:n}=this.getProps();if(!Dl(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-L(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!zc(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Q(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=_l({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Q(t=>{if(!Dl(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(L(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Cl.set(this.visualElement,this);let e=this.visualElement.current,t=el(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Di(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();zc(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=El(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),O.read(r);let o=rs(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Q(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=yl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Tl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function El(e,t,n){let r=Yi(e,Tl(n)),i=Yi(t,Tl(n));return()=>{r(),i()}}function Dl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ol(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var kl=class extends K{constructor(e){super(e),this.removeGroupControls=b,this.removeListeners=b,this.controls=new wl(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||b}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Al=e=>(t,n)=>{e&&O.update(()=>e(t,n),!1,!0)},jl=class extends K{constructor(){super(...arguments),this.removePointerDownListener=b}onPointerDown(e){this.session=new al(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tl(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Al(e),onStart:Al(t),onMove:Al(n),onEnd:(e,t)=>{delete this.session,r&&O.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=el(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ml=!1,Nl=class extends s.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Ml&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ls.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Ml=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||O.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),hi.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ml=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Pl(e){let[t,n]=$s(),r=(0,s.useContext)(c);return(0,o.jsx)(Nl,{...e,layoutGroup:r,switchLayoutGroup:(0,s.useContext)(Rc),isPresent:t,safeToRemove:n})}var Fl={pan:{Feature:jl},drag:{Feature:kl,ProjectionNode:Ws,MeasureLayout:Pl}};function Il(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&O.postRender(()=>i(t,Qc(t)))}var Ll=class extends K{mount(){let{current:e}=this.node;e&&(this.unmount=xi(e,(e,t)=>(Il(this.node,t,`Start`),e=>Il(this.node,e,`End`))))}unmount(){}},Rl=class extends K{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=x(rs(this.node.current,`focus`,()=>this.onFocus()),rs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function zl(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&O.postRender(()=>i(t,Qc(t)))}var Bl=class extends K{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Pi(e,(e,t)=>(zl(this.node,t,`Start`),(e,{success:t})=>zl(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Vl=new WeakMap,Hl=new WeakMap,Ul=e=>{let t=Vl.get(e.target);t&&t(e)},Wl=e=>{e.forEach(Ul)};function Gl({root:e,...t}){let n=e||document;Hl.has(n)||Hl.set(n,{});let r=Hl.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Wl,{root:e,...t})),r[i]}function Kl(e,t,n){let r=Gl(t);return Vl.set(e,n),r.observe(e),()=>{Vl.delete(e),r.unobserve(e)}}var ql={some:0,all:1},Jl=class extends K{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:ql[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Kl(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Yl(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Yl({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Xl={inView:{Feature:Jl},tap:{Feature:Bl},focus:{Feature:Rl},hover:{Feature:Ll}},Zl={layout:{ProjectionNode:Ws,MeasureLayout:Pl}},Ql=qc({...Zc,...Xl,...Fl,...Zl},Jc),$l=Ql;export{Ql as n,nc as r,$l as t};