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