framer-motion 6.3.12 → 6.3.13

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.
package/dist/index.d.ts CHANGED
@@ -22,6 +22,55 @@ declare class MotionValue<V = any> {
22
22
  * When MotionValues are provided to motion components, warn if versions are mixed.
23
23
  */
24
24
  version: string;
25
+ /**
26
+ * Adds a function that will be notified when the `MotionValue` is updated.
27
+ *
28
+ * It returns a function that, when called, will cancel the subscription.
29
+ *
30
+ * When calling `onChange` inside a React component, it should be wrapped with the
31
+ * `useEffect` hook. As it returns an unsubscribe function, this should be returned
32
+ * from the `useEffect` function to ensure you don't add duplicate subscribers..
33
+ *
34
+ * ```jsx
35
+ * export const MyComponent = () => {
36
+ * const x = useMotionValue(0)
37
+ * const y = useMotionValue(0)
38
+ * const opacity = useMotionValue(1)
39
+ *
40
+ * useEffect(() => {
41
+ * function updateOpacity() {
42
+ * const maxXY = Math.max(x.get(), y.get())
43
+ * const newOpacity = transform(maxXY, [0, 100], [1, 0])
44
+ * opacity.set(newOpacity)
45
+ * }
46
+ *
47
+ * const unsubscribeX = x.onChange(updateOpacity)
48
+ * const unsubscribeY = y.onChange(updateOpacity)
49
+ *
50
+ * return () => {
51
+ * unsubscribeX()
52
+ * unsubscribeY()
53
+ * }
54
+ * }, [])
55
+ *
56
+ * return <motion.div style={{ x }} />
57
+ * }
58
+ * ```
59
+ *
60
+ * @privateRemarks
61
+ *
62
+ * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
63
+ *
64
+ * ```jsx
65
+ * useOnChange(x, () => {})
66
+ * ```
67
+ *
68
+ * @param subscriber - A function that receives the latest value.
69
+ * @returns A function that, when called, will cancel this subscription.
70
+ *
71
+ * @public
72
+ */
73
+ onChange(subscription: Subscriber<V>): () => void;
25
74
  clearListeners(): void;
26
75
  /**
27
76
  * Sets the state of the `MotionValue`.
@@ -115,6 +164,27 @@ interface AnimationControls {
115
164
  * @public
116
165
  */
117
166
  start(definition: ControlsAnimationDefinition, transitionOverride?: Transition): Promise<any>;
167
+ /**
168
+ * Instantly set to a set of properties or a variant.
169
+ *
170
+ * ```jsx
171
+ * // With properties
172
+ * controls.set({ opacity: 0 })
173
+ *
174
+ * // With variants
175
+ * controls.set("hidden")
176
+ * ```
177
+ *
178
+ * @privateRemarks
179
+ * We could perform a similar trick to `.start` where this can be called before mount
180
+ * and we maintain a list of of pending actions that get applied on mount. But the
181
+ * expectation of `set` is that it happens synchronously and this would be difficult
182
+ * to do before any children have even attached themselves. It's also poor practise
183
+ * and we should discourage render-synchronous `.start` calls rather than lean into this.
184
+ *
185
+ * @public
186
+ */
187
+ set(definition: ControlsAnimationDefinition): void;
118
188
  /**
119
189
  * Stops animations on all linked components.
120
190
  *
@@ -1281,7 +1281,7 @@
1281
1281
  * This will be replaced by the build step with the latest version number.
1282
1282
  * When MotionValues are provided to motion components, warn if versions are mixed.
1283
1283
  */
1284
- this.version = "6.3.12";
1284
+ this.version = "6.3.13";
1285
1285
  /**
1286
1286
  * Duration, in milliseconds, since last updating frame.
1287
1287
  *
@@ -1408,7 +1408,7 @@
1408
1408
  * }
1409
1409
  * ```
1410
1410
  *
1411
- * @internalremarks
1411
+ * @privateRemarks
1412
1412
  *
1413
1413
  * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
1414
1414
  *
@@ -4316,7 +4316,7 @@
4316
4316
  * and warn against mismatches.
4317
4317
  */
4318
4318
  {
4319
- warnOnce(nextValue.version === "6.3.12", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.12 may not work as expected."));
4319
+ warnOnce(nextValue.version === "6.3.13", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.13 may not work as expected."));
4320
4320
  }
4321
4321
  }
4322
4322
  else if (isMotionValue(prevValue)) {
@@ -1 +1 @@
1
- import{createContext as t,useRef as n,useContext as e,useEffect as r}from"react";var o=function(){return(o=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function i(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function a(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function u(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}function s(t){return"object"==typeof t&&"function"==typeof t.start}var c=t(null);var l=0,f=function(){return l++},d=function(){return t=f,null===(e=n(null)).current&&(e.current=t()),e.current;var t,e};var p=function(t){return Array.isArray(t)};function v(t,n){if(!Array.isArray(n))return!1;var e=n.length;if(e!==t.length)return!1;for(var r=0;r<e;r++)if(n[r]!==t[r])return!1;return!0}const m=(t,n,e)=>Math.min(Math.max(e,t),n);function h({duration:t=800,bounce:n=.25,velocity:e=0,mass:r=1}){let o,i,a=1-n;a=m(.05,1,a),t=m(.01,10,t/1e3),a<1?(o=n=>{const r=n*a,o=r*t;return.001-(r-e)/g(n,a)*Math.exp(-o)},i=n=>{const r=n*a*t,i=r*e+e,u=Math.pow(a,2)*Math.pow(n,2)*t,s=Math.exp(-r),c=g(Math.pow(n,2),a);return(.001-o(n)>0?-1:1)*((i-u)*s)/c}):(o=n=>Math.exp(-n*t)*((n-e)*t+1)-.001,i=n=>Math.exp(-n*t)*(t*t*(e-n)));const u=function(t,n,e){let r=e;for(let e=1;e<12;e++)r-=t(r)/n(r);return r}(o,i,5/t);if(t*=1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const n=Math.pow(u,2)*r;return{stiffness:n,damping:2*a*Math.sqrt(r*n),duration:t}}}function g(t,n){return t*Math.sqrt(1-n*n)}const y=["duration","bounce"],b=["stiffness","damping","mass"];function w(t,n){return n.some(n=>void 0!==t[n])}function A(t){var{from:n=0,to:e=1,restSpeed:r=2,restDelta:o}=t,a=i(t,["from","to","restSpeed","restDelta"]);const u={done:!1,value:n};let{stiffness:s,damping:c,mass:l,velocity:f,duration:d,isResolvedFromDuration:p}=function(t){let n=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!w(t,b)&&w(t,y)){const e=h(t);n=Object.assign(Object.assign(Object.assign({},n),e),{velocity:0,mass:1}),n.isResolvedFromDuration=!0}return n}(a),v=V,m=V;function A(){const t=f?-f/1e3:0,r=e-n,i=c/(2*Math.sqrt(s*l)),a=Math.sqrt(s/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(e-n)/100,.4)),i<1){const n=g(a,i);v=o=>{const u=Math.exp(-i*a*o);return e-u*((t+i*a*r)/n*Math.sin(n*o)+r*Math.cos(n*o))},m=e=>{const o=Math.exp(-i*a*e);return i*a*o*(Math.sin(n*e)*(t+i*a*r)/n+r*Math.cos(n*e))-o*(Math.cos(n*e)*(t+i*a*r)-n*r*Math.sin(n*e))}}else if(1===i)v=n=>e-Math.exp(-a*n)*(r+(t+a*r)*n);else{const n=a*Math.sqrt(i*i-1);v=o=>{const u=Math.exp(-i*a*o),s=Math.min(n*o,300);return e-u*((t+i*a*r)*Math.sinh(s)+n*r*Math.cosh(s))/n}}}return A(),{next:t=>{const n=v(t);if(p)u.done=t>=d;else{const i=1e3*m(t),a=Math.abs(i)<=r,s=Math.abs(e-n)<=o;u.done=a&&s}return u.value=u.done?e:n,u},flipTarget:()=>{f=-f,[n,e]=[e,n],A()}}}A.needsInterpolation=(t,n)=>"string"==typeof t||"string"==typeof n;const V=t=>0,x=(t,n,e)=>{const r=n-t;return 0===r?1:(e-t)/r},O=(t,n,e)=>-e*t+e*n+t,S=(t,n)=>e=>Math.max(Math.min(e,n),t),M=t=>t%1?Number(t.toFixed(5)):t,T=/(-)?([\d]*\.?[\d])+/g,E=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,C=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function P(t){return"string"==typeof t}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I=Object.assign(Object.assign({},k),{transform:S(0,1)}),F=Object.assign(Object.assign({},k),{default:1}),R=t=>({test:n=>P(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),j=R("deg"),D=R("%"),B=R("px"),L=R("vh"),U=R("vw"),N=Object.assign(Object.assign({},D),{parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}),Y=(t,n)=>e=>Boolean(P(e)&&C.test(e)&&e.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(e,n)),z=(t,n,e)=>r=>{if(!P(r))return r;const[o,i,a,u]=r.match(T);return{[t]:parseFloat(o),[n]:parseFloat(i),[e]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},X={test:Y("hsl","hue"),parse:z("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:e,alpha:r=1})=>"hsla("+Math.round(t)+", "+D.transform(M(n))+", "+D.transform(M(e))+", "+M(I.transform(r))+")"},H=S(0,255),W=Object.assign(Object.assign({},k),{transform:t=>Math.round(H(t))}),Z={test:Y("rgb","red"),parse:z("red","green","blue"),transform:({red:t,green:n,blue:e,alpha:r=1})=>"rgba("+W.transform(t)+", "+W.transform(n)+", "+W.transform(e)+", "+M(I.transform(r))+")"};const $={test:Y("#"),parse:function(t){let n="",e="",r="",o="";return t.length>5?(n=t.substr(1,2),e=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(n=t.substr(1,1),e=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),n+=n,e+=e,r+=r,o+=o),{red:parseInt(n,16),green:parseInt(e,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Z.transform},q={test:t=>Z.test(t)||$.test(t)||X.test(t),parse:t=>Z.test(t)?Z.parse(t):X.test(t)?X.parse(t):$.parse(t),transform:t=>P(t)?t:t.hasOwnProperty("red")?Z.transform(t):X.transform(t)};function K(t){"number"==typeof t&&(t=""+t);const n=[];let e=0;const r=t.match(E);r&&(e=r.length,t=t.replace(E,"${c}"),n.push(...r.map(q.parse)));const o=t.match(T);return o&&(t=t.replace(T,"${n}"),n.push(...o.map(k.parse))),{values:n,numColors:e,tokenised:t}}function G(t){return K(t).values}function J(t){const{values:n,numColors:e,tokenised:r}=K(t),o=n.length;return t=>{let n=r;for(let r=0;r<o;r++)n=n.replace(r<e?"${c}":"${n}",r<e?q.transform(t[r]):M(t[r]));return n}}const _=t=>"number"==typeof t?0:t;const Q={test:function(t){var n,e,r,o;return isNaN(t)&&P(t)&&(null!==(e=null===(n=t.match(T))||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(o=null===(r=t.match(E))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:G,createTransformer:J,getAnimatableNone:function(t){const n=G(t);return J(t)(n.map(_))}},tt=new Set(["brightness","contrast","saturate","opacity"]);function nt(t){let[n,e]=t.slice(0,-1).split("(");if("drop-shadow"===n)return t;const[r]=e.match(T)||[];if(!r)return t;const o=e.replace(r,"");let i=tt.has(n)?1:0;return r!==e&&(i*=100),n+"("+i+o+")"}const et=/([a-z-]*)\(.*?\)/g,rt=Object.assign(Object.assign({},Q),{getAnimatableNone:t=>{const n=t.match(et);return n?n.map(nt).join(" "):t}});function ot(t,n,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}function it({hue:t,saturation:n,lightness:e,alpha:r}){t/=360,e/=100;let o=0,i=0,a=0;if(n/=100){const r=e<.5?e*(1+n):e+n-e*n,u=2*e-r;o=ot(u,r,t+1/3),i=ot(u,r,t),a=ot(u,r,t-1/3)}else o=i=a=e;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*a),alpha:r}}const at=(t,n,e)=>{const r=t*t,o=n*n;return Math.sqrt(Math.max(0,e*(o-r)+r))},ut=[$,Z,X],st=t=>ut.find(n=>n.test(t)),ct=(t,n)=>{let e=st(t),r=st(n),o=e.parse(t),i=r.parse(n);e===X&&(o=it(o),e=Z),r===X&&(i=it(i),r=Z);const a=Object.assign({},o);return t=>{for(const n in a)"alpha"!==n&&(a[n]=at(o[n],i[n],t));return a.alpha=O(o.alpha,i.alpha,t),e.transform(a)}},lt=(t,n)=>e=>n(t(e)),ft=(...t)=>t.reduce(lt);function dt(t,n){return"number"==typeof t?e=>O(t,n,e):q.test(t)?ct(t,n):ht(t,n)}const pt=(t,n)=>{const e=[...t],r=e.length,o=t.map((t,e)=>dt(t,n[e]));return t=>{for(let n=0;n<r;n++)e[n]=o[n](t);return e}},vt=(t,n)=>{const e=Object.assign(Object.assign({},t),n),r={};for(const o in e)void 0!==t[o]&&void 0!==n[o]&&(r[o]=dt(t[o],n[o]));return t=>{for(const n in r)e[n]=r[n](t);return e}};function mt(t){const n=Q.parse(t),e=n.length;let r=0,o=0,i=0;for(let t=0;t<e;t++)r||"number"==typeof n[t]?r++:void 0!==n[t].hue?i++:o++;return{parsed:n,numNumbers:r,numRGB:o,numHSL:i}}const ht=(t,n)=>{const e=Q.createTransformer(n),r=mt(t),o=mt(n);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?ft(pt(r.parsed,o.parsed),e):e=>""+(e>0?n:t)},gt=(t,n)=>e=>O(t,n,e);function yt(t,n,e){const r=[],o=e||("number"==typeof(i=t[0])?gt:"string"==typeof i?q.test(i)?ct:ht:Array.isArray(i)?pt:"object"==typeof i?vt:void 0);var i;const a=t.length-1;for(let e=0;e<a;e++){let i=o(t[e],t[e+1]);if(n){const t=Array.isArray(n)?n[e]:n;i=ft(t,i)}r.push(i)}return r}function bt(t,n,{clamp:e=!0,ease:r,mixer:o}={}){const i=t.length;n.length,!r||!Array.isArray(r)||r.length,t[0]>t[i-1]&&(t=[].concat(t),n=[].concat(n),t.reverse(),n.reverse());const a=yt(n,r,o),u=2===i?function([t,n],[e]){return r=>e(x(t,n,r))}(t,a):function(t,n){const e=t.length,r=e-1;return o=>{let i=0,a=!1;if(o<=t[0]?a=!0:o>=t[r]&&(i=r-1,a=!0),!a){let n=1;for(;n<e&&!(t[n]>o||n===r);n++);i=n-1}const u=x(t[i],t[i+1],o);return n[i](u)}}(t,a);return e?n=>u(m(t[0],t[i-1],n)):u}const wt=t=>n=>1-t(1-n),At=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,Vt=t=>n=>n*n*((t+1)*n-t),xt=t=>t,Ot=(St=2,t=>Math.pow(t,St));var St;const Mt=wt(Ot),Tt=At(Ot),Et=t=>1-Math.sin(Math.acos(t)),Ct=wt(Et),Pt=At(Ct),kt=Vt(1.525),It=wt(kt),Ft=At(kt),Rt=(t=>{const n=Vt(t);return t=>(t*=2)<1?.5*n(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),jt=t=>{if(1===t||0===t)return t;const n=t*t;return t<4/11?7.5625*n:t<8/11?9.075*n-9.9*t+3.4:t<.9?4356/361*n-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Dt=wt(jt);function Bt(t,n){return t.map(()=>n||Tt).splice(0,t.length-1)}function Lt({from:t=0,to:n=1,ease:e,offset:r,duration:o=300}){const i={done:!1,value:t},a=Array.isArray(n)?n:[t,n],u=function(t,n){return t.map(t=>t*n)}(r&&r.length===a.length?r:function(t){const n=t.length;return t.map((t,e)=>0!==e?e/(n-1):0)}(a),o);function s(){return bt(u,a,{ease:Array.isArray(e)?e:Bt(a,e)})}let c=s();return{next:t=>(i.value=c(t),i.done=t>=o,i),flipTarget:()=>{a.reverse(),c=s()}}}const Ut={keyframes:Lt,spring:A,decay:function({velocity:t=0,from:n=0,power:e=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const a={done:!1,value:n};let u=e*t;const s=n+u,c=void 0===i?s:i(s);return c!==s&&(u=c-n),{next:t=>{const n=-u*Math.exp(-t/r);return a.done=!(n>o||n<-o),a.value=a.done?c:c+n,a},flipTarget:()=>{}}}};const Nt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Yt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Nt()),1/60*1e3);let zt=!0,Xt=!1,Ht=!1;const Wt={delta:0,timestamp:0},Zt=["read","update","preRender","render","postRender"],$t=Zt.reduce((t,n)=>(t[n]=function(t){let n=[],e=[],r=0,o=!1,i=!1;const a=new WeakSet,u={schedule:(t,i=!1,u=!1)=>{const s=u&&o,c=s?n:e;return i&&a.add(t),-1===c.indexOf(t)&&(c.push(t),s&&o&&(r=n.length)),t},cancel:t=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1),a.delete(t)},process:s=>{if(o)i=!0;else{if(o=!0,[n,e]=[e,n],e.length=0,r=n.length,r)for(let e=0;e<r;e++){const r=n[e];r(s),a.has(r)&&(u.schedule(r),t())}o=!1,i&&(i=!1,u.process(s))}}};return u}(()=>Xt=!0),t),{}),qt=Zt.reduce((t,n)=>{const e=$t[n];return t[n]=(t,n=!1,r=!1)=>(Xt||_t(),e.schedule(t,n,r)),t},{}),Kt=Zt.reduce((t,n)=>(t[n]=$t[n].cancel,t),{});Zt.reduce((t,n)=>(t[n]=()=>$t[n].process(Wt),t),{});const Gt=t=>$t[t].process(Wt),Jt=t=>{Xt=!1,Wt.delta=zt?1/60*1e3:Math.max(Math.min(t-Wt.timestamp,40),1),Wt.timestamp=t,Ht=!0,Zt.forEach(Gt),Ht=!1,Xt&&(zt=!1,Yt(Jt))},_t=()=>{Xt=!0,zt=!0,Ht||Yt(Jt)},Qt=()=>Wt;function tn(t,n,e=0){return t-n-e}const nn=t=>{const n=({delta:n})=>t(n);return{start:()=>qt.update(n,!0),stop:()=>Kt.update(n)}};function en(t){var n,e,{from:r,autoplay:o=!0,driver:a=nn,elapsed:u=0,repeat:s=0,repeatType:c="loop",repeatDelay:l=0,onPlay:f,onStop:d,onComplete:p,onRepeat:v,onUpdate:m}=t,h=i(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,y,b,{to:w}=h,V=0,x=h.duration,O=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return Lt;if(Ut[t.type])return Ut[t.type];const n=new Set(Object.keys(t));return n.has("ease")||n.has("duration")&&!n.has("dampingRatio")?Lt:n.has("dampingRatio")||n.has("stiffness")||n.has("mass")||n.has("damping")||n.has("restSpeed")||n.has("restDelta")?A:Lt}(h);(null===(e=(n=M).needsInterpolation)||void 0===e?void 0:e.call(n,r,w))&&(b=bt([0,100],[r,w],{clamp:!1}),r=0,w=100);const T=M(Object.assign(Object.assign({},h),{from:r,to:w}));function E(){V++,"reverse"===c?(S=V%2==0,u=function(t,n,e=0,r=!0){return r?tn(n+-t,n,e):n-(t-n)+e}(u,x,l,S)):(u=tn(u,x,l),"mirror"===c&&T.flipTarget()),O=!1,v&&v()}function C(t){if(S||(t=-t),u+=t,!O){const t=T.next(Math.max(0,u));y=t.value,b&&(y=b(y)),O=S?t.done:u<=0}null==m||m(y),O&&(0===V&&(null!=x||(x=u)),V<s?function(t,n,e,r){return r?t>=n+e:t<=-e}(u,x,l,S)&&E():(g.stop(),p&&p()))}return o&&(null==f||f(),g=a(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function rn(t,n){return n?t*(1e3/n):0}const on=(t,n)=>1-3*n+3*t,an=(t,n)=>3*n-6*t,un=t=>3*t,sn=(t,n,e)=>((on(n,e)*t+an(n,e))*t+un(n))*t,cn=(t,n,e)=>3*on(n,e)*t*t+2*an(n,e)*t+un(n);function ln(t,n,e,r){if(t===n&&e===r)return xt;const o=new Float32Array(11);for(let n=0;n<11;++n)o[n]=sn(.1*n,t,e);function i(n){let r=0,i=1;for(;10!==i&&o[i]<=n;++i)r+=.1;--i;const a=r+.1*((n-o[i])/(o[i+1]-o[i])),u=cn(a,t,e);return u>=.001?function(t,n,e,r){for(let o=0;o<8;++o){const o=cn(n,e,r);if(0===o)return n;n-=(sn(n,e,r)-t)/o}return n}(n,a,t,e):0===u?a:function(t,n,e,r,o){let i,a,u=0;do{a=n+(e-n)/2,i=sn(a,r,o)-t,i>0?e=a:n=a}while(Math.abs(i)>1e-7&&++u<10);return a}(n,r,r+.1,t,e)}return t=>0===t||1===t?t:sn(i(t),n,r)}var fn=function(t){return 1e3*t},dn={linear:xt,easeIn:Ot,easeInOut:Tt,easeOut:Mt,circIn:Et,circInOut:Pt,circOut:Ct,backIn:kt,backInOut:Ft,backOut:It,anticipate:Rt,bounceIn:Dt,bounceInOut:t=>t<.5?.5*(1-jt(1-2*t)):.5*jt(2*t-1)+.5,bounceOut:jt},pn=function(t){if(Array.isArray(t)){t.length;var n=a(t,4);return ln(n[0],n[1],n[2],n[3])}return"string"==typeof t?dn[t]:t},vn=function(t,n){return"zIndex"!==t&&(!("number"!=typeof n&&!Array.isArray(n))||!("string"!=typeof n||!Q.test(n)||n.startsWith("url(")))},mn=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},hn=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}},gn=function(){return{type:"keyframes",ease:"linear",duration:.3}},yn=function(t){return{type:"keyframes",duration:.8,values:t}},bn={x:mn,y:mn,z:mn,rotate:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scaleX:hn,scaleY:hn,scale:hn,opacity:gn,backgroundColor:gn,color:gn,default:hn},wn=o(o({},k),{transform:Math.round}),An={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,size:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,rotate:j,rotateX:j,rotateY:j,rotateZ:j,scale:F,scaleX:F,scaleY:F,scaleZ:F,skew:j,skewX:j,skewY:j,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:I,originX:N,originY:N,originZ:B,zIndex:wn,fillOpacity:I,strokeOpacity:I,numOctaves:wn},Vn=o(o({},An),{color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:rt,WebkitFilter:rt}),xn=function(t){return Vn[t]};function On(t,n){var e,r=xn(t);return r!==rt&&(r=Q),null===(e=r.getAnimatableNone)||void 0===e?void 0:e.call(r,n)}var Sn=!1,Mn=function(t){return p(t)?t[t.length-1]||0:t};function Tn(t){var n=t.ease,e=t.times,r=t.yoyo,a=t.flip,u=t.loop,s=i(t,["ease","times","yoyo","flip","loop"]),c=o({},s);return e&&(c.offset=e),s.duration&&(c.duration=fn(s.duration)),s.repeatDelay&&(c.repeatDelay=fn(s.repeatDelay)),n&&(c.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(n)?n.map(pn):pn(n)),"tween"===s.type&&(c.type="keyframes"),(r||u||a)&&(r?c.repeatType="reverse":u?c.repeatType="loop":a&&(c.repeatType="mirror"),c.repeat=u||r||a||s.repeat),"spring"!==s.type&&(c.type="keyframes"),c}function En(t,n,e){var r,s,c,l;return Array.isArray(n.to)&&(null!==(r=t.duration)&&void 0!==r||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=u([],a(t.to),!1),t.to[0]=t.from)}(n),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var n=i(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(n).length}(t)||(t=o(o({},t),(s=e,c=n.to,l=p(c)?yn:bn[s]||bn.default,o({to:c},l(c))))),o(o({},n),Tn(t))}function Cn(t,n,e,r,i){var a,u=In(r,t),s=null!==(a=u.from)&&void 0!==a?a:n.get(),c=vn(t,e);return"none"===s&&c&&"string"==typeof e?s=On(t,e):Pn(s)&&"string"==typeof e?s=kn(e):!Array.isArray(e)&&Pn(e)&&"string"==typeof s&&(e=kn(s)),vn(t,s)&&c&&!1!==u.type?function(){var r={from:s,to:e,velocity:n.getVelocity(),onComplete:i,onUpdate:function(t){return n.set(t)}};return"inertia"===u.type||"decay"===u.type?function({from:t=0,velocity:n=0,min:e,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:a=500,bounceDamping:u=10,restDelta:s=1,modifyTarget:c,driver:l,onUpdate:f,onComplete:d,onStop:p}){let v;function m(t){return void 0!==e&&t<e||void 0!==r&&t>r}function h(t){return void 0===e?r:void 0===r||Math.abs(e-t)<Math.abs(r-t)?e:r}function g(t){null==v||v.stop(),v=en(Object.assign(Object.assign({},t),{driver:l,onUpdate:n=>{var e;null==f||f(n),null===(e=t.onUpdate)||void 0===e||e.call(t,n)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:a,damping:u,restDelta:s},t))}if(m(t))y({from:t,velocity:n,to:h(t)});else{let r=o*n+t;void 0!==c&&(r=c(r));const a=h(r),u=a===e?-1:1;let l,f;const d=t=>{l=f,f=t,n=rn(t-l,Qt().delta),(1===u&&t>a||-1===u&&t<a)&&y({from:t,to:a,velocity:n})};g({type:"decay",from:t,velocity:n,timeConstant:i,power:o,restDelta:s,modifyTarget:c,onUpdate:m(r)?d:void 0})}return{stop:()=>null==v?void 0:v.stop()}}(o(o({},r),u)):en(o(o({},En(u,r,t)),{onUpdate:function(t){var n;r.onUpdate(t),null===(n=u.onUpdate)||void 0===n||n.call(u,t)},onComplete:function(){var t;r.onComplete(),null===(t=u.onComplete)||void 0===t||t.call(u)}}))}:function(){var t,r,o=Mn(e);return n.set(o),i(),null===(t=null==u?void 0:u.onUpdate)||void 0===t||t.call(u,o),null===(r=null==u?void 0:u.onComplete)||void 0===r||r.call(u),{stop:function(){}}}}function Pn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function kn(t){return"number"==typeof t?0:On("",t)}function In(t,n){return t[n]||t.default||t}function Fn(t,n,e,r){return void 0===r&&(r={}),Sn&&(r={type:!1}),n.start((function(o){var i,a,u=Cn(t,n,e,r,o),s=function(t,n){var e,r;return null!==(r=null!==(e=(In(t,n)||{}).delay)&&void 0!==e?e:t.delay)&&void 0!==r?r:0}(r,t),c=function(){return a=u()};return s?i=window.setTimeout(c,fn(s)):c(),function(){clearTimeout(i),null==a||a.stop()}}))}var Rn=function(t){return/^0[^.\s]+$/.test(t)};var jn=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var n,e,r=this;return n=this.subscriptions,e=t,-1===n.indexOf(e)&&n.push(e),function(){return function(t,n){var e=t.indexOf(n);e>-1&&t.splice(e,1)}(r.subscriptions,t)}},t.prototype.notify=function(t,n,e){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,n,e);else for(var o=0;o<r;o++){var i=this.subscriptions[o];i&&i(t,n,e)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Dn=function(){function t(t){var n,e=this;this.version="6.3.12",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new jn,this.velocityUpdateSubscribers=new jn,this.renderSubscribers=new jn,this.canTrackVelocity=!1,this.updateAndNotify=function(t,n){void 0===n&&(n=!0),e.prev=e.current,e.current=t;var r=Qt(),o=r.delta,i=r.timestamp;e.lastUpdated!==i&&(e.timeDelta=o,e.lastUpdated=i,qt.postRender(e.scheduleVelocityCheck)),e.prev!==e.current&&e.updateSubscribers.notify(e.current),e.velocityUpdateSubscribers.getSize()&&e.velocityUpdateSubscribers.notify(e.getVelocity()),n&&e.renderSubscribers.notify(e.current)},this.scheduleVelocityCheck=function(){return qt.postRender(e.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==e.lastUpdated&&(e.prev=e.current,e.velocityUpdateSubscribers.notify(e.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,n){void 0===n&&(n=!0),n&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,n)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?rn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var n=this;return this.stop(),new Promise((function(e){n.hasAnimated=!0,n.stopAnimation=t(e)})).then((function(){return n.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function Bn(t){return new Dn(t)}var Ln=function(t){return function(n){return n.test(t)}},Un=[k,B,D,j,U,L,{test:function(t){return"auto"===t},parse:function(t){return t}}],Nn=function(t){return Un.find(Ln(t))},Yn=u(u([],a(Un),!1),[q,Q],!1),zn=function(t){return Yn.find(Ln(t))};function Xn(t){return Array.isArray(t)}function Hn(t){return"string"==typeof t||Xn(t)}function Wn(t,n,e){var r=t.getProps();return function(t,n,e,r,o){var i;return void 0===r&&(r={}),void 0===o&&(o={}),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),"string"==typeof n&&(n=null===(i=t.variants)||void 0===i?void 0:i[n]),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),n}(r,n,null!=e?e:r.custom,function(t){var n={};return t.forEachValue((function(t,e){return n[e]=t.get()})),n}(t),function(t){var n={};return t.forEachValue((function(t,e){return n[e]=t.getVelocity()})),n}(t))}function Zn(t){var n;return"function"==typeof(null===(n=t.animate)||void 0===n?void 0:n.start)||Hn(t.initial)||Hn(t.animate)||Hn(t.whileHover)||Hn(t.whileDrag)||Hn(t.whileTap)||Hn(t.whileFocus)||Hn(t.exit)}function $n(t,n,e){t.hasValue(n)?t.getValue(n).set(e):t.addValue(n,Bn(e))}function qn(t,n){if(n)return(n[t]||n.default||n).from}var Kn=["","X","Y","Z"],Gn=["transformPerspective","x","y","z"];function Jn(t,n){return Gn.indexOf(t)-Gn.indexOf(n)}["translate","scale","rotate","skew"].forEach((function(t){return Kn.forEach((function(n){return Gn.push(t+n)}))}));var _n=new Set(Gn);function Qn(t){return _n.has(t)}var te,ne=new Set(["originX","originY","originZ"]);function ee(t){return ne.has(t)}function re(t,n,e){var r;void 0===e&&(e={});var i=Wn(t,n,e.custom),u=(i||{}).transition,s=void 0===u?t.getDefaultTransition()||{}:u;e.transitionOverride&&(s=e.transitionOverride);var c=i?function(){return oe(t,i,e)}:function(){return Promise.resolve()},l=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?function(r){void 0===r&&(r=0);var i=s.delayChildren,a=void 0===i?0:i,u=s.staggerChildren,c=s.staggerDirection;return function(t,n,e,r,i,a){void 0===e&&(e=0);void 0===r&&(r=0);void 0===i&&(i=1);var u=[],s=(t.variantChildren.size-1)*r,c=1===i?function(t){return void 0===t&&(t=0),t*r}:function(t){return void 0===t&&(t=0),s-t*r};return Array.from(t.variantChildren).sort(ie).forEach((function(t,r){u.push(re(t,n,o(o({},a),{delay:e+c(r)})).then((function(){return t.notifyAnimationComplete(n)})))})),Promise.all(u)}(t,n,a+r,u,c,e)}:function(){return Promise.resolve()},f=s.when;if(f){var d=a("beforeChildren"===f?[c,l]:[l,c],2),p=d[0],v=d[1];return p().then(v)}return Promise.all([c(),l(e.delay)])}function oe(t,n,e){var r,a=void 0===e?{}:e,u=a.delay,s=void 0===u?0:u,c=a.transitionOverride,l=a.type,f=t.makeTargetAnimatable(n),d=f.transition,p=void 0===d?t.getDefaultTransition():d,v=f.transitionEnd,m=i(f,["transition","transitionEnd"]);c&&(p=c);var h=[],g=l&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[l]);for(var y in m){var b=t.getValue(y),w=m[y];if(!(!b||void 0===w||g&&ae(g,y))){var A=o({delay:s},p);t.shouldReduceMotion&&Qn(y)&&(A=o(o({},A),{type:!1,delay:0}));var V=Fn(y,b,w,A);h.push(V)}}return Promise.all(h).then((function(){v&&function(t,n){var e=Wn(t,n),r=e?t.makeTargetAnimatable(e,!1):{},a=r.transitionEnd,u=void 0===a?{}:a;r.transition;var s=i(r,["transitionEnd","transition"]);for(var c in s=o(o({},s),u)){$n(t,c,Mn(s[c]))}}(t,v)}))}function ie(t,n){return t.sortNodePosition(n)}function ae(t,n){var e=t.protectedKeys,r=t.needsAnimating,o=e.hasOwnProperty(n)&&!0!==r[n];return r[n]=!1,o}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(te||(te={}));var ue=[te.Animate,te.InView,te.Focus,te.Hover,te.Tap,te.Drag,te.Exit],se=u([],a(ue),!1).reverse(),ce=ue.length;function le(t){return function(n){return Promise.all(n.map((function(n){var e=n.animation,r=n.options;return function(t,n,e){var r;if(void 0===e&&(e={}),t.notifyAnimationStart(n),Array.isArray(n)){var o=n.map((function(n){return re(t,n,e)}));r=Promise.all(o)}else if("string"==typeof n)r=re(t,n,e);else{var i="function"==typeof n?Wn(t,n,e.custom):n;r=oe(t,i,e)}return r.then((function(){return t.notifyAnimationComplete(n)}))}(t,e,r)})))}}function fe(t){var n,e=le(t),r=((n={})[te.Animate]=de(!0),n[te.InView]=de(),n[te.Hover]=de(),n[te.Tap]=de(),n[te.Drag]=de(),n[te.Focus]=de(),n[te.Exit]=de(),n),c={},l=!0,f=function(n,e){var r=Wn(t,e);if(r){r.transition;var a=r.transitionEnd,u=i(r,["transition","transitionEnd"]);n=o(o(o({},n),u),a)}return n};function d(n,i){for(var d,m=t.getProps(),h=t.getVariantContext(!0)||{},g=[],y=new Set,b={},w=1/0,A=function(e){var c=se[e],A=r[c],V=null!==(d=m[c])&&void 0!==d?d:h[c],x=Hn(V),O=c===i?A.isActive:null;!1===O&&(w=e);var S=V===h[c]&&V!==m[c]&&x;if(S&&l&&t.manuallyAnimateOnMount&&(S=!1),A.protectedKeys=o({},b),!A.isActive&&null===O||!V&&!A.prevProp||s(V)||"boolean"==typeof V)return"continue";var M=function(t,n){if("string"==typeof n)return n!==t;if(Xn(n))return!v(n,t);return!1}(A.prevProp,V),T=M||c===i&&A.isActive&&!S&&x||e>w&&x,E=Array.isArray(V)?V:[V],C=E.reduce(f,{});!1===O&&(C={});var P=A.prevResolvedValues,k=void 0===P?{}:P,I=o(o({},k),C),F=function(t){T=!0,y.delete(t),A.needsAnimating[t]=!0};for(var R in I){var j=C[R],D=k[R];b.hasOwnProperty(R)||(j!==D?p(j)&&p(D)?!v(j,D)||M?F(R):A.protectedKeys[R]=!0:void 0!==j?F(R):y.add(R):void 0!==j&&y.has(R)?F(R):A.protectedKeys[R]=!0)}A.prevProp=V,A.prevResolvedValues=C,A.isActive&&(b=o(o({},b),C)),l&&t.blockInitialAnimation&&(T=!1),T&&!S&&g.push.apply(g,u([],a(E.map((function(t){return{animation:t,options:o({type:c},n)}}))),!1))},V=0;V<ce;V++)A(V);if(c=o({},b),y.size){var x={};y.forEach((function(n){var e=t.getBaseTarget(n);void 0!==e&&(x[n]=e)})),g.push({animation:x})}var O=Boolean(g.length);return l&&!1===m.initial&&!t.manuallyAnimateOnMount&&(O=!1),l=!1,O?e(g):Promise.resolve()}return{isAnimated:function(t){return void 0!==c[t]},animateChanges:d,setActive:function(n,e,o){var i;if(r[n].isActive===e)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach((function(t){var r;return null===(r=t.animationState)||void 0===r?void 0:r.setActive(n,e)})),r[n].isActive=e;var a=d(o,n);for(var u in r)r[u].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:function(){return r}}}function de(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pe=function(t){return function(n){return t(n),null}},ve={animation:pe((function(t){var n=t.visualElement,e=t.animate;n.animationState||(n.animationState=fe(n)),s(e)&&r((function(){return e.subscribe(n)}),[e])})),exit:pe((function(t){var n=t.custom,o=t.visualElement,i=a(function(){var t=e(c);if(null===t)return[!0,null];var n=t.isPresent,o=t.onExitComplete,i=t.register,a=d();return r((function(){return i(a)}),[]),!n&&o?[!1,function(){return null==o?void 0:o(a)}]:[!0]}(),2),u=i[0],s=i[1],l=e(c);r((function(){var t,e;o.isPresent=u;var r=null===(t=o.animationState)||void 0===t?void 0:t.setActive(te.Exit,!u,{custom:null!==(e=null==l?void 0:l.custom)&&void 0!==e?e:n});!u&&(null==r||r.then(s))}),[u])}))};function me(t,n,e,r){return void 0===r&&(r={passive:!0}),t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e)}}function he(t,n,e,o){r((function(){var r=t.current;if(e&&r)return me(r,n,e,o)}),[t,n,e,o])}function ge(t){return!!t.touches}var ye={pageX:0,pageY:0};function be(t,n){void 0===n&&(n="page");var e=t.touches[0]||t.changedTouches[0]||ye;return{x:e[n+"X"],y:e[n+"Y"]}}function we(t,n){return void 0===n&&(n="page"),{x:t[n+"X"],y:t[n+"Y"]}}var Ae=function(t,n){void 0===n&&(n=!1);var e,r=function(n){return t(n,function(t,n){return void 0===n&&(n="page"),{point:ge(t)?be(t,n):we(t,n)}}(n))};return n?(e=r,function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}):r},Ve="undefined"!=typeof document,xe={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Oe={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Se(t){return Ve&&null===window.onpointerdown?t:Ve&&null===window.ontouchstart?Oe[t]:Ve&&null===window.onmousedown?xe[t]:t}function Me(t,n,e,r){return me(t,Se(n),Ae(e,"pointerdown"===n),r)}function Te(t,n,e,r){return he(t,Se(n),e&&Ae(e,"pointerdown"===n),r)}function Ee(t){var n=null;return function(){return null===n&&(n=t,function(){n=null})}}var Ce=Ee("dragHorizontal"),Pe=Ee("dragVertical");function ke(){var t=function(t){var n=!1;if("y"===t)n=Pe();else if("x"===t)n=Ce();else{var e=Ce(),r=Pe();e&&r?n=function(){e(),r()}:(e&&e(),r&&r())}return n}(!0);return!t||(t(),!1)}function Ie(t,n,e){return function(r,o){var i;(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!ke()&&(null===(i=t.animationState)||void 0===i||i.setActive(te.Hover,n),null==e||e(r,o))}}var Fe=function(t,n){return!!n&&(t===n||Fe(t,n.parentElement))};var Re=("undefined"==typeof process||process.env,"production"),je=new Set;var De=new WeakMap,Be=new WeakMap,Le=function(t){var n;null===(n=De.get(t.target))||void 0===n||n(t)},Ue=function(t){t.forEach(Le)};function Ne(t,n,e){var r=function(t){var n=t.root,e=i(t,["root"]),r=n||document;Be.has(r)||Be.set(r,{});var a=Be.get(r),u=JSON.stringify(e);return a[u]||(a[u]=new IntersectionObserver(Ue,o({root:n},e))),a[u]}(n);return De.set(t,e),r.observe(t),function(){De.delete(t),r.unobserve(t)}}var Ye={some:0,all:1};function ze(t,n,e,o){var i=o.root,a=o.margin,u=o.amount,s=void 0===u?"some":u,c=o.once;r((function(){if(t){var r={root:null==i?void 0:i.current,rootMargin:a,threshold:"number"==typeof s?s:Ye[s]};return Ne(e.getInstance(),r,(function(t){var r,o=t.isIntersecting;if(n.isInView!==o&&(n.isInView=o,!c||o||!n.hasEnteredView)){o&&(n.hasEnteredView=!0),null===(r=e.animationState)||void 0===r||r.setActive(te.InView,o);var i=e.getProps(),a=o?i.onViewportEnter:i.onViewportLeave;null==a||a(t)}}))}}),[t,i,a,s])}function Xe(t,n,e,o){var i=o.fallback,a=void 0===i||i;r((function(){var r,o;t&&a&&("production"!==Re&&(r="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||je.has(r)||(console.warn(r),o&&console.warn(o),je.add(r))),requestAnimationFrame((function(){var t;n.hasEnteredView=!0;var r=e.getProps().onViewportEnter;null==r||r(null),null===(t=e.animationState)||void 0===t||t.setActive(te.InView,!0)})))}),[t])}var He={inView:pe((function(t){var e=t.visualElement,r=t.whileInView,o=t.onViewportEnter,i=t.onViewportLeave,a=t.viewport,u=void 0===a?{}:a,s=n({hasEnteredView:!1,isInView:!1}),c=Boolean(r||o||i);u.once&&s.current.hasEnteredView&&(c=!1),("undefined"==typeof IntersectionObserver?Xe:ze)(c,s.current,e,u)})),tap:pe((function(t){var e,o=t.onTap,i=t.onTapStart,a=t.onTapCancel,u=t.whileTap,s=t.visualElement,c=o||i||a||u,l=n(!1),f=n(null),d={passive:!(i||o||a||g)};function p(){var t;null===(t=f.current)||void 0===t||t.call(f),f.current=null}function v(){var t;return p(),l.current=!1,null===(t=s.animationState)||void 0===t||t.setActive(te.Tap,!1),!ke()}function m(t,n){v()&&(Fe(s.getInstance(),t.target)?null==o||o(t,n):null==a||a(t,n))}function h(t,n){v()&&(null==a||a(t,n))}function g(t,n){var e;p(),l.current||(l.current=!0,f.current=ft(Me(window,"pointerup",m,d),Me(window,"pointercancel",h,d)),null===(e=s.animationState)||void 0===e||e.setActive(te.Tap,!0),null==i||i(t,n))}Te(s,"pointerdown",c?g:void 0,d),e=p,r((function(){return function(){return e()}}),[])})),focus:pe((function(t){var n=t.whileFocus,e=t.visualElement;he(e,"focus",n?function(){var t;null===(t=e.animationState)||void 0===t||t.setActive(te.Focus,!0)}:void 0),he(e,"blur",n?function(){var t;null===(t=e.animationState)||void 0===t||t.setActive(te.Focus,!1)}:void 0)})),hover:pe((function(t){var n=t.onHoverStart,e=t.onHoverEnd,r=t.whileHover,o=t.visualElement;Te(o,"pointerenter",n||r?Ie(o,!0,n):void 0,{passive:!n}),Te(o,"pointerleave",e||r?Ie(o,!1,e):void 0,{passive:!e})}))},We=function(t){return Boolean(null!==t&&"object"==typeof t&&t.getVelocity)},Ze=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];var $e=function(t){var n=t.treeType,e=void 0===n?"":n,r=t.build,i=t.getBaseTarget,s=t.makeTargetAnimatable,c=t.measureViewportBox,l=t.render,f=t.readValueFromInstance,d=t.removeValueFromRenderState,p=t.sortNodePosition,v=t.scrapeMotionValuesFromProps;return function(t,n){var m=t.parent,h=t.props,g=t.presenceId,y=t.blockInitialAnimation,b=t.visualState,w=t.shouldReduceMotion;void 0===n&&(n={});var A,V,x=!1,O=b.latestValues,S=b.renderState,M=function(){var t=Ze.map((function(){return new jn})),n={},e={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){Ze.forEach((function(r){var o,i="on"+r,a=t[i];null===(o=n[r])||void 0===o||o.call(n),a&&(n[r]=e[i](a))}))}};return t.forEach((function(t,n){e["on"+Ze[n]]=function(n){return t.add(n)},e["notify"+Ze[n]]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.notify.apply(t,u([],a(n),!1))}})),e}(),T=new Map,E=new Map,C={},P=o({},O);function k(){A&&x&&(I(),l(A,S,h.style,N.projection))}function I(){r(N,S,O,n,h)}function F(){M.notifyUpdate(O)}function R(t,n){var e=n.onChange((function(n){O[t]=n,h.onUpdate&&qt.update(F,!1,!0)})),r=n.onRenderRequest(N.scheduleRender);E.set(t,(function(){e(),r()}))}var j=v(h);for(var D in j){var B=j[D];void 0!==O[D]&&We(B)&&B.set(O[D],!1)}var L=Zn(h),U=function(t){return Boolean(Zn(t)||t.variants)}(h),N=o(o({treeType:e,current:null,depth:m?m.depth+1:0,parent:m,children:new Set,presenceId:g,shouldReduceMotion:w,variantChildren:U?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==m?void 0:m.isMounted()),blockInitialAnimation:y,isMounted:function(){return Boolean(A)},mount:function(t){x=!0,A=N.current=t,N.projection&&N.projection.mount(t),U&&m&&!L&&(V=null==m?void 0:m.addVariantChild(N)),T.forEach((function(t,n){return R(n,t)})),null==m||m.children.add(N),N.setProps(h)},unmount:function(){var t;null===(t=N.projection)||void 0===t||t.unmount(),Kt.update(F),Kt.render(k),E.forEach((function(t){return t()})),null==V||V(),null==m||m.children.delete(N),M.clearAllListeners(),A=void 0,x=!1},addVariantChild:function(t){var n,e=N.getClosestVariantNode();if(e)return null===(n=e.variantChildren)||void 0===n||n.add(t),function(){return e.variantChildren.delete(t)}},sortNodePosition:function(t){return p&&e===t.treeType?p(N.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return U?N:null==m?void 0:m.getClosestVariantNode()},getLayoutId:function(){return h.layoutId},getInstance:function(){return A},getStaticValue:function(t){return O[t]},setStaticValue:function(t,n){return O[t]=n},getLatestValues:function(){return O},setVisibility:function(t){N.isVisible!==t&&(N.isVisible=t,N.scheduleRender())},makeTargetAnimatable:function(t,n){return void 0===n&&(n=!0),s(N,t,h,n)},measureViewportBox:function(){return c(A,h)},addValue:function(t,n){N.hasValue(t)&&N.removeValue(t),T.set(t,n),O[t]=n.get(),R(t,n)},removeValue:function(t){var n;T.delete(t),null===(n=E.get(t))||void 0===n||n(),E.delete(t),delete O[t],d(t,S)},hasValue:function(t){return T.has(t)},getValue:function(t,n){var e=T.get(t);return void 0===e&&void 0!==n&&(e=Bn(n),N.addValue(t,e)),e},forEachValue:function(t){return T.forEach(t)},readValue:function(t){var e;return null!==(e=O[t])&&void 0!==e?e:f(A,t,n)},setBaseTarget:function(t,n){P[t]=n},getBaseTarget:function(t){if(i){var n=i(h,t);if(void 0!==n&&!We(n))return n}return P[t]}},M),{build:function(){return I(),S},scheduleRender:function(){qt.render(k,!1,!0)},syncRender:k,setProps:function(t){(t.transformTemplate||h.transformTemplate)&&N.scheduleRender(),h=t,M.updatePropListeners(t),C=function(t,n,e){var r;for(var o in n){var i=n[o],a=e[o];if(We(i))t.addValue(o,i);else if(We(a))t.addValue(o,Bn(i));else if(a!==i)if(t.hasValue(o)){var u=t.getValue(o);!u.hasAnimated&&u.set(i)}else t.addValue(o,Bn(null!==(r=t.getStaticValue(o))&&void 0!==r?r:i))}for(var o in e)void 0===n[o]&&t.removeValue(o);return n}(N,v(h),C)},getProps:function(){return h},getVariant:function(t){var n;return null===(n=h.variants)||void 0===n?void 0:n[t]},getDefaultTransition:function(){return h.transition},getTransformPagePoint:function(){return h.transformPagePoint},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==m?void 0:m.getVariantContext();if(!L){var n=(null==m?void 0:m.getVariantContext())||{};return void 0!==h.initial&&(n.initial=h.initial),n}for(var e={},r=0;r<Ke;r++){var o=qe[r],i=h[o];(Hn(i)||!1===i)&&(e[o]=i)}return e}});return N}},qe=u(["initial"],a(ue),!1),Ke=qe.length,Ge={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Je(t){return t.startsWith("--")}var _e=function(t,n){return n&&"number"==typeof t?n.transform(t):t};function Qe(t,n,e,r){var o,i=t.style,a=t.vars,u=t.transform,s=t.transformKeys,c=t.transformOrigin;s.length=0;var l=!1,f=!1,d=!0;for(var p in n){var v=n[p];if(Je(p))a[p]=v;else{var m=An[p],h=_e(v,m);if(Qn(p)){if(l=!0,u[p]=h,s.push(p),!d)continue;v!==(null!==(o=m.default)&&void 0!==o?o:0)&&(d=!1)}else ee(p)?(c[p]=h,f=!0):i[p]=h}}l?i.transform=function(t,n,e,r){var o=t.transform,i=t.transformKeys,a=n.enableHardwareAcceleration,u=void 0===a||a,s=n.allowTransformNone,c=void 0===s||s,l="";i.sort(Jn);for(var f=!1,d=i.length,p=0;p<d;p++){var v=i[p];l+="".concat(Ge[v]||v,"(").concat(o[v],") "),"z"===v&&(f=!0)}return!f&&u?l+="translateZ(0)":l=l.trim(),r?l=r(o,e?"":l):c&&e&&(l="none"),l}(t,e,d,r):r?i.transform=r({},""):!n.transform&&i.transform&&(i.transform="none"),f&&(i.transformOrigin=function(t){var n=t.originX,e=void 0===n?"50%":n,r=t.originY,o=void 0===r?"50%":r,i=t.originZ,a=void 0===i?0:i;return"".concat(e," ").concat(o," ").concat(a)}(c))}function tr(t){return"string"==typeof t&&t.startsWith("var(--")}var nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function er(t,n,e){var r=a(function(t){var n=nr.exec(t);if(!n)return[,];var e=a(n,3);return[e[1],e[2]]}(t),2),o=r[0],i=r[1];if(o){var u=window.getComputedStyle(n).getPropertyValue(o);return u?u.trim():tr(i)?er(i,n):i}}var rr,or=new Set(["width","height","top","left","right","bottom","x","y"]),ir=function(t){return or.has(t)},ar=function(t,n){t.set(n,!1),t.set(n)},ur=function(t){return t===k||t===B};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(rr||(rr={}));var sr=function(t,n){return parseFloat(t.split(", ")[n])},cr=function(t,n){return function(e,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return sr(i[1],n);var a=o.match(/^matrix\((.+)\)$/);return a?sr(a[1],t):0}},lr=new Set(["x","y","z"]),fr=Gn.filter((function(t){return!lr.has(t)}));var dr={width:function(t,n){var e=t.x,r=n.paddingLeft,o=void 0===r?"0":r,i=n.paddingRight,a=void 0===i?"0":i;return e.max-e.min-parseFloat(o)-parseFloat(a)},height:function(t,n){var e=t.y,r=n.paddingTop,o=void 0===r?"0":r,i=n.paddingBottom,a=void 0===i?"0":i;return e.max-e.min-parseFloat(o)-parseFloat(a)},top:function(t,n){var e=n.top;return parseFloat(e)},left:function(t,n){var e=n.left;return parseFloat(e)},bottom:function(t,n){var e=t.y,r=n.top;return parseFloat(r)+(e.max-e.min)},right:function(t,n){var e=t.x,r=n.left;return parseFloat(r)+(e.max-e.min)},x:cr(4,13),y:cr(5,14)},pr=function(t,n,e,r){void 0===e&&(e={}),void 0===r&&(r={}),n=o({},n),r=o({},r);var i=Object.keys(n).filter(ir),u=[],s=!1,c=[];if(i.forEach((function(o){var i=t.getValue(o);if(t.hasValue(o)){var a,l=e[o],f=Nn(l),d=n[o];if(p(d)){var v=d.length,m=null===d[0]?1:0;l=d[m],f=Nn(l);for(var h=m;h<v;h++)a?Nn(d[h]):a=Nn(d[h])}else a=Nn(d);if(f!==a)if(ur(f)&&ur(a)){var g=i.get();"string"==typeof g&&i.set(parseFloat(g)),"string"==typeof d?n[o]=parseFloat(d):Array.isArray(d)&&a===B&&(n[o]=d.map(parseFloat))}else(null==f?void 0:f.transform)&&(null==a?void 0:a.transform)&&(0===l||0===d)?0===l?i.set(a.transform(l)):n[o]=f.transform(d):(s||(u=function(t){var n=[];return fr.forEach((function(e){var r=t.getValue(e);void 0!==r&&(n.push([e,r.get()]),r.set(e.startsWith("scale")?1:0))})),n.length&&t.syncRender(),n}(t),s=!0),c.push(o),r[o]=void 0!==r[o]?r[o]:n[o],ar(i,d))}})),c.length){var l=c.indexOf("height")>=0?window.pageYOffset:null,f=function(t,n,e){var r=n.measureViewportBox(),o=n.getInstance(),i=getComputedStyle(o),a=i.display,u={};"none"===a&&n.setStaticValue("display",t.display||"block"),e.forEach((function(t){u[t]=dr[t](r,i)})),n.syncRender();var s=n.measureViewportBox();return e.forEach((function(e){var r=n.getValue(e);ar(r,u[e]),t[e]=dr[e](s,i)})),t}(n,t,c);return u.length&&u.forEach((function(n){var e=a(n,2),r=e[0],o=e[1];t.getValue(r).set(o)})),t.syncRender(),null!==l&&window.scrollTo({top:l}),{target:f,transitionEnd:r}}return{target:n,transitionEnd:r}};function vr(t,n,e,r){return function(t){return Object.keys(t).some(ir)}(n)?pr(t,n,e,r):{target:n,transitionEnd:r}}var mr=function(t,n,e,r){var a=function(t,n,e){var r,a=i(n,[]),u=t.getInstance();if(!(u instanceof Element))return{target:a,transitionEnd:e};for(var s in e&&(e=o({},e)),t.forEachValue((function(t){var n=t.get();if(tr(n)){var e=er(n,u);e&&t.set(e)}})),a){var c=a[s];if(tr(c)){var l=er(c,u);l&&(a[s]=l,e&&(null!==(r=e[s])&&void 0!==r||(e[s]=c)))}}return{target:a,transitionEnd:e}}(t,n,r);return vr(t,n=a.target,e,r=a.transitionEnd)},hr={};function gr(t,n){var e=n.layout,r=n.layoutId;return Qn(t)||ee(t)||(e||void 0!==r)&&(!!hr[t]||"opacity"===t)}function yr(t){var n=t.style,e={};for(var r in n)(We(n[r])||gr(r,t))&&(e[r]=n[r]);return e}function br(t,n,e,r){var o=n.style,i=n.vars;for(var a in Object.assign(t.style,o,r&&r.getProjectionStyles(e)),i)t.style.setProperty(a,i[a])}var wr={treeType:"dom",readValueFromInstance:function(t,n){if(Qn(n)){var e=xn(n);return e&&e.default||0}var r,o=(r=t,window.getComputedStyle(r));return(Je(n)?o.getPropertyValue(n):o[n])||0},sortNodePosition:function(t,n){return 2&t.compareDocumentPosition(n)?1:-1},getBaseTarget:function(t,n){var e;return null===(e=t.style)||void 0===e?void 0:e[n]},measureViewportBox:function(t,n){return function(t,n){return e=function(t,n){if(!n)return t;var e=n({x:t.left,y:t.top}),r=n({x:t.right,y:t.bottom});return{top:e.y,left:e.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),n),r=e.top,{x:{min:e.left,max:e.right},y:{min:r,max:e.bottom}};var e,r}(t,n.transformPagePoint)},resetTransform:function(t,n,e){var r=e.transformTemplate;n.style.transform=r?r({},""):"none",t.scheduleRender()},restoreTransform:function(t,n){t.style.transform=n.style.transform},removeValueFromRenderState:function(t,n){var e=n.vars,r=n.style;delete e[t],delete r[t]},makeTargetAnimatable:function(t,n,e,r){var a=e.transformValues;void 0===r&&(r=!0);var u=n.transition,s=n.transitionEnd,c=i(n,["transition","transitionEnd"]),l=function(t,n,e){var r,o,i={};for(var a in t)i[a]=null!==(r=qn(a,n))&&void 0!==r?r:null===(o=e.getValue(a))||void 0===o?void 0:o.get();return i}(c,u||{},t);if(a&&(s&&(s=a(s)),c&&(c=a(c)),l&&(l=a(l))),r){!function(t,n,e){var r,o,i,a,u=Object.keys(n).filter((function(n){return!t.hasValue(n)})),s=u.length;if(s)for(var c=0;c<s;c++){var l=u[c],f=n[l],d=null;Array.isArray(f)&&(d=f[0]),null===d&&(d=null!==(o=null!==(r=e[l])&&void 0!==r?r:t.readValue(l))&&void 0!==o?o:n[l]),null!=d&&("string"==typeof d&&(/^\-?\d*\.?\d+$/.test(d)||Rn(d))?d=parseFloat(d):!zn(d)&&Q.test(f)&&(d=On(l,f)),t.addValue(l,Bn(d)),null!==(i=(a=e)[l])&&void 0!==i||(a[l]=d),t.setBaseTarget(l,d))}}(t,c,l);var f=mr(t,c,l,s);s=f.transitionEnd,c=f.target}return o({transition:u,transitionEnd:s},c)},scrapeMotionValuesFromProps:yr,build:function(t,n,e,r,o){void 0!==t.isVisible&&(n.style.visibility=t.isVisible?"visible":"hidden"),Qe(n,e,r,o.transformTemplate)},render:br},Ar=$e(wr);function Vr(t,n,e){return"string"==typeof t?t:B.transform(n+e*t)}var xr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Or={offset:"strokeDashoffset",array:"strokeDasharray"};function Sr(t,n,e,r){var o=n.attrX,a=n.attrY,u=n.originX,s=n.originY,c=n.pathLength,l=n.pathSpacing,f=void 0===l?1:l,d=n.pathOffset,p=void 0===d?0:d;Qe(t,i(n,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),e,r),t.attrs=t.style,t.style={};var v=t.attrs,m=t.style,h=t.dimensions;v.transform&&(h&&(m.transform=v.transform),delete v.transform),h&&(void 0!==u||void 0!==s||m.transform)&&(m.transformOrigin=function(t,n,e){var r=Vr(n,t.x,t.width),o=Vr(e,t.y,t.height);return"".concat(r," ").concat(o)}(h,void 0!==u?u:.5,void 0!==s?s:.5)),void 0!==o&&(v.x=o),void 0!==a&&(v.y=a),void 0!==c&&function(t,n,e,r,o){void 0===e&&(e=1),void 0===r&&(r=0),void 0===o&&(o=!0),t.pathLength=1;var i=o?xr:Or;t[i.offset]=B.transform(-r);var a=B.transform(n),u=B.transform(e);t[i.array]="".concat(a," ").concat(u)}(v,c,f,p,!1)}var Mr=/([a-z])([A-Z])/g,Tr=function(t){return t.replace(Mr,"$1-$2").toLowerCase()},Er=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);var Cr=$e(o(o({},wr),{getBaseTarget:function(t,n){return t[n]},readValueFromInstance:function(t,n){var e;return Qn(n)?(null===(e=xn(n))||void 0===e?void 0:e.default)||0:(n=Er.has(n)?n:Tr(n),t.getAttribute(n))},scrapeMotionValuesFromProps:function(t){var n=yr(t);for(var e in t){if(We(t[e]))n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},build:function(t,n,e,r,o){Sr(n,e,r,o.transformTemplate)},render:function(t,n,e,r){for(var o in br(t,n,void 0,r),n.attrs)t.setAttribute(Er.has(o)?o:Tr(o),n.attrs[o])}})),Pr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];var kr=o(o({renderer:function(t,n){return function(t){return"string"==typeof t&&!t.includes("-")&&!!(Pr.indexOf(t)>-1||/[A-Z]/.test(t))}(t)?Cr(n,{enableHardwareAcceleration:!1}):Ar(n,{enableHardwareAcceleration:!0})}},ve),He);export{kr as domAnimation};
1
+ import{createContext as t,useRef as n,useContext as e,useEffect as r}from"react";var o=function(){return(o=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function i(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function a(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function u(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}function s(t){return"object"==typeof t&&"function"==typeof t.start}var c=t(null);var l=0,f=function(){return l++},d=function(){return t=f,null===(e=n(null)).current&&(e.current=t()),e.current;var t,e};var p=function(t){return Array.isArray(t)};function v(t,n){if(!Array.isArray(n))return!1;var e=n.length;if(e!==t.length)return!1;for(var r=0;r<e;r++)if(n[r]!==t[r])return!1;return!0}const m=(t,n,e)=>Math.min(Math.max(e,t),n);function h({duration:t=800,bounce:n=.25,velocity:e=0,mass:r=1}){let o,i,a=1-n;a=m(.05,1,a),t=m(.01,10,t/1e3),a<1?(o=n=>{const r=n*a,o=r*t;return.001-(r-e)/g(n,a)*Math.exp(-o)},i=n=>{const r=n*a*t,i=r*e+e,u=Math.pow(a,2)*Math.pow(n,2)*t,s=Math.exp(-r),c=g(Math.pow(n,2),a);return(.001-o(n)>0?-1:1)*((i-u)*s)/c}):(o=n=>Math.exp(-n*t)*((n-e)*t+1)-.001,i=n=>Math.exp(-n*t)*(t*t*(e-n)));const u=function(t,n,e){let r=e;for(let e=1;e<12;e++)r-=t(r)/n(r);return r}(o,i,5/t);if(t*=1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const n=Math.pow(u,2)*r;return{stiffness:n,damping:2*a*Math.sqrt(r*n),duration:t}}}function g(t,n){return t*Math.sqrt(1-n*n)}const y=["duration","bounce"],b=["stiffness","damping","mass"];function w(t,n){return n.some(n=>void 0!==t[n])}function A(t){var{from:n=0,to:e=1,restSpeed:r=2,restDelta:o}=t,a=i(t,["from","to","restSpeed","restDelta"]);const u={done:!1,value:n};let{stiffness:s,damping:c,mass:l,velocity:f,duration:d,isResolvedFromDuration:p}=function(t){let n=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!w(t,b)&&w(t,y)){const e=h(t);n=Object.assign(Object.assign(Object.assign({},n),e),{velocity:0,mass:1}),n.isResolvedFromDuration=!0}return n}(a),v=V,m=V;function A(){const t=f?-f/1e3:0,r=e-n,i=c/(2*Math.sqrt(s*l)),a=Math.sqrt(s/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(e-n)/100,.4)),i<1){const n=g(a,i);v=o=>{const u=Math.exp(-i*a*o);return e-u*((t+i*a*r)/n*Math.sin(n*o)+r*Math.cos(n*o))},m=e=>{const o=Math.exp(-i*a*e);return i*a*o*(Math.sin(n*e)*(t+i*a*r)/n+r*Math.cos(n*e))-o*(Math.cos(n*e)*(t+i*a*r)-n*r*Math.sin(n*e))}}else if(1===i)v=n=>e-Math.exp(-a*n)*(r+(t+a*r)*n);else{const n=a*Math.sqrt(i*i-1);v=o=>{const u=Math.exp(-i*a*o),s=Math.min(n*o,300);return e-u*((t+i*a*r)*Math.sinh(s)+n*r*Math.cosh(s))/n}}}return A(),{next:t=>{const n=v(t);if(p)u.done=t>=d;else{const i=1e3*m(t),a=Math.abs(i)<=r,s=Math.abs(e-n)<=o;u.done=a&&s}return u.value=u.done?e:n,u},flipTarget:()=>{f=-f,[n,e]=[e,n],A()}}}A.needsInterpolation=(t,n)=>"string"==typeof t||"string"==typeof n;const V=t=>0,x=(t,n,e)=>{const r=n-t;return 0===r?1:(e-t)/r},O=(t,n,e)=>-e*t+e*n+t,S=(t,n)=>e=>Math.max(Math.min(e,n),t),M=t=>t%1?Number(t.toFixed(5)):t,T=/(-)?([\d]*\.?[\d])+/g,E=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,C=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function P(t){return"string"==typeof t}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I=Object.assign(Object.assign({},k),{transform:S(0,1)}),F=Object.assign(Object.assign({},k),{default:1}),R=t=>({test:n=>P(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),j=R("deg"),D=R("%"),B=R("px"),L=R("vh"),U=R("vw"),N=Object.assign(Object.assign({},D),{parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}),Y=(t,n)=>e=>Boolean(P(e)&&C.test(e)&&e.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(e,n)),z=(t,n,e)=>r=>{if(!P(r))return r;const[o,i,a,u]=r.match(T);return{[t]:parseFloat(o),[n]:parseFloat(i),[e]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},X={test:Y("hsl","hue"),parse:z("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:e,alpha:r=1})=>"hsla("+Math.round(t)+", "+D.transform(M(n))+", "+D.transform(M(e))+", "+M(I.transform(r))+")"},H=S(0,255),W=Object.assign(Object.assign({},k),{transform:t=>Math.round(H(t))}),Z={test:Y("rgb","red"),parse:z("red","green","blue"),transform:({red:t,green:n,blue:e,alpha:r=1})=>"rgba("+W.transform(t)+", "+W.transform(n)+", "+W.transform(e)+", "+M(I.transform(r))+")"};const $={test:Y("#"),parse:function(t){let n="",e="",r="",o="";return t.length>5?(n=t.substr(1,2),e=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(n=t.substr(1,1),e=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),n+=n,e+=e,r+=r,o+=o),{red:parseInt(n,16),green:parseInt(e,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Z.transform},q={test:t=>Z.test(t)||$.test(t)||X.test(t),parse:t=>Z.test(t)?Z.parse(t):X.test(t)?X.parse(t):$.parse(t),transform:t=>P(t)?t:t.hasOwnProperty("red")?Z.transform(t):X.transform(t)};function K(t){"number"==typeof t&&(t=""+t);const n=[];let e=0;const r=t.match(E);r&&(e=r.length,t=t.replace(E,"${c}"),n.push(...r.map(q.parse)));const o=t.match(T);return o&&(t=t.replace(T,"${n}"),n.push(...o.map(k.parse))),{values:n,numColors:e,tokenised:t}}function G(t){return K(t).values}function J(t){const{values:n,numColors:e,tokenised:r}=K(t),o=n.length;return t=>{let n=r;for(let r=0;r<o;r++)n=n.replace(r<e?"${c}":"${n}",r<e?q.transform(t[r]):M(t[r]));return n}}const _=t=>"number"==typeof t?0:t;const Q={test:function(t){var n,e,r,o;return isNaN(t)&&P(t)&&(null!==(e=null===(n=t.match(T))||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(o=null===(r=t.match(E))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:G,createTransformer:J,getAnimatableNone:function(t){const n=G(t);return J(t)(n.map(_))}},tt=new Set(["brightness","contrast","saturate","opacity"]);function nt(t){let[n,e]=t.slice(0,-1).split("(");if("drop-shadow"===n)return t;const[r]=e.match(T)||[];if(!r)return t;const o=e.replace(r,"");let i=tt.has(n)?1:0;return r!==e&&(i*=100),n+"("+i+o+")"}const et=/([a-z-]*)\(.*?\)/g,rt=Object.assign(Object.assign({},Q),{getAnimatableNone:t=>{const n=t.match(et);return n?n.map(nt).join(" "):t}});function ot(t,n,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}function it({hue:t,saturation:n,lightness:e,alpha:r}){t/=360,e/=100;let o=0,i=0,a=0;if(n/=100){const r=e<.5?e*(1+n):e+n-e*n,u=2*e-r;o=ot(u,r,t+1/3),i=ot(u,r,t),a=ot(u,r,t-1/3)}else o=i=a=e;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*a),alpha:r}}const at=(t,n,e)=>{const r=t*t,o=n*n;return Math.sqrt(Math.max(0,e*(o-r)+r))},ut=[$,Z,X],st=t=>ut.find(n=>n.test(t)),ct=(t,n)=>{let e=st(t),r=st(n),o=e.parse(t),i=r.parse(n);e===X&&(o=it(o),e=Z),r===X&&(i=it(i),r=Z);const a=Object.assign({},o);return t=>{for(const n in a)"alpha"!==n&&(a[n]=at(o[n],i[n],t));return a.alpha=O(o.alpha,i.alpha,t),e.transform(a)}},lt=(t,n)=>e=>n(t(e)),ft=(...t)=>t.reduce(lt);function dt(t,n){return"number"==typeof t?e=>O(t,n,e):q.test(t)?ct(t,n):ht(t,n)}const pt=(t,n)=>{const e=[...t],r=e.length,o=t.map((t,e)=>dt(t,n[e]));return t=>{for(let n=0;n<r;n++)e[n]=o[n](t);return e}},vt=(t,n)=>{const e=Object.assign(Object.assign({},t),n),r={};for(const o in e)void 0!==t[o]&&void 0!==n[o]&&(r[o]=dt(t[o],n[o]));return t=>{for(const n in r)e[n]=r[n](t);return e}};function mt(t){const n=Q.parse(t),e=n.length;let r=0,o=0,i=0;for(let t=0;t<e;t++)r||"number"==typeof n[t]?r++:void 0!==n[t].hue?i++:o++;return{parsed:n,numNumbers:r,numRGB:o,numHSL:i}}const ht=(t,n)=>{const e=Q.createTransformer(n),r=mt(t),o=mt(n);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?ft(pt(r.parsed,o.parsed),e):e=>""+(e>0?n:t)},gt=(t,n)=>e=>O(t,n,e);function yt(t,n,e){const r=[],o=e||("number"==typeof(i=t[0])?gt:"string"==typeof i?q.test(i)?ct:ht:Array.isArray(i)?pt:"object"==typeof i?vt:void 0);var i;const a=t.length-1;for(let e=0;e<a;e++){let i=o(t[e],t[e+1]);if(n){const t=Array.isArray(n)?n[e]:n;i=ft(t,i)}r.push(i)}return r}function bt(t,n,{clamp:e=!0,ease:r,mixer:o}={}){const i=t.length;n.length,!r||!Array.isArray(r)||r.length,t[0]>t[i-1]&&(t=[].concat(t),n=[].concat(n),t.reverse(),n.reverse());const a=yt(n,r,o),u=2===i?function([t,n],[e]){return r=>e(x(t,n,r))}(t,a):function(t,n){const e=t.length,r=e-1;return o=>{let i=0,a=!1;if(o<=t[0]?a=!0:o>=t[r]&&(i=r-1,a=!0),!a){let n=1;for(;n<e&&!(t[n]>o||n===r);n++);i=n-1}const u=x(t[i],t[i+1],o);return n[i](u)}}(t,a);return e?n=>u(m(t[0],t[i-1],n)):u}const wt=t=>n=>1-t(1-n),At=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,Vt=t=>n=>n*n*((t+1)*n-t),xt=t=>t,Ot=(St=2,t=>Math.pow(t,St));var St;const Mt=wt(Ot),Tt=At(Ot),Et=t=>1-Math.sin(Math.acos(t)),Ct=wt(Et),Pt=At(Ct),kt=Vt(1.525),It=wt(kt),Ft=At(kt),Rt=(t=>{const n=Vt(t);return t=>(t*=2)<1?.5*n(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),jt=t=>{if(1===t||0===t)return t;const n=t*t;return t<4/11?7.5625*n:t<8/11?9.075*n-9.9*t+3.4:t<.9?4356/361*n-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Dt=wt(jt);function Bt(t,n){return t.map(()=>n||Tt).splice(0,t.length-1)}function Lt({from:t=0,to:n=1,ease:e,offset:r,duration:o=300}){const i={done:!1,value:t},a=Array.isArray(n)?n:[t,n],u=function(t,n){return t.map(t=>t*n)}(r&&r.length===a.length?r:function(t){const n=t.length;return t.map((t,e)=>0!==e?e/(n-1):0)}(a),o);function s(){return bt(u,a,{ease:Array.isArray(e)?e:Bt(a,e)})}let c=s();return{next:t=>(i.value=c(t),i.done=t>=o,i),flipTarget:()=>{a.reverse(),c=s()}}}const Ut={keyframes:Lt,spring:A,decay:function({velocity:t=0,from:n=0,power:e=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const a={done:!1,value:n};let u=e*t;const s=n+u,c=void 0===i?s:i(s);return c!==s&&(u=c-n),{next:t=>{const n=-u*Math.exp(-t/r);return a.done=!(n>o||n<-o),a.value=a.done?c:c+n,a},flipTarget:()=>{}}}};const Nt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Yt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Nt()),1/60*1e3);let zt=!0,Xt=!1,Ht=!1;const Wt={delta:0,timestamp:0},Zt=["read","update","preRender","render","postRender"],$t=Zt.reduce((t,n)=>(t[n]=function(t){let n=[],e=[],r=0,o=!1,i=!1;const a=new WeakSet,u={schedule:(t,i=!1,u=!1)=>{const s=u&&o,c=s?n:e;return i&&a.add(t),-1===c.indexOf(t)&&(c.push(t),s&&o&&(r=n.length)),t},cancel:t=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1),a.delete(t)},process:s=>{if(o)i=!0;else{if(o=!0,[n,e]=[e,n],e.length=0,r=n.length,r)for(let e=0;e<r;e++){const r=n[e];r(s),a.has(r)&&(u.schedule(r),t())}o=!1,i&&(i=!1,u.process(s))}}};return u}(()=>Xt=!0),t),{}),qt=Zt.reduce((t,n)=>{const e=$t[n];return t[n]=(t,n=!1,r=!1)=>(Xt||_t(),e.schedule(t,n,r)),t},{}),Kt=Zt.reduce((t,n)=>(t[n]=$t[n].cancel,t),{});Zt.reduce((t,n)=>(t[n]=()=>$t[n].process(Wt),t),{});const Gt=t=>$t[t].process(Wt),Jt=t=>{Xt=!1,Wt.delta=zt?1/60*1e3:Math.max(Math.min(t-Wt.timestamp,40),1),Wt.timestamp=t,Ht=!0,Zt.forEach(Gt),Ht=!1,Xt&&(zt=!1,Yt(Jt))},_t=()=>{Xt=!0,zt=!0,Ht||Yt(Jt)},Qt=()=>Wt;function tn(t,n,e=0){return t-n-e}const nn=t=>{const n=({delta:n})=>t(n);return{start:()=>qt.update(n,!0),stop:()=>Kt.update(n)}};function en(t){var n,e,{from:r,autoplay:o=!0,driver:a=nn,elapsed:u=0,repeat:s=0,repeatType:c="loop",repeatDelay:l=0,onPlay:f,onStop:d,onComplete:p,onRepeat:v,onUpdate:m}=t,h=i(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,y,b,{to:w}=h,V=0,x=h.duration,O=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return Lt;if(Ut[t.type])return Ut[t.type];const n=new Set(Object.keys(t));return n.has("ease")||n.has("duration")&&!n.has("dampingRatio")?Lt:n.has("dampingRatio")||n.has("stiffness")||n.has("mass")||n.has("damping")||n.has("restSpeed")||n.has("restDelta")?A:Lt}(h);(null===(e=(n=M).needsInterpolation)||void 0===e?void 0:e.call(n,r,w))&&(b=bt([0,100],[r,w],{clamp:!1}),r=0,w=100);const T=M(Object.assign(Object.assign({},h),{from:r,to:w}));function E(){V++,"reverse"===c?(S=V%2==0,u=function(t,n,e=0,r=!0){return r?tn(n+-t,n,e):n-(t-n)+e}(u,x,l,S)):(u=tn(u,x,l),"mirror"===c&&T.flipTarget()),O=!1,v&&v()}function C(t){if(S||(t=-t),u+=t,!O){const t=T.next(Math.max(0,u));y=t.value,b&&(y=b(y)),O=S?t.done:u<=0}null==m||m(y),O&&(0===V&&(null!=x||(x=u)),V<s?function(t,n,e,r){return r?t>=n+e:t<=-e}(u,x,l,S)&&E():(g.stop(),p&&p()))}return o&&(null==f||f(),g=a(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function rn(t,n){return n?t*(1e3/n):0}const on=(t,n)=>1-3*n+3*t,an=(t,n)=>3*n-6*t,un=t=>3*t,sn=(t,n,e)=>((on(n,e)*t+an(n,e))*t+un(n))*t,cn=(t,n,e)=>3*on(n,e)*t*t+2*an(n,e)*t+un(n);function ln(t,n,e,r){if(t===n&&e===r)return xt;const o=new Float32Array(11);for(let n=0;n<11;++n)o[n]=sn(.1*n,t,e);function i(n){let r=0,i=1;for(;10!==i&&o[i]<=n;++i)r+=.1;--i;const a=r+.1*((n-o[i])/(o[i+1]-o[i])),u=cn(a,t,e);return u>=.001?function(t,n,e,r){for(let o=0;o<8;++o){const o=cn(n,e,r);if(0===o)return n;n-=(sn(n,e,r)-t)/o}return n}(n,a,t,e):0===u?a:function(t,n,e,r,o){let i,a,u=0;do{a=n+(e-n)/2,i=sn(a,r,o)-t,i>0?e=a:n=a}while(Math.abs(i)>1e-7&&++u<10);return a}(n,r,r+.1,t,e)}return t=>0===t||1===t?t:sn(i(t),n,r)}var fn=function(t){return 1e3*t},dn={linear:xt,easeIn:Ot,easeInOut:Tt,easeOut:Mt,circIn:Et,circInOut:Pt,circOut:Ct,backIn:kt,backInOut:Ft,backOut:It,anticipate:Rt,bounceIn:Dt,bounceInOut:t=>t<.5?.5*(1-jt(1-2*t)):.5*jt(2*t-1)+.5,bounceOut:jt},pn=function(t){if(Array.isArray(t)){t.length;var n=a(t,4);return ln(n[0],n[1],n[2],n[3])}return"string"==typeof t?dn[t]:t},vn=function(t,n){return"zIndex"!==t&&(!("number"!=typeof n&&!Array.isArray(n))||!("string"!=typeof n||!Q.test(n)||n.startsWith("url(")))},mn=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},hn=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}},gn=function(){return{type:"keyframes",ease:"linear",duration:.3}},yn=function(t){return{type:"keyframes",duration:.8,values:t}},bn={x:mn,y:mn,z:mn,rotate:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scaleX:hn,scaleY:hn,scale:hn,opacity:gn,backgroundColor:gn,color:gn,default:hn},wn=o(o({},k),{transform:Math.round}),An={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,size:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,rotate:j,rotateX:j,rotateY:j,rotateZ:j,scale:F,scaleX:F,scaleY:F,scaleZ:F,skew:j,skewX:j,skewY:j,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:I,originX:N,originY:N,originZ:B,zIndex:wn,fillOpacity:I,strokeOpacity:I,numOctaves:wn},Vn=o(o({},An),{color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:rt,WebkitFilter:rt}),xn=function(t){return Vn[t]};function On(t,n){var e,r=xn(t);return r!==rt&&(r=Q),null===(e=r.getAnimatableNone)||void 0===e?void 0:e.call(r,n)}var Sn=!1,Mn=function(t){return p(t)?t[t.length-1]||0:t};function Tn(t){var n=t.ease,e=t.times,r=t.yoyo,a=t.flip,u=t.loop,s=i(t,["ease","times","yoyo","flip","loop"]),c=o({},s);return e&&(c.offset=e),s.duration&&(c.duration=fn(s.duration)),s.repeatDelay&&(c.repeatDelay=fn(s.repeatDelay)),n&&(c.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(n)?n.map(pn):pn(n)),"tween"===s.type&&(c.type="keyframes"),(r||u||a)&&(r?c.repeatType="reverse":u?c.repeatType="loop":a&&(c.repeatType="mirror"),c.repeat=u||r||a||s.repeat),"spring"!==s.type&&(c.type="keyframes"),c}function En(t,n,e){var r,s,c,l;return Array.isArray(n.to)&&(null!==(r=t.duration)&&void 0!==r||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=u([],a(t.to),!1),t.to[0]=t.from)}(n),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var n=i(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(n).length}(t)||(t=o(o({},t),(s=e,c=n.to,l=p(c)?yn:bn[s]||bn.default,o({to:c},l(c))))),o(o({},n),Tn(t))}function Cn(t,n,e,r,i){var a,u=In(r,t),s=null!==(a=u.from)&&void 0!==a?a:n.get(),c=vn(t,e);return"none"===s&&c&&"string"==typeof e?s=On(t,e):Pn(s)&&"string"==typeof e?s=kn(e):!Array.isArray(e)&&Pn(e)&&"string"==typeof s&&(e=kn(s)),vn(t,s)&&c&&!1!==u.type?function(){var r={from:s,to:e,velocity:n.getVelocity(),onComplete:i,onUpdate:function(t){return n.set(t)}};return"inertia"===u.type||"decay"===u.type?function({from:t=0,velocity:n=0,min:e,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:a=500,bounceDamping:u=10,restDelta:s=1,modifyTarget:c,driver:l,onUpdate:f,onComplete:d,onStop:p}){let v;function m(t){return void 0!==e&&t<e||void 0!==r&&t>r}function h(t){return void 0===e?r:void 0===r||Math.abs(e-t)<Math.abs(r-t)?e:r}function g(t){null==v||v.stop(),v=en(Object.assign(Object.assign({},t),{driver:l,onUpdate:n=>{var e;null==f||f(n),null===(e=t.onUpdate)||void 0===e||e.call(t,n)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:a,damping:u,restDelta:s},t))}if(m(t))y({from:t,velocity:n,to:h(t)});else{let r=o*n+t;void 0!==c&&(r=c(r));const a=h(r),u=a===e?-1:1;let l,f;const d=t=>{l=f,f=t,n=rn(t-l,Qt().delta),(1===u&&t>a||-1===u&&t<a)&&y({from:t,to:a,velocity:n})};g({type:"decay",from:t,velocity:n,timeConstant:i,power:o,restDelta:s,modifyTarget:c,onUpdate:m(r)?d:void 0})}return{stop:()=>null==v?void 0:v.stop()}}(o(o({},r),u)):en(o(o({},En(u,r,t)),{onUpdate:function(t){var n;r.onUpdate(t),null===(n=u.onUpdate)||void 0===n||n.call(u,t)},onComplete:function(){var t;r.onComplete(),null===(t=u.onComplete)||void 0===t||t.call(u)}}))}:function(){var t,r,o=Mn(e);return n.set(o),i(),null===(t=null==u?void 0:u.onUpdate)||void 0===t||t.call(u,o),null===(r=null==u?void 0:u.onComplete)||void 0===r||r.call(u),{stop:function(){}}}}function Pn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function kn(t){return"number"==typeof t?0:On("",t)}function In(t,n){return t[n]||t.default||t}function Fn(t,n,e,r){return void 0===r&&(r={}),Sn&&(r={type:!1}),n.start((function(o){var i,a,u=Cn(t,n,e,r,o),s=function(t,n){var e,r;return null!==(r=null!==(e=(In(t,n)||{}).delay)&&void 0!==e?e:t.delay)&&void 0!==r?r:0}(r,t),c=function(){return a=u()};return s?i=window.setTimeout(c,fn(s)):c(),function(){clearTimeout(i),null==a||a.stop()}}))}var Rn=function(t){return/^0[^.\s]+$/.test(t)};var jn=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var n,e,r=this;return n=this.subscriptions,e=t,-1===n.indexOf(e)&&n.push(e),function(){return function(t,n){var e=t.indexOf(n);e>-1&&t.splice(e,1)}(r.subscriptions,t)}},t.prototype.notify=function(t,n,e){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,n,e);else for(var o=0;o<r;o++){var i=this.subscriptions[o];i&&i(t,n,e)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Dn=function(){function t(t){var n,e=this;this.version="6.3.13",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new jn,this.velocityUpdateSubscribers=new jn,this.renderSubscribers=new jn,this.canTrackVelocity=!1,this.updateAndNotify=function(t,n){void 0===n&&(n=!0),e.prev=e.current,e.current=t;var r=Qt(),o=r.delta,i=r.timestamp;e.lastUpdated!==i&&(e.timeDelta=o,e.lastUpdated=i,qt.postRender(e.scheduleVelocityCheck)),e.prev!==e.current&&e.updateSubscribers.notify(e.current),e.velocityUpdateSubscribers.getSize()&&e.velocityUpdateSubscribers.notify(e.getVelocity()),n&&e.renderSubscribers.notify(e.current)},this.scheduleVelocityCheck=function(){return qt.postRender(e.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==e.lastUpdated&&(e.prev=e.current,e.velocityUpdateSubscribers.notify(e.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,n){void 0===n&&(n=!0),n&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,n)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?rn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var n=this;return this.stop(),new Promise((function(e){n.hasAnimated=!0,n.stopAnimation=t(e)})).then((function(){return n.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function Bn(t){return new Dn(t)}var Ln=function(t){return function(n){return n.test(t)}},Un=[k,B,D,j,U,L,{test:function(t){return"auto"===t},parse:function(t){return t}}],Nn=function(t){return Un.find(Ln(t))},Yn=u(u([],a(Un),!1),[q,Q],!1),zn=function(t){return Yn.find(Ln(t))};function Xn(t){return Array.isArray(t)}function Hn(t){return"string"==typeof t||Xn(t)}function Wn(t,n,e){var r=t.getProps();return function(t,n,e,r,o){var i;return void 0===r&&(r={}),void 0===o&&(o={}),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),"string"==typeof n&&(n=null===(i=t.variants)||void 0===i?void 0:i[n]),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),n}(r,n,null!=e?e:r.custom,function(t){var n={};return t.forEachValue((function(t,e){return n[e]=t.get()})),n}(t),function(t){var n={};return t.forEachValue((function(t,e){return n[e]=t.getVelocity()})),n}(t))}function Zn(t){var n;return"function"==typeof(null===(n=t.animate)||void 0===n?void 0:n.start)||Hn(t.initial)||Hn(t.animate)||Hn(t.whileHover)||Hn(t.whileDrag)||Hn(t.whileTap)||Hn(t.whileFocus)||Hn(t.exit)}function $n(t,n,e){t.hasValue(n)?t.getValue(n).set(e):t.addValue(n,Bn(e))}function qn(t,n){if(n)return(n[t]||n.default||n).from}var Kn=["","X","Y","Z"],Gn=["transformPerspective","x","y","z"];function Jn(t,n){return Gn.indexOf(t)-Gn.indexOf(n)}["translate","scale","rotate","skew"].forEach((function(t){return Kn.forEach((function(n){return Gn.push(t+n)}))}));var _n=new Set(Gn);function Qn(t){return _n.has(t)}var te,ne=new Set(["originX","originY","originZ"]);function ee(t){return ne.has(t)}function re(t,n,e){var r;void 0===e&&(e={});var i=Wn(t,n,e.custom),u=(i||{}).transition,s=void 0===u?t.getDefaultTransition()||{}:u;e.transitionOverride&&(s=e.transitionOverride);var c=i?function(){return oe(t,i,e)}:function(){return Promise.resolve()},l=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?function(r){void 0===r&&(r=0);var i=s.delayChildren,a=void 0===i?0:i,u=s.staggerChildren,c=s.staggerDirection;return function(t,n,e,r,i,a){void 0===e&&(e=0);void 0===r&&(r=0);void 0===i&&(i=1);var u=[],s=(t.variantChildren.size-1)*r,c=1===i?function(t){return void 0===t&&(t=0),t*r}:function(t){return void 0===t&&(t=0),s-t*r};return Array.from(t.variantChildren).sort(ie).forEach((function(t,r){u.push(re(t,n,o(o({},a),{delay:e+c(r)})).then((function(){return t.notifyAnimationComplete(n)})))})),Promise.all(u)}(t,n,a+r,u,c,e)}:function(){return Promise.resolve()},f=s.when;if(f){var d=a("beforeChildren"===f?[c,l]:[l,c],2),p=d[0],v=d[1];return p().then(v)}return Promise.all([c(),l(e.delay)])}function oe(t,n,e){var r,a=void 0===e?{}:e,u=a.delay,s=void 0===u?0:u,c=a.transitionOverride,l=a.type,f=t.makeTargetAnimatable(n),d=f.transition,p=void 0===d?t.getDefaultTransition():d,v=f.transitionEnd,m=i(f,["transition","transitionEnd"]);c&&(p=c);var h=[],g=l&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[l]);for(var y in m){var b=t.getValue(y),w=m[y];if(!(!b||void 0===w||g&&ae(g,y))){var A=o({delay:s},p);t.shouldReduceMotion&&Qn(y)&&(A=o(o({},A),{type:!1,delay:0}));var V=Fn(y,b,w,A);h.push(V)}}return Promise.all(h).then((function(){v&&function(t,n){var e=Wn(t,n),r=e?t.makeTargetAnimatable(e,!1):{},a=r.transitionEnd,u=void 0===a?{}:a;r.transition;var s=i(r,["transitionEnd","transition"]);for(var c in s=o(o({},s),u)){$n(t,c,Mn(s[c]))}}(t,v)}))}function ie(t,n){return t.sortNodePosition(n)}function ae(t,n){var e=t.protectedKeys,r=t.needsAnimating,o=e.hasOwnProperty(n)&&!0!==r[n];return r[n]=!1,o}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(te||(te={}));var ue=[te.Animate,te.InView,te.Focus,te.Hover,te.Tap,te.Drag,te.Exit],se=u([],a(ue),!1).reverse(),ce=ue.length;function le(t){return function(n){return Promise.all(n.map((function(n){var e=n.animation,r=n.options;return function(t,n,e){var r;if(void 0===e&&(e={}),t.notifyAnimationStart(n),Array.isArray(n)){var o=n.map((function(n){return re(t,n,e)}));r=Promise.all(o)}else if("string"==typeof n)r=re(t,n,e);else{var i="function"==typeof n?Wn(t,n,e.custom):n;r=oe(t,i,e)}return r.then((function(){return t.notifyAnimationComplete(n)}))}(t,e,r)})))}}function fe(t){var n,e=le(t),r=((n={})[te.Animate]=de(!0),n[te.InView]=de(),n[te.Hover]=de(),n[te.Tap]=de(),n[te.Drag]=de(),n[te.Focus]=de(),n[te.Exit]=de(),n),c={},l=!0,f=function(n,e){var r=Wn(t,e);if(r){r.transition;var a=r.transitionEnd,u=i(r,["transition","transitionEnd"]);n=o(o(o({},n),u),a)}return n};function d(n,i){for(var d,m=t.getProps(),h=t.getVariantContext(!0)||{},g=[],y=new Set,b={},w=1/0,A=function(e){var c=se[e],A=r[c],V=null!==(d=m[c])&&void 0!==d?d:h[c],x=Hn(V),O=c===i?A.isActive:null;!1===O&&(w=e);var S=V===h[c]&&V!==m[c]&&x;if(S&&l&&t.manuallyAnimateOnMount&&(S=!1),A.protectedKeys=o({},b),!A.isActive&&null===O||!V&&!A.prevProp||s(V)||"boolean"==typeof V)return"continue";var M=function(t,n){if("string"==typeof n)return n!==t;if(Xn(n))return!v(n,t);return!1}(A.prevProp,V),T=M||c===i&&A.isActive&&!S&&x||e>w&&x,E=Array.isArray(V)?V:[V],C=E.reduce(f,{});!1===O&&(C={});var P=A.prevResolvedValues,k=void 0===P?{}:P,I=o(o({},k),C),F=function(t){T=!0,y.delete(t),A.needsAnimating[t]=!0};for(var R in I){var j=C[R],D=k[R];b.hasOwnProperty(R)||(j!==D?p(j)&&p(D)?!v(j,D)||M?F(R):A.protectedKeys[R]=!0:void 0!==j?F(R):y.add(R):void 0!==j&&y.has(R)?F(R):A.protectedKeys[R]=!0)}A.prevProp=V,A.prevResolvedValues=C,A.isActive&&(b=o(o({},b),C)),l&&t.blockInitialAnimation&&(T=!1),T&&!S&&g.push.apply(g,u([],a(E.map((function(t){return{animation:t,options:o({type:c},n)}}))),!1))},V=0;V<ce;V++)A(V);if(c=o({},b),y.size){var x={};y.forEach((function(n){var e=t.getBaseTarget(n);void 0!==e&&(x[n]=e)})),g.push({animation:x})}var O=Boolean(g.length);return l&&!1===m.initial&&!t.manuallyAnimateOnMount&&(O=!1),l=!1,O?e(g):Promise.resolve()}return{isAnimated:function(t){return void 0!==c[t]},animateChanges:d,setActive:function(n,e,o){var i;if(r[n].isActive===e)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach((function(t){var r;return null===(r=t.animationState)||void 0===r?void 0:r.setActive(n,e)})),r[n].isActive=e;var a=d(o,n);for(var u in r)r[u].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:function(){return r}}}function de(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pe=function(t){return function(n){return t(n),null}},ve={animation:pe((function(t){var n=t.visualElement,e=t.animate;n.animationState||(n.animationState=fe(n)),s(e)&&r((function(){return e.subscribe(n)}),[e])})),exit:pe((function(t){var n=t.custom,o=t.visualElement,i=a(function(){var t=e(c);if(null===t)return[!0,null];var n=t.isPresent,o=t.onExitComplete,i=t.register,a=d();return r((function(){return i(a)}),[]),!n&&o?[!1,function(){return null==o?void 0:o(a)}]:[!0]}(),2),u=i[0],s=i[1],l=e(c);r((function(){var t,e;o.isPresent=u;var r=null===(t=o.animationState)||void 0===t?void 0:t.setActive(te.Exit,!u,{custom:null!==(e=null==l?void 0:l.custom)&&void 0!==e?e:n});!u&&(null==r||r.then(s))}),[u])}))};function me(t,n,e,r){return void 0===r&&(r={passive:!0}),t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e)}}function he(t,n,e,o){r((function(){var r=t.current;if(e&&r)return me(r,n,e,o)}),[t,n,e,o])}function ge(t){return!!t.touches}var ye={pageX:0,pageY:0};function be(t,n){void 0===n&&(n="page");var e=t.touches[0]||t.changedTouches[0]||ye;return{x:e[n+"X"],y:e[n+"Y"]}}function we(t,n){return void 0===n&&(n="page"),{x:t[n+"X"],y:t[n+"Y"]}}var Ae=function(t,n){void 0===n&&(n=!1);var e,r=function(n){return t(n,function(t,n){return void 0===n&&(n="page"),{point:ge(t)?be(t,n):we(t,n)}}(n))};return n?(e=r,function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}):r},Ve="undefined"!=typeof document,xe={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Oe={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Se(t){return Ve&&null===window.onpointerdown?t:Ve&&null===window.ontouchstart?Oe[t]:Ve&&null===window.onmousedown?xe[t]:t}function Me(t,n,e,r){return me(t,Se(n),Ae(e,"pointerdown"===n),r)}function Te(t,n,e,r){return he(t,Se(n),e&&Ae(e,"pointerdown"===n),r)}function Ee(t){var n=null;return function(){return null===n&&(n=t,function(){n=null})}}var Ce=Ee("dragHorizontal"),Pe=Ee("dragVertical");function ke(){var t=function(t){var n=!1;if("y"===t)n=Pe();else if("x"===t)n=Ce();else{var e=Ce(),r=Pe();e&&r?n=function(){e(),r()}:(e&&e(),r&&r())}return n}(!0);return!t||(t(),!1)}function Ie(t,n,e){return function(r,o){var i;(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!ke()&&(null===(i=t.animationState)||void 0===i||i.setActive(te.Hover,n),null==e||e(r,o))}}var Fe=function(t,n){return!!n&&(t===n||Fe(t,n.parentElement))};var Re=("undefined"==typeof process||process.env,"production"),je=new Set;var De=new WeakMap,Be=new WeakMap,Le=function(t){var n;null===(n=De.get(t.target))||void 0===n||n(t)},Ue=function(t){t.forEach(Le)};function Ne(t,n,e){var r=function(t){var n=t.root,e=i(t,["root"]),r=n||document;Be.has(r)||Be.set(r,{});var a=Be.get(r),u=JSON.stringify(e);return a[u]||(a[u]=new IntersectionObserver(Ue,o({root:n},e))),a[u]}(n);return De.set(t,e),r.observe(t),function(){De.delete(t),r.unobserve(t)}}var Ye={some:0,all:1};function ze(t,n,e,o){var i=o.root,a=o.margin,u=o.amount,s=void 0===u?"some":u,c=o.once;r((function(){if(t){var r={root:null==i?void 0:i.current,rootMargin:a,threshold:"number"==typeof s?s:Ye[s]};return Ne(e.getInstance(),r,(function(t){var r,o=t.isIntersecting;if(n.isInView!==o&&(n.isInView=o,!c||o||!n.hasEnteredView)){o&&(n.hasEnteredView=!0),null===(r=e.animationState)||void 0===r||r.setActive(te.InView,o);var i=e.getProps(),a=o?i.onViewportEnter:i.onViewportLeave;null==a||a(t)}}))}}),[t,i,a,s])}function Xe(t,n,e,o){var i=o.fallback,a=void 0===i||i;r((function(){var r,o;t&&a&&("production"!==Re&&(r="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||je.has(r)||(console.warn(r),o&&console.warn(o),je.add(r))),requestAnimationFrame((function(){var t;n.hasEnteredView=!0;var r=e.getProps().onViewportEnter;null==r||r(null),null===(t=e.animationState)||void 0===t||t.setActive(te.InView,!0)})))}),[t])}var He={inView:pe((function(t){var e=t.visualElement,r=t.whileInView,o=t.onViewportEnter,i=t.onViewportLeave,a=t.viewport,u=void 0===a?{}:a,s=n({hasEnteredView:!1,isInView:!1}),c=Boolean(r||o||i);u.once&&s.current.hasEnteredView&&(c=!1),("undefined"==typeof IntersectionObserver?Xe:ze)(c,s.current,e,u)})),tap:pe((function(t){var e,o=t.onTap,i=t.onTapStart,a=t.onTapCancel,u=t.whileTap,s=t.visualElement,c=o||i||a||u,l=n(!1),f=n(null),d={passive:!(i||o||a||g)};function p(){var t;null===(t=f.current)||void 0===t||t.call(f),f.current=null}function v(){var t;return p(),l.current=!1,null===(t=s.animationState)||void 0===t||t.setActive(te.Tap,!1),!ke()}function m(t,n){v()&&(Fe(s.getInstance(),t.target)?null==o||o(t,n):null==a||a(t,n))}function h(t,n){v()&&(null==a||a(t,n))}function g(t,n){var e;p(),l.current||(l.current=!0,f.current=ft(Me(window,"pointerup",m,d),Me(window,"pointercancel",h,d)),null===(e=s.animationState)||void 0===e||e.setActive(te.Tap,!0),null==i||i(t,n))}Te(s,"pointerdown",c?g:void 0,d),e=p,r((function(){return function(){return e()}}),[])})),focus:pe((function(t){var n=t.whileFocus,e=t.visualElement;he(e,"focus",n?function(){var t;null===(t=e.animationState)||void 0===t||t.setActive(te.Focus,!0)}:void 0),he(e,"blur",n?function(){var t;null===(t=e.animationState)||void 0===t||t.setActive(te.Focus,!1)}:void 0)})),hover:pe((function(t){var n=t.onHoverStart,e=t.onHoverEnd,r=t.whileHover,o=t.visualElement;Te(o,"pointerenter",n||r?Ie(o,!0,n):void 0,{passive:!n}),Te(o,"pointerleave",e||r?Ie(o,!1,e):void 0,{passive:!e})}))},We=function(t){return Boolean(null!==t&&"object"==typeof t&&t.getVelocity)},Ze=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];var $e=function(t){var n=t.treeType,e=void 0===n?"":n,r=t.build,i=t.getBaseTarget,s=t.makeTargetAnimatable,c=t.measureViewportBox,l=t.render,f=t.readValueFromInstance,d=t.removeValueFromRenderState,p=t.sortNodePosition,v=t.scrapeMotionValuesFromProps;return function(t,n){var m=t.parent,h=t.props,g=t.presenceId,y=t.blockInitialAnimation,b=t.visualState,w=t.shouldReduceMotion;void 0===n&&(n={});var A,V,x=!1,O=b.latestValues,S=b.renderState,M=function(){var t=Ze.map((function(){return new jn})),n={},e={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){Ze.forEach((function(r){var o,i="on"+r,a=t[i];null===(o=n[r])||void 0===o||o.call(n),a&&(n[r]=e[i](a))}))}};return t.forEach((function(t,n){e["on"+Ze[n]]=function(n){return t.add(n)},e["notify"+Ze[n]]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.notify.apply(t,u([],a(n),!1))}})),e}(),T=new Map,E=new Map,C={},P=o({},O);function k(){A&&x&&(I(),l(A,S,h.style,N.projection))}function I(){r(N,S,O,n,h)}function F(){M.notifyUpdate(O)}function R(t,n){var e=n.onChange((function(n){O[t]=n,h.onUpdate&&qt.update(F,!1,!0)})),r=n.onRenderRequest(N.scheduleRender);E.set(t,(function(){e(),r()}))}var j=v(h);for(var D in j){var B=j[D];void 0!==O[D]&&We(B)&&B.set(O[D],!1)}var L=Zn(h),U=function(t){return Boolean(Zn(t)||t.variants)}(h),N=o(o({treeType:e,current:null,depth:m?m.depth+1:0,parent:m,children:new Set,presenceId:g,shouldReduceMotion:w,variantChildren:U?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==m?void 0:m.isMounted()),blockInitialAnimation:y,isMounted:function(){return Boolean(A)},mount:function(t){x=!0,A=N.current=t,N.projection&&N.projection.mount(t),U&&m&&!L&&(V=null==m?void 0:m.addVariantChild(N)),T.forEach((function(t,n){return R(n,t)})),null==m||m.children.add(N),N.setProps(h)},unmount:function(){var t;null===(t=N.projection)||void 0===t||t.unmount(),Kt.update(F),Kt.render(k),E.forEach((function(t){return t()})),null==V||V(),null==m||m.children.delete(N),M.clearAllListeners(),A=void 0,x=!1},addVariantChild:function(t){var n,e=N.getClosestVariantNode();if(e)return null===(n=e.variantChildren)||void 0===n||n.add(t),function(){return e.variantChildren.delete(t)}},sortNodePosition:function(t){return p&&e===t.treeType?p(N.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return U?N:null==m?void 0:m.getClosestVariantNode()},getLayoutId:function(){return h.layoutId},getInstance:function(){return A},getStaticValue:function(t){return O[t]},setStaticValue:function(t,n){return O[t]=n},getLatestValues:function(){return O},setVisibility:function(t){N.isVisible!==t&&(N.isVisible=t,N.scheduleRender())},makeTargetAnimatable:function(t,n){return void 0===n&&(n=!0),s(N,t,h,n)},measureViewportBox:function(){return c(A,h)},addValue:function(t,n){N.hasValue(t)&&N.removeValue(t),T.set(t,n),O[t]=n.get(),R(t,n)},removeValue:function(t){var n;T.delete(t),null===(n=E.get(t))||void 0===n||n(),E.delete(t),delete O[t],d(t,S)},hasValue:function(t){return T.has(t)},getValue:function(t,n){var e=T.get(t);return void 0===e&&void 0!==n&&(e=Bn(n),N.addValue(t,e)),e},forEachValue:function(t){return T.forEach(t)},readValue:function(t){var e;return null!==(e=O[t])&&void 0!==e?e:f(A,t,n)},setBaseTarget:function(t,n){P[t]=n},getBaseTarget:function(t){if(i){var n=i(h,t);if(void 0!==n&&!We(n))return n}return P[t]}},M),{build:function(){return I(),S},scheduleRender:function(){qt.render(k,!1,!0)},syncRender:k,setProps:function(t){(t.transformTemplate||h.transformTemplate)&&N.scheduleRender(),h=t,M.updatePropListeners(t),C=function(t,n,e){var r;for(var o in n){var i=n[o],a=e[o];if(We(i))t.addValue(o,i);else if(We(a))t.addValue(o,Bn(i));else if(a!==i)if(t.hasValue(o)){var u=t.getValue(o);!u.hasAnimated&&u.set(i)}else t.addValue(o,Bn(null!==(r=t.getStaticValue(o))&&void 0!==r?r:i))}for(var o in e)void 0===n[o]&&t.removeValue(o);return n}(N,v(h),C)},getProps:function(){return h},getVariant:function(t){var n;return null===(n=h.variants)||void 0===n?void 0:n[t]},getDefaultTransition:function(){return h.transition},getTransformPagePoint:function(){return h.transformPagePoint},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==m?void 0:m.getVariantContext();if(!L){var n=(null==m?void 0:m.getVariantContext())||{};return void 0!==h.initial&&(n.initial=h.initial),n}for(var e={},r=0;r<Ke;r++){var o=qe[r],i=h[o];(Hn(i)||!1===i)&&(e[o]=i)}return e}});return N}},qe=u(["initial"],a(ue),!1),Ke=qe.length,Ge={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Je(t){return t.startsWith("--")}var _e=function(t,n){return n&&"number"==typeof t?n.transform(t):t};function Qe(t,n,e,r){var o,i=t.style,a=t.vars,u=t.transform,s=t.transformKeys,c=t.transformOrigin;s.length=0;var l=!1,f=!1,d=!0;for(var p in n){var v=n[p];if(Je(p))a[p]=v;else{var m=An[p],h=_e(v,m);if(Qn(p)){if(l=!0,u[p]=h,s.push(p),!d)continue;v!==(null!==(o=m.default)&&void 0!==o?o:0)&&(d=!1)}else ee(p)?(c[p]=h,f=!0):i[p]=h}}l?i.transform=function(t,n,e,r){var o=t.transform,i=t.transformKeys,a=n.enableHardwareAcceleration,u=void 0===a||a,s=n.allowTransformNone,c=void 0===s||s,l="";i.sort(Jn);for(var f=!1,d=i.length,p=0;p<d;p++){var v=i[p];l+="".concat(Ge[v]||v,"(").concat(o[v],") "),"z"===v&&(f=!0)}return!f&&u?l+="translateZ(0)":l=l.trim(),r?l=r(o,e?"":l):c&&e&&(l="none"),l}(t,e,d,r):r?i.transform=r({},""):!n.transform&&i.transform&&(i.transform="none"),f&&(i.transformOrigin=function(t){var n=t.originX,e=void 0===n?"50%":n,r=t.originY,o=void 0===r?"50%":r,i=t.originZ,a=void 0===i?0:i;return"".concat(e," ").concat(o," ").concat(a)}(c))}function tr(t){return"string"==typeof t&&t.startsWith("var(--")}var nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function er(t,n,e){var r=a(function(t){var n=nr.exec(t);if(!n)return[,];var e=a(n,3);return[e[1],e[2]]}(t),2),o=r[0],i=r[1];if(o){var u=window.getComputedStyle(n).getPropertyValue(o);return u?u.trim():tr(i)?er(i,n):i}}var rr,or=new Set(["width","height","top","left","right","bottom","x","y"]),ir=function(t){return or.has(t)},ar=function(t,n){t.set(n,!1),t.set(n)},ur=function(t){return t===k||t===B};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(rr||(rr={}));var sr=function(t,n){return parseFloat(t.split(", ")[n])},cr=function(t,n){return function(e,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return sr(i[1],n);var a=o.match(/^matrix\((.+)\)$/);return a?sr(a[1],t):0}},lr=new Set(["x","y","z"]),fr=Gn.filter((function(t){return!lr.has(t)}));var dr={width:function(t,n){var e=t.x,r=n.paddingLeft,o=void 0===r?"0":r,i=n.paddingRight,a=void 0===i?"0":i;return e.max-e.min-parseFloat(o)-parseFloat(a)},height:function(t,n){var e=t.y,r=n.paddingTop,o=void 0===r?"0":r,i=n.paddingBottom,a=void 0===i?"0":i;return e.max-e.min-parseFloat(o)-parseFloat(a)},top:function(t,n){var e=n.top;return parseFloat(e)},left:function(t,n){var e=n.left;return parseFloat(e)},bottom:function(t,n){var e=t.y,r=n.top;return parseFloat(r)+(e.max-e.min)},right:function(t,n){var e=t.x,r=n.left;return parseFloat(r)+(e.max-e.min)},x:cr(4,13),y:cr(5,14)},pr=function(t,n,e,r){void 0===e&&(e={}),void 0===r&&(r={}),n=o({},n),r=o({},r);var i=Object.keys(n).filter(ir),u=[],s=!1,c=[];if(i.forEach((function(o){var i=t.getValue(o);if(t.hasValue(o)){var a,l=e[o],f=Nn(l),d=n[o];if(p(d)){var v=d.length,m=null===d[0]?1:0;l=d[m],f=Nn(l);for(var h=m;h<v;h++)a?Nn(d[h]):a=Nn(d[h])}else a=Nn(d);if(f!==a)if(ur(f)&&ur(a)){var g=i.get();"string"==typeof g&&i.set(parseFloat(g)),"string"==typeof d?n[o]=parseFloat(d):Array.isArray(d)&&a===B&&(n[o]=d.map(parseFloat))}else(null==f?void 0:f.transform)&&(null==a?void 0:a.transform)&&(0===l||0===d)?0===l?i.set(a.transform(l)):n[o]=f.transform(d):(s||(u=function(t){var n=[];return fr.forEach((function(e){var r=t.getValue(e);void 0!==r&&(n.push([e,r.get()]),r.set(e.startsWith("scale")?1:0))})),n.length&&t.syncRender(),n}(t),s=!0),c.push(o),r[o]=void 0!==r[o]?r[o]:n[o],ar(i,d))}})),c.length){var l=c.indexOf("height")>=0?window.pageYOffset:null,f=function(t,n,e){var r=n.measureViewportBox(),o=n.getInstance(),i=getComputedStyle(o),a=i.display,u={};"none"===a&&n.setStaticValue("display",t.display||"block"),e.forEach((function(t){u[t]=dr[t](r,i)})),n.syncRender();var s=n.measureViewportBox();return e.forEach((function(e){var r=n.getValue(e);ar(r,u[e]),t[e]=dr[e](s,i)})),t}(n,t,c);return u.length&&u.forEach((function(n){var e=a(n,2),r=e[0],o=e[1];t.getValue(r).set(o)})),t.syncRender(),null!==l&&window.scrollTo({top:l}),{target:f,transitionEnd:r}}return{target:n,transitionEnd:r}};function vr(t,n,e,r){return function(t){return Object.keys(t).some(ir)}(n)?pr(t,n,e,r):{target:n,transitionEnd:r}}var mr=function(t,n,e,r){var a=function(t,n,e){var r,a=i(n,[]),u=t.getInstance();if(!(u instanceof Element))return{target:a,transitionEnd:e};for(var s in e&&(e=o({},e)),t.forEachValue((function(t){var n=t.get();if(tr(n)){var e=er(n,u);e&&t.set(e)}})),a){var c=a[s];if(tr(c)){var l=er(c,u);l&&(a[s]=l,e&&(null!==(r=e[s])&&void 0!==r||(e[s]=c)))}}return{target:a,transitionEnd:e}}(t,n,r);return vr(t,n=a.target,e,r=a.transitionEnd)},hr={};function gr(t,n){var e=n.layout,r=n.layoutId;return Qn(t)||ee(t)||(e||void 0!==r)&&(!!hr[t]||"opacity"===t)}function yr(t){var n=t.style,e={};for(var r in n)(We(n[r])||gr(r,t))&&(e[r]=n[r]);return e}function br(t,n,e,r){var o=n.style,i=n.vars;for(var a in Object.assign(t.style,o,r&&r.getProjectionStyles(e)),i)t.style.setProperty(a,i[a])}var wr={treeType:"dom",readValueFromInstance:function(t,n){if(Qn(n)){var e=xn(n);return e&&e.default||0}var r,o=(r=t,window.getComputedStyle(r));return(Je(n)?o.getPropertyValue(n):o[n])||0},sortNodePosition:function(t,n){return 2&t.compareDocumentPosition(n)?1:-1},getBaseTarget:function(t,n){var e;return null===(e=t.style)||void 0===e?void 0:e[n]},measureViewportBox:function(t,n){return function(t,n){return e=function(t,n){if(!n)return t;var e=n({x:t.left,y:t.top}),r=n({x:t.right,y:t.bottom});return{top:e.y,left:e.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),n),r=e.top,{x:{min:e.left,max:e.right},y:{min:r,max:e.bottom}};var e,r}(t,n.transformPagePoint)},resetTransform:function(t,n,e){var r=e.transformTemplate;n.style.transform=r?r({},""):"none",t.scheduleRender()},restoreTransform:function(t,n){t.style.transform=n.style.transform},removeValueFromRenderState:function(t,n){var e=n.vars,r=n.style;delete e[t],delete r[t]},makeTargetAnimatable:function(t,n,e,r){var a=e.transformValues;void 0===r&&(r=!0);var u=n.transition,s=n.transitionEnd,c=i(n,["transition","transitionEnd"]),l=function(t,n,e){var r,o,i={};for(var a in t)i[a]=null!==(r=qn(a,n))&&void 0!==r?r:null===(o=e.getValue(a))||void 0===o?void 0:o.get();return i}(c,u||{},t);if(a&&(s&&(s=a(s)),c&&(c=a(c)),l&&(l=a(l))),r){!function(t,n,e){var r,o,i,a,u=Object.keys(n).filter((function(n){return!t.hasValue(n)})),s=u.length;if(s)for(var c=0;c<s;c++){var l=u[c],f=n[l],d=null;Array.isArray(f)&&(d=f[0]),null===d&&(d=null!==(o=null!==(r=e[l])&&void 0!==r?r:t.readValue(l))&&void 0!==o?o:n[l]),null!=d&&("string"==typeof d&&(/^\-?\d*\.?\d+$/.test(d)||Rn(d))?d=parseFloat(d):!zn(d)&&Q.test(f)&&(d=On(l,f)),t.addValue(l,Bn(d)),null!==(i=(a=e)[l])&&void 0!==i||(a[l]=d),t.setBaseTarget(l,d))}}(t,c,l);var f=mr(t,c,l,s);s=f.transitionEnd,c=f.target}return o({transition:u,transitionEnd:s},c)},scrapeMotionValuesFromProps:yr,build:function(t,n,e,r,o){void 0!==t.isVisible&&(n.style.visibility=t.isVisible?"visible":"hidden"),Qe(n,e,r,o.transformTemplate)},render:br},Ar=$e(wr);function Vr(t,n,e){return"string"==typeof t?t:B.transform(n+e*t)}var xr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Or={offset:"strokeDashoffset",array:"strokeDasharray"};function Sr(t,n,e,r){var o=n.attrX,a=n.attrY,u=n.originX,s=n.originY,c=n.pathLength,l=n.pathSpacing,f=void 0===l?1:l,d=n.pathOffset,p=void 0===d?0:d;Qe(t,i(n,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),e,r),t.attrs=t.style,t.style={};var v=t.attrs,m=t.style,h=t.dimensions;v.transform&&(h&&(m.transform=v.transform),delete v.transform),h&&(void 0!==u||void 0!==s||m.transform)&&(m.transformOrigin=function(t,n,e){var r=Vr(n,t.x,t.width),o=Vr(e,t.y,t.height);return"".concat(r," ").concat(o)}(h,void 0!==u?u:.5,void 0!==s?s:.5)),void 0!==o&&(v.x=o),void 0!==a&&(v.y=a),void 0!==c&&function(t,n,e,r,o){void 0===e&&(e=1),void 0===r&&(r=0),void 0===o&&(o=!0),t.pathLength=1;var i=o?xr:Or;t[i.offset]=B.transform(-r);var a=B.transform(n),u=B.transform(e);t[i.array]="".concat(a," ").concat(u)}(v,c,f,p,!1)}var Mr=/([a-z])([A-Z])/g,Tr=function(t){return t.replace(Mr,"$1-$2").toLowerCase()},Er=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);var Cr=$e(o(o({},wr),{getBaseTarget:function(t,n){return t[n]},readValueFromInstance:function(t,n){var e;return Qn(n)?(null===(e=xn(n))||void 0===e?void 0:e.default)||0:(n=Er.has(n)?n:Tr(n),t.getAttribute(n))},scrapeMotionValuesFromProps:function(t){var n=yr(t);for(var e in t){if(We(t[e]))n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},build:function(t,n,e,r,o){Sr(n,e,r,o.transformTemplate)},render:function(t,n,e,r){for(var o in br(t,n,void 0,r),n.attrs)t.setAttribute(Er.has(o)?o:Tr(o),n.attrs[o])}})),Pr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];var kr=o(o({renderer:function(t,n){return function(t){return"string"==typeof t&&!t.includes("-")&&!!(Pr.indexOf(t)>-1||/[A-Z]/.test(t))}(t)?Cr(n,{enableHardwareAcceleration:!1}):Ar(n,{enableHardwareAcceleration:!0})}},ve),He);export{kr as domAnimation};