import{q as t,t as e,u as i,v as n,w as s,x as o,y as r,z as a,A as l,B as h,C as u,D as c,E as d,F as p,G as m,H as f,I as y,J as g,K as v,b as x,m as T,o as P,r as w,M as S,n as A,i as V,h as E,p as b,k as M,N as D,d as C,s as k,P as R,L,S as j,a as B,O as F,j as I,Q as O,R as U,l as N,e as K,f as W,g as z}from"./size-rollup-dom-max-assets.js";import{jsx as $}from"react/jsx-runtime";import{useContext as Y,useId as X,useEffect as H,useCallback as G,Component as q,Fragment as _}from"react";function Z(t,e){-1===t.indexOf(e)&&t.push(e)}function J(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}const Q={},tt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function et(t){return"object"==typeof t&&null!==t}const it=t=>/^0[^.\s]+$/u.test(t);function nt(t){let e;return()=>(void 0===e&&(e=t()),e)}const st=t=>t,ot=(t,e)=>i=>e(t(i)),rt=(...t)=>t.reduce(ot),at=(t,e,i)=>{const n=e-t;return 0===n?1:(i-t)/n};class lt{constructor(){this.subscriptions=[]}add(t){return Z(this.subscriptions,t),()=>J(this.subscriptions,t)}notify(t,e,i){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s1e3*t,ut=t=>t/1e3;function ct(t,e){return e?t*(1e3/e):0}const dt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function pt(t,e,i,n){if(t===e&&i===n)return st;const s=e=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=dt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,i);return t=>0===t||1===t?t:dt(s(t),e,n)}const mt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ft=t=>e=>1-t(1-e),yt=pt(.33,1.53,.69,.99),gt=ft(yt),vt=mt(gt),xt=t=>(t*=2)<1?.5*gt(t):.5*(2-Math.pow(2,-10*(t-1))),Tt=t=>1-Math.sin(Math.acos(t)),Pt=ft(Tt),wt=mt(Tt),St=pt(.42,0,1,1),At=pt(0,0,.58,1),Vt=pt(.42,0,.58,1),Et=t=>Array.isArray(t)&&"number"==typeof t[0],bt={linear:st,easeIn:St,easeInOut:Vt,easeOut:At,circIn:Tt,circInOut:wt,circOut:Pt,backIn:gt,backInOut:vt,backOut:yt,anticipate:xt},Mt=t=>{if(Et(t)){t.length;const[e,i,n,s]=t;return pt(e,i,n,s)}return"string"==typeof t?bt[t]:t},Dt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Ct={value:null,addProjectionMetrics:null};function kt(t,e){let i=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>i=!0,r=Dt.reduce((t,i)=>(t[i]=function(t,e){let i=new Set,n=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?i:n;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[i,n]=[n,i],i.forEach(h),e&&Ct.value&&Ct.value.frameloop[e].push(l),l=0,i.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?i:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=Q.useManualTiming?s.timestamp:performance.now();i=!1,Q.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(f))};return{schedule:Dt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,n=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===Ft&&Ot.set(jt.isProcessing||Q.useManualTiming?jt.timestamp:performance.now()),Ft),set:t=>{Ft=t,queueMicrotask(It)}};function Ut(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function Nt(t,e){return i=>i>0?e:t}const Kt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Wt=[n,e,i];function zt(t){const e=(n=t,Wt.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===i&&(s=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=Ut(a,n,t+1/3),o=Ut(a,n,t),r=Ut(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}(s)),s}const $t=(i,n)=>{const s=zt(i),o=zt(n);if(!s||!o)return Nt(i,n);const r={...s};return i=>(r.red=Kt(s.red,o.red,i),r.green=Kt(s.green,o.green,i),r.blue=Kt(s.blue,o.blue,i),r.alpha=t(s.alpha,o.alpha,i),e.transform(r))},Yt=new Set(["none","hidden"]);function Xt(e,i){return n=>t(e,i,n)}function Ht(t){return"number"==typeof t?Xt:"string"==typeof t?s(t)?Nt:o.test(t)?$t:_t:Array.isArray(t)?Gt:"object"==typeof t?o.test(t)?$t:qt:Nt}function Gt(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>Ht(t)(t,e[i]));return t=>{for(let e=0;e{for(const e in n)i[e]=n[e](t);return i}}const _t=(t,e)=>{const i=r.createTransformer(e),n=a(t),s=a(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?Yt.has(t)&&!s.values.length||Yt.has(e)&&!n.values.length?function(t,e){return Yt.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):rt(Gt(function(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Rt.update(e,t),stop:()=>Lt(e),now:()=>jt.isProcessing?jt.timestamp:Ot.now()}},Qt=(t,e,i=10)=>{let n="";const s=Math.max(Math.round(e/i),2);for(let e=0;e=te?1/0:e}function ie(t,e,i){const n=Math.max(e-5,0);return ct(i-t(n),e-n)}const ne=100,se=10,oe=1,re=0,ae=800,le=.3,he=.3,ue={granular:.01,default:2},ce={granular:.005,default:.5},de=.01,pe=10,me=.05,fe=1,ye=.001;function ge({duration:t=ae,bounce:e=le,velocity:i=re,mass:n=oe}){let s,o,r=1-e;r=l(me,fe,r),t=l(de,pe,ut(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=xe(e,r),l=Math.exp(-s);return ye-o/a*l},o=e=>{const n=e*r*t,o=n*i+i,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-n),h=xe(Math.pow(e,2),r);return(-s(e)+ye>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const a=function(t,e,i){let n=i;for(let i=1;ivoid 0!==t[e])}function Se(t=he,e=le){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:h,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:re,stiffness:ne,damping:se,mass:oe,isResolvedFromDuration:!1,...t};if(!we(t,Pe)&&we(t,Te))if(t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*l(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:oe,stiffness:s,damping:o}}else{const i=ge(t);e={...e,...i,mass:oe},e.isResolvedFromDuration=!0}return e}({...i,velocity:-ut(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(h*c)),g=r-o,v=ut(Math.sqrt(h/c)),x=Math.abs(g)<5;let T;if(n||(n=x?ue.granular:ue.default),s||(s=x?ce.granular:ce.default),y<1){const t=xe(v,y);T=e=>{const i=Math.exp(-y*v*e);return r-i*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>r-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);T=e=>{const i=Math.exp(-y*v*e),n=Math.min(t*e,300);return r-i*((f+y*v*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const P={calculatedDuration:m&&d||null,next:t=>{const e=T(t);if(m)a.done=t>=d;else{let i=0===t?f:0;y<1&&(i=0===t?ht(f):ie(T,t,e));const o=Math.abs(i)<=n,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(ee(P),te),e=Qt(e=>P.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return P}function Ae({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/n),v=t=>y+g(t),x=t=>{const e=g(t),i=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:i};let T,P;const w=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,P=Se({keyframes:[d.value,p(d.value)],velocity:ie(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==T||(e=!0,x(t),w(t)),void 0!==T&&t>=T?P.next(t-T):(!e&&x(t),d)}}}function Ve(t,e,{clamp:i=!0,ease:n,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,i){const n=[],s=i||Q.mix||Zt,o=t.length-1;for(let i=0;i{if(r&&i1)for(;nu(l(t[0],t[o-1],e)):u}function Ee(e){const i=[0];return function(e,i){const n=e[e.length-1];for(let s=1;s<=i;s++){const o=at(0,i,s);e.push(t(n,1,o))}}(i,e.length-1),i}function be({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Mt):Mt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Ee(e),t),a=Ve(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Vt).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}Se.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(ee(n),te);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:ut(s)}}(t,100,Se);return t.ease=e.ease,t.duration=ht(e.duration),t.type="keyframes",t};const Me=t=>null!==t;function De(t,{repeat:e,repeatType:i="loop"},n,s=1){const o=t.filter(Me),r=s<0||e&&"loop"!==i&&e%2==1?0:o.length-1;return r&&void 0!==n?n:o[r]}const Ce={decay:Ae,inertia:Ae,tween:be,keyframes:be,spring:Se};function ke(t){"string"==typeof t.type&&(t.type=Ce[t.type])}class Re{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Le=t=>t/100;class je extends Re{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Ot.now()&&this.tick(Ot.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ke(t);const{type:e=be,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||be;a!==be&&"number"!=typeof r[0]&&(this.mixKeyframes=rt(Le,Zt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ee(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:h=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-h*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>n;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x=this.currentTime,T=i;if(c){const t=Math.min(this.currentTime,n)/r;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(i=1-i,p&&(i-=p/r)):"mirror"===d&&(T=o)),x=l(0,1,i)*r}const P=v?{done:!1,value:u[0]}:T.next(x);s&&(P.value=s(P.value));let{done:w}=P;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&m!==Ae&&(P.value=De(u,this.options,y,this.speed)),f&&f(P.value),S&&this.finish(),P}then(t,e){return this.finished.then(t,e)}get duration(){return ut(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ut(t)}get time(){return ut(this.currentTime)}set time(t){t=ht(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ot.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=ut(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Jt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ot.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Be=t=>180*t/Math.PI,Fe=t=>{const e=Be(Math.atan2(t[1],t[0]));return Oe(e)},Ie={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fe,rotateZ:Fe,skewX:t=>Be(Math.atan(t[1])),skewY:t=>Be(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Oe=t=>((t%=360)<0&&(t+=360),t),Ue=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ne=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ke={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ue,scaleY:Ne,scale:t=>(Ue(t)+Ne(t))/2,rotateX:t=>Oe(Be(Math.atan2(t[6],t[5]))),rotateY:t=>Oe(Be(Math.atan2(-t[2],t[0]))),rotateZ:Fe,rotate:Fe,skewX:t=>Be(Math.atan(t[4])),skewY:t=>Be(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function We(t){return t.includes("scale")?1:0}function ze(t,e){if(!t||"none"===t)return We(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=Ke,s=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Ie,s=e}if(!s)return We(e);const o=n[e],r=s[1].split(",").map($e);return"function"==typeof o?o(r):r[o]}function $e(t){return parseFloat(t.trim())}const Ye=t=>t===h||t===u,Xe=new Set(["x","y","z"]),He=c.filter(t=>!Xe.has(t));const Ge={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ze(e,"x"),y:(t,{transform:e})=>ze(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const qe=new Set;let _e=!1,Ze=!1,Je=!1;function Qe(){if(Ze){const t=Array.from(qe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return He.forEach(i=>{const n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ze=!1,_e=!1,qe.forEach(t=>t.complete(Je)),qe.clear()}function ti(){qe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)})}class ei{constructor(t,e,i,n,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(qe.add(this),_e||(_e=!0,Rt.read(ti),Rt.resolveKeyframes(Qe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;if(null===t[0]){const s=n?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){const n=i.readValue(e,o);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=o),n&&void 0===s&&n.set(t[0])}!function(t){for(let e=1;evoid 0!==window.ScrollTimeline),ni={};function si(t,e){const i=nt(t);return()=>ni[e]??i()}const oi=si(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ri=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,ai={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ri([0,.65,.55,1]),circOut:ri([.55,0,1,.45]),backIn:ri([.31,.01,.66,-.59]),backOut:ri([.33,1.53,.69,.99])};function li(t,e){return t?"function"==typeof t?oi()?Qt(t,e):"ease-out":Et(t)?ri(t):Array.isArray(t)?t.map(t=>li(t,e)||ai.easeOut):ai[t]:void 0}function hi(t,e,i,{delay:n=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:i};l&&(u.offset=l);const c=li(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(u,d)}function ui(t){return"function"==typeof t&&"applyToOptions"in t}class ci extends Re{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:i,keyframes:n,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,t.type;const l=function({type:t,...e}){return ui(t)&&oi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=hi(e,i,n,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=De(n,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,i){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,i):t.style[e]=i}(e,i,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ut(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ut(t)}get time(){return ut(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ht(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ii()?(this.animation.timeline=t,st):e(this)}}const di={anticipate:xt,backInOut:vt,circInOut:wt};function pi(t){"string"==typeof t.ease&&t.ease in di&&(t.ease=di[t.ease])}class mi extends ci{constructor(t){pi(t),ke(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:n,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new je({...o,autoplay:!1}),a=ht(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const fi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!r.test(t)&&"0"!==t||t.startsWith("url(")));function yi(t){t.duration=0,t.type="keyframes"}const gi=new Set(["opacity","clipPath","filter","transform"]),vi=nt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class xi extends Re{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ot.now();const c={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||ei;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,n){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=i;this.resolvedAt=Ot.now(),function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=fi(s,e),a=fi(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},c=!l&&function(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:h}=e.owner.getProps();return vi()&&i&&gi.has(i)&&("transform"!==i||!h)&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new mi({...u,element:u.motionValue.owner.current}):new je(u);c.finished.then(()=>this.notifyFinished()).catch(st),this.pendingTimeline&&(this.stopTimeline=c.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=c}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Je=!0,ti(),Qe(),Je=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ti=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Pi(t,e,i=1){const[n,o]=function(t){const e=Ti.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!n)return;const r=window.getComputedStyle(e).getPropertyValue(n);if(r){const t=r.trim();return tt(t)?parseFloat(t):t}return s(o)?Pi(o,e,i+1):o}function wi(t,e){return t?.[e]??t?.default??t}const Si=new Set(["width","height","top","left","right","bottom",...c]),Ai=t=>e=>e.test(t),Vi=[h,u,d,p,m,f,{test:t=>"auto"===t,parse:t=>t}],Ei=t=>Vi.find(Ai(t));function bi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||it(t))}const Mi=new Set(["brightness","contrast","saturate","opacity"]);function Di(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=i.match(y)||[];if(!n)return t;const s=i.replace(n,"");let o=Mi.has(e)?1:0;return n!==i&&(o*=100),e+"("+o+s+")"}const Ci=/\b([a-z-]*)\(.*?\)/gu,ki={...r,getAnimatableNone:t=>{const e=t.match(Ci);return e?e.map(Di).join(" "):t}},Ri={...g,color:o,backgroundColor:o,outlineColor:o,fill:o,stroke:o,borderColor:o,borderTopColor:o,borderRightColor:o,borderBottomColor:o,borderLeftColor:o,filter:ki,WebkitFilter:ki},Li=t=>Ri[t];function ji(t,e){let i=Li(t);return i!==ki&&(i=r),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const Bi=new Set(["auto","none","0"]);class Fi extends ei{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}class Ii{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Ot.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Ot.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new lt);const i=this.events[t].add(e);return"change"===t?()=>{i(),Rt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ot.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ct(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Oi(t,e){return new Ii(t,e)}const{schedule:Ui,cancel:Ni}=kt(queueMicrotask,!1),Ki={x:!1,y:!1};function Wi(){return Ki.x||Ki.y}function zi(t,e){const i=function(t){if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function $i(t){return!("touch"===t.pointerType||Wi())}const Yi=(t,e)=>!!e&&(t===e||Yi(t,e.parentElement)),Xi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Hi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Gi=new WeakSet;function qi(t){return e=>{"Enter"===e.key&&t(e)}}function _i(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Zi(t){return Xi(t)&&!Wi()}function Ji(t,e,i={}){const[n,s,o]=zi(t,i),r=t=>{const n=t.currentTarget;if(!Zi(t))return;Gi.add(n);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Gi.has(n)&&Gi.delete(n),Zi(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||Yi(n,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),et(e=t)&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=qi(()=>{if(Gi.has(i))return;_i(i,"down");const t=qi(()=>{_i(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>_i(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),function(t){return Hi.has(t.tagName)||-1!==t.tabIndex}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Qi(t){return et(t)&&"ownerSVGElement"in t}const tn=[...Vi,o,r];class en{constructor(t){this.isMounted=!1,this.node=t}update(){}}const nn=t=>null!==t;const sn={type:"spring",stiffness:500,damping:25,restSpeed:10},on={type:"keyframes",duration:.8},rn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},an=(t,{keyframes:e})=>e.length>2?on:v.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:sn:rn;const ln=(t,e,i,n={},s,o)=>r=>{const a=wi(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=ht(l);const u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,an(t,u)),u.duration&&(u.duration=ht(u.duration)),u.repeatDelay&&(u.repeatDelay=ht(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(yi(u),0===u.delay&&(c=!0)),(Q.instantAnimations||Q.skipAnimations)&&(c=!0,yi(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(nn),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}(u.keyframes,a);if(void 0!==t)return void Rt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new je(u):new xi(u)};function hn(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}function un(t){return{point:{x:t.pageX,y:t.pageY}}}function cn(t,e,i,n){return hn(t,e,(t=>e=>Xi(e)&&t(e,un(e)))(i),n)}function dn({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function pn(t){return t.max-t.min}function mn(e,i,n,s=.5){e.origin=s,e.originPoint=t(i.min,i.max,e.origin),e.scale=pn(n)/pn(i),e.translate=t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function fn(t,e,i,n){mn(t.x,e.x,i.x,n?n.originX:void 0),mn(t.y,e.y,i.y,n?n.originY:void 0)}function yn(t,e,i){t.min=i.min+e.min,t.max=t.min+pn(e)}function gn(t,e,i){t.min=e.min-i.min,t.max=t.min+pn(e)}function vn(t,e,i){gn(t.x,e.x,i.x),gn(t.y,e.y,i.y)}const xn=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Tn(t){return[t("x"),t("y")]}function Pn(t){return void 0===t||1===t}function wn({scale:t,scaleX:e,scaleY:i}){return!Pn(t)||!Pn(e)||!Pn(i)}function Sn(t){return wn(t)||An(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function An(t){return Vn(t.x)||Vn(t.y)}function Vn(t){return t&&"0%"!==t}function En(t,e,i){return i+e*(t-i)}function bn(t,e,i,n,s){return void 0!==s&&(t=En(t,s,n)),En(t,i,n)+e}function Mn(t,e=0,i=1,n,s){t.min=bn(t.min,e,i,n,s),t.max=bn(t.max,e,i,n,s)}function Dn(t,{x:e,y:i}){Mn(t.x,e.translate,e.scale,e.originPoint),Mn(t.y,i.translate,i.scale,i.originPoint)}const Cn=.999999999999,kn=1.0000000000001;function Rn(t,e){t.min=t.min+e,t.max=t.max+e}function Ln(e,i,n,s,o=.5){Mn(e,i,n,t(e.min,e.max,o),s)}function jn(t,e){Ln(t.x,e.x,e.scaleX,e.scale,e.originX),Ln(t.y,e.y,e.scaleY,e.scale,e.originY)}function Bn(t,e){return dn(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}const Fn=({current:t})=>t?t.ownerDocument.defaultView:null;function In(t,e){const i=t.getValue("willChange");if(n=i,Boolean(x(n)&&n.add))return i.add(e);if(!i&&Q.WillChange){const i=new Q.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}const On=(t,e)=>Math.abs(t-e);class Un{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Wn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=On(t.x,e.x),n=On(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=jt;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Nn(e,this.transformPagePoint),Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Wn("pointercancel"===t.type?this.lastMoveEventInfo:Nn(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!Xi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const r=Nn(un(t),this.transformPagePoint),{point:a}=r,{timestamp:l}=jt;this.history=[{...a,timestamp:l}];const{onSessionStart:h}=e;h&&h(t,Wn(r,this.history)),this.removeListeners=rt(cn(this.contextWindow,"pointermove",this.handlePointerMove),cn(this.contextWindow,"pointerup",this.handlePointerUp),cn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt(this.updatePoint)}}function Nn(t,e){return e?{point:e(t.point)}:t}function Kn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wn({point:t},e){return{point:t,delta:Kn(t,$n(e)),offset:Kn(t,zn(e)),velocity:Yn(e,.1)}}function zn(t){return t[0]}function $n(t){return t[t.length-1]}function Yn(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=$n(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>ht(e)));)i--;if(!n)return{x:0,y:0};const o=ut(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Xn(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Hn(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(un(t).point)},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?Ki[o]?null:(Ki[o]=!0,()=>{Ki[o]=!1}):Ki.x||Ki.y?null:(Ki.x=Ki.y=!0,()=>{Ki.x=Ki.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(d.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=pn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Rt.postRender(()=>s(t,e)),In(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>Tn(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:Fn(this.visualElement)})}stop(t,e){const i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Rt.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(e,i,n){const{drag:s}=this.getProps();if(!n||!Qn(e,s,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(r=function(e,{min:i,max:n},s){return void 0!==i&&en&&(e=s?t(n,e,s.max):Math.min(e,n)),e}(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&T(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Xn(t.x,i,s),y:Xn(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=Gn){return!1===t?t=0:!0===t&&(t=Gn),{x:qn(t,"left","right"),y:qn(t,"top","bottom")}}(e),n!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Tn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!T(t))return!1;const i=t.current,{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const s=function(t,e,i){const n=Bn(t,i),{scroll:s}=e;return s&&(Rn(n.x,s.offset.x),Rn(n.y,s.offset.y)),n}(i,n.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Hn(t.x,e.x),y:Hn(t.y,e.y)}}(n.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=dn(t))}return o}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Tn(r=>{if(!Qn(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=n?200:1e6,u=n?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return In(this.visualElement,t),i.start(ln(t,i,0,e,this.visualElement,!1))}stopAnimation(){Tn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Tn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),n=i[e];return n||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(e){Tn(i=>{const{drag:n}=this.getProps();if(!Qn(i,n,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(i);if(s&&s.layout){const{min:n,max:r}=s.layout.layoutBox[i];o.set(e[i]-t(n,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!T(i)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Tn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const n=pn(t),s=pn(e);return s>n?i=at(e.min,e.max-n,t.min):n>s&&(i=at(t.min,t.max-s,e.min)),l(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Tn(i=>{if(!Qn(i,e,null))return;const n=this.getAxisMotionValue(i),{min:o,max:r}=this.constraints[i];n.set(t(o,r,s[i]))})}addListeners(){if(!this.visualElement.current)return;Zn.set(this.visualElement,this);const t=cn(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();T(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,n=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Rt.read(e);const s=hn(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Tn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),n(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=Gn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Qn(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const ts=t=>(e,i)=>{t&&Rt.postRender(()=>t(e,i))};function es(t){return t.props[P]}const is=(t,e)=>t.depth-e.depth;class ns{constructor(){this.children=[],this.isDirty=!1}add(t){Z(this.children,t),this.isDirty=!0}remove(t){J(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}const ss=["TopLeft","TopRight","BottomLeft","BottomRight"],os=ss.length,rs=t=>"string"==typeof t?parseFloat(t):t,as=t=>"number"==typeof t||u.test(t);function ls(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const hs=cs(0,.5,Pt),us=cs(.5,.95,st);function cs(t,e,i){return n=>ne?1:i(at(t,e,n))}function ds(t,e){t.min=e.min,t.max=e.max}function ps(t,e){ds(t.x,e.x),ds(t.y,e.y)}function ms(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function fs(t,e,i,n,s){return t=En(t-=e,1/i,n),void 0!==s&&(t=En(t,1/s,n)),t}function ys(e,i,[n,s,o],r,a){!function(e,i=0,n=1,s=.5,o,r=e,a=e){d.test(i)&&(i=parseFloat(i),i=t(a.min,a.max,i/100)-a.min);if("number"!=typeof i)return;let l=t(r.min,r.max,s);e===r&&(l-=i),e.min=fs(e.min,i,n,l,o),e.max=fs(e.max,i,n,l,o)}(e,i[n],i[s],i[o],i.scale,r,a)}const gs=["x","scaleX","originX"],vs=["y","scaleY","originY"];function xs(t,e,i,n){ys(t.x,e,gs,i?i.x:void 0,n?n.x:void 0),ys(t.y,e,vs,i?i.y:void 0,n?n.y:void 0)}function Ts(t){return 0===t.translate&&1===t.scale}function Ps(t){return Ts(t.x)&&Ts(t.y)}function ws(t,e){return t.min===e.min&&t.max===e.max}function Ss(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function As(t,e){return Ss(t.x,e.x)&&Ss(t.y,e.y)}function Vs(t){return pn(t.x)/pn(t.y)}function Es(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class bs{constructor(){this.members=[]}add(t){Z(this.members,t),t.scheduleRender()}remove(t){if(J(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let i;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){i=e;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:n}=t.options;!1===n&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Ms={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ds=["","X","Y","Z"];let Cs=0;function ks(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function Rs(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=es(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Rt,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&Rs(n)}function Ls({attachResizeListener:e,defaultParent:i,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},e=i?.()){this.id=Cs++,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,this.nodes.forEach(Fs),this.nodes.forEach(zs),this.nodes.forEach($s),this.nodes.forEach(Is)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;Rt.read(()=>{n=window.innerWidth}),e(t,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=Ot.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(Lt(n),t(o-e))};return Rt.setup(n,!0),()=>Lt(n)}(s,250),Ms.hasAnimatedSinceResize&&(Ms.hasAnimatedSinceResize=!1,this.nodes.forEach(Ws)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||_s,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!As(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...wi(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||Ws(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Lt(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(Ys),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||pn(this.snapshot.measuredBox.x)||pn(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tCn&&(e.x=1),e.yCn&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(ms(this.prevProjectionDelta.x,this.projectionDelta.x),ms(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),fn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Es(this.projectionDelta.x,this.prevProjectionDelta.x)&&Es(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,i=!1){const n=this.snapshot,s=n?n.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(qs));let p;this.animationProgress=0,this.mixTargetDelta=i=>{const n=i/1e3;var h,m,f,y,g,v;Hs(r.x,e.x,n),Hs(r.y,e.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vn(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,y=this.relativeTargetOrigin,g=a,v=n,Gs(f.x,y.x,g.x,v),Gs(f.y,y.y,g.y,v),p&&(h=this.relativeTarget,m=p,ws(h.x,m.x)&&ws(h.y,m.y))&&(this.isProjectionDirty=!1),p||(p={x:{min:0,max:0},y:{min:0,max:0}}),ps(p,this.relativeTarget)),l&&(this.animationValues=o,function(e,i,n,s,o,r){o?(e.opacity=t(0,n.opacity??1,hs(s)),e.opacityExit=t(i.opacity??1,0,us(s))):r&&(e.opacity=t(i.opacity??1,n.opacity??1,s));for(let o=0;o{Ms.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Oi(0)),this.currentAnimation=function(t,e,i){const n=x(t)?t:Oi(t);return n.start(ln("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&to(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=pn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=pn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}ps(e,i),jn(e,s),fn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new bs);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&ks("z",t,n,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Us),this.root.sharedNodes.clear()}}}function js(t){t.updateLayout()}function Bs(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Tn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=pn(n);n.min=i[t].min,n.max=n.min+s}):to(s,e.layoutBox,i)&&Tn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=pn(i[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fn(r,i,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?fn(a,t.applyTransform(n,!0),e.measuredBox):fn(a,i,e.layoutBox);const l=!Ps(r);let h=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};vn(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};vn(a,i,o.layoutBox),As(r,a)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Fs(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Is(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Os(t){t.clearSnapshot()}function Us(t){t.clearMeasurements()}function Ns(t){t.isLayoutDirty=!1}function Ks(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ws(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function zs(t){t.resolveTargetDelta()}function $s(t){t.calcProjection()}function Ys(t){t.resetSkewAndRotation()}function Xs(t){t.removeLeadSnapshot()}function Hs(e,i,n){e.translate=t(i.translate,0,n),e.scale=t(i.scale,1,n),e.origin=i.origin,e.originPoint=i.originPoint}function Gs(e,i,n,s){e.min=t(i.min,n.min,s),e.max=t(i.max,n.max,s)}function qs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const _s={duration:.45,ease:[.4,0,.1,1]},Zs=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Js=Zs("applewebkit/")&&!Zs("chrome/")?Math.round:st;function Qs(t){t.min=Js(t.min),t.max=Js(t.max)}function to(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Vs(e),s=Vs(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function eo(t){return t!==t.root&&t.scroll?.wasRoot}const io=Ls({attachResizeListener:(t,e)=>hn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),no={current:void 0},so=Ls({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!no.current){const t=new io({});t.mount(window),t.setOptions({layoutScroll:!0}),no.current=t}return no.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),oo={current:null},ro={current:!1};const ao=new WeakMap;const lo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ho{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ei,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Ot.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),ro.current||function(){if(ro.current=!0,A)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>oo.current=t.matches;t.addEventListener("change",e),e()}else oo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||oo.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Lt(this.notifyUpdate),Lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=v.has(t);i&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Rt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in b){const e=b[t];if(!e)continue;const{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=Oi(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=i&&("string"==typeof i&&(tt(i)||it(i))?i=parseFloat(i):(n=i,!tn.find(Ai(n))&&r.test(e)&&(i=ji(t,e))),this.setBaseTarget(t,x(i)?i.get():i)),x(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let i;if("string"==typeof e||"object"==typeof e){const n=M(this.props,e,this.presenceContext?.custom);n&&(i=n[t])}if(e&&void 0!==i)return i;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||x(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new lt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Ui.render(this.render)}}class uo extends ho{constructor(){super(...arguments),this.KeyframeResolver=Fi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;x(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function co(t,{style:e,vars:i},n,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}class po extends uo{constructor(){super(...arguments),this.type="html",this.renderInstance=co}readValueFromInstance(t,e){if(v.has(e))return this.projection?.isProjecting?We(e):((t,e)=>{const{transform:i="none"}=getComputedStyle(t);return ze(i,e)})(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(D(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return Bn(t,e)}build(t,e,i){C(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return k(t,e,i)}}let mo=!1;class fo extends q{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),mo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Ms.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,mo=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Rt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ui.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;mo=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function yo(t){const[e,i]=function(t=!0){const e=Y(R);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=X();H(()=>{if(t)return s(o)},[t]);const r=G(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=Y(L);return $(fo,{...t,layoutGroup:n,switchLayoutGroup:Y(j),isPresent:e,safeToRemove:i})}const go={pan:{Feature:class extends en{constructor(){super(...arguments),this.removePointerDownListener=st}onPointerDown(t){this.session=new Un(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fn(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:ts(t),onStart:ts(e),onMove:i,onEnd:(t,e)=>{delete this.session,n&&Rt.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=cn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends en{constructor(t){super(t),this.removeGroupControls=st,this.removeListeners=st,this.controls=new Jn(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||st}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:so,MeasureLayout:yo}},vo={layout:{ProjectionNode:so,MeasureLayout:yo}};function xo(t,e,i){const n=t.getProps();return M(n,e,void 0!==i?i:n.custom,t)}const To=t=>Array.isArray(t);function Po(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,Oi(i))}function wo(t){return To(t)?t[t.length-1]||0:t}function So({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function Ao(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;n&&(o=n);const l=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&So(h,e))continue;const r={delay:i,...wi(o||{},e)},u=n.get();if(void 0!==u&&!n.isAnimating&&!Array.isArray(s)&&s===u&&!r.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const i=es(t);if(i){const t=window.MotionHandoffAnimation(i,e,Rt);null!==t&&(r.startTime=t,c=!0)}}In(t,e),n.start(ln(e,n,s,t.shouldReduceMotion&&Si.has(e)?{type:!1}:r,t,c));const d=n.animation;d&&l.push(d)}return r&&Promise.all(l).then(()=>{Rt.update(()=>{r&&function(t,e){const i=xo(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)Po(t,e,wo(o[e]))}(t,r)})}),l}function Vo(t,e,i,n=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*n;return"function"==typeof i?i(o,r):1===s?o*n:a-o*n}function Eo(t,e,i={}){const n=xo(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(Ao(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Eo(l,e,{...r,delay:i+("function"==typeof n?0:n)+Vo(t.variantChildren,l,n,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,o,r,a,i)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(i.delay)])}function bo(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;nPromise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Eo(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=Eo(t,e,i);else{const s="function"==typeof e?xo(t,e,i.custom):e;n=Promise.all(Ao(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function Lo(t){let e=Ro(t),i=Fo(),n=!0;const s=e=>(i,n)=>{const s=xo(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function o(o){const{props:r}=t,a=Do(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;ec&&f,T=!1;const P=Array.isArray(m)?m:[m];let w=P.reduce(s(d),{});!1===y&&(w={});const{prevResolvedValues:S={}}=p,A={...S,...w},V=e=>{x=!0,h.has(e)&&(T=!0,h.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=w[t],i=S[t];if(u.hasOwnProperty(t))continue;let n=!1;n=To(e)&&To(i)?!bo(e,i):e!==i,n?null!=e?V(t):h.add(t):void 0!==e&&h.has(t)?V(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=w,p.isActive&&(u={...u,...w}),n&&t.blockInitialAnimation&&(x=!1);const E=g&&v;x&&(!E||T)&&l.push(...P.map(e=>{const i={type:d};if("string"==typeof e&&n&&!E&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=xo(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=Vo(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const i=xo(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}h.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),l.push({animation:e})}let d=Boolean(l.length);return!n||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),n=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;const s=o(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=Fo()}}}function jo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!bo(e,t)}function Bo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fo(){return{animate:Bo(!0),whileInView:Bo(),whileHover:Bo(),whileTap:Bo(),whileDrag:Bo(),whileFocus:Bo(),exit:Bo()}}let Io=0;const Oo={animation:{Feature:class extends en{constructor(t){super(t),t.animationState||(t.animationState=Lo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();I(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends en{constructor(){super(...arguments),this.id=Io++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Uo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&Rt.postRender(()=>s(e,un(e)))}function No(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&Rt.postRender(()=>s(e,un(e)))}const Ko=new WeakMap,Wo=new WeakMap,zo=t=>{const e=Ko.get(t.target);e&&e(t)},$o=t=>{t.forEach(zo)};function Yo(t,e,i){const n=function({root:t,...e}){const i=t||document;Wo.has(i)||Wo.set(i,{});const n=Wo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver($o,{root:t,...e})),n[s]}(e);return Ko.set(t,i),n.observe(t),()=>{Ko.delete(t),n.unobserve(t)}}const Xo={some:0,all:1};const Ho={inView:{Feature:class extends en{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:Xo[n]};return Yo(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends en{mount(){const{current:t}=this.node;t&&(this.unmount=Ji(t,(t,e)=>(No(this.node,e,"Start"),(t,{success:e})=>No(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends en{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=rt(hn(this.node.current,"focus",()=>this.onFocus()),hn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends en{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){const[n,s,o]=zi(t,i),r=t=>{if(!$i(t))return;const{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;const o=t=>{$i(t)&&(n(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,s)};return n.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(Uo(this.node,e,"Start"),t=>Uo(this.node,t,"End"))))}unmount(){}}}},Go=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"]);class qo extends uo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(v.has(e)){const t=Li(e);return t&&t.default||0}return e=Go.has(e)?e:U(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return N(t,e,i)}build(t,e,i){K(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){co(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(Go.has(i)?i:U(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=W(t.tagName),super.mount(t)}}const _o={renderer:(t,e)=>z(t)?new qo(e):new po(e,{allowProjection:t!==_}),...Oo,...Ho},Zo={..._o,...go,...vo};export{Zo as domMax};