framer-motion 7.7.0 → 7.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +549 -174
- package/dist/es/animation/legacy-popmotion/index.mjs +5 -3
- package/dist/es/animation/legacy-popmotion/inertia.mjs +2 -2
- package/dist/es/animation/utils/is-animatable.mjs +1 -1
- package/dist/es/animation/utils/transitions.mjs +5 -2
- package/dist/es/frameloop/create-render-step.mjs +88 -0
- package/dist/es/frameloop/data.mjs +6 -0
- package/dist/es/frameloop/index.mjs +59 -0
- package/dist/es/frameloop/on-next-frame.mjs +12 -0
- package/dist/es/gestures/PanSession.mjs +4 -3
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +4 -5
- package/dist/es/gestures/drag/utils/constraints.mjs +1 -2
- package/dist/es/motion/features/layout/MeasureLayout.mjs +1 -1
- package/dist/es/projection/animation/mix-values.mjs +7 -8
- package/dist/es/projection/geometry/delta-remove.mjs +1 -1
- package/dist/es/projection/node/create-projection-node.mjs +1 -1
- package/dist/es/projection/styles/scale-border-radius.mjs +1 -1
- package/dist/es/projection/styles/scale-box-shadow.mjs +1 -1
- package/dist/es/render/VisualElement.mjs +1 -1
- package/dist/es/render/dom/utils/unit-conversion.mjs +2 -1
- package/dist/es/render/dom/value-types/animatable-none.mjs +2 -1
- package/dist/es/render/dom/value-types/defaults.mjs +2 -1
- package/dist/es/render/dom/value-types/dimensions.mjs +2 -1
- package/dist/es/render/dom/value-types/find.mjs +2 -1
- package/dist/es/render/dom/value-types/number.mjs +2 -1
- package/dist/es/render/dom/value-types/type-int.mjs +1 -1
- package/dist/es/render/svg/utils/path.mjs +1 -1
- package/dist/es/render/svg/utils/transform-origin.mjs +1 -1
- package/dist/es/render/utils/animation-state.mjs +1 -2
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/render/utils/setters.mjs +1 -1
- package/dist/es/utils/delay.mjs +1 -1
- package/dist/es/utils/interpolate.mjs +1 -1
- package/dist/es/utils/mix-color.mjs +4 -1
- package/dist/es/utils/mix-complex.mjs +5 -24
- package/dist/es/utils/use-animation-frame.mjs +1 -1
- package/dist/es/utils/use-force-update.mjs +1 -1
- package/dist/es/utils/use-instant-transition.mjs +1 -1
- package/dist/es/value/index.mjs +4 -3
- package/dist/es/value/types/color/hex.mjs +40 -0
- package/dist/es/value/types/color/hsla.mjs +22 -0
- package/dist/es/value/types/color/index.mjs +28 -0
- package/dist/es/value/types/color/rgba.mjs +25 -0
- package/dist/es/value/types/color/utils.mjs +23 -0
- package/dist/es/value/types/complex/filter.mjs +30 -0
- package/dist/es/value/types/complex/index.mjs +61 -0
- package/dist/es/value/types/numbers/index.mjs +17 -0
- package/dist/es/value/types/numbers/units.mjs +19 -0
- package/dist/es/value/types/utils.mjs +15 -0
- package/dist/es/value/use-combine-values.mjs +1 -1
- package/dist/framer-motion.dev.js +304 -249
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/projection.dev.js +5455 -5397
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.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/dist/size-webpack-m.js +1 -1
- package/dist/three-entry.d.ts +7 -2
- package/package.json +9 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{t as r,v as a,w as l,x as u,y as c,z as h,A as d,B as p,C as m,i as f,D as v,E as g,F as y,a as x,u as b,M as P,P as V,G as T,H as E,g as A,L as S,S as w,d as M,r as C,I as D,J as R,K as B,N as L,o as k,O as F,Q as j,n as I,c as U,b as O,m as N,f as z,R as $,h as G,q as H,T as W,U as Y,V as X,s as q,j as K,p as Z,k as _,l as J}from"./size-rollup-dom-max-assets.js";const Q=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),tt=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},et={test:Q("hsl","hue"),parse:tt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},nt=p(0,255),it=Object.assign(Object.assign({},d),{transform:t=>Math.round(nt(t))}),ot={test:Q("rgb","red"),parse:tt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+c(h.transform(i))+")"};const st={test:Q("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:ot.transform},rt={test:t=>ot.test(t)||st.test(t)||et.test(t),parse:t=>ot.test(t)?ot.parse(t):et.test(t)?et.parse(t):st.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?ot.transform(t):et.transform(t)};function at(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(rt.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function lt(t){return at(t).values}function ut(t){const{values:e,numColors:n,tokenised:i}=at(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?rt.transform(t[i]):c(t[i]));return e}}const ct=t=>"number"==typeof t?0:t;const ht={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:lt,createTransformer:ut,getAnimatableNone:function(t){const e=lt(t);return ut(t)(e.map(ct))}},dt=new Set(["brightness","contrast","saturate","opacity"]);function pt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=dt.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const mt=/([a-z-]*)\(.*?\)/g,ft=Object.assign(Object.assign({},ht),{getAnimatableNone:t=>{const e=t.match(mt);return e?e.map(pt).join(" "):t}});function vt(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function gt(t){return!!t.touches}const yt={pageX:0,pageY:0};function xt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||yt;return{x:n[e+"X"],y:n[e+"Y"]}}function bt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Pt(t,e="page"){return{point:gt(t)?xt(t,e):bt(t,e)}}const Vt=(t,e=!1)=>{const n=e=>t(e,Pt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},Tt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Et="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Tt()),1/60*1e3);let At=!0,St=!1,wt=!1;const Mt={delta:0,timestamp:0},Ct=["read","update","preRender","render","postRender"],Dt=Ct.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!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())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>St=!0),t),{}),Rt=Ct.reduce((t,e)=>{const n=Dt[e];return t[e]=(t,e=!1,i=!1)=>(St||jt(),n.schedule(t,e,i)),t},{}),Bt=Ct.reduce((t,e)=>(t[e]=Dt[e].cancel,t),{}),Lt=Ct.reduce((t,e)=>(t[e]=()=>Dt[e].process(Mt),t),{}),kt=t=>Dt[t].process(Mt),Ft=t=>{St=!1,Mt.delta=At?1/60*1e3:Math.max(Math.min(t-Mt.timestamp,40),1),Mt.timestamp=t,wt=!0,Ct.forEach(kt),wt=!1,St&&(At=!1,Et(Ft))},jt=()=>{St=!0,At=!0,wt||Et(Ft)},It=()=>Mt,Ut=t=>1e3*t;function Ot(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Nt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return Ot(e,n,i,o)},[t,n,i,o])}const zt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},$t={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Gt(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?$t[t]:f&&null===window.onmousedown?zt[t]:t}function Ht(t,e,n,i){return Ot(t,Gt(e),Vt(n,"pointerdown"===e),i)}function Wt(t,e,n,i){return Nt(t,Gt(e),n&&Vt(n,"pointerdown"===e),i)}const Yt=(t,e)=>n=>e(t(n)),Xt=(...t)=>t.reduce(Yt),qt=(t,e)=>Math.abs(t-e);class Kt{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=Jt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=qt(t.x,e.x),i=qt(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:o}=It();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Zt(e,this.transformPagePoint),vt(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=Jt(Zt(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},gt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=Zt(Pt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=It();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,Jt(i,this.history)),this.removeListeners=Xt(Ht(window,"pointermove",this.handlePointerMove),Ht(window,"pointerup",this.handlePointerUp),Ht(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bt.update(this.updatePoint)}}function Zt(t,e){return e?{point:e(t.point)}:t}function _t(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Jt({point:t},e){return{point:t,delta:_t(t,te(e)),offset:_t(t,Qt(e)),velocity:ee(e,.1)}}function Qt(t){return t[0]}function te(t){return t[t.length-1]}function ee(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=te(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ne(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ie=ne("dragHorizontal"),oe=ne("dragVertical");function se(t){let e=!1;if("y"===t)e=oe();else if("x"===t)e=ie();else{const t=ie(),n=oe();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function re(){const t=se(!0);return!t||(t(),!1)}const ae=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},le=(t,e,n)=>-n*t+n*e+t;function ue(t){return t.max-t.min}function ce(t,e=0,n=.01){return Math.abs(t-e)<=n}function he(t,e,n,i=.5){t.origin=i,t.originPoint=le(e.min,e.max,t.origin),t.scale=ue(n)/ue(e),(ce(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=le(n.min,n.max,t.origin)-t.originPoint,(ce(t.translate)||isNaN(t.translate))&&(t.translate=0)}function de(t,e,n,i){he(t.x,e.x,n.x,null==i?void 0:i.originX),he(t.y,e.y,n.y,null==i?void 0:i.originY)}function pe(t,e,n){t.min=n.min+e.min,t.max=t.min+ue(e)}function me(t,e,n){t.min=e.min-n.min,t.max=t.min+ue(e)}function fe(t,e,n){me(t.x,e.x,n.x),me(t.y,e.y,n.y)}const ve=(t,e,n)=>Math.min(Math.max(n,t),e);function ge(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 ye(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 xe=.35;function be(t,e,n){return{min:Pe(t,e),max:Pe(t,n)}}function Pe(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var Ve;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Ve||(Ve={}));function Te(t){return[t("x"),t("y")]}function Ee({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ae(t){return void 0===t||1===t}function Se({scale:t,scaleX:e,scaleY:n}){return!Ae(t)||!Ae(e)||!Ae(n)}function we(t){return Se(t)||Me(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Me(t){return Ce(t.x)||Ce(t.y)}function Ce(t){return t&&"0%"!==t}function De(t,e,n){return n+e*(t-n)}function Re(t,e,n,i,o){return void 0!==o&&(t=De(t,o,i)),De(t,n,i)+e}function Be(t,e=0,n=1,i,o){t.min=Re(t.min,e,n,i,o),t.max=Re(t.max,e,n,i,o)}function Le(t,{x:e,y:n}){Be(t.x,e.translate,e.scale,e.originPoint),Be(t.y,n.translate,n.scale,n.originPoint)}function ke(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Fe(t,e){t.min=t.min+e,t.max=t.max+e}function je(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=le(t.min,t.max,s);Be(t,e[n],e[i],r,e.scale)}const Ie=["x","scaleX","originX"],Ue=["y","scaleY","originY"];function Oe(t,e){je(t.x,e,Ie),je(t.y,e,Ue)}function Ne(t,e){return Ee(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 ze=t=>t,$e=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ge(t,e,n,i){if(t===e&&n===i)return ze;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=$e(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:$e(o(t),e,i)}const He=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,We=t=>e=>1-t(1-e),Ye=t=>t*t,Xe=We(Ye),qe=He(Ye),Ke=t=>1-Math.sin(Math.acos(t)),Ze=We(Ke),_e=He(Ze),Je=(t=1.525)=>e=>e*e*((t+1)*e-t),Qe=Je(),tn=We(Qe),en=He(Qe),nn=(t=>{const e=Je(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),on={linear:ze,easeIn:Ye,easeInOut:qe,easeOut:Xe,circIn:Ke,circInOut:_e,circOut:Ze,backIn:Qe,backInOut:en,backOut:tn,anticipate:nn},sn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Ge(e,n,i,o)}return"string"==typeof t?on[t]:t},rn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ht.test(e)||e.startsWith("url("))),an=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ln=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),un=()=>({type:"keyframes",ease:"linear",duration:.3}),cn=t=>({type:"keyframes",duration:.8,values:t}),hn={x:an,y:an,z:an,rotate:an,rotateX:an,rotateY:an,rotateZ:an,scaleX:ln,scaleY:ln,scale:ln,opacity:un,backgroundColor:un,color:un,default:ln},dn=(t,e)=>{let n;return n=v(e)?cn:hn[t]||hn.default,{to:e,...n(e)}},pn={...g,color:rt,backgroundColor:rt,outlineColor:rt,fill:rt,stroke:rt,borderColor:rt,borderTopColor:rt,borderRightColor:rt,borderBottomColor:rt,borderLeftColor:rt,filter:ft,WebkitFilter:ft},mn=t=>pn[t];function fn(t,e){var n;let i=mn(t);return i!==ft&&(i=ht),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const vn=!1;function gn(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Bt.read(i),t(s-e))};return Rt.read(i,!0),()=>Bt.read(i)}function yn(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 xn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},bn=[st,ot,et];function Pn(t){const e=(n=t,bn.find(t=>t.test(n)));var n;let i=e.parse(t);return e===et&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=yn(a,i,t+1/3),s=yn(a,i,t),r=yn(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const Vn=(t,e)=>{const n=Pn(t),i=Pn(e),o={...n};return t=>(o.red=xn(n.red,i.red,t),o.green=xn(n.green,i.green,t),o.blue=xn(n.blue,i.blue,t),o.alpha=le(n.alpha,i.alpha,t),ot.transform(o))};function Tn(t,e){return"number"==typeof t?n=>le(t,e,n):rt.test(t)?Vn(t,e):wn(t,e)}const En=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>Tn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},An=(t,e)=>{const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Tn(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function Sn(t){const e=ht.parse(t),n=e.length;let i=0,o=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:o++;return{parsed:e,numNumbers:i,numColors:o}}const wn=(t,e)=>{const n=ht.createTransformer(e),i=Sn(t),o=Sn(e);return i.numColors===o.numColors&&i.numNumbers>=o.numNumbers?Xt(En(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},Mn=(t,e)=>n=>le(t,e,n);function Cn(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?Mn:"string"==typeof s?rt.test(s)?Vn:wn:Array.isArray(s)?En:"object"==typeof s?An:Mn);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Xt(t,s)}i.push(s)}return i}function Dn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Cn(e,i,o),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=ae(t[n],t[n+1],e);return r[n](i)};return n?e=>l(ve(t[0],t[s-1],e)):l}function Rn(t,e){return t.map(()=>e||qe).splice(0,t.length-1)}function Bn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=ve(.05,1,r),t=ve(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/Ln(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Ln(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=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}(o,s,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 Ln(t,e){return t*Math.sqrt(1-e*e)}const kn=["duration","bounce"],Fn=["stiffness","damping","mass"];function jn(t,e){return e.some(e=>void 0!==t[e])}function In({from:t=0,to:e=1,restSpeed:n=2,restDelta:i=.01,...o}){const s={done:!1,value:t};let{stiffness:r,damping:a,mass:l,velocity:u,duration:c,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!jn(t,Fn)&&jn(t,kn)){const n=Bn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(o),d=Un,p=Un;function m(){const n=u?-u/1e3:0,o=e-t,s=a/(2*Math.sqrt(r*l)),c=Math.sqrt(r/l)/1e3;if(void 0===i&&(i=Math.min(Math.abs(e-t)/100,.4)),s<1){const t=Ln(c,s);d=i=>{const r=Math.exp(-s*c*i);return e-r*((n+s*c*o)/t*Math.sin(t*i)+o*Math.cos(t*i))},p=e=>{const i=Math.exp(-s*c*e);return s*c*i*(Math.sin(t*e)*(n+s*c*o)/t+o*Math.cos(t*e))-i*(Math.cos(t*e)*(n+s*c*o)-t*o*Math.sin(t*e))}}else if(1===s)d=t=>e-Math.exp(-c*t)*(o+(n+c*o)*t);else{const t=c*Math.sqrt(s*s-1);d=i=>{const r=Math.exp(-s*c*i),a=Math.min(t*i,300);return e-r*((n+s*c*o)*Math.sinh(a)+t*o*Math.cosh(a))/t}}}return m(),{next:t=>{const o=d(t);if(h)s.done=t>=c;else{const r=1e3*p(t),a=Math.abs(r)<=n,l=Math.abs(e-o)<=i;s.done=a&&l}return s.value=s.done?e:o,s},flipTarget:()=>{u=-u,[t,e]=[e,t],m()}}}In.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Un=t=>0;const On={decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}},keyframes:function({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return Dn(a,r,{ease:Array.isArray(n)?n:Rn(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}},spring:In};function Nn(t,e,n=0){return t-e-n}const zn=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Bt.update(e)}};function $n({from:t,autoplay:e=!0,driver:n=zn,elapsed:i=0,repeat:o=0,repeatType:s="loop",repeatDelay:r=0,onPlay:a,onStop:l,onComplete:u,onRepeat:c,onUpdate:h,type:d="keyframes",...p}){var m,f;let v,g,y,{to:x}=p,b=0,P=p.duration,V=!1,T=!0;const E=On[Array.isArray(x)?"keyframes":d];(null===(f=(m=E).needsInterpolation)||void 0===f?void 0:f.call(m,t,x))&&(y=Dn([0,100],[t,x],{clamp:!1}),t=0,x=100);const A=E({...p,from:t,to:x});function S(){b++,"reverse"===s?(T=b%2==0,i=function(t,e=0,n=0,i=!0){return i?Nn(e+-t,e,n):e-(t-e)+n}(i,P,r,T)):(i=Nn(i,P,r),"mirror"===s&&A.flipTarget()),V=!1,c&&c()}function w(t){if(T||(t=-t),i+=t,!V){const t=A.next(Math.max(0,i));g=t.value,y&&(g=y(g)),V=T?t.done:i<=0}null==h||h(g),V&&(0===b&&(null!=P||(P=i)),b<o?function(t,e,n,i){return i?t>=e+n:t<=-n}(i,P,r,T)&&S():(v.stop(),u&&u()))}return e&&(null==a||a(),v=n(w),v.start()),{stop:()=>{null==l||l(),v.stop()}}}function Gn(t,e){return e?t*(1e3/e):0}function Hn({ease:t,times:e,...n}){const i={...n};return e&&(i.offset=e),n.duration&&(i.duration=Ut(n.duration)),n.repeatDelay&&(i.repeatDelay=Ut(n.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(sn):sn(t)),"tween"===n.type&&(i.type="keyframes"),"spring"!==n.type&&(i.type="keyframes"),i}function Wn(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...dn(n,e.to)}),{...e,...Hn(t)}}function Yn(t,e,n,i,o){const s=Kn(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=rn(t,n);"none"===r&&a&&"string"==typeof n?r=fn(t,n):Xn(r)&&"string"==typeof n?r=qn(n):!Array.isArray(n)&&Xn(n)&&"string"==typeof r&&(n=qn(r));return rn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=$n({...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 y(t){g({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=Gn(t-c,It().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):$n({...Wn(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function Xn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function qn(t){return"number"==typeof t?0:fn("",t)}function Kn(t,e){return t[e]||t.default||t}function Zn(t,e,n,i={}){return vn&&(i={type:!1}),e.start(o=>{let s;const r=Yn(t,e,n,i,o),a=function(t,e){var n,i;return null!==(i=null!==(n=(Kn(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),l=()=>s=r();let u;return a?u=gn(l,Ut(a)):l(),()=>{u&&u(),s&&s.stop()}})}const _n=new WeakMap;class Jn{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 Kt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(Pt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=se(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),Te(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(o){i=ue(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Ve.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=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==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),null==s||s(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:o}=this.getProps();null==o||o(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(Ve.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Qn(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?le(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?le(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:ge(t.x,n,o),y:ge(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=xe){return!1===t?t=0:!0===t&&(t=xe),{x:be(t,"left","right"),y:be(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Te(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||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Ne(t,n),{scroll:o}=e;return o&&(Fe(i.x,o.offset.x),Fe(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:ye(t.x,e.x),y:ye(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=Ee(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Te(r=>{var l;if(!Qn(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return Zn(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Te(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Te(e=>{const{drag:n}=this.getProps();if(!Qn(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e];o.set(t[e]-le(n,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Te(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=ue(t),o=ue(e);return o>i?n=ae(e.min,e.max-i,t.min):i>o&&(n=ae(t.min,t.max-o,e.min)),ve(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Te(t=>{if(!Qn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(le(i,s,o[t]))})}addListeners(){var t;if(!this.visualElement.current)return;_n.set(this.visualElement,this);const e=Ht(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=Ot(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Te(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=xe,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function Qn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function ti(t){return e(()=>()=>t(),[])}const ei=t=>e=>(t(e),null),ni={pan:ei((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Wt(a,"pointerdown",l&&function(t){u.current=new Kt(t,h,{transformPagePoint:c})}),ti(()=>u.current&&u.current.end())})),drag:ei((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new Jn(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function ii(){const t=i(V);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function oi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const si={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!T.test(t))return t;t=parseFloat(t)}return`${oi(t,e.target.x)}% ${oi(t,e.target.y)}%`}};function ri(t){return"string"==typeof t&&t.startsWith("var(--")}const ai=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function li(t,e,n=1){const[i,o]=function(t){const e=ai.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():ri(o)?li(o,e,n+1):o}const ui={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(ai,t=>(s.push(t),"_$css")));const r=ht.parse(t);if(r.length>5)return i;const a=ht.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=le(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(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class ci extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;E(hi),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.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 hi={borderRadius:{...si,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:si,borderTopRightRadius:si,borderBottomLeftRadius:si,borderBottomRightRadius:si,boxShadow:ui},di={measureLayout:function(e){const[n,o]=ii(),s=i(S);return t.createElement(ci,{...e,layoutGroup:s,switchLayoutGroup:i(w),isPresent:n,safeToRemove:o})}};function pi(t,e){-1===t.indexOf(e)&&t.push(e)}function mi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class fi{constructor(){this.subscriptions=[]}add(t){return pi(this.subscriptions,t),()=>mi(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class vi{constructor(t){var e;this.version="7.7.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new fi,this.velocityUpdateSubscribers=new fi,this.renderSubscribers=new fi,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=It();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Gn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function gi(t){return new vi(t)}const yi=["TopLeft","TopRight","BottomLeft","BottomRight"],xi=yi.length,bi=t=>"string"==typeof t?parseFloat(t):t,Pi=t=>"number"==typeof t||T.test(t);function Vi(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Ti=Ai(0,.5,Ze),Ei=Ai(.5,.95,ze);function Ai(t,e,n){return i=>i<t?0:i>e?1:n(ae(t,e,i))}function Si(t,e){t.min=e.min,t.max=e.max}function wi(t,e){Si(t.x,e.x),Si(t.y,e.y)}function Mi(t,e,n,i,o){return t=De(t-=e,1/n,i),void 0!==o&&(t=De(t,1/o,i)),t}function Ci(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=le(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=le(s.min,s.max,i);t===s&&(a-=e),t.min=Mi(t.min,e,n,a,o),t.max=Mi(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Di=["x","scaleX","originX"],Ri=["y","scaleY","originY"];function Bi(t,e,n,i){Ci(t.x,e,Di,null==n?void 0:n.x,null==i?void 0:i.x),Ci(t.y,e,Ri,null==n?void 0:n.y,null==i?void 0:i.y)}function Li(t){return 0===t.translate&&1===t.scale}function ki(t){return Li(t.x)&&Li(t.y)}function Fi(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 ji(t){return ue(t.x)/ue(t.y)}class Ii{constructor(){this.members=[]}add(t){pi(this.members,t),t.scheduleRender()}remove(t){if(mi(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:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ui(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y;if((o||s)&&(i=`translate3d(${o}px, ${s}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}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 Oi=(t,e)=>t.depth-e.depth;class Ni{constructor(){this.children=[],this.isDirty=!1}add(t){pi(this.children,t),this.isDirty=!0}remove(t){mi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Oi),this.isDirty=!1,this.children.forEach(t)}}const zi=["","X","Y","Z"];let $i=0;function Gi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=$i++,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(Yi),this.nodes.forEach(_i),this.nodes.forEach(Ji)},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 Ni)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new fi),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:o,layout:s,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&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=gn(i,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(Zi))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:oo,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Fi(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={...Kn(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Zi(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,Bt.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(Qi),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:o,layout:s}=this.options;if(void 0===o&&!s)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(qi);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(so),this.potentialNodes.clear()),this.nodes.forEach(Ki),this.nodes.forEach(Hi),this.nodes.forEach(Wi),this.clearAllSnapshots(),Lt.update(),Lt.preRender(),Lt.render())}clearAllSnapshots(){this.nodes.forEach(Xi),this.sharedNodes.forEach(to)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.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(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!ki(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||we(this.latestValues)||r)&&(o(this.instance,s),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)),ro((i=n).x),ro(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&&(Fe(e.x,n.offset.x),Fe(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};wi(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;if(i!==this.root&&o&&s.layoutScroll){if(o.isRoot){wi(e,t);const{scroll:n}=this.root;n&&(Fe(e.x,-n.offset.x),Fe(e.y,-n.offset.y))}Fe(e.x,o.offset.x),Fe(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};wi(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&&Oe(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),we(i.latestValues)&&Oe(n,i.latestValues)}return we(this.latestValues)&&Oe(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};wi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!we(i.latestValues))continue;Se(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};wi(o,i.measurePageBox()),Bi(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layoutBox,o)}return we(this.latestValues)&&Bi(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}},fe(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),wi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,s,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)?(o=this.target,s=this.relativeTarget,r=this.relativeParent.target,pe(o.x,s.x,r.x),pe(o.y,s.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):wi(this.target,this.layout.layoutBox),Le(this.target,this.targetDelta)):wi(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}},fe(this.relativeTargetOrigin,this.target,t.target),wi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Se(this.parent.latestValues)&&!Me(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(),o=Boolean(this.resumingFrom)||this!==i;let s=!0;if(e&&(s=!1),o&&n&&(s=!1),s)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;wi(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){var o,s;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===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Oe(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Le(t,l)),i&&we(a.latestValues)&&Oe(t,a.latestValues));e.x=ke(e.x),e.y=ke(e.y)}(this.layoutCorrected,this.treeScale,this.path,o);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;de(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Ui(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 o=this.snapshot,s=(null==o?void 0:o.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}},c=(null==o?void 0:o.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),h=((null===(i=this.getStack())||void 0===i?void 0:i.members.length)||0)<=1,d=Boolean(c&&!h&&!0===this.options.crossfade&&!this.path.some(io));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var o,p,m,f;eo(a.x,t.x,i),eo(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)&&(fe(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),o=this.relativeTarget,p=this.relativeTargetOrigin,m=l,f=i,no(o.x,p.x,m.x,f),no(o.y,p.y,m.y,f)),c&&(this.animationValues=r,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=le(0,null!==(r=n.opacity)&&void 0!==r?r:1,Ti(i)),t.opacityExit=le(null!==(a=e.opacity)&&void 0!==a?a:1,0,Ei(i))):s&&(t.opacity=le(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<xi;o++){const s=`border${yi[o]}Radius`;let r=Vi(e,s),a=Vi(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Pi(r)===Pi(a)?(t[s]=Math.max(le(bi(r),bi(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=le(e.rotate||0,n.rotate||0,i))}(r,s,this.latestValues,i,d,h)),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&&(Bt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:gi(t);return Zn("",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:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ao(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ue(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=ue(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}wi(e,n),Oe(e,o),de(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ii);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.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<zi.length;e++){const o="rotate"+zi[e];n[o]&&(i[o]=n[o],t.setStaticValue(o,0))}null==t||t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;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&&!we(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=Ui(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.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:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in D){if(void 0===a[t])continue;const{correct:e,applyTo:n}=D[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}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(qi),this.root.sharedNodes.clear()}}}function Hi(t){t.updateLayout()}function Wi(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:i}=t.options,s=o.source!==t.layout.source;"size"===i?Te(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=ue(n);n.min=e[t].min,n.max=n.min+i}):ao(i,o.layoutBox,e)&&Te(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=ue(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}};de(r,e,o.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?de(a,t.applyTransform(n,!0),o.measuredBox):de(a,e,o.layoutBox);const l=!ki(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}};fe(n,o.layoutBox,t.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};fe(s,e,i.layoutBox),Fi(n,s)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,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 Yi(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Xi(t){t.clearSnapshot()}function qi(t){t.clearMeasurements()}function Ki(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Zi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function _i(t){t.resolveTargetDelta()}function Ji(t){t.calcProjection()}function Qi(t){t.resetRotation()}function to(t){t.removeLeadSnapshot()}function eo(t,e,n){t.translate=le(e.translate,0,n),t.scale=le(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function no(t,e,n,i){t.min=le(e.min,n.min,i),t.max=le(e.max,n.max,i)}function io(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const oo={duration:.45,ease:[.4,0,.1,1]};function so(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 ro(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ao(t,e,n){return"position"===t||"preserve-aspect"===t&&!ce(ji(e),ji(n),.2)}const lo=Gi({attachResizeListener:(t,e)=>Ot(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uo={current:void 0},co=Gi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!uo.current){const t=new lo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),uo.current=t}return uo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ho=t=>/^0[^.\s]+$/.test(t),po=t=>e=>e.test(t),mo=[d,T,u,R,B,L,{test:t=>"auto"===t,parse:t=>t}],fo=t=>mo.find(po(t)),vo=[...mo,rt,ht],go=t=>vo.find(po(t));function yo(t,e,n){const i=t.getProps();return k(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 xo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,gi(n))}function bo(t,e){if(!e)return;return(e[t]||e.default||e).from}const Po=new Set(["width","height","top","left","right","bottom","x","y"]),Vo=t=>Po.has(t),To=(t,e)=>{t.set(e,!1),t.set(e)},Eo=t=>t===d||t===T;var Ao;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Ao||(Ao={}));const So=(t,e)=>parseFloat(t.split(", ")[e]),wo=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return So(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?So(e[1],t):0}},Mo=new Set(["x","y","z"]),Co=F.filter(t=>!Mo.has(t));const Do={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:wo(4,13),y:wo(5,14)},Ro=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(Vo);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=fo(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=fo(u);for(let n=e;n<t;n++)d?fo(h[n]):d=fo(h[n])}else d=fo(h);if(c!==d)if(Eo(c)&&Eo(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===T&&(e[o]=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[o]=c.transform(h):(r||(s=function(t){const e=[];return Co.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(o),i[o]=void 0!==i[o]?i[o]:e[o],To(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Do[t](i,s)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);To(i,a[n]),t[n]=Do[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function Bo(t,e,n,i){return(t=>Object.keys(t).some(Vo))(e)?Ro(t,e,n,i):{target:e,transitionEnd:i}}const Lo=(t,e,n,i)=>{const o=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(!ri(e))return;const n=li(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!ri(o))continue;const s=li(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return Bo(t,e=o.target,n,i=o.transitionEnd)},ko=("undefined"==typeof process||process.env,"production"),Fo={current:null},jo={current:!1};function Io(t){return Boolean(M(t)&&t.add)}function Uo(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 Oo(t,e,n={}){var i;const o=yo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>No(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(zo).forEach((t,i)=>{r.push(Oo(t,e,{...s,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function No(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&$o(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&j.has(e)&&(s={...s,type:!1,delay:0});let a=Zn(e,i,o,s);Io(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=yo(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){xo(t,e,y(s[e]))}}(t,a)})}function zo(t,e){return t.sortNodePosition(e)}function $o({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Go=[Ve.Animate,Ve.InView,Ve.Focus,Ve.Hover,Ve.Tap,Ve.Drag,Ve.Exit],Ho=[...Go].reverse(),Wo=Go.length;function Yo(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 o=e.map(e=>Oo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Oo(t,e,n);else{const o="function"==typeof e?yo(t,e,n.custom):e;i=No(t,o,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Xo(t){let e=Yo(t);const n={[Ve.Animate]:Ko(!0),[Ve.InView]:Ko(),[Ve.Hover]:Ko(),[Ve.Tap]:Ko(),[Ve.Drag]:Ko(),[Ve.Focus]:Ko(),[Ve.Exit]:Ko()};let i=!0;const o=(e,n)=>{const i=yo(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<Wo;e++){const m=Ho[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||I(g)||"boolean"==typeof g)continue;const P=qo(f.prevProp,g);let V=P||m===r&&f.isActive&&!b&&y||e>p&&y;const T=Array.isArray(g)?g:[g];let E=T.reduce(o,{});!1===x&&(E={});const{prevResolvedValues:A={}}=f,S={...A,...E},w=t=>{V=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in S){const e=E[t],n=A[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!Uo(e,n)||P?w(t):f.protectedKeys[t]=!0:void 0!==e?w(t):h.add(t):void 0!==e&&h.has(t)?w(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=E,f.isActive&&(d={...d,...E}),i&&t.blockInitialAnimation&&(V=!1),V&&!b&&c.push(...T.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){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=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function qo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Uo(e,t)}function Ko(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Zo=new Set;const _o=Object.keys(z),Jo=_o.length,Qo=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const ts=["initial",...Go],es=ts.length;class ns extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:i},o={}){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=()=>Rt.render(this.render,!1,!0);const{latestValues:s,renderState:r}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=r,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=O(e),this.isVariantNode=N(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!==s[t]&&M(e)&&(e.set(s[t],!1),Io(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){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)),jo.current||function(){if(jo.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fo.current=t.matches;t.addListener(e),e()}else Fo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Fo.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(),Bt.update(this.notifyUpdate),Bt.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=j.has(t),i=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Rt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<Jo;e++){const n=_o[e],{isEnabled:i,Component:o}=z[n];i(t)&&o&&a.push(s(o,{key:n,...t,visualElement:this}))}if(!this.projection&&o){this.projection=new o(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a}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(),this.props=t;for(let e=0;e<Qo.length;e++){const n=Qo[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 o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),Io(i)&&i.add(o);else if(M(r))t.addValue(o,gi(s)),Io(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,gi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}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<es;t++){const e=ts[t],n=this.props[e];(U(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){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}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=gi(e),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=k(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||M(o)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new fi),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},o){let s=function(t,e,n){var i;const o={};for(const s in t){const t=bo(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),s&&(s=i(s))),o){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||ho(u))?u=parseFloat(u):!go(u)&&ht.test(l)&&(u=fn(r,l)),t.addValue(r,gi(u)),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}(this,n,s);const t=Lo(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class is extends ns{readValueFromInstance(t,e){if(j.has(e)){const t=mn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ne(t,e)}build(t,e,n,i){G(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t){return H(t)}renderInstance(t,e,n,i){W(t,e,n,i)}}const os={animation:ei(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Xo(t)),I(n)&&e(()=>n.subscribe(t),[n])}),exit:ei(t=>{const{custom:n,visualElement:o}=t,[s,r]=ii(),a=i(V);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(Ve.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function ss(t,e,n){return(i,o)=>{vt(i)&&!re()&&(t.animationState&&t.animationState.setActive(Ve.Hover,e),n&&n(i,o))}}const rs=(t,e)=>!!e&&(t===e||rs(t,e.parentElement));const as=new WeakMap,ls=new WeakMap,us=t=>{const e=as.get(t.target);e&&e(t)},cs=t=>{t.forEach(us)};function hs(t,e,n){const i=function({root:t,...e}){const n=t||document;ls.has(n)||ls.set(n,{});const i=ls.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(cs,{root:t,...e})),i[o]}(e);return as.set(t,n),i.observe(t),()=>{as.delete(t),i.unobserve(t)}}const ds={some:0,all:1};function ps(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t||!i.current)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:ds[r]};return hs(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(Ve.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function ms(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==ko&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Zo.has(e)||(console.warn(e),s&&console.warn(s),Zo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(Ve.InView,!0)}))},[t])}const fs={inView:ei((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ms:ps)(a,r.current,t,s)})),tap:ei((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(Ve.Tap,!1),!re()}function d(e,n){h()&&(rs(s.current,e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=Xt(Ht(window,"pointerup",d,u),Ht(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(Ve.Tap,!0),e&&e(t,n))}Wt(s,"pointerdown",r?m:void 0,u),ti(c)})),focus:ei((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Nt(e,"focus",t?()=>{n&&n.setActive(Ve.Focus,!0)}:void 0),Nt(e,"blur",t?()=>{n&&n.setActive(Ve.Focus,!1)}:void 0)})),hover:ei((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Wt(i,"pointerenter",t||n?ss(i,!0,t):void 0,{passive:!t}),Wt(i,"pointerleave",e||n?ss(i,!1,e):void 0,{passive:!e})}))};class vs extends ns{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return j.has(e)?(null===(n=mn(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return q(t)}build(t,e,n,i){K(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Z(t,e,n,i)}mount(t){this.isSVGTag=_(t.tagName),super.mount(t)}}const gs={...{renderer:(t,e)=>J(t)?new vs(e,{enableHardwareAcceleration:!1}):new is(e,{enableHardwareAcceleration:!0}),...os,...fs},...ni,...di,projectionNodeConstructor:co};export{gs as domMax};
|
|
1
|
+
import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{i as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,C as f,D as v,E as g,F as y,a as x,u as b,M as P,P as V,G as T,H as E,g as A,L as S,S as w,d as M,r as C,I as D,J as R,K as B,N as L,o as k,O as F,Q as j,n as I,c as U,b as O,m as N,f as z,R as $,h as G,q as H,T as W,U as Y,V as X,s as q,j as K,p as Z,k as _,l as J}from"./size-rollup-dom-max-assets.js";function Q(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function tt(t){return!!t.touches}const et={pageX:0,pageY:0};function nt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||et;return{x:n[e+"X"],y:n[e+"Y"]}}function it(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function ot(t,e="page"){return{point:tt(t)?nt(t,e):it(t,e)}}const st=(t,e=!1)=>{const n=e=>t(e,ot(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},rt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),at="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(rt()),1/60*1e3);const lt={delta:0,timestamp:0};let ut=!0,ct=!1,ht=!1;const dt=["read","update","preRender","render","postRender"],pt=dt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!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())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>ct=!0),t),{}),mt=dt.reduce((t,e)=>{const n=pt[e];return t[e]=(t,e=!1,i=!1)=>(ct||xt(),n.schedule(t,e,i)),t},{}),ft=dt.reduce((t,e)=>(t[e]=pt[e].cancel,t),{}),vt=dt.reduce((t,e)=>(t[e]=()=>pt[e].process(lt),t),{}),gt=t=>pt[t].process(lt),yt=t=>{ct=!1,lt.delta=ut?1/60*1e3:Math.max(Math.min(t-lt.timestamp,40),1),lt.timestamp=t,ht=!0,dt.forEach(gt),ht=!1,ct&&(ut=!1,at(yt))},xt=()=>{ct=!0,ut=!0,ht||at(yt)},bt=t=>1e3*t;function Pt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Vt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return Pt(e,n,i,o)},[t,n,i,o])}const Tt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Et={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function At(t){return r&&null===window.onpointerdown?t:r&&null===window.ontouchstart?Et[t]:r&&null===window.onmousedown?Tt[t]:t}function St(t,e,n,i){return Pt(t,At(e),st(n,"pointerdown"===e),i)}function wt(t,e,n,i){return Vt(t,At(e),n&&st(n,"pointerdown"===e),i)}const Mt=(t,e)=>n=>e(t(n)),Ct=(...t)=>t.reduce(Mt),Dt=(t,e)=>Math.abs(t-e);class Rt{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=kt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Dt(t.x,e.x),i=Dt(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:o}=lt;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Bt(e,this.transformPagePoint),Q(t)&&0===t.buttons?this.handlePointerUp(t,e):mt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=kt(Bt(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},tt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=Bt(ot(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=lt;this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,kt(i,this.history)),this.removeListeners=Ct(St(window,"pointermove",this.handlePointerMove),St(window,"pointerup",this.handlePointerUp),St(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ft.update(this.updatePoint)}}function Bt(t,e){return e?{point:e(t.point)}:t}function Lt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function kt({point:t},e){return{point:t,delta:Lt(t,jt(e)),offset:Lt(t,Ft(e)),velocity:It(e,.1)}}function Ft(t){return t[0]}function jt(t){return t[t.length-1]}function It(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=jt(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>bt(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Ut(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Ot=Ut("dragHorizontal"),Nt=Ut("dragVertical");function zt(t){let e=!1;if("y"===t)e=Nt();else if("x"===t)e=Ot();else{const t=Ot(),n=Nt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function $t(){const t=zt(!0);return!t||(t(),!1)}const Gt=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Ht=(t,e,n)=>-n*t+n*e+t;function Wt(t){return t.max-t.min}function Yt(t,e=0,n=.01){return Math.abs(t-e)<=n}function Xt(t,e,n,i=.5){t.origin=i,t.originPoint=Ht(e.min,e.max,t.origin),t.scale=Wt(n)/Wt(e),(Yt(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ht(n.min,n.max,t.origin)-t.originPoint,(Yt(t.translate)||isNaN(t.translate))&&(t.translate=0)}function qt(t,e,n,i){Xt(t.x,e.x,n.x,null==i?void 0:i.originX),Xt(t.y,e.y,n.y,null==i?void 0:i.originY)}function Kt(t,e,n){t.min=n.min+e.min,t.max=t.min+Wt(e)}function Zt(t,e,n){t.min=e.min-n.min,t.max=t.min+Wt(e)}function _t(t,e,n){Zt(t.x,e.x,n.x),Zt(t.y,e.y,n.y)}function Jt(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Qt(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const te=.35;function ee(t,e,n){return{min:ne(t,e),max:ne(t,n)}}function ne(t,e){return"number"==typeof t?t:t[e]||0}var ie;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ie||(ie={}));function oe(t){return[t("x"),t("y")]}function se({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function re(t){return void 0===t||1===t}function ae({scale:t,scaleX:e,scaleY:n}){return!re(t)||!re(e)||!re(n)}function le(t){return ae(t)||ue(t)||t.z||t.rotate||t.rotateX||t.rotateY}function ue(t){return ce(t.x)||ce(t.y)}function ce(t){return t&&"0%"!==t}function he(t,e,n){return n+e*(t-n)}function de(t,e,n,i,o){return void 0!==o&&(t=he(t,o,i)),he(t,n,i)+e}function pe(t,e=0,n=1,i,o){t.min=de(t.min,e,n,i,o),t.max=de(t.max,e,n,i,o)}function me(t,{x:e,y:n}){pe(t.x,e.translate,e.scale,e.originPoint),pe(t.y,n.translate,n.scale,n.originPoint)}function fe(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ve(t,e){t.min=t.min+e,t.max=t.max+e}function ge(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=Ht(t.min,t.max,s);pe(t,e[n],e[i],r,e.scale)}const ye=["x","scaleX","originX"],xe=["y","scaleY","originY"];function be(t,e){ge(t.x,e,ye),ge(t.y,e,xe)}function Pe(t,e){return se(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 Ve=t=>t,Te=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ee(t,e,n,i){if(t===e&&n===i)return Ve;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Te(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:Te(o(t),e,i)}const Ae=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Se=t=>e=>1-t(1-e),we=t=>t*t,Me=Se(we),Ce=Ae(we),De=t=>1-Math.sin(Math.acos(t)),Re=Se(De),Be=Ae(Re),Le=(t=1.525)=>e=>e*e*((t+1)*e-t),ke=Le(),Fe=Se(ke),je=Ae(ke),Ie=(t=>{const e=Le(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),Ue={linear:Ve,easeIn:we,easeInOut:Ce,easeOut:Me,circIn:De,circInOut:Be,circOut:Re,backIn:ke,backInOut:je,backOut:Fe,anticipate:Ie},Oe=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Ee(e,n,i,o)}return"string"==typeof t?Ue[t]:t},Ne=(t,e)=>n=>Boolean(l(n)&&u.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ze=(t,e,n)=>i=>{if(!l(i))return i;const[o,s,r,a]=i.match(c);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},$e={...p,transform:t=>Math.round((t=>a(0,255,t))(t))},Ge={test:Ne("rgb","red"),parse:ze("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+$e.transform(t)+", "+$e.transform(e)+", "+$e.transform(n)+", "+h(d.transform(i))+")"};const He={test:Ne("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Ge.transform},We={test:Ne("hsl","hue"),parse:ze("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+m.transform(h(e))+", "+m.transform(h(n))+", "+h(d.transform(i))+")"},Ye={test:t=>Ge.test(t)||He.test(t)||We.test(t),parse:t=>Ge.test(t)?Ge.parse(t):We.test(t)?We.parse(t):He.parse(t),transform:t=>l(t)?t:t.hasOwnProperty("red")?Ge.transform(t):We.transform(t)};function Xe(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(f);o&&(n=o.length,t=t.replace(f,"${c}"),e.push(...o.map(Ye.parse)));const s=t.match(c);return s&&(i=s.length,t=t.replace(c,"${n}"),e.push(...s.map(p.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function qe(t){return Xe(t).values}function Ke(t){const{values:e,numColors:n,tokenised:i}=Xe(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?Ye.transform(t[i]):h(t[i]));return e}}const Ze=t=>"number"==typeof t?0:t;const _e={test:function(t){var e,n;return isNaN(t)&&l(t)&&((null===(e=t.match(c))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(f))||void 0===n?void 0:n.length)||0)>0},parse:qe,createTransformer:Ke,getAnimatableNone:function(t){const e=qe(t);return Ke(t)(e.map(Ze))}},Je=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!_e.test(e)||e.startsWith("url("))),Qe=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),tn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),en=()=>({type:"keyframes",ease:"linear",duration:.3}),nn=t=>({type:"keyframes",duration:.8,values:t}),on={x:Qe,y:Qe,z:Qe,rotate:Qe,rotateX:Qe,rotateY:Qe,rotateZ:Qe,scaleX:tn,scaleY:tn,scale:tn,opacity:en,backgroundColor:en,color:en,default:tn},sn=(t,e)=>{let n;return n=v(e)?nn:on[t]||on.default,{to:e,...n(e)}},rn=new Set(["brightness","contrast","saturate","opacity"]);function an(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(c)||[];if(!i)return t;const o=n.replace(i,"");let s=rn.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const ln=/([a-z-]*)\(.*?\)/g,un={..._e,getAnimatableNone:t=>{const e=t.match(ln);return e?e.map(an).join(" "):t}},cn={...g,color:Ye,backgroundColor:Ye,outlineColor:Ye,fill:Ye,stroke:Ye,borderColor:Ye,borderTopColor:Ye,borderRightColor:Ye,borderBottomColor:Ye,borderLeftColor:Ye,filter:un,WebkitFilter:un},hn=t=>cn[t];function dn(t,e){var n;let i=hn(t);return i!==un&&(i=_e),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const pn=!1;function mn(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(ft.read(i),t(s-e))};return mt.read(i,!0),()=>ft.read(i)}function fn(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 vn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},gn=[He,Ge,We];function yn(t){const e=(n=t,gn.find(t=>t.test(n)));var n;let i=e.parse(t);return e===We&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=fn(a,i,t+1/3),s=fn(a,i,t),r=fn(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const xn=(t,e)=>{const n=yn(t),i=yn(e),o={...n};return t=>(o.red=vn(n.red,i.red,t),o.green=vn(n.green,i.green,t),o.blue=vn(n.blue,i.blue,t),o.alpha=Ht(n.alpha,i.alpha,t),Ge.transform(o))};function bn(t,e){return"number"==typeof t?n=>Ht(t,e,n):Ye.test(t)?xn(t,e):Tn(t,e)}const Pn=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>bn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},Vn=(t,e)=>{const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=bn(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}},Tn=(t,e)=>{const n=_e.createTransformer(e),i=Xe(t),o=Xe(e);return i.numColors===o.numColors&&i.numNumbers>=o.numNumbers?Ct(Pn(i.values,o.values),n):n=>""+(n>0?e:t)},En=(t,e)=>n=>Ht(t,e,n);function An(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?En:"string"==typeof s?Ye.test(s)?xn:Tn:Array.isArray(s)?Pn:"object"==typeof s?Vn:En);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Ct(t,s)}i.push(s)}return i}function Sn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=An(e,i,o),l=r.length,u=e=>{let n=0;if(l>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=Gt(t[n],t[n+1],e);return r[n](i)};return n?e=>u(a(t[0],t[s-1],e)):u}function wn(t,e){return t.map(()=>e||Ce).splice(0,t.length-1)}function Mn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=a(.05,1,r),t=a(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/Cn(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Cn(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(l,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Cn(t,e){return t*Math.sqrt(1-e*e)}const Dn=["duration","bounce"],Rn=["stiffness","damping","mass"];function Bn(t,e){return e.some(e=>void 0!==t[e])}function Ln({from:t=0,to:e=1,restSpeed:n=2,restDelta:i=.01,...o}){const s={done:!1,value:t};let{stiffness:r,damping:a,mass:l,velocity:u,duration:c,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Bn(t,Rn)&&Bn(t,Dn)){const n=Mn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(o),d=kn,p=kn;function m(){const n=u?-u/1e3:0,o=e-t,s=a/(2*Math.sqrt(r*l)),c=Math.sqrt(r/l)/1e3;if(void 0===i&&(i=Math.min(Math.abs(e-t)/100,.4)),s<1){const t=Cn(c,s);d=i=>{const r=Math.exp(-s*c*i);return e-r*((n+s*c*o)/t*Math.sin(t*i)+o*Math.cos(t*i))},p=e=>{const i=Math.exp(-s*c*e);return s*c*i*(Math.sin(t*e)*(n+s*c*o)/t+o*Math.cos(t*e))-i*(Math.cos(t*e)*(n+s*c*o)-t*o*Math.sin(t*e))}}else if(1===s)d=t=>e-Math.exp(-c*t)*(o+(n+c*o)*t);else{const t=c*Math.sqrt(s*s-1);d=i=>{const r=Math.exp(-s*c*i),a=Math.min(t*i,300);return e-r*((n+s*c*o)*Math.sinh(a)+t*o*Math.cosh(a))/t}}}return m(),{next:t=>{const o=d(t);if(h)s.done=t>=c;else{const r=1e3*p(t),a=Math.abs(r)<=n,l=Math.abs(e-o)<=i;s.done=a&&l}return s.value=s.done?e:o,s},flipTarget:()=>{u=-u,[t,e]=[e,t],m()}}}Ln.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const kn=t=>0;const Fn={decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}},keyframes:function({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return Sn(a,r,{ease:Array.isArray(n)?n:wn(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}},spring:Ln};function jn(t,e,n=0){return t-e-n}const In=t=>{const e=({delta:e})=>t(e);return{start:()=>mt.update(e,!0),stop:()=>ft.update(e)}};function Un({from:t,autoplay:e=!0,driver:n=In,elapsed:i=0,repeat:o=0,repeatType:s="loop",repeatDelay:r=0,onPlay:a,onStop:l,onComplete:u,onRepeat:c,onUpdate:h,type:d="keyframes",...p}){var m,f;let v,g,y,{to:x}=p,b=0,P=p.duration,V=!1,T=!0;const E=Fn[Array.isArray(x)?"keyframes":d];(null===(f=(m=E).needsInterpolation)||void 0===f?void 0:f.call(m,t,x))&&(y=Sn([0,100],[t,x],{clamp:!1}),t=0,x=100);const A=E({...p,from:t,to:x});function S(){b++,"reverse"===s?(T=b%2==0,i=function(t,e=0,n=0,i=!0){return i?jn(e+-t,e,n):e-(t-e)+n}(i,P,r,T)):(i=jn(i,P,r),"mirror"===s&&A.flipTarget()),V=!1,c&&c()}function w(t){if(T||(t=-t),i+=t,!V){const t=A.next(Math.max(0,i));g=t.value,y&&(g=y(g)),V=T?t.done:i<=0}null==h||h(g),V&&(0===b&&(P=void 0!==P?P:i),b<o?function(t,e,n,i){return i?t>=e+n:t<=-n}(i,P,r,T)&&S():(v.stop(),u&&u()))}return e&&(null==a||a(),v=n(w),v.start()),{stop:()=>{null==l||l(),v.stop()}}}function On(t,e){return e?t*(1e3/e):0}function Nn({ease:t,times:e,...n}){const i={...n};return e&&(i.offset=e),n.duration&&(i.duration=bt(n.duration)),n.repeatDelay&&(i.repeatDelay=bt(n.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Oe):Oe(t)),"tween"===n.type&&(i.type="keyframes"),"spring"!==n.type&&(i.type="keyframes"),i}function zn(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...sn(n,e.to)}),{...e,...Nn(t)}}function $n(t,e,n,i,o){const s=Wn(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=Je(t,n);"none"===r&&a&&"string"==typeof n?r=dn(t,n):Gn(r)&&"string"==typeof n?r=Hn(n):!Array.isArray(n)&&Gn(n)&&"string"==typeof r&&(n=Hn(r));return Je(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=Un({...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 y(t){g({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=On(t-c,lt.delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):Un({...zn(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function Gn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Hn(t){return"number"==typeof t?0:dn("",t)}function Wn(t,e){return t[e]||t.default||t}function Yn(t,e,n,i={}){return pn&&(i={type:!1}),e.start(o=>{let s;const r=$n(t,e,n,i,o),a=function(t,e){const n=Wn(t,e)||{};return void 0!==n.delay?n.delay:void 0!==t.delay?t.delay:0}(i,t),l=()=>s=r();let u;return a?u=mn(l,bt(a)):l(),()=>{u&&u(),s&&s.stop()}})}const Xn=new WeakMap;class qn{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 Rt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(ot(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=zt(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),oe(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(m.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(o){i=Wt(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(ie.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=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==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),null==s||s(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:o}=this.getProps();null==o||o(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(ie.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Kn(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Ht(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Ht(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:Jt(t.x,n,o),y:Jt(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=te){return!1===t?t=0:!0===t&&(t=te),{x:ee(t,"left","right"),y:ee(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&oe(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||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Pe(t,n),{scroll:o}=e;return o&&(ve(i.x,o.offset.x),ve(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:Qt(t.x,e.x),y:Qt(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=se(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=oe(r=>{if(!Kn(r,e,this.currentDirection))return;let l=(null==a?void 0:a[r])||{};s&&(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,...o,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return Yn(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){oe(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){oe(e=>{const{drag:n}=this.getProps();if(!Kn(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e];o.set(t[e]-Ht(n,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};oe(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=Wt(t),o=Wt(e);return o>i?n=Gt(e.min,e.max-i,t.min):i>o&&(n=Gt(t.min,t.max-o,e.min)),a(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),oe(t=>{if(!Kn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(Ht(i,s,o[t]))})}addListeners(){var t;if(!this.visualElement.current)return;Xn.set(this.visualElement,this);const e=St(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=Pt(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(oe(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=te,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function Kn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Zn(t){return e(()=>()=>t(),[])}const _n=t=>e=>(t(e),null),Jn={pan:_n((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),wt(a,"pointerdown",l&&function(t){u.current=new Rt(t,h,{transformPagePoint:c})}),Zn(()=>u.current&&u.current.end())})),drag:_n((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new qn(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function Qn(){const t=i(V);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function ti(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ei={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!T.test(t))return t;t=parseFloat(t)}return`${ti(t,e.target.x)}% ${ti(t,e.target.y)}%`}};function ni(t){return"string"==typeof t&&t.startsWith("var(--")}const ii=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function oi(t,e,n=1){const[i,o]=function(t){const e=ii.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():ni(o)?oi(o,e,n+1):o}const si={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(ii,t=>(s.push(t),"_$css")));const r=_e.parse(t);if(r.length>5)return i;const a=_e.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=Ht(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(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class ri extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;E(ai),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||mt.postRender(()=>{var t;(null===(t=s.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 ai={borderRadius:{...ei,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ei,borderTopRightRadius:ei,borderBottomLeftRadius:ei,borderBottomRightRadius:ei,boxShadow:si},li={measureLayout:function(e){const[n,o]=Qn(),s=i(S);return t.createElement(ri,{...e,layoutGroup:s,switchLayoutGroup:i(w),isPresent:n,safeToRemove:o})}};function ui(t,e){-1===t.indexOf(e)&&t.push(e)}function ci(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class hi{constructor(){this.subscriptions=[]}add(t){return ui(this.subscriptions,t),()=>ci(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class di{constructor(t){var e;this.version="7.7.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new hi,this.velocityUpdateSubscribers=new hi,this.renderSubscribers=new hi,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=lt;this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,mt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>mt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?On(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function pi(t){return new di(t)}const mi=["TopLeft","TopRight","BottomLeft","BottomRight"],fi=mi.length,vi=t=>"string"==typeof t?parseFloat(t):t,gi=t=>"number"==typeof t||T.test(t);function yi(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const xi=Pi(0,.5,Re),bi=Pi(.5,.95,Ve);function Pi(t,e,n){return i=>i<t?0:i>e?1:n(Gt(t,e,i))}function Vi(t,e){t.min=e.min,t.max=e.max}function Ti(t,e){Vi(t.x,e.x),Vi(t.y,e.y)}function Ei(t,e,n,i,o){return t=he(t-=e,1/n,i),void 0!==o&&(t=he(t,1/o,i)),t}function Ai(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(m.test(e)){e=parseFloat(e);e=Ht(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Ht(s.min,s.max,i);t===s&&(a-=e),t.min=Ei(t.min,e,n,a,o),t.max=Ei(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Si=["x","scaleX","originX"],wi=["y","scaleY","originY"];function Mi(t,e,n,i){Ai(t.x,e,Si,null==n?void 0:n.x,null==i?void 0:i.x),Ai(t.y,e,wi,null==n?void 0:n.y,null==i?void 0:i.y)}function Ci(t){return 0===t.translate&&1===t.scale}function Di(t){return Ci(t.x)&&Ci(t.y)}function Ri(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 Wt(t.x)/Wt(t.y)}class Li{constructor(){this.members=[]}add(t){ui(this.members,t),t.scheduleRender()}remove(t){if(ci(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:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ki(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y;if((o||s)&&(i=`translate3d(${o}px, ${s}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}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 Fi=(t,e)=>t.depth-e.depth;class ji{constructor(){this.children=[],this.isDirty=!1}add(t){ui(this.children,t),this.isDirty=!0}remove(t){ci(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Fi),this.isDirty=!1,this.children.forEach(t)}}const Ii=["","X","Y","Z"];let Ui=0;function Oi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=Ui++,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(Xi),this.nodes.forEach(qi)},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 ji)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new hi),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:o,layout:s,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&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=mn(i,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(Yi))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:to,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Ri(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={...Wn(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Yi(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,ft.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(Ki),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:o,layout:s}=this.options;if(void 0===o&&!s)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(Hi);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(eo),this.potentialNodes.clear()),this.nodes.forEach(Wi),this.nodes.forEach(Ni),this.nodes.forEach(zi),this.clearAllSnapshots(),vt.update(),vt.preRender(),vt.render())}clearAllSnapshots(){this.nodes.forEach(Gi),this.sharedNodes.forEach(Zi)}scheduleUpdateProjection(){mt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){mt.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(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Di(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||le(this.latestValues)||r)&&(o(this.instance,s),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)),no((i=n).x),no(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&&(ve(e.x,n.offset.x),ve(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Ti(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;if(i!==this.root&&o&&s.layoutScroll){if(o.isRoot){Ti(e,t);const{scroll:n}=this.root;n&&(ve(e.x,-n.offset.x),ve(e.y,-n.offset.y))}ve(e.x,o.offset.x),ve(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Ti(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&&be(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),le(i.latestValues)&&be(n,i.latestValues)}return le(this.latestValues)&&be(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Ti(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!le(i.latestValues))continue;ae(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Ti(o,i.measurePageBox()),Mi(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layoutBox,o)}return le(this.latestValues)&&Mi(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}},_t(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Ti(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,s,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)?(o=this.target,s=this.relativeTarget,r=this.relativeParent.target,Kt(o.x,s.x,r.x),Kt(o.y,s.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Ti(this.target,this.layout.layoutBox),me(this.target,this.targetDelta)):Ti(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}},_t(this.relativeTargetOrigin,this.target,t.target),Ti(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!ae(this.parent.latestValues)&&!ue(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(),o=Boolean(this.resumingFrom)||this!==i;let s=!0;if(e&&(s=!1),o&&n&&(s=!1),s)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;Ti(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){var o,s;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===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&be(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,me(t,l)),i&&le(a.latestValues)&&be(t,a.latestValues));e.x=fe(e.x),e.y=fe(e.y)}(this.layoutCorrected,this.treeScale,this.path,o);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;qt(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=ki(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 o=this.snapshot,s=(null==o?void 0:o.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==o?void 0:o.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(Qi));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var o,d,p,f;_i(a.x,t.x,i),_i(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)&&(_t(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),o=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=i,Ji(o.x,d.x,p.x,f),Ji(o.y,d.y,p.y,f)),u&&(this.animationValues=r,function(t,e,n,i,o,s){o?(t.opacity=Ht(0,void 0!==n.opacity?n.opacity:1,xi(i)),t.opacityExit=Ht(void 0!==e.opacity?e.opacity:1,0,bi(i))):s&&(t.opacity=Ht(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let o=0;o<fi;o++){const s=`border${mi[o]}Radius`;let r=yi(e,s),a=yi(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||gi(r)===gi(a)?(t[s]=Math.max(Ht(vi(r),vi(a),i),0),(m.test(a)||m.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=Ht(e.rotate||0,n.rotate||0,i))}(r,s,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&&(ft.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=mt.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:pi(t);return Yn("",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:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&io(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Wt(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Wt(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Ti(e,n),be(e,o),qt(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Li);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.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<Ii.length;e++){const o="rotate"+Ii[e];n[o]&&(i[o]=n[o],t.setStaticValue(o,0))}null==t||t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;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&&!le(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=ki(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.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:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in D){if(void 0===a[t])continue;const{correct:e,applyTo:n}=D[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}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(Hi),this.root.sharedNodes.clear()}}}function Ni(t){t.updateLayout()}function zi(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:i}=t.options,s=o.source!==t.layout.source;"size"===i?oe(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=Wt(n);n.min=e[t].min,n.max=n.min+i}):io(i,o.layoutBox,e)&&oe(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=Wt(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}};qt(r,e,o.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?qt(a,t.applyTransform(n,!0),o.measuredBox):qt(a,e,o.layoutBox);const l=!Di(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}};_t(n,o.layoutBox,t.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};_t(s,e,i.layoutBox),Ri(n,s)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,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 Gi(t){t.clearSnapshot()}function Hi(t){t.clearMeasurements()}function Wi(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Yi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Xi(t){t.resolveTargetDelta()}function qi(t){t.calcProjection()}function Ki(t){t.resetRotation()}function Zi(t){t.removeLeadSnapshot()}function _i(t,e,n){t.translate=Ht(e.translate,0,n),t.scale=Ht(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ji(t,e,n,i){t.min=Ht(e.min,n.min,i),t.max=Ht(e.max,n.max,i)}function Qi(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const to={duration:.45,ease:[.4,0,.1,1]};function eo(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 no(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function io(t,e,n){return"position"===t||"preserve-aspect"===t&&!Yt(Bi(e),Bi(n),.2)}const oo=Oi({attachResizeListener:(t,e)=>Pt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),so={current:void 0},ro=Oi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!so.current){const t=new oo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),so.current=t}return so.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ao=t=>/^0[^.\s]+$/.test(t),lo=t=>e=>e.test(t),uo=[p,T,m,R,B,L,{test:t=>"auto"===t,parse:t=>t}],co=t=>uo.find(lo(t)),ho=[...uo,Ye,_e],po=t=>ho.find(lo(t));function mo(t,e,n){const i=t.getProps();return k(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 fo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pi(n))}function vo(t,e){if(!e)return;return(e[t]||e.default||e).from}const go=new Set(["width","height","top","left","right","bottom","x","y"]),yo=t=>go.has(t),xo=(t,e)=>{t.set(e,!1),t.set(e)},bo=t=>t===p||t===T;var Po;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Po||(Po={}));const Vo=(t,e)=>parseFloat(t.split(", ")[e]),To=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return Vo(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?Vo(e[1],t):0}},Eo=new Set(["x","y","z"]),Ao=F.filter(t=>!Eo.has(t));const So={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:To(4,13),y:To(5,14)},wo=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(yo);let s=[],a=!1;const l=[];if(o.forEach(o=>{const r=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=co(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=co(u);for(let n=e;n<t;n++)d?co(h[n]):d=co(h[n])}else d=co(h);if(c!==d)if(bo(c)&&bo(d)){const t=r.get();"string"==typeof t&&r.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===T&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?r.set(d.transform(u)):e[o]=c.transform(h):(a||(s=function(t){const e=[];return Ao.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),a=!0),l.push(o),i[o]=void 0!==i[o]?i[o]:e[o],xo(r,h))}),l.length){const n=l.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=So[t](i,s)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);xo(i,a[n]),t[n]=So[n](l,s)}),t})(e,t,l);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),r&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function Mo(t,e,n,i){return(t=>Object.keys(t).some(yo))(e)?wo(t,e,n,i):{target:e,transitionEnd:i}}const Co=(t,e,n,i)=>{const o=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(!ni(e))return;const n=oi(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!ni(o))continue;const s=oi(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return Mo(t,e=o.target,n,i=o.transitionEnd)},Do=("undefined"==typeof process||process.env,"production"),Ro={current:null},Bo={current:!1};function Lo(t){return Boolean(M(t)&&t.add)}function ko(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 Fo(t,e,n={}){var i;const o=mo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>jo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Io).forEach((t,i)=>{r.push(Fo(t,e,{...s,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function jo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&Uo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&j.has(e)&&(s={...s,type:!1,delay:0});let a=Yn(e,i,o,s);Lo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=mo(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){fo(t,e,y(s[e]))}}(t,a)})}function Io(t,e){return t.sortNodePosition(e)}function Uo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Oo=[ie.Animate,ie.InView,ie.Focus,ie.Hover,ie.Tap,ie.Drag,ie.Exit],No=[...Oo].reverse(),zo=Oo.length;function $o(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 o=e.map(e=>Fo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Fo(t,e,n);else{const o="function"==typeof e?mo(t,e,n.custom):e;i=jo(t,o,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Go(t){let e=$o(t);const n={[ie.Animate]:Wo(!0),[ie.InView]:Wo(),[ie.Hover]:Wo(),[ie.Tap]:Wo(),[ie.Drag]:Wo(),[ie.Focus]:Wo(),[ie.Exit]:Wo()};let i=!0;const o=(e,n)=>{const i=mo(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let h={},d=1/0;for(let e=0;e<zo;e++){const p=No[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=U(f),y=p===r?m.isActive:null;!1===y&&(d=e);let x=f===l[p]&&f!==a[p]&&g;if(x&&i&&t.manuallyAnimateOnMount&&(x=!1),m.protectedKeys={...h},!m.isActive&&null===y||!f&&!m.prevProp||I(f)||"boolean"==typeof f)continue;const b=Ho(m.prevProp,f);let P=b||p===r&&m.isActive&&!x&&g||e>d&&g;const V=Array.isArray(f)?f:[f];let T=V.reduce(o,{});!1===y&&(T={});const{prevResolvedValues:E={}}=m,A={...E,...T},S=t=>{P=!0,c.delete(t),m.needsAnimating[t]=!0};for(const t in A){const e=T[t],n=E[t];h.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!ko(e,n)||b?S(t):m.protectedKeys[t]=!0:void 0!==e?S(t):c.add(t):void 0!==e&&c.has(t)?S(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=T,m.isActive&&(h={...h,...T}),i&&t.blockInitialAnimation&&(P=!1),P&&!x&&u.push(...V.map(t=>({animation:t,options:{type:p,...s}})))}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:s,setActive:function(e,i,o){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=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Ho(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ko(e,t)}function Wo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Yo=new Set;const Xo=Object.keys(z),qo=Xo.length,Ko=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const Zo=["initial",...Oo],_o=Zo.length;class Jo extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:i},o={}){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=()=>mt.render(this.render,!1,!0);const{latestValues:s,renderState:r}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=r,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=O(e),this.isVariantNode=N(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!==s[t]&&M(e)&&(e.set(s[t],!1),Lo(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){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)),Bo.current||function(){if(Bo.current=!0,r)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ro.current=t.matches;t.addListener(e),e()}else Ro.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ro.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(),ft.update(this.notifyUpdate),ft.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=j.has(t),i=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&mt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<qo;e++){const n=Xo[e],{isEnabled:i,Component:o}=z[n];i(t)&&o&&a.push(s(o,{key:n,...t,visualElement:this}))}if(!this.projection&&o){this.projection=new o(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a}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(),this.props=t;for(let e=0;e<Ko.length;e++){const n=Ko[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 o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),Lo(i)&&i.add(o);else if(M(r))t.addValue(o,pi(s)),Lo(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,pi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}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<_o;t++){const e=Zo[t],n=this.props[e];(U(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){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}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=pi(e),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=k(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||M(o)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new hi),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},o){let s=function(t,e,n){var i;const o={};for(const s in t){const t=vo(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),s&&(s=i(s))),o){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||ao(u))?u=parseFloat(u):!po(u)&&_e.test(l)&&(u=dn(r,l)),t.addValue(r,pi(u)),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}(this,n,s);const t=Co(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Qo extends Jo{readValueFromInstance(t,e){if(j.has(e)){const t=hn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Pe(t,e)}build(t,e,n,i){G(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t){return H(t)}renderInstance(t,e,n,i){W(t,e,n,i)}}const ts={animation:_n(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Go(t)),I(n)&&e(()=>n.subscribe(t),[n])}),exit:_n(t=>{const{custom:n,visualElement:o}=t,[s,r]=Qn(),a=i(V);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(ie.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function es(t,e,n){return(i,o)=>{Q(i)&&!$t()&&(t.animationState&&t.animationState.setActive(ie.Hover,e),n&&n(i,o))}}const ns=(t,e)=>!!e&&(t===e||ns(t,e.parentElement));const is=new WeakMap,os=new WeakMap,ss=t=>{const e=is.get(t.target);e&&e(t)},rs=t=>{t.forEach(ss)};function as(t,e,n){const i=function({root:t,...e}){const n=t||document;os.has(n)||os.set(n,{});const i=os.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(rs,{root:t,...e})),i[o]}(e);return is.set(t,n),i.observe(t),()=>{is.delete(t),i.unobserve(t)}}const ls={some:0,all:1};function us(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t||!i.current)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:ls[r]};return as(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(ie.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function cs(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Do&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Yo.has(e)||(console.warn(e),s&&console.warn(s),Yo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(ie.InView,!0)}))},[t])}const hs={inView:_n((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?cs:us)(a,r.current,t,s)})),tap:_n((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(ie.Tap,!1),!$t()}function d(e,n){h()&&(ns(s.current,e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=Ct(St(window,"pointerup",d,u),St(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(ie.Tap,!0),e&&e(t,n))}wt(s,"pointerdown",r?m:void 0,u),Zn(c)})),focus:_n((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Vt(e,"focus",t?()=>{n&&n.setActive(ie.Focus,!0)}:void 0),Vt(e,"blur",t?()=>{n&&n.setActive(ie.Focus,!1)}:void 0)})),hover:_n((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){wt(i,"pointerenter",t||n?es(i,!0,t):void 0,{passive:!t}),wt(i,"pointerleave",e||n?es(i,!1,e):void 0,{passive:!e})}))};class ds extends Jo{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return j.has(e)?(null===(n=hn(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return q(t)}build(t,e,n,i){K(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Z(t,e,n,i)}mount(t){this.isSVGTag=_(t.tagName),super.mount(t)}}const ps={...{renderer:(t,e)=>J(t)?new ds(e,{enableHardwareAcceleration:!1}):new Qo(e,{enableHardwareAcceleration:!0}),...ts,...hs},...Jn,...li,projectionNodeConstructor:ro};export{ps as domMax};
|
package/dist/size-rollup-m.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i();o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.render()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notify("Unmount"),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const S=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return b(t.animate)||S.some(n=>w(t[n]))}function C(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[O(n),O(e)])}function O(t){return Array.isArray(t)?t.join(" "):t}const V=t=>({isEnabled:n=>t.some(t=>!!n[t])}),T={measureLayout:V(["layout","layoutId","drag"]),animation:V(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:V(["exit"]),drag:V(["drag","dragControls"]),focus:V(["whileFocus"]),hover:V(["whileHover","onHoverStart","onHoverEnd"]),tap:V(["whileTap","onTap","onTapStart","onTapCancel"]),pan:V(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:V(["whileInView","onViewportEnter","onViewportLeave"])};function E(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const P=!1;let k=1;const A=e({});class L extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const j=e({}),B=Symbol.for("motionComponentSymbol");function M({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){n&&function(t){for(const n in t)"projectionNodeConstructor"===n?T.projectionNodeConstructor=t[n]:T[n].Component=t[n]}(n);const c=l((function(c,l){const u={...r(f),...c,layoutId:D(c)},{isStatic:m}=u;let g=null;const w=C(c),b=m?void 0:E(()=>{if(P)return k++}),S=i(c,m);if(!m&&p){w.visualElement=h(s,S,u,e);const t=r(y).strict,a=r(j);w.visualElement&&(g=w.visualElement.loadFeatures(u,t,n,b,o||T.projectionNodeConstructor,a))}return t.createElement(L,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(S,w.visualElement,l),S,m,w.visualElement)))}));return c[B]=s,c}function D({layoutId:t}){const n=r(A).id;return n&&void 0!==t?n+"-"+t:t}const R=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function W(t){return"string"==typeof t&&!t.includes("-")&&!!(R.indexOf(t)>-1||/[A-Z]/.test(t))}const X={},Y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(Y);function F(t,{layout:n,layoutId:e}){return H.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!X[t]||"opacity"===t)}const I=t=>!!(null==t?void 0:t.getVelocity),$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z=(t,n)=>Y.indexOf(t)-Y.indexOf(n);function z(t){return t.startsWith("--")}const N=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const U={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},K=Object.assign(Object.assign({},U),{transform:(q=0,_=1,t=>Math.max(Math.min(t,_),q))});var q,_;const G=Object.assign(Object.assign({},U),{default:1}),J=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),Q=J("deg"),tt=J("%"),nt=J("px"),et=Object.assign(Object.assign({},tt),{parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)}),rt={...U,transform:Math.round},ot={borderWidth:nt,borderTopWidth:nt,borderRightWidth:nt,borderBottomWidth:nt,borderLeftWidth:nt,borderRadius:nt,radius:nt,borderTopLeftRadius:nt,borderTopRightRadius:nt,borderBottomRightRadius:nt,borderBottomLeftRadius:nt,width:nt,maxWidth:nt,height:nt,maxHeight:nt,size:nt,top:nt,right:nt,bottom:nt,left:nt,padding:nt,paddingTop:nt,paddingRight:nt,paddingBottom:nt,paddingLeft:nt,margin:nt,marginTop:nt,marginRight:nt,marginBottom:nt,marginLeft:nt,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:Q,skewX:Q,skewY:Q,distance:nt,translateX:nt,translateY:nt,translateZ:nt,x:nt,y:nt,z:nt,perspective:nt,transformPerspective:nt,opacity:K,originX:et,originY:et,originZ:nt,zIndex:rt,fillOpacity:K,strokeOpacity:K,numOctaves:rt};function at(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(z(t)){a[t]=e;continue}const r=ot[t],d=N(e,r);if(H.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(n.transform||(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort(Z);for(const e of n)i+=`${$[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const it=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function st(t,n,e){for(const r in n)I(n[r])||F(r,e)||(t[r]=n[r])}function ct(t,n,e){const r={};return st(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return at(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function lt(t,n,e){const r={},o=ct(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const ut=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ft(t){return ut.has(t)}let dt=t=>!ft(t);try{(mt=require("@emotion/is-prop-valid").default)&&(dt=t=>t.startsWith("on")?!ft(t):mt(t))}catch(t){}var mt;function pt(t,n,e){return"string"==typeof t?t:nt.transform(n+e*t)}const gt={offset:"stroke-dashoffset",array:"stroke-dasharray"},yt={offset:"strokeDashoffset",array:"strokeDasharray"};function ht(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u,f){if(at(t,c,l,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||m.transform)&&(m.transformOrigin=function(t,n,e){return`${pt(n,t.x,t.width)} ${pt(e,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(d.x=n),void 0!==e&&(d.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?gt:yt;t[a.offset]=nt.transform(-r);const i=nt.transform(n),s=nt.transform(e);t[a.array]=`${i} ${s}`}(d,a,i,s,!1)}const vt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),wt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function bt(t,n,e,r){const o=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return ht(e,n,{enableHardwareAcceleration:!1},wt(r),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};st(n,t.style,t),o.style={...n,...o.style}}return o}function St(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(W(n)?bt:lt)(e,a,i,n),c={...function(t,n,e){const r={};for(const o in t)(dt(o)||!0===e&&ft(o)||!n&&!ft(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const xt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ct(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(xt.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function Ot(t){const{style:n}=t,e={};for(const r in n)(I(n[r])||F(r,t))&&(e[r]=n[r]);return e}function Vt(t){const n=I(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Tt=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Et(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():E(i)};function Et(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Vt(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Pt={useVisualState:Tt({scrapeMotionValuesFromProps:function(t){const n=Ot(t);for(const e in t)if(I(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:vt,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}ht(e,r,{enableHardwareAcceleration:!1},wt(n.tagName),t.transformTemplate),Ct(n,e)}})},kt={useVisualState:Tt({scrapeMotionValuesFromProps:Ot,createRenderState:it})};const At=function(t){function n(n,e={}){return M(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...W(t)?Pt:kt,preloadedFeatures:e,useRender:St(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{At as m};
|
|
1
|
+
import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i();o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.render()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notify("Unmount"),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function S(t){return"object"==typeof t&&"function"==typeof t.start}const b=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return S(t.animate)||b.some(n=>w(t[n]))}function C(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[V(n),V(e)])}function V(t){return Array.isArray(t)?t.join(" "):t}const T=t=>({isEnabled:n=>t.some(t=>!!n[t])}),E={measureLayout:T(["layout","layoutId","drag"]),animation:T(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:T(["exit"]),drag:T(["drag","dragControls"]),focus:T(["whileFocus"]),hover:T(["whileHover","onHoverStart","onHoverEnd"]),tap:T(["whileTap","onTap","onTapStart","onTapCancel"]),pan:T(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:T(["whileInView","onViewportEnter","onViewportLeave"])};function P(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const k=!1;let A=1;const L=e({});class O extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const B=e({}),M=Symbol.for("motionComponentSymbol");function j({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){n&&function(t){for(const n in t)"projectionNodeConstructor"===n?E.projectionNodeConstructor=t[n]:E[n].Component=t[n]}(n);const c=l((function(c,l){const u={...r(f),...c,layoutId:D(c)},{isStatic:m}=u;let g=null;const w=C(c),S=m?void 0:P(()=>{if(k)return A++}),b=i(c,m);if(!m&&p){w.visualElement=h(s,b,u,e);const t=r(y).strict,a=r(B);w.visualElement&&(g=w.visualElement.loadFeatures(u,t,n,S,o||E.projectionNodeConstructor,a))}return t.createElement(O,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,S,v(b,w.visualElement,l),b,m,w.visualElement)))}));return c[M]=s,c}function D({layoutId:t}){const n=r(L).id;return n&&void 0!==t?n+"-"+t:t}const R=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function W(t){return"string"==typeof t&&!t.includes("-")&&!!(R.indexOf(t)>-1||/[A-Z]/.test(t))}const X={},Y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(Y);function F(t,{layout:n,layoutId:e}){return H.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!X[t]||"opacity"===t)}const I=t=>!!(null==t?void 0:t.getVelocity),$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z=(t,n)=>Y.indexOf(t)-Y.indexOf(n);function z(t){return t.startsWith("--")}const N=(t,n)=>n&&"number"==typeof t?n.transform(t):t,U={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},K={...U,transform:t=>((t,n,e)=>Math.min(Math.max(e,t),n))(0,1,t)},q={...U,default:1};const _=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),G=_("deg"),J=_("%"),Q=_("px"),tt={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(100*t)},nt={...U,transform:Math.round},et={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,size:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,rotate:G,rotateX:G,rotateY:G,rotateZ:G,scale:q,scaleX:q,scaleY:q,scaleZ:q,skew:G,skewX:G,skewY:G,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:K,originX:tt,originY:tt,originZ:Q,zIndex:nt,fillOpacity:K,strokeOpacity:K,numOctaves:nt};function rt(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(z(t)){a[t]=e;continue}const r=et[t],d=N(e,r);if(H.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(n.transform||(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort(Z);for(const e of n)i+=`${$[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const ot=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function at(t,n,e){for(const r in n)I(n[r])||F(r,e)||(t[r]=n[r])}function it(t,n,e){const r={};return at(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return rt(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function st(t,n,e){const r={},o=it(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const ct=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function lt(t){return ct.has(t)}let ut=t=>!lt(t);try{(ft=require("@emotion/is-prop-valid").default)&&(ut=t=>t.startsWith("on")?!lt(t):ft(t))}catch(t){}var ft;function dt(t,n,e){return"string"==typeof t?t:Q.transform(n+e*t)}const mt={offset:"stroke-dashoffset",array:"stroke-dasharray"},pt={offset:"strokeDashoffset",array:"strokeDasharray"};function gt(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u,f){if(rt(t,c,l,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||m.transform)&&(m.transformOrigin=function(t,n,e){return`${dt(n,t.x,t.width)} ${dt(e,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(d.x=n),void 0!==e&&(d.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?mt:pt;t[a.offset]=Q.transform(-r);const i=Q.transform(n),s=Q.transform(e);t[a.array]=`${i} ${s}`}(d,a,i,s,!1)}const yt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),ht=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vt(t,n,e,r){const o=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return gt(e,n,{enableHardwareAcceleration:!1},ht(r),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};at(n,t.style,t),o.style={...n,...o.style}}return o}function wt(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(W(n)?vt:st)(e,a,i,n),c={...function(t,n,e){const r={};for(const o in t)(ut(o)||!0===e&<(o)||!n&&!lt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const St=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bt(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(St.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function xt(t){const{style:n}=t,e={};for(const r in n)(I(n[r])||F(r,t))&&(e[r]=n[r]);return e}function Ct(t){const n=I(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Vt=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Tt(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():P(i)};function Tt(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Ct(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!S(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Et={useVisualState:Vt({scrapeMotionValuesFromProps:function(t){const n=xt(t);for(const e in t)if(I(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:yt,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}gt(e,r,{enableHardwareAcceleration:!1},ht(n.tagName),t.transformTemplate),bt(n,e)}})},Pt={useVisualState:Vt({scrapeMotionValuesFromProps:xt,createRenderState:ot})};const kt=function(t){function n(n,e={}){return j(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...W(t)?Et:Pt,preloadedFeatures:e,useRender:wt(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{kt as m};
|