framer-motion 10.0.0 → 10.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{t,u as e,v as n,w as s,x as i,y as o,z as r,A as a,B as l,C as h,D as c,a as u,d,E as p,g as m,r as f,F as g,G as y,H as v,I as x,J as P,o as T,K as b,M as S,N as V,i as A,b as E,m as w,f as C,c as D,O as M,Q as L,h as R,q as k,R as j,P as B,T as F,L as I,S as U,U as O,V as N,n as $,W as z,s as G,j as H,p as W,k as q,l as Y}from"./size-rollup-dom-max-assets.js";import X,{useContext as K,useId as Z,useEffect as _}from"react";class J{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Q=t=>t;let tt=Q,et=Q;const nt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function st(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const it="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ot="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(it()),1/60*1e3);const rt={delta:0,timestamp:0};let at=!0,lt=!1,ht=!1;const ct=["read","update","preRender","render","postRender"],ut=ct.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,h=l?e:n;return o&&r.add(t),-1===h.indexOf(t)&&(h.push(t),l&&i&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(l),r.has(s)&&(a.schedule(s),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>lt=!0),t),{}),dt=ct.reduce((t,e)=>{const n=ut[e];return t[e]=(t,e=!1,s=!1)=>(lt||yt(),n.schedule(t,e,s)),t},{}),pt=ct.reduce((t,e)=>(t[e]=ut[e].cancel,t),{}),mt=ct.reduce((t,e)=>(t[e]=()=>ut[e].process(rt),t),{}),ft=t=>ut[t].process(rt),gt=t=>{lt=!1,rt.delta=at?1/60*1e3:Math.max(Math.min(t-rt.timestamp,40),1),rt.timestamp=t,ht=!0,ct.forEach(ft),ht=!1,lt&&(at=!1,ot(gt))},yt=()=>{lt=!0,at=!0,ht||ot(gt)},vt=t=>1e3*t;function xt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Pt(t,e,n,s){return xt(t,e,(t=>e=>nt(e)&&t(e,st(e)))(n),s)}const Tt=(t,e)=>n=>e(t(n)),bt=(...t)=>t.reduce(Tt),St=(t,e)=>Math.abs(t-e);class Vt{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=wt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=St(t.x,e.x),s=St(t.y,e.y);return Math.sqrt(n**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:s}=t,{timestamp:i}=rt;this.history.push({...s,timestamp:i});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=At(e,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:s}=this.handlers,i=wt("pointercancel"===t.type?this.lastMoveEventInfo:At(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),s&&s(t,i)},!nt(t))return;this.handlers=e,this.transformPagePoint=n;const s=At(st(t),this.transformPagePoint),{point:i}=s,{timestamp:o}=rt;this.history=[{...i,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,wt(s,this.history)),this.removeListeners=bt(Pt(window,"pointermove",this.handlePointerMove),Pt(window,"pointerup",this.handlePointerUp),Pt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pt.update(this.updatePoint)}}function At(t,e){return e?{point:e(t.point)}:t}function Et(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wt({point:t},e){return{point:t,delta:Et(t,Dt(e)),offset:Et(t,Ct(e)),velocity:Mt(e,.1)}}function Ct(t){return t[0]}function Dt(t){return t[t.length-1]}function Mt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Dt(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>vt(e)));)n--;if(!s)return{x:0,y:0};const o=(i.timestamp-s.timestamp)/1e3;if(0===o)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Lt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Rt=Lt("dragHorizontal"),kt=Lt("dragVertical");function jt(t){let e=!1;if("y"===t)e=kt();else if("x"===t)e=Rt();else{const t=Rt(),n=kt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Bt(){const t=jt(!0);return!t||(t(),!1)}const Ft=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},It=(t,e,n)=>-n*t+n*e+t;function Ut(t){return t.max-t.min}function Ot(t,e=0,n=.01){return Math.abs(t-e)<=n}function Nt(t,e,n,s=.5){t.origin=s,t.originPoint=It(e.min,e.max,t.origin),t.scale=Ut(n)/Ut(e),(Ot(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=It(n.min,n.max,t.origin)-t.originPoint,(Ot(t.translate)||isNaN(t.translate))&&(t.translate=0)}function $t(t,e,n,s){Nt(t.x,e.x,n.x,s?s.originX:void 0),Nt(t.y,e.y,n.y,s?s.originY:void 0)}function zt(t,e,n){t.min=n.min+e.min,t.max=t.min+Ut(e)}function Gt(t,e,n){t.min=e.min-n.min,t.max=t.min+Ut(e)}function Ht(t,e,n){Gt(t.x,e.x,n.x),Gt(t.y,e.y,n.y)}function Wt(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function qt(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}const Yt=.35;function Xt(t,e,n){return{min:Kt(t,e),max:Kt(t,n)}}function Kt(t,e){return"number"==typeof t?t:t[e]||0}function Zt(t){return[t("x"),t("y")]}function _t({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Jt(t){return void 0===t||1===t}function Qt({scale:t,scaleX:e,scaleY:n}){return!Jt(t)||!Jt(e)||!Jt(n)}function te(t){return Qt(t)||ee(t)||t.z||t.rotate||t.rotateX||t.rotateY}function ee(t){return ne(t.x)||ne(t.y)}function ne(t){return t&&"0%"!==t}function se(t,e,n){return n+e*(t-n)}function ie(t,e,n,s,i){return void 0!==i&&(t=se(t,i,s)),se(t,n,s)+e}function oe(t,e=0,n=1,s,i){t.min=ie(t.min,e,n,s,i),t.max=ie(t.max,e,n,s,i)}function re(t,{x:e,y:n}){oe(t.x,e.translate,e.scale,e.originPoint),oe(t.y,n.translate,n.scale,n.originPoint)}function ae(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function le(t,e){t.min=t.min+e,t.max=t.max+e}function he(t,e,[n,s,i]){const o=void 0!==e[i]?e[i]:.5,r=It(t.min,t.max,o);oe(t,e[n],e[s],r,e.scale)}const ce=["x","scaleX","originX"],ue=["y","scaleY","originY"];function de(t,e){he(t.x,e,ce),he(t.y,e,ue)}function pe(t,e){return _t(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}const me=!1,fe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ge=t=>e=>1-t(1-e),ye=t=>t*t,ve=ge(ye),xe=fe(ye),Pe=(t,s)=>i=>Boolean(e(i)&&n.test(i)&&i.startsWith(t)||s&&Object.prototype.hasOwnProperty.call(i,s)),Te=(t,n,i)=>o=>{if(!e(o))return o;const[r,a,l,h]=o.match(s);return{[t]:parseFloat(r),[n]:parseFloat(a),[i]:parseFloat(l),alpha:void 0!==h?parseFloat(h):1}},be={...r,transform:e=>Math.round((e=>t(0,255,e))(e))},Se={test:Pe("rgb","red"),parse:Te("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+be.transform(t)+", "+be.transform(e)+", "+be.transform(n)+", "+i(o.transform(s))+")"};const Ve={test:Pe("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Se.transform},Ae={test:Pe("hsl","hue"),parse:Te("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+a.transform(i(e))+", "+a.transform(i(n))+", "+i(o.transform(s))+")"},Ee={test:t=>Se.test(t)||Ve.test(t)||Ae.test(t),parse:t=>Se.test(t)?Se.parse(t):Ae.test(t)?Ae.parse(t):Ve.parse(t),transform:t=>e(t)?t:t.hasOwnProperty("red")?Se.transform(t):Ae.transform(t)};function we(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Ce=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},De=[Ve,Se,Ae];function Me(t){const e=(n=t,De.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Ae&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,o=0,r=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=we(a,s,t+1/3),o=we(a,s,t),r=we(a,s,t-1/3)}else i=o=r=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const Le=(t,e)=>{const n=Me(t),s=Me(e),i={...n};return t=>(i.red=Ce(n.red,s.red,t),i.green=Ce(n.green,s.green,t),i.blue=Ce(n.blue,s.blue,t),i.alpha=It(n.alpha,s.alpha,t),Se.transform(i))};function Re(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(l);o&&(n=o.length,t=t.replace(l,"${c}"),e.push(...o.map(Ee.parse)));const a=t.match(s);return a&&(i=a.length,t=t.replace(s,"${n}"),e.push(...a.map(r.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function ke(t){return Re(t).values}function je(t){const{values:e,numColors:n,tokenised:s}=Re(t),o=e.length;return t=>{let e=s;for(let s=0;s<o;s++)e=e.replace(s<n?"${c}":"${n}",s<n?Ee.transform(t[s]):i(t[s]));return e}}const Be=t=>"number"==typeof t?0:t;const Fe={test:function(t){var n,i;return isNaN(t)&&e(t)&&((null===(n=t.match(s))||void 0===n?void 0:n.length)||0)+((null===(i=t.match(l))||void 0===i?void 0:i.length)||0)>0},parse:ke,createTransformer:je,getAnimatableNone:function(t){const e=ke(t);return je(t)(e.map(Be))}};function Ie(t,e){return"number"==typeof t?n=>It(t,e,n):Ee.test(t)?Le(t,e):Ne(t,e)}const Ue=(t,e)=>{const n=[...t],s=n.length,i=t.map((t,n)=>Ie(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}},Oe=(t,e)=>{const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Ie(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}},Ne=(t,e)=>{const n=Fe.createTransformer(e),s=Re(t),i=Re(e);return s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?bt(Ue(s.values,i.values),n):n=>""+(n>0?e:t)},$e=(t,e)=>n=>It(t,e,n);function ze(t,e,n){const s=[],i=n||("number"==typeof(o=t[0])?$e:"string"==typeof o?Ee.test(o)?Le:Ne:Array.isArray(o)?Ue:"object"==typeof o?Oe:$e);var o;const r=t.length-1;for(let n=0;n<r;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=bt(t,o)}s.push(o)}return s}function Ge(e,n,{clamp:s=!0,ease:i,mixer:o}={}){const r=e.length;et(r===n.length),et(!i||!Array.isArray(i)||i.length===r-1),e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const a=ze(n,i,o),l=a.length,h=t=>{let n=0;if(l>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=Ft(e[n],e[n+1],t);return a[n](s)};return s?n=>h(t(e[0],e[r-1],n)):h}function He(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(It(n,1,i))}}(e,t.length-1),e}const We=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function qe(t,e,n,s){if(t===e&&n===s)return Q;const i=e=>function(t,e,n,s,i){let o,r,a=0;do{r=e+(n-e)/2,o=We(r,s,i)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:We(i(t),e,s)}const Ye=t=>1-Math.sin(Math.acos(t)),Xe=ge(Ye),Ke=fe(Xe),Ze=qe(.33,1.53,.69,.99),_e=ge(Ze),Je=fe(_e),Qe={linear:Q,easeIn:ye,easeInOut:xe,easeOut:ve,circIn:Ye,circInOut:Ke,circOut:Xe,backIn:_e,backInOut:Je,backOut:Ze,anticipate:t=>(t*=2)<1?.5*_e(t):.5*(2-Math.pow(2,-10*(t-1)))},tn=t=>{if(Array.isArray(t)){et(4===t.length);const[e,n,s,i]=t;return qe(e,n,s,i)}return"string"==typeof t?Qe[t]:t};function en({keyframes:t,ease:e=xe,times:n,duration:s=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(tn):tn(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:He(t),s);function a(){return Ge(r,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||xe).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=s,o),flipTarget:()=>{t.reverse(),l=a()}}}function nn({duration:e=800,bounce:n=.25,velocity:s=0,mass:i=1}){let o,r;tt(e<=1e4);let a=1-n;a=t(.05,1,a),e=t(.01,10,e/1e3),a<1?(o=t=>{const n=t*a,i=n*e;return.001-(n-s)/sn(t,a)*Math.exp(-i)},r=t=>{const n=t*a*e,i=n*s+s,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),h=sn(Math.pow(t,2),a);return(.001-o(t)>0?-1:1)*((i-r)*l)/h}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(s-t)));const l=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(o,r,5/e);if(e*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(l,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}function sn(t,e){return t*Math.sqrt(1-e*e)}function on(t,e){return e?t*(1e3/e):0}const rn=["duration","bounce"],an=["stiffness","damping","mass"];function ln(t,e){return e.some(e=>void 0!==t[e])}function hn({keyframes:t,restDelta:e,restSpeed:n,...s}){let i=t[0],o=t[t.length-1];const r={done:!1,value:i},{stiffness:a,damping:l,mass:h,velocity:c,duration:u,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!ln(t,an)&&ln(t,rn)){const n=nn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let p=cn,m=c?-c/1e3:0;const f=l/(2*Math.sqrt(a*h));function g(){const t=o-i,s=Math.sqrt(a/h)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=sn(s,f);p=n=>{const i=Math.exp(-f*s*n);return o-i*((m+f*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>o-Math.exp(-s*e)*(t+(m+s*t)*e);else{const e=s*Math.sqrt(f*f-1);p=n=>{const i=Math.exp(-f*s*n),r=Math.min(e*n,300);return o-i*((m+f*s*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const s=p(t);if(d)r.done=t>=u;else{let i=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);i=on(s-p(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(o-s)<=e;r.done=a&&l}return r.value=r.done?o:s,r},flipTarget:()=>{m=-m,[i,o]=[o,i],g()}}}hn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const cn=t=>0;const un={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:i=.5,modifyTarget:o}){const r=t[0],a={done:!1,value:r};let l=n*e;const h=r+l,c=void 0===o?h:o(h);return c!==h&&(l=c-r),{next:t=>{const e=-l*Math.exp(-t/s);return a.done=!(e>i||e<-i),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:en,tween:en,spring:hn};function dn(t,e,n=0){return t-e-n}const pn=t=>{const e=({delta:e})=>t(e);return{start:()=>dt.update(e,!0),stop:()=>pt.update(e)}};function mn({duration:t,driver:e=pn,elapsed:n=0,repeat:s=0,repeatType:i="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:h,onComplete:c,onRepeat:u,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,T=!0;const b=un[r.length>2?"keyframes":p]||en,S=r[0],V=r[r.length-1];let A={done:!1,value:S};const{needsInterpolation:E}=b;E&&E(S,V)&&(y=Ge([0,100],[S,V],{clamp:!1}),r=[0,100]);const w=b({...m,duration:t,keyframes:r});function C(){v++,"reverse"===i?(T=v%2==0,n=function(t,e=0,n=0,s=!0){return s?dn(e+-t,e,n):e-(t-e)+n}(n,x,o,T)):(n=dn(n,x,o),"mirror"===i&&w.flipTarget()),P=!1,u&&u()}function D(t){T||(t=-t),n+=t,P||(A=w.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=T?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,x,o,T)&&C():(g&&g.stop(),c&&c()))}return a&&(l&&l(),g=e(D),g.start()),{stop:()=>{h&&h(),g&&g.stop()},set currentTime(t){n=f,D(t)},sample:e=>{n=f;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let i=0;for(D(0);i<=e;){const t=e-i;D(Math.min(t,s)),i+=s}return A}}}const fn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,gn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function yn(t){if(t)return Array.isArray(t)?fn(t):gn[t]}const vn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},xn={},Pn={};for(const t in vn)Pn[t]=()=>(void 0===xn[t]&&(xn[t]=vn[t]()),xn[t]);const Tn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),bn=(t,e)=>{return"spring"===e.type||"backgroundColor"===t||!(!(n=e.ease)||Array.isArray(n)||"string"==typeof n&&gn[n]);var n};function Sn(t,e,{onUpdate:n,onComplete:s,...i}){if(!(Pn.waapi()&&Tn.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=i;if(bn(e,i)){const t=mn({...i,repeat:0,elapsed:0});let e={done:!1,value:o[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s),n.push(e.value),s+=10;o=n,r=s-10,l="linear"}const h=function(t,e,n,{delay:s=0,duration:i,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:s,duration:i,easing:yn(a),fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(t.owner.current,e,o,{...i,delay:-a,duration:r,ease:l});return h.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,i)),dt.update(()=>h.cancel()),s&&s()},{get currentTime(){return h.currentTime||0},set currentTime(t){h.currentTime=t},stop:()=>{const{currentTime:e}=h;if(e){const n=mn({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}dt.update(()=>h.cancel())}}}function Vn(t,e){const n=performance.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(pt.read(s),t(o-e))};return dt.read(s,!0),()=>pt.read(s)}function An({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const i=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:Vn(i,-e)}:i()}const En={type:"spring",stiffness:500,damping:25,restSpeed:10},wn={type:"keyframes",duration:.8},Cn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Dn=(t,{keyframes:e})=>e.length>2?wn:h.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:En:Cn,Mn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Fe.test(e)||e.startsWith("url("))),Ln=new Set(["brightness","contrast","saturate","opacity"]);function Rn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(s)||[];if(!i)return t;const o=n.replace(i,"");let r=Ln.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+o+")"}const kn=/([a-z-]*)\(.*?\)/g,jn={...Fe,getAnimatableNone:t=>{const e=t.match(kn);return e?e.map(Rn).join(" "):t}},Bn={...c,color:Ee,backgroundColor:Ee,outlineColor:Ee,fill:Ee,stroke:Ee,borderColor:Ee,borderTopColor:Ee,borderRightColor:Ee,borderBottomColor:Ee,borderLeftColor:Ee,filter:jn,WebkitFilter:jn},Fn=t=>Bn[t];function In(t,e){let n=Fn(t);return n!==jn&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function Un(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function On(t){return"number"==typeof t?0:In("",t)}function Nn(t,e){return t[e]||t.default||t}const $n=(t,e,n,s={})=>i=>{const o=Nn(s,t)||{},r=o.delay||s.delay||0;let{elapsed:a=0}=s;a-=vt(r);const l=function(t,e,n,s){const i=Mn(e,n);let o=void 0!==s.from?s.from:t.get();return"none"===o&&i&&"string"==typeof n?o=In(e,n):Un(o)&&"string"==typeof n?o=On(n):!Array.isArray(n)&&Un(n)&&"string"==typeof o&&(n=On(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),h=l[0],c=l[l.length-1],u=Mn(t,h),d=Mn(t,c);let p={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!u||!d||me||!1===o.type)return An(p);if("inertia"===o.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:i=.8,timeConstant:o=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:h,driver:c,onUpdate:u,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==s&&t>s}function y(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function v(t){f&&f.stop(),f=mn({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{u&&u(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=i*e+m;void 0!==h&&(t=h(t));const s=y(t),r=s===n?-1:1;let a,c;const u=t=>{a=c,c=t,e=on(t-a,rt.delta),(1===r&&t>s||-1===r&&t<s)&&x({keyframes:[t,s],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:i,restDelta:l,modifyTarget:h,onUpdate:g(t)?u:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...c}){return!!Object.keys(c).length}(o)||(p={...p,...Dn(t,p)}),p.duration&&(p.duration=vt(p.duration)),p.repeatDelay&&(p.repeatDelay=vt(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=Sn(e,t,p);if(n)return n}return mn(p)},zn=new WeakMap;class Gn{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;this.panSession=new Vt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(st(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:s,onDragStart:i}=this.getProps();if(n&&!s&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=jt(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zt(t=>{let e=this.getAxisMotionValue(t).get()||0;if(a.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const s=n.layout.layoutBox[t];if(s){e=Ut(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),i&&i(t,e);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:s,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&i&&i(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.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&i(t,e)}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:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!Hn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},s){return void 0!==e&&t<e?t=s?It(e,t,s.min):Math.max(t,e):void 0!==n&&t>n&&(t=s?It(n,t,s.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},s=this.constraints;t&&u(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:s,right:i}){return{x:Wt(t.x,n,i),y:Wt(t.y,e,s)}}(n.layoutBox,t),this.elastic=function(t=Yt){return!1===t?t=0:!0===t&&(t=Yt),{x:Xt(t,"left","right"),y:Xt(t,"top","bottom")}}(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Zt(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!u(t))return!1;const n=t.current;et(null!==n);const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=function(t,e,n){const s=pe(t,n),{scroll:i}=e;return i&&(le(s.x,i.offset.x),le(s.y,i.offset.y)),s}(n,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:qt(t.x,e.x),y:qt(t.y,e.y)}}(s.layout.layoutBox,i);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=_t(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Zt(r=>{if(!Hn(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,c=s?40:1e7,u={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(r,u)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start($n(t,n,0,e))}stopAnimation(){Zt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),s=n[e];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Zt(e=>{const{drag:n}=this.getProps();if(!Hn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:n,max:o}=s.layout.layoutBox[e];i.set(t[e]-It(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!u(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Zt(e=>{const n=this.getAxisMotionValue(e);if(n){const s=n.get();i[e]=function(e,n){let s=.5;const i=Ut(e),o=Ut(n);return o>i?s=Ft(n.min,n.max-i,e.min):i>o&&(s=Ft(e.min,e.max-o,n.min)),t(0,1,s)}({min:s,max:s},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Zt(t=>{if(!Hn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:s,max:o}=this.constraints[t];n.set(It(s,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;zn.set(this.visualElement,this);const t=Pt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();u(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,s=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=xt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Zt(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Yt,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:r}}}function Hn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Wn(t,e){-1===t.indexOf(e)&&t.push(e)}function qn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Yn{constructor(){this.subscriptions=[]}add(t){return Wn(this.subscriptions,t),()=>qn(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Xn{constructor(t,e={}){var n;this.version="10.0.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=rt;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,dt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>dt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Yn);const n=this.events[t].add(e);return"change"===t?()=>{n(),dt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?on(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Kn(t,e){return new Xn(t,e)}const Zn=["TopLeft","TopRight","BottomLeft","BottomRight"],_n=Zn.length,Jn=t=>"string"==typeof t?parseFloat(t):t,Qn=t=>"number"==typeof t||p.test(t);function ts(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const es=ss(0,.5,Xe),ns=ss(.5,.95,Q);function ss(t,e,n){return s=>s<t?0:s>e?1:n(Ft(t,e,s))}function is(t,e){t.min=e.min,t.max=e.max}function os(t,e){is(t.x,e.x),is(t.y,e.y)}function rs(t,e,n,s,i){return t=se(t-=e,1/n,s),void 0!==i&&(t=se(t,1/i,s)),t}function as(t,e,[n,s,i],o,r){!function(t,e=0,n=1,s=.5,i,o=t,r=t){if(a.test(e)){e=parseFloat(e);e=It(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let l=It(o.min,o.max,s);t===o&&(l-=e),t.min=rs(t.min,e,n,l,i),t.max=rs(t.max,e,n,l,i)}(t,e[n],e[s],e[i],e.scale,o,r)}const ls=["x","scaleX","originX"],hs=["y","scaleY","originY"];function cs(t,e,n,s){as(t.x,e,ls,n?n.x:void 0,s?s.x:void 0),as(t.y,e,hs,n?n.y:void 0,s?s.y:void 0)}function us(t){return 0===t.translate&&1===t.scale}function ds(t){return us(t.x)&&us(t.y)}function ps(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function ms(t){return Ut(t.x)/Ut(t.y)}class fs{constructor(){this.members=[]}add(t){Wn(this.members,t),t.scheduleRender()}remove(t){if(qn(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 n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gs(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(s=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(s+=`rotate(${t}deg) `),e&&(s+=`rotateX(${e}deg) `),i&&(s+=`rotateY(${i}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(s+=`scale(${r}, ${a})`),s||"none"}const ys=(t,e)=>t.depth-e.depth;class vs{constructor(){this.children=[],this.isDirty=!1}add(t){Wn(this.children,t),this.isDirty=!0}remove(t){qn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ys),this.isDirty=!1,this.children.forEach(t)}}const xs=["","X","Y","Z"];let Ps=0;const Ts={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function bs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(t,n={},s=(null==e?void 0:e())){this.id=Ps++,this.animationId=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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;Ts.totalNodes=Ts.resolvedTargetDeltas=Ts.recalculatedProjection=0,this.nodes.forEach(As),this.nodes.forEach(Ls),this.nodes.forEach(Rs),this.nodes.forEach(Es),t=Ts,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new vs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Yn),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:s,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(i||s)&&(this.isLayoutDirty=!0),t){let n;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Vn(s,250),m.hasAnimatedSinceResize&&(m.hasAnimatedSinceResize=!1,this.nodes.forEach(Ms))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&o&&(s||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||o.getDefaultTransition()||Us,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!ps(this.targetLayout,s)||n,h=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...Nn(i,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Ms(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}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,pt.preRender(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(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Cs);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Os),this.potentialNodes.clear()),this.nodes.forEach(Ds),this.nodes.forEach(Ss),this.nodes.forEach(Vs),this.clearAllSnapshots(),mt.update(),mt.preRender(),mt.render())}clearAllSnapshots(){this.nodes.forEach(ws),this.sharedNodes.forEach(js)}scheduleUpdateProjection(){dt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}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;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ds(this.projectionDelta),n=this.getTransformTemplate(),s=n?n(this.latestValues,""):void 0,o=s!==this.prevTransformTemplateValue;t&&(e||te(this.latestValues)||o)&&(i(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var s;return t&&(n=this.removeTransform(n)),Ns((s=n).x),Ns(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(le(e.x,n.offset.x),le(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};os(e,t);for(let n=0;n<this.path.length;n++){const s=this.path[n],{scroll:i,options:o}=s;if(s!==this.root&&i&&o.layoutScroll){if(i.isRoot){os(e,t);const{scroll:n}=this.root;n&&(le(e.x,-n.offset.x),le(e.y,-n.offset.y))}le(e.x,i.offset.x),le(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};os(n,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&de(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),te(s.latestValues)&&de(n,s.latestValues)}return te(this.latestValues)&&de(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};os(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!te(n.latestValues))continue;Qt(n.latestValues)&&n.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};os(s,n.measurePageBox()),cs(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,s)}return te(this.latestValues)&&cs(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);if(!((Boolean(this.resumingFrom)||this!==e)&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:n,layoutId:s}=this.options;if(this.layout&&(n||s)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ht(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),os(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,o,r;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(i=this.target,o=this.relativeTarget,r=this.relativeParent.target,zt(i.x,o.x,r.x),zt(i.y,o.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):os(this.target,this.layout.layoutBox),re(this.target,this.targetDelta)):os(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ht(this.relativeTargetOrigin,this.target,t.target),os(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ts.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Qt(this.parent.latestValues)&&!ee(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let s=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(s=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),s)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;os(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,s=!1){const i=n.length;if(!i)return;let o,r;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&de(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,re(t,r)),s&&te(o.latestValues)&&de(t,o.latestValues))}e.x=ae(e.x),e.y=ae(e.y)}(this.layoutCorrected,this.treeScale,this.path,n);const{target:r}=e;if(!r)return;this.projectionDelta||(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}});const a=this.treeScale.x,l=this.treeScale.y,h=this.projectionTransform;$t(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=gs(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===a&&this.treeScale.y===l||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r)),Ts.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,s=n?n.latestValues:{},i={...this.latestValues},o={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=!e;const r={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(),c=!h||h.members.length<=1,u=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(Is));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var h,p,m,f;Bs(o.x,t.x,n),Bs(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ht(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=r,f=n,Fs(h.x,p.x,m.x,f),Fs(h.y,p.y,m.y,f),d&&ps(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),os(d,this.relativeTarget)),l&&(this.animationValues=i,function(t,e,n,s,i,o){i?(t.opacity=It(0,void 0!==n.opacity?n.opacity:1,es(s)),t.opacityExit=It(void 0!==e.opacity?e.opacity:1,0,ns(s))):o&&(t.opacity=It(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,s));for(let i=0;i<_n;i++){const o=`border${Zn[i]}Radius`;let r=ts(e,o),l=ts(n,o);if(void 0===r&&void 0===l)continue;r||(r=0),l||(l=0);0===r||0===l||Qn(r)===Qn(l)?(t[o]=Math.max(It(Jn(r),Jn(l),s),0),(a.test(l)||a.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||n.rotate)&&(t.rotate=It(e.rotate||0,n.rotate||0,s))}(i,s,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{m.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const s=d(t)?t:Kn(t);return s.start($n("",s,e,n)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},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:n,layout:s,latestValues:i}=t;if(e&&n&&s){if(this!==t&&this.layout&&s&&$s(this.options.animationType,this.layout.layoutBox,s.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ut(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const s=Ut(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+s}os(e,n),de(e,i),$t(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new fs);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const s=this.getStack();s&&s.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const s={};for(let e=0;e<xs.length;e++){const i="rotate"+xs[e];n[i]&&(s[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in s)t.setStaticValue(e,s[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const s={};if(!this.instance||this.isSVG)return s;if(!this.isVisible)return{visibility:"hidden"};s.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=f(t.pointerEvents)||"",s.transform=i?i(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=f(t.pointerEvents)||""),this.hasProjected&&!te(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=gs(this.projectionDeltaWithTransform,this.treeScale,r),i&&(s.transform=i(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in g){if(void 0===r[t])continue;const{correct:e,applyTo:n}=g[t],i="none"===s.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)s[n[e]]=i}else s[t]=i}return this.options.layoutId&&(s.pointerEvents=o===this?f(t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Cs),this.root.sharedNodes.clear()}}}function Ss(t){t.updateLayout()}function Vs(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?Zt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=Ut(s);s.min=e[t].min,s.max=s.min+i}):$s(i,n.layoutBox,e)&&Zt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=Ut(e[t]);s.max=s.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};$t(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?$t(a,t.applyTransform(s,!0),n.measuredBox):$t(a,e,n.layoutBox);const l=!ds(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:i,layout:o}=s;if(i&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ht(r,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ht(a,e,o.layoutBox),ps(r,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function As(t){Ts.totalNodes++,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 Es(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ws(t){t.clearSnapshot()}function Cs(t){t.clearMeasurements()}function Ds(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ms(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Ls(t){t.resolveTargetDelta()}function Rs(t){t.calcProjection()}function ks(t){t.resetRotation()}function js(t){t.removeLeadSnapshot()}function Bs(t,e,n){t.translate=It(e.translate,0,n),t.scale=It(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Fs(t,e,n,s){t.min=It(e.min,n.min,s),t.max=It(e.max,n.max,s)}function Is(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Us={duration:.45,ease:[.4,0,.1,1]};function Os(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const s=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);s&&t.mount(s,!0)}function Ns(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function $s(t,e,n){return"position"===t||"preserve-aspect"===t&&!Ot(ms(e),ms(n),.2)}const zs=bs({attachResizeListener:(t,e)=>xt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Gs={current:void 0},Hs=bs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Gs.current){const t=new zs(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Gs.current=t}return Gs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Ws(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const qs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!p.test(t))return t;t=parseFloat(t)}return`${Ws(t,e.target.x)}% ${Ws(t,e.target.y)}%`}},Ys=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Xs(t,e,n=1){const[s,i]=function(t){const e=Ys.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);return o?o.trim():y(i)?Xs(i,e,n+1):i}const Ks={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=t.includes("var("),o=[];i&&(t=t.replace(Ys,t=>(o.push(t),"_$css")));const r=Fe.parse(t);if(r.length>5)return s;const a=Fe.createTransformer(t),l="number"!=typeof r[0]?1:0,h=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=h,r[1+l]/=c;const u=It(h,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=u),"number"==typeof r[3+l]&&(r[3+l]/=u);let d=a(r);if(i){let t=0;d=d.replace("_$css",()=>{const e=o[t];return t++,e})}return d}},Zs=t=>/^0[^.\s]+$/.test(t),_s=t=>e=>e.test(t),Js=[r,p,a,v,x,P,{test:t=>"auto"===t,parse:t=>t}],Qs=t=>Js.find(_s(t)),ti=[...Js,Ee,Fe],ei=t=>ti.find(_s(t));function ni(t,e,n){const s=t.getProps();return T(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function si(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Kn(n))}function ii(t,e){if(!e)return;return(e[t]||e.default||e).from}const oi=new Set(["width","height","top","left","right","bottom","x","y"]),ri=t=>oi.has(t),ai=t=>t===r||t===p,li=(t,e)=>parseFloat(t.split(", ")[e]),hi=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return li(i[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?li(e[1],t):0}},ci=new Set(["x","y","z"]),ui=S.filter(t=>!ci.has(t));const di={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:hi(4,13),y:hi(5,14)},pi=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(ri);let o=[],r=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let h=n[i],c=Qs(h);const u=e[i];let d;if(V(u)){const t=u.length,e=null===u[0]?1:0;h=u[e],c=Qs(h);for(let n=e;n<t;n++)d?et(Qs(u[n])===d):d=Qs(u[n])}else d=Qs(u);if(c!==d)if(ai(c)&&ai(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof u?e[i]=parseFloat(u):Array.isArray(u)&&d===p&&(e[i]=u.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===h||0===u)?0===h?l.set(d.transform(h)):e[i]=c.transform(u):(r||(o=function(t){const e=[];return ui.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(i),s[i]=void 0!==s[i]?s[i]:e[i],l.jump(u))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const s=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:r}=o,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=di[t](s,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=di[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),A&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:s}}return{target:e,transitionEnd:s}};function mi(t,e,n,s){return(t=>Object.keys(t).some(ri))(e)?pi(t,e,n,s):{target:e,transitionEnd:s}}const fi=(t,e,n,s)=>{const i=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!y(e))return;const n=Xs(e,s);n&&t.set(n)});for(const t in e){const i=e[t];if(!y(i))continue;const o=Xs(i,s);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,s);return mi(t,e=i.target,n,s=i.transitionEnd)},gi={current:null},yi={current:!1};function vi(t){return Boolean(d(t)&&t.add)}const xi=Object.keys(C),Pi=xi.length,Ti=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],bi=M.length;class Si extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>dt.render(this.render,!1,!0);const{latestValues:r,renderState:a}=i;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=E(e),this.isVariantNode=w(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==r[t]&&d(e)&&(e.set(r[t],!1),vi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),yi.current||function(){if(yi.current=!0,A)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gi.current=t.matches;t.addListener(e),e()}else gi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||gi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pt.update(this.notifyUpdate),pt.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=h.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&dt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,i,o){let r,a;for(let t=0;t<Pi;t++){const n=xi[t],{isEnabled:s,Feature:i,ProjectionNode:o,MeasureLayout:l}=C[n];o&&(r=o),s(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&u(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,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;e<Ti.length;e++){const n=Ti[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(d(o))t.addValue(i,o),vi(s)&&s.add(i);else if(d(r))t.addValue(i,Kn(o,{owner:t})),vi(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Kn(void 0!==e?e:o,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<bi;t++){const n=M[t],s=this.props[n];(D(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(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 n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Kn(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=T(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||d(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Yn),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{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:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},i){let o=function(t,e,n){const s={};for(const i in t){const t=ii(i,e);if(void 0!==t)s[i]=t;else{const t=n.getValue(i);t&&(s[i]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),o&&(o=s(o))),i){!function(t,e,n){var s,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),r=o.length;if(r)for(let a=0;a<r;a++){const r=o[a],l=e[r];let h=null;Array.isArray(l)&&(h=l[0]),null===h&&(h=null!==(i=null!==(s=n[r])&&void 0!==s?s:t.readValue(r))&&void 0!==i?i:e[r]),null!=h&&("string"==typeof h&&(/^\-?\d*\.?\d+$/.test(h)||Zs(h))?h=parseFloat(h):!ei(h)&&Fe.test(l)&&(h=In(r,l)),t.addValue(r,Kn(h,{owner:t})),void 0===n[r]&&(n[r]=h),null!==h&&t.setBaseTarget(r,h))}}(this,n,o);const t=fi(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Vi extends Si{readValueFromInstance(t,e){if(h.has(e)){const t=Fn(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(L(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return pe(t,e)}build(t,e,n,s){R(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return k(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;d(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){j(t,e,n,s)}}class Ai extends X.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;F(wi),i&&(e.group&&e.group.add(i),n&&n.register&&s&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),m.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:s,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,s||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||dt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ei(t){const[e,n]=function(){const t=K(B);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=Z();return _(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),s=K(I);return X.createElement(Ai,{...t,layoutGroup:s,switchLayoutGroup:K(U),isPresent:e,safeToRemove:n})}const wi={borderRadius:{...qs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qs,borderTopRightRadius:qs,borderBottomLeftRadius:qs,borderBottomRightRadius:qs,boxShadow:Ks},Ci={pan:{Feature:class extends J{constructor(){super(...arguments),this.removePointerDownListener=Q}onPointerDown(t){this.session=new Vt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,s&&s(t,e)}}}mount(){this.removePointerDownListener=Pt(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 J{constructor(t){super(t),this.removeGroupControls=Q,this.removeListeners=Q,this.controls=new Gn(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Q}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Hs,MeasureLayout:Ei}},Di={layout:{ProjectionNode:Hs,MeasureLayout:Ei}};function Mi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Li="data-"+O("framerAppearId");function Ri(t,e,n={}){const s=ni(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>ki(t,s,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(ji).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(Ri(t,e,{...o,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+s,r,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function ki(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(o=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e),i=a[e];if(!s||void 0===i||u&&Bi(u,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[Li];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,s,dt))}let d=s.start($n(e,s,i,t.shouldReduceMotion&&h.has(e)?{type:!1}:r));vi(l)&&(l.add(e),d=d.then(()=>l.remove(e))),c.push(d)}return Promise.all(c).then(()=>{r&&function(t,e){const n=ni(t,e);let{transitionEnd:s={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...s};for(const e in o){si(t,e,b(o[e]))}}(t,r)})}function ji(t,e){return t.sortNodePosition(e)}function Bi({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const Fi=[...N].reverse(),Ii=N.length;function Ui(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Ri(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=Ri(t,e,n);else{const i="function"==typeof e?ni(t,e,n.custom):e;s=ki(t,i,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Oi(t){let e=Ui(t);const n={animate:$i(!0),whileInView:$i(),whileHover:$i(),whileTap:$i(),whileDrag:$i(),whileFocus:$i(),exit:$i()};let s=!0;const i=(e,n)=>{const s=ni(t,n);if(s){const{transition:t,transitionEnd:n,...i}=s;e={...e,...i,...n}}return e};function o(o,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},h=[],c=new Set;let u={},d=1/0;for(let e=0;e<Ii;e++){const p=Fi[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=D(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&s&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...u},!m.isActive&&null===y||!f&&!m.prevProp||$(f)||"boolean"==typeof f)continue;const x=Ni(m.prevProp,f);let P=x||p===r&&m.isActive&&!v&&g||e>d&&g;const T=Array.isArray(f)?f:[f];let b=T.reduce(i,{});!1===y&&(b={});const{prevResolvedValues:S={}}=m,A={...S,...b},E=t=>{P=!0,c.delete(t),m.needsAnimating[t]=!0};for(const t in A){const e=b[t],n=S[t];u.hasOwnProperty(t)||(e!==n?V(e)&&V(n)?!Mi(e,n)||x?E(t):m.protectedKeys[t]=!0:void 0!==e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=b,m.isActive&&(u={...u,...b}),s&&t.blockInitialAnimation&&(P=!1),P&&!v&&h.push(...T.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),h.push({animation:e})}let p=Boolean(h.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,s,i){var r;if(n[e].isActive===s)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Ni(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Mi(e,t)}function $i(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let zi=0;const Gi={animation:{Feature:class extends J{constructor(t){super(t),t.animationState||(t.animationState=Oi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),$(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends J{constructor(){super(...arguments),this.id=zi++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function Hi(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return Pt(t.current,n,(n,i)=>{if("touch"===n.type||Bt())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[s]&&o[s](n,i)},{passive:!t.getProps()[s]})}const Wi=(t,e)=>!!e&&(t===e||Wi(t,e.parentElement));function qi(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,st(n))}const Yi=new WeakMap,Xi=new WeakMap,Ki=t=>{const e=Yi.get(t.target);e&&e(t)},Zi=t=>{t.forEach(Ki)};function _i(t,e,n){const s=function({root:t,...e}){const n=t||document;Xi.has(n)||Xi.set(n,{});const s=Xi.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Zi,{root:t,...e})),s[i]}(e);return Yi.set(t,n),s.observe(t),()=>{Yi.delete(t),s.unobserve(t)}}const Ji={some:0,all:1};const Qi={inView:{Feature:class extends J{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Ji[s]};return _i(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),o=e?n:s;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends J{constructor(){super(...arguments),this.removeStartListeners=Q,this.removeEndListeners=Q,this.removeAccessibleListeners=Q,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=Pt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();Wi(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),i=Pt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=bt(s,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=xt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=xt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&qi("up",this.node.getProps().onTap)}),qi("down",(t,e)=>{this.startPress(t,e)})}),e=xt(this.node.current,"blur",()=>{this.isPressing&&qi("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=bt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Bt()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=Pt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=xt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=bt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends J{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=bt(xt(this.node.current,"focus",()=>this.onFocus()),xt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends J{mount(){this.unmount=bt(Hi(this.node,!0),Hi(this.node,!1))}unmount(){}}}};class to extends Si{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(h.has(e)){const t=Fn(e);return t&&t.default||0}return e=z.has(e)?e:O(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return G(t,e)}build(t,e,n,s){H(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){W(t,e,n,s)}mount(t){this.isSVGTag=q(t.tagName),super.mount(t)}}const eo={...{renderer:(t,e)=>Y(t)?new to(e,{enableHardwareAcceleration:!1}):new Vi(e,{enableHardwareAcceleration:!0}),...Gi,...Qi},...Ci,...Di};export{eo as domMax};
1
+ import{t,u as e,v as n,w as s,x as i,y as o,z as r,A as a,B as l,C as h,D as c,a as u,d,E as p,g as m,r as f,F as g,G as y,H as v,I as x,J as P,o as T,K as b,M as S,N as V,i as A,b as E,m as w,f as C,c as D,O as M,Q as L,h as R,q as k,R as j,P as B,T as F,L as I,S as U,U as O,V as N,n as $,W as z,s as G,j as H,p as W,k as q,l as Y}from"./size-rollup-dom-max-assets.js";import X,{useContext as K,useId as Z,useEffect as _}from"react";class J{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Q=t=>t;let tt=Q,et=Q;const nt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function st(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const it="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ot="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(it()),1/60*1e3);const rt={delta:0,timestamp:0};let at=!0,lt=!1,ht=!1;const ct=["read","update","preRender","render","postRender"],ut=ct.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,h=l?e:n;return o&&r.add(t),-1===h.indexOf(t)&&(h.push(t),l&&i&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(l),r.has(s)&&(a.schedule(s),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>lt=!0),t),{}),dt=ct.reduce((t,e)=>{const n=ut[e];return t[e]=(t,e=!1,s=!1)=>(lt||yt(),n.schedule(t,e,s)),t},{}),pt=ct.reduce((t,e)=>(t[e]=ut[e].cancel,t),{}),mt=ct.reduce((t,e)=>(t[e]=()=>ut[e].process(rt),t),{}),ft=t=>ut[t].process(rt),gt=t=>{lt=!1,rt.delta=at?1/60*1e3:Math.max(Math.min(t-rt.timestamp,40),1),rt.timestamp=t,ht=!0,ct.forEach(ft),ht=!1,lt&&(at=!1,ot(gt))},yt=()=>{lt=!0,at=!0,ht||ot(gt)},vt=t=>1e3*t;function xt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Pt(t,e,n,s){return xt(t,e,(t=>e=>nt(e)&&t(e,st(e)))(n),s)}const Tt=(t,e)=>n=>e(t(n)),bt=(...t)=>t.reduce(Tt),St=(t,e)=>Math.abs(t-e);class Vt{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=wt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=St(t.x,e.x),s=St(t.y,e.y);return Math.sqrt(n**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:s}=t,{timestamp:i}=rt;this.history.push({...s,timestamp:i});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=At(e,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:s}=this.handlers,i=wt("pointercancel"===t.type?this.lastMoveEventInfo:At(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),s&&s(t,i)},!nt(t))return;this.handlers=e,this.transformPagePoint=n;const s=At(st(t),this.transformPagePoint),{point:i}=s,{timestamp:o}=rt;this.history=[{...i,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,wt(s,this.history)),this.removeListeners=bt(Pt(window,"pointermove",this.handlePointerMove),Pt(window,"pointerup",this.handlePointerUp),Pt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pt.update(this.updatePoint)}}function At(t,e){return e?{point:e(t.point)}:t}function Et(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wt({point:t},e){return{point:t,delta:Et(t,Dt(e)),offset:Et(t,Ct(e)),velocity:Mt(e,.1)}}function Ct(t){return t[0]}function Dt(t){return t[t.length-1]}function Mt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Dt(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>vt(e)));)n--;if(!s)return{x:0,y:0};const o=(i.timestamp-s.timestamp)/1e3;if(0===o)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Lt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Rt=Lt("dragHorizontal"),kt=Lt("dragVertical");function jt(t){let e=!1;if("y"===t)e=kt();else if("x"===t)e=Rt();else{const t=Rt(),n=kt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Bt(){const t=jt(!0);return!t||(t(),!1)}const Ft=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},It=(t,e,n)=>-n*t+n*e+t;function Ut(t){return t.max-t.min}function Ot(t,e=0,n=.01){return Math.abs(t-e)<=n}function Nt(t,e,n,s=.5){t.origin=s,t.originPoint=It(e.min,e.max,t.origin),t.scale=Ut(n)/Ut(e),(Ot(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=It(n.min,n.max,t.origin)-t.originPoint,(Ot(t.translate)||isNaN(t.translate))&&(t.translate=0)}function $t(t,e,n,s){Nt(t.x,e.x,n.x,s?s.originX:void 0),Nt(t.y,e.y,n.y,s?s.originY:void 0)}function zt(t,e,n){t.min=n.min+e.min,t.max=t.min+Ut(e)}function Gt(t,e,n){t.min=e.min-n.min,t.max=t.min+Ut(e)}function Ht(t,e,n){Gt(t.x,e.x,n.x),Gt(t.y,e.y,n.y)}function Wt(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function qt(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}const Yt=.35;function Xt(t,e,n){return{min:Kt(t,e),max:Kt(t,n)}}function Kt(t,e){return"number"==typeof t?t:t[e]||0}function Zt(t){return[t("x"),t("y")]}function _t({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Jt(t){return void 0===t||1===t}function Qt({scale:t,scaleX:e,scaleY:n}){return!Jt(t)||!Jt(e)||!Jt(n)}function te(t){return Qt(t)||ee(t)||t.z||t.rotate||t.rotateX||t.rotateY}function ee(t){return ne(t.x)||ne(t.y)}function ne(t){return t&&"0%"!==t}function se(t,e,n){return n+e*(t-n)}function ie(t,e,n,s,i){return void 0!==i&&(t=se(t,i,s)),se(t,n,s)+e}function oe(t,e=0,n=1,s,i){t.min=ie(t.min,e,n,s,i),t.max=ie(t.max,e,n,s,i)}function re(t,{x:e,y:n}){oe(t.x,e.translate,e.scale,e.originPoint),oe(t.y,n.translate,n.scale,n.originPoint)}function ae(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function le(t,e){t.min=t.min+e,t.max=t.max+e}function he(t,e,[n,s,i]){const o=void 0!==e[i]?e[i]:.5,r=It(t.min,t.max,o);oe(t,e[n],e[s],r,e.scale)}const ce=["x","scaleX","originX"],ue=["y","scaleY","originY"];function de(t,e){he(t.x,e,ce),he(t.y,e,ue)}function pe(t,e){return _t(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}const me=!1,fe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ge=t=>e=>1-t(1-e),ye=t=>t*t,ve=ge(ye),xe=fe(ye),Pe=(t,s)=>i=>Boolean(e(i)&&n.test(i)&&i.startsWith(t)||s&&Object.prototype.hasOwnProperty.call(i,s)),Te=(t,n,i)=>o=>{if(!e(o))return o;const[r,a,l,h]=o.match(s);return{[t]:parseFloat(r),[n]:parseFloat(a),[i]:parseFloat(l),alpha:void 0!==h?parseFloat(h):1}},be={...r,transform:e=>Math.round((e=>t(0,255,e))(e))},Se={test:Pe("rgb","red"),parse:Te("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+be.transform(t)+", "+be.transform(e)+", "+be.transform(n)+", "+i(o.transform(s))+")"};const Ve={test:Pe("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Se.transform},Ae={test:Pe("hsl","hue"),parse:Te("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+a.transform(i(e))+", "+a.transform(i(n))+", "+i(o.transform(s))+")"},Ee={test:t=>Se.test(t)||Ve.test(t)||Ae.test(t),parse:t=>Se.test(t)?Se.parse(t):Ae.test(t)?Ae.parse(t):Ve.parse(t),transform:t=>e(t)?t:t.hasOwnProperty("red")?Se.transform(t):Ae.transform(t)};function we(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Ce=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},De=[Ve,Se,Ae];function Me(t){const e=(n=t,De.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Ae&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,o=0,r=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=we(a,s,t+1/3),o=we(a,s,t),r=we(a,s,t-1/3)}else i=o=r=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const Le=(t,e)=>{const n=Me(t),s=Me(e),i={...n};return t=>(i.red=Ce(n.red,s.red,t),i.green=Ce(n.green,s.green,t),i.blue=Ce(n.blue,s.blue,t),i.alpha=It(n.alpha,s.alpha,t),Se.transform(i))};function Re(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(l);o&&(n=o.length,t=t.replace(l,"${c}"),e.push(...o.map(Ee.parse)));const a=t.match(s);return a&&(i=a.length,t=t.replace(s,"${n}"),e.push(...a.map(r.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function ke(t){return Re(t).values}function je(t){const{values:e,numColors:n,tokenised:s}=Re(t),o=e.length;return t=>{let e=s;for(let s=0;s<o;s++)e=e.replace(s<n?"${c}":"${n}",s<n?Ee.transform(t[s]):i(t[s]));return e}}const Be=t=>"number"==typeof t?0:t;const Fe={test:function(t){var n,i;return isNaN(t)&&e(t)&&((null===(n=t.match(s))||void 0===n?void 0:n.length)||0)+((null===(i=t.match(l))||void 0===i?void 0:i.length)||0)>0},parse:ke,createTransformer:je,getAnimatableNone:function(t){const e=ke(t);return je(t)(e.map(Be))}};function Ie(t,e){return"number"==typeof t?n=>It(t,e,n):Ee.test(t)?Le(t,e):Ne(t,e)}const Ue=(t,e)=>{const n=[...t],s=n.length,i=t.map((t,n)=>Ie(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}},Oe=(t,e)=>{const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Ie(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}},Ne=(t,e)=>{const n=Fe.createTransformer(e),s=Re(t),i=Re(e);return s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?bt(Ue(s.values,i.values),n):n=>""+(n>0?e:t)},$e=(t,e)=>n=>It(t,e,n);function ze(t,e,n){const s=[],i=n||("number"==typeof(o=t[0])?$e:"string"==typeof o?Ee.test(o)?Le:Ne:Array.isArray(o)?Ue:"object"==typeof o?Oe:$e);var o;const r=t.length-1;for(let n=0;n<r;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=bt(t,o)}s.push(o)}return s}function Ge(e,n,{clamp:s=!0,ease:i,mixer:o}={}){const r=e.length;et(r===n.length),et(!i||!Array.isArray(i)||i.length===r-1),e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const a=ze(n,i,o),l=a.length,h=t=>{let n=0;if(l>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=Ft(e[n],e[n+1],t);return a[n](s)};return s?n=>h(t(e[0],e[r-1],n)):h}function He(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(It(n,1,i))}}(e,t.length-1),e}const We=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function qe(t,e,n,s){if(t===e&&n===s)return Q;const i=e=>function(t,e,n,s,i){let o,r,a=0;do{r=e+(n-e)/2,o=We(r,s,i)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:We(i(t),e,s)}const Ye=t=>1-Math.sin(Math.acos(t)),Xe=ge(Ye),Ke=fe(Xe),Ze=qe(.33,1.53,.69,.99),_e=ge(Ze),Je=fe(_e),Qe={linear:Q,easeIn:ye,easeInOut:xe,easeOut:ve,circIn:Ye,circInOut:Ke,circOut:Xe,backIn:_e,backInOut:Je,backOut:Ze,anticipate:t=>(t*=2)<1?.5*_e(t):.5*(2-Math.pow(2,-10*(t-1)))},tn=t=>{if(Array.isArray(t)){et(4===t.length);const[e,n,s,i]=t;return qe(e,n,s,i)}return"string"==typeof t?Qe[t]:t};function en({keyframes:t,ease:e=xe,times:n,duration:s=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(tn):tn(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:He(t),s);function a(){return Ge(r,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||xe).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=s,o),flipTarget:()=>{t.reverse(),l=a()}}}function nn({duration:e=800,bounce:n=.25,velocity:s=0,mass:i=1}){let o,r;tt(e<=1e4);let a=1-n;a=t(.05,1,a),e=t(.01,10,e/1e3),a<1?(o=t=>{const n=t*a,i=n*e;return.001-(n-s)/sn(t,a)*Math.exp(-i)},r=t=>{const n=t*a*e,i=n*s+s,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),h=sn(Math.pow(t,2),a);return(.001-o(t)>0?-1:1)*((i-r)*l)/h}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(s-t)));const l=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(o,r,5/e);if(e*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(l,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}function sn(t,e){return t*Math.sqrt(1-e*e)}function on(t,e){return e?t*(1e3/e):0}const rn=["duration","bounce"],an=["stiffness","damping","mass"];function ln(t,e){return e.some(e=>void 0!==t[e])}function hn({keyframes:t,restDelta:e,restSpeed:n,...s}){let i=t[0],o=t[t.length-1];const r={done:!1,value:i},{stiffness:a,damping:l,mass:h,velocity:c,duration:u,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!ln(t,an)&&ln(t,rn)){const n=nn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let p=cn,m=c?-c/1e3:0;const f=l/(2*Math.sqrt(a*h));function g(){const t=o-i,s=Math.sqrt(a/h)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=sn(s,f);p=n=>{const i=Math.exp(-f*s*n);return o-i*((m+f*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>o-Math.exp(-s*e)*(t+(m+s*t)*e);else{const e=s*Math.sqrt(f*f-1);p=n=>{const i=Math.exp(-f*s*n),r=Math.min(e*n,300);return o-i*((m+f*s*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const s=p(t);if(d)r.done=t>=u;else{let i=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);i=on(s-p(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(o-s)<=e;r.done=a&&l}return r.value=r.done?o:s,r},flipTarget:()=>{m=-m,[i,o]=[o,i],g()}}}hn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const cn=t=>0;const un={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:i=.5,modifyTarget:o}){const r=t[0],a={done:!1,value:r};let l=n*e;const h=r+l,c=void 0===o?h:o(h);return c!==h&&(l=c-r),{next:t=>{const e=-l*Math.exp(-t/s);return a.done=!(e>i||e<-i),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:en,tween:en,spring:hn};function dn(t,e,n=0){return t-e-n}const pn=t=>{const e=({delta:e})=>t(e);return{start:()=>dt.update(e,!0),stop:()=>pt.update(e)}};function mn({duration:t,driver:e=pn,elapsed:n=0,repeat:s=0,repeatType:i="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:h,onComplete:c,onRepeat:u,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,T=!0;const b=un[r.length>2?"keyframes":p]||en,S=r[0],V=r[r.length-1];let A={done:!1,value:S};const{needsInterpolation:E}=b;E&&E(S,V)&&(y=Ge([0,100],[S,V],{clamp:!1}),r=[0,100]);const w=b({...m,duration:t,keyframes:r});function C(){v++,"reverse"===i?(T=v%2==0,n=function(t,e=0,n=0,s=!0){return s?dn(e+-t,e,n):e-(t-e)+n}(n,x,o,T)):(n=dn(n,x,o),"mirror"===i&&w.flipTarget()),P=!1,u&&u()}function D(t){T||(t=-t),n+=t,P||(A=w.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=T?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,x,o,T)&&C():(g&&g.stop(),c&&c()))}return a&&(l&&l(),g=e(D),g.start()),{stop:()=>{h&&h(),g&&g.stop()},set currentTime(t){n=f,D(t)},sample:(e,s=!1)=>{if(n=f,s)return D(e),A;const i=t&&"number"==typeof t?Math.max(.5*t,50):50;let o=0;for(D(0);o<=e;){const t=e-o;D(Math.min(t,i)),o+=i}return A}}}const fn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,gn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function yn(t){if(t)return Array.isArray(t)?fn(t):gn[t]}const vn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},xn={},Pn={};for(const t in vn)Pn[t]=()=>(void 0===xn[t]&&(xn[t]=vn[t]()),xn[t]);const Tn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),bn=(t,e)=>{return"spring"===e.type||"backgroundColor"===t||!(!(n=e.ease)||Array.isArray(n)||"string"==typeof n&&gn[n]);var n};function Sn(t,e,{onUpdate:n,onComplete:s,...i}){if(!(Pn.waapi()&&Tn.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=i;if(bn(e,i)){const t=mn({...i,repeat:0,elapsed:0});let e={done:!1,value:o[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s,!0),n.push(e.value),s+=10;o=n,r=s-10,l="linear"}const h=function(t,e,n,{delay:s=0,duration:i,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const h={[e]:n};return l&&(h.offset=l),t.animate(h,{delay:s,duration:i,easing:yn(a),fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(t.owner.current,e,o,{...i,delay:-a,duration:r,ease:l});return h.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,i)),dt.update(()=>h.cancel()),s&&s()},{get currentTime(){return h.currentTime||0},set currentTime(t){h.currentTime=t},stop:()=>{const{currentTime:e}=h;if(e){const n=mn({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}dt.update(()=>h.cancel())}}}function Vn(t,e){const n=performance.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(pt.read(s),t(o-e))};return dt.read(s,!0),()=>pt.read(s)}function An({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const i=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:Vn(i,-e)}:i()}const En={type:"spring",stiffness:500,damping:25,restSpeed:10},wn={type:"keyframes",duration:.8},Cn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Dn=(t,{keyframes:e})=>e.length>2?wn:h.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:En:Cn,Mn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Fe.test(e)||e.startsWith("url("))),Ln=new Set(["brightness","contrast","saturate","opacity"]);function Rn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(s)||[];if(!i)return t;const o=n.replace(i,"");let r=Ln.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+o+")"}const kn=/([a-z-]*)\(.*?\)/g,jn={...Fe,getAnimatableNone:t=>{const e=t.match(kn);return e?e.map(Rn).join(" "):t}},Bn={...c,color:Ee,backgroundColor:Ee,outlineColor:Ee,fill:Ee,stroke:Ee,borderColor:Ee,borderTopColor:Ee,borderRightColor:Ee,borderBottomColor:Ee,borderLeftColor:Ee,filter:jn,WebkitFilter:jn},Fn=t=>Bn[t];function In(t,e){let n=Fn(t);return n!==jn&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function Un(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function On(t){return"number"==typeof t?0:In("",t)}function Nn(t,e){return t[e]||t.default||t}const $n=(t,e,n,s={})=>i=>{const o=Nn(s,t)||{},r=o.delay||s.delay||0;let{elapsed:a=0}=s;a-=vt(r);const l=function(t,e,n,s){const i=Mn(e,n);let o=void 0!==s.from?s.from:t.get();return"none"===o&&i&&"string"==typeof n?o=In(e,n):Un(o)&&"string"==typeof n?o=On(n):!Array.isArray(n)&&Un(n)&&"string"==typeof o&&(n=On(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),h=l[0],c=l[l.length-1],u=Mn(t,h),d=Mn(t,c);let p={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!u||!d||me||!1===o.type)return An(p);if("inertia"===o.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:i=.8,timeConstant:o=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:h,driver:c,onUpdate:u,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==s&&t>s}function y(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function v(t){f&&f.stop(),f=mn({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{u&&u(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=i*e+m;void 0!==h&&(t=h(t));const s=y(t),r=s===n?-1:1;let a,c;const u=t=>{a=c,c=t,e=on(t-a,rt.delta),(1===r&&t>s||-1===r&&t<s)&&x({keyframes:[t,s],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:i,restDelta:l,modifyTarget:h,onUpdate:g(t)?u:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...c}){return!!Object.keys(c).length}(o)||(p={...p,...Dn(t,p)}),p.duration&&(p.duration=vt(p.duration)),p.repeatDelay&&(p.repeatDelay=vt(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=Sn(e,t,p);if(n)return n}return mn(p)},zn=new WeakMap;class Gn{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;this.panSession=new Vt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(st(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:s,onDragStart:i}=this.getProps();if(n&&!s&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=jt(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zt(t=>{let e=this.getAxisMotionValue(t).get()||0;if(a.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const s=n.layout.layoutBox[t];if(s){e=Ut(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),i&&i(t,e);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:s,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&i&&i(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.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&i(t,e)}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:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!Hn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},s){return void 0!==e&&t<e?t=s?It(e,t,s.min):Math.max(t,e):void 0!==n&&t>n&&(t=s?It(n,t,s.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},s=this.constraints;t&&u(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:s,right:i}){return{x:Wt(t.x,n,i),y:Wt(t.y,e,s)}}(n.layoutBox,t),this.elastic=function(t=Yt){return!1===t?t=0:!0===t&&(t=Yt),{x:Xt(t,"left","right"),y:Xt(t,"top","bottom")}}(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Zt(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!u(t))return!1;const n=t.current;et(null!==n);const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=function(t,e,n){const s=pe(t,n),{scroll:i}=e;return i&&(le(s.x,i.offset.x),le(s.y,i.offset.y)),s}(n,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:qt(t.x,e.x),y:qt(t.y,e.y)}}(s.layout.layoutBox,i);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=_t(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Zt(r=>{if(!Hn(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,c=s?40:1e7,u={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(r,u)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start($n(t,n,0,e))}stopAnimation(){Zt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),s=n[e];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Zt(e=>{const{drag:n}=this.getProps();if(!Hn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:n,max:o}=s.layout.layoutBox[e];i.set(t[e]-It(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!u(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Zt(e=>{const n=this.getAxisMotionValue(e);if(n){const s=n.get();i[e]=function(e,n){let s=.5;const i=Ut(e),o=Ut(n);return o>i?s=Ft(n.min,n.max-i,e.min):i>o&&(s=Ft(e.min,e.max-o,n.min)),t(0,1,s)}({min:s,max:s},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Zt(t=>{if(!Hn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:s,max:o}=this.constraints[t];n.set(It(s,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;zn.set(this.visualElement,this);const t=Pt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();u(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,s=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=xt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Zt(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Yt,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:r}}}function Hn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Wn(t,e){-1===t.indexOf(e)&&t.push(e)}function qn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Yn{constructor(){this.subscriptions=[]}add(t){return Wn(this.subscriptions,t),()=>qn(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Xn{constructor(t,e={}){var n;this.version="10.0.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=rt;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,dt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>dt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Yn);const n=this.events[t].add(e);return"change"===t?()=>{n(),dt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?on(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Kn(t,e){return new Xn(t,e)}const Zn=["TopLeft","TopRight","BottomLeft","BottomRight"],_n=Zn.length,Jn=t=>"string"==typeof t?parseFloat(t):t,Qn=t=>"number"==typeof t||p.test(t);function ts(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const es=ss(0,.5,Xe),ns=ss(.5,.95,Q);function ss(t,e,n){return s=>s<t?0:s>e?1:n(Ft(t,e,s))}function is(t,e){t.min=e.min,t.max=e.max}function os(t,e){is(t.x,e.x),is(t.y,e.y)}function rs(t,e,n,s,i){return t=se(t-=e,1/n,s),void 0!==i&&(t=se(t,1/i,s)),t}function as(t,e,[n,s,i],o,r){!function(t,e=0,n=1,s=.5,i,o=t,r=t){if(a.test(e)){e=parseFloat(e);e=It(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let l=It(o.min,o.max,s);t===o&&(l-=e),t.min=rs(t.min,e,n,l,i),t.max=rs(t.max,e,n,l,i)}(t,e[n],e[s],e[i],e.scale,o,r)}const ls=["x","scaleX","originX"],hs=["y","scaleY","originY"];function cs(t,e,n,s){as(t.x,e,ls,n?n.x:void 0,s?s.x:void 0),as(t.y,e,hs,n?n.y:void 0,s?s.y:void 0)}function us(t){return 0===t.translate&&1===t.scale}function ds(t){return us(t.x)&&us(t.y)}function ps(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function ms(t){return Ut(t.x)/Ut(t.y)}class fs{constructor(){this.members=[]}add(t){Wn(this.members,t),t.scheduleRender()}remove(t){if(qn(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 n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gs(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(s=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(s+=`rotate(${t}deg) `),e&&(s+=`rotateX(${e}deg) `),i&&(s+=`rotateY(${i}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(s+=`scale(${r}, ${a})`),s||"none"}const ys=(t,e)=>t.depth-e.depth;class vs{constructor(){this.children=[],this.isDirty=!1}add(t){Wn(this.children,t),this.isDirty=!0}remove(t){qn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ys),this.isDirty=!1,this.children.forEach(t)}}const xs=["","X","Y","Z"];let Ps=0;const Ts={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function bs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(t,n={},s=(null==e?void 0:e())){this.id=Ps++,this.animationId=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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;Ts.totalNodes=Ts.resolvedTargetDeltas=Ts.recalculatedProjection=0,this.nodes.forEach(As),this.nodes.forEach(Ls),this.nodes.forEach(Rs),this.nodes.forEach(Es),t=Ts,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new vs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Yn),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:s,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(i||s)&&(this.isLayoutDirty=!0),t){let n;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Vn(s,250),m.hasAnimatedSinceResize&&(m.hasAnimatedSinceResize=!1,this.nodes.forEach(Ms))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&o&&(s||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||o.getDefaultTransition()||Us,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!ps(this.targetLayout,s)||n,h=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...Nn(i,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Ms(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}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,pt.preRender(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(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Cs);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Os),this.potentialNodes.clear()),this.nodes.forEach(Ds),this.nodes.forEach(Ss),this.nodes.forEach(Vs),this.clearAllSnapshots(),mt.update(),mt.preRender(),mt.render())}clearAllSnapshots(){this.nodes.forEach(ws),this.sharedNodes.forEach(js)}scheduleUpdateProjection(){dt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}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;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ds(this.projectionDelta),n=this.getTransformTemplate(),s=n?n(this.latestValues,""):void 0,o=s!==this.prevTransformTemplateValue;t&&(e||te(this.latestValues)||o)&&(i(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var s;return t&&(n=this.removeTransform(n)),Ns((s=n).x),Ns(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(le(e.x,n.offset.x),le(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};os(e,t);for(let n=0;n<this.path.length;n++){const s=this.path[n],{scroll:i,options:o}=s;if(s!==this.root&&i&&o.layoutScroll){if(i.isRoot){os(e,t);const{scroll:n}=this.root;n&&(le(e.x,-n.offset.x),le(e.y,-n.offset.y))}le(e.x,i.offset.x),le(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};os(n,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&de(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),te(s.latestValues)&&de(n,s.latestValues)}return te(this.latestValues)&&de(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};os(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!te(n.latestValues))continue;Qt(n.latestValues)&&n.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};os(s,n.measurePageBox()),cs(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,s)}return te(this.latestValues)&&cs(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);if(!((Boolean(this.resumingFrom)||this!==e)&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:n,layoutId:s}=this.options;if(this.layout&&(n||s)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ht(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),os(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,o,r;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(i=this.target,o=this.relativeTarget,r=this.relativeParent.target,zt(i.x,o.x,r.x),zt(i.y,o.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):os(this.target,this.layout.layoutBox),re(this.target,this.targetDelta)):os(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ht(this.relativeTargetOrigin,this.target,t.target),os(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ts.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Qt(this.parent.latestValues)&&!ee(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let s=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(s=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),s)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;os(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,s=!1){const i=n.length;if(!i)return;let o,r;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&de(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,re(t,r)),s&&te(o.latestValues)&&de(t,o.latestValues))}e.x=ae(e.x),e.y=ae(e.y)}(this.layoutCorrected,this.treeScale,this.path,n);const{target:r}=e;if(!r)return;this.projectionDelta||(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}});const a=this.treeScale.x,l=this.treeScale.y,h=this.projectionTransform;$t(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=gs(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===a&&this.treeScale.y===l||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r)),Ts.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,s=n?n.latestValues:{},i={...this.latestValues},o={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=!e;const r={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(),c=!h||h.members.length<=1,u=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(Is));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var h,p,m,f;Bs(o.x,t.x,n),Bs(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ht(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=r,f=n,Fs(h.x,p.x,m.x,f),Fs(h.y,p.y,m.y,f),d&&ps(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),os(d,this.relativeTarget)),l&&(this.animationValues=i,function(t,e,n,s,i,o){i?(t.opacity=It(0,void 0!==n.opacity?n.opacity:1,es(s)),t.opacityExit=It(void 0!==e.opacity?e.opacity:1,0,ns(s))):o&&(t.opacity=It(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,s));for(let i=0;i<_n;i++){const o=`border${Zn[i]}Radius`;let r=ts(e,o),l=ts(n,o);if(void 0===r&&void 0===l)continue;r||(r=0),l||(l=0);0===r||0===l||Qn(r)===Qn(l)?(t[o]=Math.max(It(Jn(r),Jn(l),s),0),(a.test(l)||a.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||n.rotate)&&(t.rotate=It(e.rotate||0,n.rotate||0,s))}(i,s,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{m.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const s=d(t)?t:Kn(t);return s.start($n("",s,e,n)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},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:n,layout:s,latestValues:i}=t;if(e&&n&&s){if(this!==t&&this.layout&&s&&$s(this.options.animationType,this.layout.layoutBox,s.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ut(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const s=Ut(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+s}os(e,n),de(e,i),$t(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new fs);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const s=this.getStack();s&&s.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const s={};for(let e=0;e<xs.length;e++){const i="rotate"+xs[e];n[i]&&(s[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in s)t.setStaticValue(e,s[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const s={};if(!this.instance||this.isSVG)return s;if(!this.isVisible)return{visibility:"hidden"};s.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=f(t.pointerEvents)||"",s.transform=i?i(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=f(t.pointerEvents)||""),this.hasProjected&&!te(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=gs(this.projectionDeltaWithTransform,this.treeScale,r),i&&(s.transform=i(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in g){if(void 0===r[t])continue;const{correct:e,applyTo:n}=g[t],i="none"===s.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)s[n[e]]=i}else s[t]=i}return this.options.layoutId&&(s.pointerEvents=o===this?f(t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Cs),this.root.sharedNodes.clear()}}}function Ss(t){t.updateLayout()}function Vs(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?Zt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=Ut(s);s.min=e[t].min,s.max=s.min+i}):$s(i,n.layoutBox,e)&&Zt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=Ut(e[t]);s.max=s.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};$t(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?$t(a,t.applyTransform(s,!0),n.measuredBox):$t(a,e,n.layoutBox);const l=!ds(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:i,layout:o}=s;if(i&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ht(r,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ht(a,e,o.layoutBox),ps(r,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function As(t){Ts.totalNodes++,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 Es(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ws(t){t.clearSnapshot()}function Cs(t){t.clearMeasurements()}function Ds(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ms(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Ls(t){t.resolveTargetDelta()}function Rs(t){t.calcProjection()}function ks(t){t.resetRotation()}function js(t){t.removeLeadSnapshot()}function Bs(t,e,n){t.translate=It(e.translate,0,n),t.scale=It(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Fs(t,e,n,s){t.min=It(e.min,n.min,s),t.max=It(e.max,n.max,s)}function Is(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Us={duration:.45,ease:[.4,0,.1,1]};function Os(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const s=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);s&&t.mount(s,!0)}function Ns(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function $s(t,e,n){return"position"===t||"preserve-aspect"===t&&!Ot(ms(e),ms(n),.2)}const zs=bs({attachResizeListener:(t,e)=>xt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Gs={current:void 0},Hs=bs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Gs.current){const t=new zs(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Gs.current=t}return Gs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Ws(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const qs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!p.test(t))return t;t=parseFloat(t)}return`${Ws(t,e.target.x)}% ${Ws(t,e.target.y)}%`}},Ys=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Xs(t,e,n=1){const[s,i]=function(t){const e=Ys.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);return o?o.trim():y(i)?Xs(i,e,n+1):i}const Ks={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=t.includes("var("),o=[];i&&(t=t.replace(Ys,t=>(o.push(t),"_$css")));const r=Fe.parse(t);if(r.length>5)return s;const a=Fe.createTransformer(t),l="number"!=typeof r[0]?1:0,h=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=h,r[1+l]/=c;const u=It(h,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=u),"number"==typeof r[3+l]&&(r[3+l]/=u);let d=a(r);if(i){let t=0;d=d.replace("_$css",()=>{const e=o[t];return t++,e})}return d}},Zs=t=>/^0[^.\s]+$/.test(t),_s=t=>e=>e.test(t),Js=[r,p,a,v,x,P,{test:t=>"auto"===t,parse:t=>t}],Qs=t=>Js.find(_s(t)),ti=[...Js,Ee,Fe],ei=t=>ti.find(_s(t));function ni(t,e,n){const s=t.getProps();return T(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function si(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Kn(n))}function ii(t,e){if(!e)return;return(e[t]||e.default||e).from}const oi=new Set(["width","height","top","left","right","bottom","x","y"]),ri=t=>oi.has(t),ai=t=>t===r||t===p,li=(t,e)=>parseFloat(t.split(", ")[e]),hi=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return li(i[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?li(e[1],t):0}},ci=new Set(["x","y","z"]),ui=S.filter(t=>!ci.has(t));const di={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:hi(4,13),y:hi(5,14)},pi=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(ri);let o=[],r=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let h=n[i],c=Qs(h);const u=e[i];let d;if(V(u)){const t=u.length,e=null===u[0]?1:0;h=u[e],c=Qs(h);for(let n=e;n<t;n++)d?et(Qs(u[n])===d):d=Qs(u[n])}else d=Qs(u);if(c!==d)if(ai(c)&&ai(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof u?e[i]=parseFloat(u):Array.isArray(u)&&d===p&&(e[i]=u.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===h||0===u)?0===h?l.set(d.transform(h)):e[i]=c.transform(u):(r||(o=function(t){const e=[];return ui.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(i),s[i]=void 0!==s[i]?s[i]:e[i],l.jump(u))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const s=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:r}=o,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=di[t](s,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=di[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),A&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:s}}return{target:e,transitionEnd:s}};function mi(t,e,n,s){return(t=>Object.keys(t).some(ri))(e)?pi(t,e,n,s):{target:e,transitionEnd:s}}const fi=(t,e,n,s)=>{const i=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!y(e))return;const n=Xs(e,s);n&&t.set(n)});for(const t in e){const i=e[t];if(!y(i))continue;const o=Xs(i,s);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,s);return mi(t,e=i.target,n,s=i.transitionEnd)},gi={current:null},yi={current:!1};function vi(t){return Boolean(d(t)&&t.add)}const xi=Object.keys(C),Pi=xi.length,Ti=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],bi=M.length;class Si extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>dt.render(this.render,!1,!0);const{latestValues:r,renderState:a}=i;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=E(e),this.isVariantNode=w(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==r[t]&&d(e)&&(e.set(r[t],!1),vi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),yi.current||function(){if(yi.current=!0,A)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gi.current=t.matches;t.addListener(e),e()}else gi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||gi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pt.update(this.notifyUpdate),pt.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=h.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&dt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,i,o){let r,a;for(let t=0;t<Pi;t++){const n=xi[t],{isEnabled:s,Feature:i,ProjectionNode:o,MeasureLayout:l}=C[n];o&&(r=o),s(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&u(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,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;e<Ti.length;e++){const n=Ti[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(d(o))t.addValue(i,o),vi(s)&&s.add(i);else if(d(r))t.addValue(i,Kn(o,{owner:t})),vi(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Kn(void 0!==e?e:o,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<bi;t++){const n=M[t],s=this.props[n];(D(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(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 n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Kn(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=T(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||d(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Yn),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{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:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},i){let o=function(t,e,n){const s={};for(const i in t){const t=ii(i,e);if(void 0!==t)s[i]=t;else{const t=n.getValue(i);t&&(s[i]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),o&&(o=s(o))),i){!function(t,e,n){var s,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),r=o.length;if(r)for(let a=0;a<r;a++){const r=o[a],l=e[r];let h=null;Array.isArray(l)&&(h=l[0]),null===h&&(h=null!==(i=null!==(s=n[r])&&void 0!==s?s:t.readValue(r))&&void 0!==i?i:e[r]),null!=h&&("string"==typeof h&&(/^\-?\d*\.?\d+$/.test(h)||Zs(h))?h=parseFloat(h):!ei(h)&&Fe.test(l)&&(h=In(r,l)),t.addValue(r,Kn(h,{owner:t})),void 0===n[r]&&(n[r]=h),null!==h&&t.setBaseTarget(r,h))}}(this,n,o);const t=fi(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Vi extends Si{readValueFromInstance(t,e){if(h.has(e)){const t=Fn(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(L(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return pe(t,e)}build(t,e,n,s){R(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return k(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;d(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){j(t,e,n,s)}}class Ai extends X.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;F(wi),i&&(e.group&&e.group.add(i),n&&n.register&&s&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),m.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:s,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,s||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||dt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ei(t){const[e,n]=function(){const t=K(B);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=Z();return _(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),s=K(I);return X.createElement(Ai,{...t,layoutGroup:s,switchLayoutGroup:K(U),isPresent:e,safeToRemove:n})}const wi={borderRadius:{...qs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qs,borderTopRightRadius:qs,borderBottomLeftRadius:qs,borderBottomRightRadius:qs,boxShadow:Ks},Ci={pan:{Feature:class extends J{constructor(){super(...arguments),this.removePointerDownListener=Q}onPointerDown(t){this.session=new Vt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,s&&s(t,e)}}}mount(){this.removePointerDownListener=Pt(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 J{constructor(t){super(t),this.removeGroupControls=Q,this.removeListeners=Q,this.controls=new Gn(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Q}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Hs,MeasureLayout:Ei}},Di={layout:{ProjectionNode:Hs,MeasureLayout:Ei}};function Mi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Li="data-"+O("framerAppearId");function Ri(t,e,n={}){const s=ni(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>ki(t,s,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(ji).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(Ri(t,e,{...o,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+s,r,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function ki(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(o=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e),i=a[e];if(!s||void 0===i||u&&Bi(u,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[Li];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,s,dt))}let d=s.start($n(e,s,i,t.shouldReduceMotion&&h.has(e)?{type:!1}:r));vi(l)&&(l.add(e),d=d.then(()=>l.remove(e))),c.push(d)}return Promise.all(c).then(()=>{r&&function(t,e){const n=ni(t,e);let{transitionEnd:s={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...s};for(const e in o){si(t,e,b(o[e]))}}(t,r)})}function ji(t,e){return t.sortNodePosition(e)}function Bi({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const Fi=[...N].reverse(),Ii=N.length;function Ui(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Ri(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=Ri(t,e,n);else{const i="function"==typeof e?ni(t,e,n.custom):e;s=ki(t,i,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Oi(t){let e=Ui(t);const n={animate:$i(!0),whileInView:$i(),whileHover:$i(),whileTap:$i(),whileDrag:$i(),whileFocus:$i(),exit:$i()};let s=!0;const i=(e,n)=>{const s=ni(t,n);if(s){const{transition:t,transitionEnd:n,...i}=s;e={...e,...i,...n}}return e};function o(o,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},h=[],c=new Set;let u={},d=1/0;for(let e=0;e<Ii;e++){const p=Fi[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=D(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&s&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...u},!m.isActive&&null===y||!f&&!m.prevProp||$(f)||"boolean"==typeof f)continue;const x=Ni(m.prevProp,f);let P=x||p===r&&m.isActive&&!v&&g||e>d&&g;const T=Array.isArray(f)?f:[f];let b=T.reduce(i,{});!1===y&&(b={});const{prevResolvedValues:S={}}=m,A={...S,...b},E=t=>{P=!0,c.delete(t),m.needsAnimating[t]=!0};for(const t in A){const e=b[t],n=S[t];u.hasOwnProperty(t)||(e!==n?V(e)&&V(n)?!Mi(e,n)||x?E(t):m.protectedKeys[t]=!0:void 0!==e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=b,m.isActive&&(u={...u,...b}),s&&t.blockInitialAnimation&&(P=!1),P&&!v&&h.push(...T.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),h.push({animation:e})}let p=Boolean(h.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,s,i){var r;if(n[e].isActive===s)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Ni(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Mi(e,t)}function $i(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let zi=0;const Gi={animation:{Feature:class extends J{constructor(t){super(t),t.animationState||(t.animationState=Oi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),$(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends J{constructor(){super(...arguments),this.id=zi++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function Hi(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return Pt(t.current,n,(n,i)=>{if("touch"===n.type||Bt())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[s]&&o[s](n,i)},{passive:!t.getProps()[s]})}const Wi=(t,e)=>!!e&&(t===e||Wi(t,e.parentElement));function qi(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,st(n))}const Yi=new WeakMap,Xi=new WeakMap,Ki=t=>{const e=Yi.get(t.target);e&&e(t)},Zi=t=>{t.forEach(Ki)};function _i(t,e,n){const s=function({root:t,...e}){const n=t||document;Xi.has(n)||Xi.set(n,{});const s=Xi.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Zi,{root:t,...e})),s[i]}(e);return Yi.set(t,n),s.observe(t),()=>{Yi.delete(t),s.unobserve(t)}}const Ji={some:0,all:1};const Qi={inView:{Feature:class extends J{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Ji[s]};return _i(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),o=e?n:s;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends J{constructor(){super(...arguments),this.removeStartListeners=Q,this.removeEndListeners=Q,this.removeAccessibleListeners=Q,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=Pt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();Wi(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),i=Pt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=bt(s,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=xt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=xt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&qi("up",this.node.getProps().onTap)}),qi("down",(t,e)=>{this.startPress(t,e)})}),e=xt(this.node.current,"blur",()=>{this.isPressing&&qi("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=bt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Bt()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=Pt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=xt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=bt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends J{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=bt(xt(this.node.current,"focus",()=>this.onFocus()),xt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends J{mount(){this.unmount=bt(Hi(this.node,!0),Hi(this.node,!1))}unmount(){}}}};class to extends Si{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(h.has(e)){const t=Fn(e);return t&&t.default||0}return e=z.has(e)?e:O(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return G(t,e)}build(t,e,n,s){H(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){W(t,e,n,s)}mount(t){this.isSVGTag=q(t.tagName),super.mount(t)}}const eo={...{renderer:(t,e)=>Y(t)?new to(e,{enableHardwareAcceleration:!1}):new Vi(e,{enableHardwareAcceleration:!0}),...Gi,...Qi},...Ci,...Di};export{eo as domMax};
@@ -1 +1 @@
1
- import*as t from"react";import{createContext as e,useContext as n,useLayoutEffect as r,useEffect as o,useRef as a,useInsertionEffect as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?r:o,y=e({strict:!1});function h(t,e,r,s){const c=n(d).visualElement,l=n(y),u=n(m),p=n(f).reducedMotion,h=a();s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:c,props:r,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:p}));const v=h.current;i(()=>{v&&v.update(r,u)}),g(()=>{v&&v.render()}),o(()=>{v&&v.updateFeatures()});return(window.HandoffAppearAnimations?g:o)(()=>{v&&v.animationState&&v.animationState.animateChanges()}),v}function v(t,e,n){return s(r=>{var o;r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):"object"==typeof(o=n)&&Object.prototype.hasOwnProperty.call(o,"current")&&(n.current=r))},[e])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const x=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function S(t){return b(t.animate)||x.some(e=>w(t[e]))}function V(t){const{initial:e,animate:r}=function(t,e){if(S(t)){const{initial:e,animate:n}=t;return{initial:!1===e||w(e)?e:void 0,animate:w(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,n(d));return c(()=>({initial:e,animate:r}),[A(e),A(r)])}function A(t){return Array.isArray(t)?t.join(" "):t}const E={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],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"]},T={};for(const t in E)T[t]={isEnabled:e=>E[t].some(t=>!!e[t])};function k(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}const L=!1;let P=1;const W=e({}),C=e({}),O=Symbol.for("motionComponentSymbol");function B({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:a,Component:i}){e&&function(t){for(const e in t)T[e]={...T[e],...t[e]}}(e);const s=l((function(s,c){let l;const u={...n(f),...s,layoutId:M(s)},{isStatic:m}=u,g=V(s),w=m?void 0:k(()=>{if(L)return P++}),b=a(s,m);if(!m&&p){g.visualElement=h(i,b,u,r);const t=n(C),o=n(y).strict;g.visualElement&&(l=g.visualElement.loadFeatures(u,o,e,w,t))}return t.createElement(d.Provider,{value:g},l&&g.visualElement?t.createElement(l,{visualElement:g.visualElement,...u}):null,o(i,s,w,v(b,g.visualElement,c),b,m,g.visualElement))}));return s[O]=i,s}function M({layoutId:t}){const e=n(W).id;return e&&void 0!==t?e+"-"+t:t}const R=["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 X(t){return"string"==typeof t&&!t.includes("-")&&!!(R.indexOf(t)>-1||/[A-Z]/.test(t))}const Y={},H=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],F=new Set(H);function $(t,{layout:e,layoutId:n}){return F.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Y[t]||"opacity"===t)}const j=t=>Boolean(t&&t.getVelocity),D={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},I=H.length;const Z=(z="--",t=>"string"==typeof t&&t.startsWith(z));var z;const U=(t,e)=>e&&"number"==typeof t?e.transform(t):t,q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},N={...q,transform:t=>((t,e,n)=>Math.min(Math.max(n,t),e))(0,1,t)},_={...q,default:1};const G=t=>({test:e=>function(t){return"string"==typeof t}(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),J=G("deg"),K=G("%"),Q=G("px"),tt={...K,parse:t=>K.parse(t)/100,transform:t=>K.transform(100*t)},et={...q,transform:Math.round},nt={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,size:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:_,scaleX:_,scaleY:_,scaleZ:_,skew:J,skewX:J,skewY:J,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:N,originX:tt,originY:tt,originZ:Q,zIndex:et,fillOpacity:N,strokeOpacity:N,numOctaves:et};function rt(t,e,n,r){const{style:o,vars:a,transform:i,transformOrigin:s}=t;let c=!1,l=!1,u=!0;for(const t in e){const n=e[t];if(Z(t)){a[t]=n;continue}const r=nt[t],f=U(n,r);if(F.has(t)){if(c=!0,i[t]=f,!u)continue;n!==(r.default||0)&&(u=!1)}else t.startsWith("origin")?(l=!0,s[t]=f):o[t]=f}if(e.transform||(c||r?o.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,o){let a="";for(let e=0;e<I;e++){const n=H[e];if(void 0!==t[n]){a+=`${D[n]||n}(${t[n]}) `}}return e&&!t.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(t,r?"":a):n&&r&&(a="none"),a}(t.transform,n,u,r):o.transform&&(o.transform="none")),l){const{originX:t="50%",originY:e="50%",originZ:n=0}=s;o.transformOrigin=`${t} ${e} ${n}`}}const ot=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function at(t,e,n){for(const r in e)j(e[r])||$(r,n)||(t[r]=e[r])}function it(t,e,n){const r={};return at(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return c(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return rt(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}function st(t,e,n){const r={},o=it(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}const ct=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function lt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||ct.has(t)}let ut=t=>!lt(t);try{(ft=require("@emotion/is-prop-valid").default)&&(ut=t=>t.startsWith("on")?!lt(t):ft(t))}catch(t){}var ft;function dt(t,e,n){return"string"==typeof t?t:Q.transform(e+n*t)}const mt={offset:"stroke-dashoffset",array:"stroke-dasharray"},pt={offset:"strokeDashoffset",array:"strokeDasharray"};function gt(t,{attrX:e,attrY:n,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u,f){if(rt(t,c,l,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${dt(e,t.x,t.width)} ${dt(n,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==a&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const a=o?mt:pt;t[a.offset]=Q.transform(-r);const i=Q.transform(e),s=Q.transform(n);t[a.array]=`${i} ${s}`}(d,a,i,s,!1)}const yt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),ht=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vt(t,e,n,r){const o=c(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return gt(n,e,{enableHardwareAcceleration:!1},ht(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};at(e,t.style,t),o.style={...e,...o.style}}return o}function wt(t=!1){return(e,n,r,o,{latestValues:a},i)=>{const s=(X(e)?vt:st)(n,a,i,e),l={...function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(ut(o)||!0===n&&lt(o)||!e&&!lt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),...s,ref:o},{children:f}=n,d=c(()=>j(f)?f.get():f,[f]);return r&&(l["data-projection-id"]=r),u(e,{...l,children:d})}}const bt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xt(t,e,n,r){!function(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(bt.has(n)?n:n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.attrs[n])}function St(t,e){const{style:n}=t,r={};for(const o in n)(j(n[o])||e.style&&j(e.style[o])||$(o,t))&&(r[o]=n[o]);return r}function Vt(t){const e=j(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const At=t=>(e,r)=>{const o=n(d),a=n(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,o,a){const i={latestValues:Et(r,o,a,t),renderState:e()};return n&&(i.mount=t=>n(r,t,i)),i}(t,e,o,a);return r?i():k(i)};function Et(t,e,n,r){const o={},a=r(t,{});for(const t in a)o[t]=Vt(a[t]);let{initial:i,animate:s}=t;const c=S(t),l=function(t){return Boolean(S(t)||t.variants)}(t);e&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===s&&(s=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(e=>{const n=function(t,e,n,r={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),e}(t,e);if(!n)return;const{transitionEnd:r,transition:a,...i}=n;for(const t in i){let e=i[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const t in r)o[t]=r[t]})}return o}const Tt={useVisualState:At({scrapeMotionValuesFromProps:function(t,e){const n=St(t,e);for(const r in t)if(j(t[r])||j(e[r])){n["x"===r||"y"===r?"attr"+r.toUpperCase():r]=t[r]}return n},createRenderState:yt,onMount:(t,e,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}gt(n,r,{enableHardwareAcceleration:!1},ht(e.tagName),t.transformTemplate),xt(e,n)}})},kt={useVisualState:At({scrapeMotionValuesFromProps:St,createRenderState:ot})};const Lt=function(t){function e(e,n={}){return B(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}((function(t,{forwardMotionProps:e=!1},n,r){return{...X(t)?Tt:kt,preloadedFeatures:n,useRender:wt(e),createVisualElement:r,Component:t}}));export{Lt as m};
1
+ import*as t from"react";import{createContext as e,useLayoutEffect as n,useEffect as r,useContext as o,useRef as a,useInsertionEffect as i,useCallback as s,useMemo as l,forwardRef as c,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({}),m=e(null),p="undefined"!=typeof document,g=p?n:r,y=e({strict:!1});function h(t,e,n){return s(r=>{var o;r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):"object"==typeof(o=n)&&Object.prototype.hasOwnProperty.call(o,"current")&&(n.current=r))},[e])}function v(t){return"string"==typeof t||Array.isArray(t)}function w(t){return"object"==typeof t&&"function"==typeof t.start}const b=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function x(t){return w(t.animate)||b.some(e=>v(t[e]))}function S(t){const{initial:e,animate:n}=function(t,e){if(x(t)){const{initial:e,animate:n}=t;return{initial:!1===e||v(e)?e:void 0,animate:v(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,o(d));return l(()=>({initial:e,animate:n}),[V(e),V(n)])}function V(t){return Array.isArray(t)?t.join(" "):t}const A={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"]},E={};for(const t in A)E[t]={isEnabled:e=>A[t].some(t=>!!e[t])};function T(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}const k=!1;let L=1;const P=e({}),W=e({}),C=Symbol.for("motionComponentSymbol");function O({preloadedFeatures:e,createVisualElement:n,useRender:s,useVisualState:l,Component:u}){e&&function(t){for(const e in t)E[e]={...E[e],...t[e]}}(e);const v=c((function(c,v){let w;const b={...o(f),...c,layoutId:B(c)},{isStatic:x}=b,V=S(c),A=x?void 0:T(()=>{if(k)return L++}),E=l(c,x);if(!x&&p){V.visualElement=function(t,e,n,s){const{visualElement:l}=o(d),c=o(y),u=o(m),p=o(f).reducedMotion,h=a();s=s||c.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:p}));const v=h.current;return i(()=>{v&&v.update(n,u)}),g(()=>{v&&v.render()}),r(()=>{v&&v.updateFeatures()}),(window.HandoffAppearAnimations?g:r)(()=>{v&&v.animationState&&v.animationState.animateChanges()}),v}(u,E,b,n);const t=o(W),s=o(y).strict;V.visualElement&&(w=V.visualElement.loadFeatures(b,s,e,A,t))}return t.createElement(d.Provider,{value:V},w&&V.visualElement?t.createElement(w,{visualElement:V.visualElement,...b}):null,s(u,c,A,h(E,V.visualElement,v),E,x,V.visualElement))}));return v[C]=u,v}function B({layoutId:t}){const e=o(P).id;return e&&void 0!==t?e+"-"+t:t}const M=["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 R(t){return"string"==typeof t&&!t.includes("-")&&!!(M.indexOf(t)>-1||/[A-Z]/.test(t))}const X={},Y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(Y);function F(t,{layout:e,layoutId:n}){return H.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!X[t]||"opacity"===t)}const $=t=>Boolean(t&&t.getVelocity),j={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},D=Y.length;const I=(Z="--",t=>"string"==typeof t&&t.startsWith(Z));var Z;const z=(t,e)=>e&&"number"==typeof t?e.transform(t):t,U={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},q={...U,transform:t=>((t,e,n)=>Math.min(Math.max(n,t),e))(0,1,t)},N={...U,default:1};const _=t=>({test:e=>function(t){return"string"==typeof t}(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),G=_("deg"),J=_("%"),K=_("px"),Q={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(100*t)},tt={...U,transform:Math.round},et={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,radius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,size:K,top:K,right:K,bottom:K,left:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,rotate:G,rotateX:G,rotateY:G,rotateZ:G,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:G,skewX:G,skewY:G,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:q,originX:Q,originY:Q,originZ:K,zIndex:tt,fillOpacity:q,strokeOpacity:q,numOctaves:tt};function nt(t,e,n,r){const{style:o,vars:a,transform:i,transformOrigin:s}=t;let l=!1,c=!1,u=!0;for(const t in e){const n=e[t];if(I(t)){a[t]=n;continue}const r=et[t],f=z(n,r);if(H.has(t)){if(l=!0,i[t]=f,!u)continue;n!==(r.default||0)&&(u=!1)}else t.startsWith("origin")?(c=!0,s[t]=f):o[t]=f}if(e.transform||(l||r?o.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,o){let a="";for(let e=0;e<D;e++){const n=Y[e];if(void 0!==t[n]){a+=`${j[n]||n}(${t[n]}) `}}return e&&!t.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(t,r?"":a):n&&r&&(a="none"),a}(t.transform,n,u,r):o.transform&&(o.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=s;o.transformOrigin=`${t} ${e} ${n}`}}const rt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ot(t,e,n){for(const r in e)$(e[r])||F(r,n)||(t[r]=e[r])}function at(t,e,n){const r={};return ot(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return l(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return nt(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}function it(t,e,n){const r={},o=at(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}const st=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function lt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||st.has(t)}let ct=t=>!lt(t);try{(ut=require("@emotion/is-prop-valid").default)&&(ct=t=>t.startsWith("on")?!lt(t):ut(t))}catch(t){}var ut;function ft(t,e,n){return"string"==typeof t?t:K.transform(e+n*t)}const dt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};function pt(t,{attrX:e,attrY:n,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...l},c,u,f){if(nt(t,l,c,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${ft(e,t.x,t.width)} ${ft(n,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==a&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const a=o?dt:mt;t[a.offset]=K.transform(-r);const i=K.transform(e),s=K.transform(n);t[a.array]=`${i} ${s}`}(d,a,i,s,!1)}const gt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),yt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ht(t,e,n,r){const o=l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return pt(n,e,{enableHardwareAcceleration:!1},yt(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};ot(e,t.style,t),o.style={...e,...o.style}}return o}function vt(t=!1){return(e,n,r,o,{latestValues:a},i)=>{const s=(R(e)?ht:it)(n,a,i,e),c={...function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(ct(o)||!0===n&&lt(o)||!e&&!lt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),...s,ref:o},{children:f}=n,d=l(()=>$(f)?f.get():f,[f]);return r&&(c["data-projection-id"]=r),u(e,{...c,children:d})}}const wt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bt(t,e,n,r){!function(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(wt.has(n)?n:n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.attrs[n])}function xt(t,e){const{style:n}=t,r={};for(const o in n)($(n[o])||e.style&&$(e.style[o])||F(o,t))&&(r[o]=n[o]);return r}function St(t){const e=$(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Vt=t=>(e,n)=>{const r=o(d),a=o(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,o,a){const i={latestValues:At(r,o,a,t),renderState:e()};return n&&(i.mount=t=>n(r,t,i)),i}(t,e,r,a);return n?i():T(i)};function At(t,e,n,r){const o={},a=r(t,{});for(const t in a)o[t]=St(a[t]);let{initial:i,animate:s}=t;const l=x(t),c=function(t){return Boolean(x(t)||t.variants)}(t);e&&c&&!l&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===s&&(s=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!w(f)){(Array.isArray(f)?f:[f]).forEach(e=>{const n=function(t,e,n,r={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),e}(t,e);if(!n)return;const{transitionEnd:r,transition:a,...i}=n;for(const t in i){let e=i[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const t in r)o[t]=r[t]})}return o}const Et={useVisualState:Vt({scrapeMotionValuesFromProps:function(t,e){const n=xt(t,e);for(const r in t)if($(t[r])||$(e[r])){n["x"===r||"y"===r?"attr"+r.toUpperCase():r]=t[r]}return n},createRenderState:gt,onMount:(t,e,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}pt(n,r,{enableHardwareAcceleration:!1},yt(e.tagName),t.transformTemplate),bt(e,n)}})},Tt={useVisualState:Vt({scrapeMotionValuesFromProps:xt,createRenderState:rt})};const kt=function(t){function e(e,n={}){return O(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}((function(t,{forwardMotionProps:e=!1},n,r){return{...R(t)?Et:Tt,preloadedFeatures:n,useRender:vt(e),createVisualElement:r,Component:t}}));export{kt as m};