"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8505],{88505:function(t,e,i){i.d(e,{E:function(){return je}});var s=i(61434),o=i(38219),n=i(48904),r=i(5627),a=i(94796),h=i(50065),l=i(57035),c=i(98457),u=i(41429),d=i(67817),m=i(96953);const p=(t,e)=>Math.abs(t-e);var g=i(53502),v=i(41359);class y{constructor(t,e,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=P(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=p(t.x,e.x),s=p(t.y,e.y);return Math.sqrt(i**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!i)return;const{point:s}=t,{timestamp:o}=v.w0;this.history.push({...s,timestamp:o});const{onStart:n,onMove:r}=this.handlers;e||(n&&n(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=f(e,this.transformPagePoint),v.Wi.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:s,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const n=P("pointercancel"===t.type?this.lastMoveEventInfo:f(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,n),s&&s(t,n)},!(0,g.D)(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=i,this.contextWindow=s||window;const n=f((0,c.Q)(t),this.transformPagePoint),{point:r}=n,{timestamp:a}=v.w0;this.history=[{...r,timestamp:a}];const{onSessionStart:h}=e;h&&h(t,P(n,this.history)),this.removeListeners=(0,m.z)((0,d.a)(this.contextWindow,"pointermove",this.handlePointerMove),(0,d.a)(this.contextWindow,"pointerup",this.handlePointerUp),(0,d.a)(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),(0,v.Pn)(this.updatePoint)}}function f(t,e){return e?{point:e(t.point)}:t}function x(t,e){return{x:t.x-e.x,y:t.y-e.y}}function P({point:t},e){return{point:t,delta:x(t,D(e)),offset:x(t,T(e)),velocity:E(e,.1)}}function T(t){return t[0]}function D(t){return t[t.length-1]}function E(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null;const o=D(t);for(;i>=0&&(s=t[i],!(o.timestamp-s.timestamp>(0,u.w)(e)));)i--;if(!s)return{x:0,y:0};const n=(0,u.X)(o.timestamp-s.timestamp);if(0===n)return{x:0,y:0};const r={x:(o.x-s.x)/n,y:(o.y-s.y)/n};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}var S=i(54438),L=i(8350),R=i(17475),A=i(19038);function w(t){return t.max-t.min}function j(t,e=0,i=.01){return Math.abs(t-e)<=i}function B(t,e,i,s=.5){t.origin=s,t.originPoint=(0,A.t)(e.min,e.max,t.origin),t.scale=w(i)/w(e),(j(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=(0,A.t)(i.min,i.max,t.origin)-t.originPoint,(j(t.translate)||isNaN(t.translate))&&(t.translate=0)}function C(t,e,i,s){B(t.x,e.x,i.x,s?s.originX:void 0),B(t.y,e.y,i.y,s?s.originY:void 0)}function V(t,e,i){t.min=i.min+e.min,t.max=t.min+w(e)}function M(t,e,i){t.min=e.min-i.min,t.max=t.min+w(e)}function b(t,e,i){M(t.x,e.x,i.x),M(t.y,e.y,i.y)}var k=i(51366);function U(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function O(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.mint?t.ownerDocument.defaultView:null,Q=new WeakMap;class _{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=(0,G.dO)(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new y(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor((0,c.Q)(t,"page").point)},onStart:(t,e)=>{const{drag:i,dragPropagation:s,onDragStart:o}=this.getProps();if(i&&!s&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=(0,S.fJ)(i),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$((t=>{let e=this.getAxisMotionValue(t).get()||0;if(X.aQ.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const s=i.layout.layoutBox[t];if(s){e=w(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e})),o&&o(t,e);const{animationState:n}=this.visualElement;n&&n.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:i,dragDirectionLock:s,onDirectionLock:o,onDrag:n}=this.getProps();if(!i&&!this.openGlobalLock)return;const{offset:r}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),n&&n(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>$((t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:Z(this.visualElement)})}stop(t,e){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&o(t,e)}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!q(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let n=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(n=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?(0,A.t)(i,t,s.max):Math.min(t,i)),t}(n,this.constraints[t],this.elastic[t])),o.set(n)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,o=this.constraints;e&&(0,L.I)(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!s)&&function(t,{top:e,left:i,bottom:s,right:o}){return{x:U(t.x,i,o),y:U(t.y,e,s)}}(s.layoutBox,e),this.elastic=function(t=F){return!1===t?t=0:!0===t&&(t=F),{x:I(t,"left","right"),y:I(t,"top","bottom")}}(i),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&$((t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(s.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!(0,L.I)(t))return!1;const i=t.current;(0,l.k)(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=(0,N.z)(i,s.root,this.visualElement.getTransformPagePoint());let n=function(t,e){return{x:O(t.x,e.x),y:O(t.y,e.y)}}(s.layout.layoutBox,o);if(e){const t=e((0,z.z2)(n));this.hasMutatedConstraints=!!t,t&&(n=(0,z.i8)(t))}return n}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:n,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},h=$((r=>{if(!q(r,e,this.currentDirection))return;let h=a&&a[r]||{};n&&(h={min:0,max:0});const l=s?200:1e6,c=s?40:1e7,u={type:"inertia",velocity:i?t[r]:0,bounceStiffness:l,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(r,u)}));return Promise.all(h).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return i.start((0,H.v)(t,i,0,e,this.visualElement))}stopAnimation(){$((t=>this.getAxisMotionValue(t).stop()))}pauseAnimation(){$((t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()}))}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[e];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){$((e=>{const{drag:i}=this.getProps();if(!q(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:n}=s.layout.layoutBox[e];o.set(t[e]-(0,A.t)(i,n,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!(0,L.I)(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};$((t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const s=w(t),o=w(e);return o>s?i=(0,R.Y)(e.min,e.max-s,t.min):s>o&&(i=(0,R.Y)(t.min,t.max-o,e.min)),(0,k.u)(0,1,i)}({min:i,max:i},this.constraints[t])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),$((e=>{if(!q(e,t,null))return;const i=this.getAxisMotionValue(e),{min:o,max:n}=this.constraints[e];i.set((0,A.t)(o,n,s[e]))}))}addListeners(){if(!this.visualElement.current)return;Q.set(this.visualElement,this);const t=this.visualElement.current,e=(0,d.a)(t,"pointerdown",(t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)})),i=()=>{const{dragConstraints:t}=this.getProps();(0,L.I)(t)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const n=(0,Y.E)(window,"resize",(()=>this.scalePositionWithinConstraints())),r=s.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&($((e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))})),this.visualElement.render())}));return()=>{n(),e(),o(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:n=F,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:n,dragMomentum:r}}}function q(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}class J extends a.L{constructor(t){super(t),this.removeGroupControls=h.Z,this.removeListeners=h.Z,this.controls=new _(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||h.Z}unmount(){this.removeGroupControls(),this.removeListeners()}}const K=t=>(e,i)=>{t&&t(e,i)};class tt extends a.L{constructor(){super(...arguments),this.removePointerDownListener=h.Z}onPointerDown(t){this.session=new y(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Z(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:K(t),onStart:K(e),onMove:i,onEnd:(t,e)=>{delete this.session,s&&s(t,e)}}}mount(){this.removePointerDownListener=(0,d.a)(this.node.current,"pointerdown",(t=>this.onPointerDown(t)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var et=i(52322),it=i(2784),st=i(97967);var ot=i(3422),nt=i(64460);const rt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function at(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ht={correct:(t,e)=>{if(!e.target)return t;if("string"===typeof t){if(!X.px.test(t))return t;t=parseFloat(t)}return`${at(t,e.target.x)}% ${at(t,e.target.y)}%`}};var lt=i(76865);const ct={correct:(t,{treeScale:e,projectionDelta:i})=>{const s=t,o=lt.P.parse(t);if(o.length>5)return s;const n=lt.P.createTransformer(t),r="number"!==typeof o[0]?1:0,a=i.x.scale*e.x,h=i.y.scale*e.y;o[0+r]/=a,o[1+r]/=h;const l=(0,A.t)(a,h,.5);return"number"===typeof o[2+r]&&(o[2+r]/=l),"number"===typeof o[3+r]&&(o[3+r]/=l),n(o)}};var ut=i(14599),dt=i(91353);class mt extends it.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=t;(0,ut.B)(gt),o&&(e.group&&e.group.add(o),i&&i.register&&s&&i.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),rt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:s,isPresent:o}=this.props,n=i.projection;return n?(n.isPresent=o,s||t.layoutDependency!==e||void 0===e?n.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?n.promote():n.relegate()||v.Wi.postRender((()=>{const t=n.getStack();t&&t.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dt.g.postRender((()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function pt(t){const[e,i]=function(){const t=(0,it.useContext)(st.O);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:i,register:s}=t,o=(0,it.useId)();return(0,it.useEffect)((()=>s(o)),[]),!e&&i?[!1,()=>i&&i(o)]:[!0]}(),s=(0,it.useContext)(ot.p);return(0,et.jsx)(mt,{...t,layoutGroup:s,switchLayoutGroup:(0,it.useContext)(nt.g),isPresent:e,safeToRemove:i})}const gt={borderRadius:{...ht,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomLeftRadius:ht,borderBottomRightRadius:ht,boxShadow:ct};var vt=i(88069),yt=i(41469);const ft=["TopLeft","TopRight","BottomLeft","BottomRight"],xt=ft.length,Pt=t=>"string"===typeof t?parseFloat(t):t,Tt=t=>"number"===typeof t||X.px.test(t);function Dt(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Et=Lt(0,.5,yt.Bn),St=Lt(.5,.95,h.Z);function Lt(t,e,i){return s=>se?1:i((0,R.Y)(t,e,s))}function Rt(t,e){t.min=e.min,t.max=e.max}function At(t,e){Rt(t.x,e.x),Rt(t.y,e.y)}var wt=i(2217);function jt(t,e,i,s,o){return t-=e,t=(0,wt.q2)(t,1/i,s),void 0!==o&&(t=(0,wt.q2)(t,1/o,s)),t}function Bt(t,e,[i,s,o],n,r){!function(t,e=0,i=1,s=.5,o,n=t,r=t){X.aQ.test(e)&&(e=parseFloat(e),e=(0,A.t)(r.min,r.max,e/100)-r.min);if("number"!==typeof e)return;let a=(0,A.t)(n.min,n.max,s);t===n&&(a-=e),t.min=jt(t.min,e,i,a,o),t.max=jt(t.max,e,i,a,o)}(t,e[i],e[s],e[o],e.scale,n,r)}const Ct=["x","scaleX","originX"],Vt=["y","scaleY","originY"];function Mt(t,e,i,s){Bt(t.x,e,Ct,i?i.x:void 0,s?s.x:void 0),Bt(t.y,e,Vt,i?i.y:void 0,s?s.y:void 0)}var bt=i(73172);function kt(t){return 0===t.translate&&1===t.scale}function Ut(t){return kt(t.x)&&kt(t.y)}function Ot(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function Ft(t){return w(t.x)/w(t.y)}var It=i(44866);class Wt{constructor(){this.members=[]}add(t){(0,It.y4)(this.members,t),t.scheduleRender()}remove(t){if((0,It.cl)(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex((e=>t===e));if(0===e)return!1;let i;for(let s=e;s>=0;s--){const t=this.members[s];if(!1!==t.isPresent){i=t;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&i.hide()}}exitAnimationComplete(){this.members.forEach((t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()}))}scheduleRender(){this.members.forEach((t=>{t.instance&&t.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Gt(t,e,i){let s="";const o=t.x.translate/e.x,n=t.y.translate/e.y,r=(null===i||void 0===i?void 0:i.z)||0;if((o||n||r)&&(s=`translate3d(${o}px, ${n}px, ${r}px) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:o,rotateY:n,skewX:r,skewY:a}=i;t&&(s=`perspective(${t}px) ${s}`),e&&(s+=`rotate(${e}deg) `),o&&(s+=`rotateX(${o}deg) `),n&&(s+=`rotateY(${n}deg) `),r&&(s+=`skewX(${r}deg) `),a&&(s+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,h=t.y.scale*e.y;return 1===a&&1===h||(s+=`scale(${a}, ${h})`),s||"none"}var $t=i(28749);const Nt=(t,e)=>t.depth-e.depth;class zt{constructor(){this.children=[],this.isDirty=!1}add(t){(0,It.y4)(this.children,t),this.isDirty=!0}remove(t){(0,It.cl)(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Nt),this.isDirty=!1,this.children.forEach(t)}}var Yt=i(69535),Xt=i(82644);var Ht=i(40226),Zt=i(15815);const Qt=["","X","Y","Z"],_t={visibility:"hidden"};let qt=0;const Jt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Kt(t,e,i,s){const{latestValues:o}=e;o[t]&&(i[t]=o[t],e.setStaticValue(t,0),s&&(s[t]=0))}function te({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},i=(null===e||void 0===e?void 0:e())){this.id=qt++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;this.projectionUpdateScheduled=!1,Jt.totalNodes=Jt.resolvedTargetDeltas=Jt.recalculatedProjection=0,this.nodes.forEach(se),this.nodes.forEach(ce),this.nodes.forEach(ue),this.nodes.forEach(oe),t=Jt,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;t(e,(()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=Xt.X.now(),s=({timestamp:o})=>{const n=o-i;n>=e&&((0,v.Pn)(s),t(n-e))};return v.Wi.read(s,!0),()=>(0,v.Pn)(s)}(s,250),rt.hasAnimatedSinceResize&&(rt.hasAnimatedSinceResize=!1,this.nodes.forEach(le))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||n)&&this.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||r.getDefaultTransition()||ye,{onLayoutAnimationStart:n,onLayoutAnimationComplete:a}=r.getProps(),h=!this.targetLayout||!Ot(this.targetLayout,s)||i,l=!e&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||l||e&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,l);const e={...(0,bt.e)(o,"layout"),onPlay:n,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||le(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,(0,v.Pn)(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(de),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;othis.update())))}clearAllSnapshots(){this.nodes.forEach(ne),this.sharedNodes.forEach(me)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,v.Wi.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){v.Wi.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),(!this.options.alwaysMeasureLayout||!this.isLead())&&!this.isLayoutDirty)return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let i=0;i{const i=e/1e3;var h,d,m,p,g,v;pe(n.x,t.x,i),pe(n.y,t.y,i),this.setTargetDelta(n),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(b(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,g=r,v=i,ge(m.x,p.x,g.x,v),ge(m.y,p.y,g.y,v),u&&(h=this.relativeTarget,d=u,h.x.min===d.x.min&&h.x.max===d.x.max&&h.y.min===d.y.min&&h.y.max===d.y.max)&&(this.isProjectionDirty=!1),u||(u=(0,G.dO)()),At(u,this.relativeTarget)),a&&(this.animationValues=o,function(t,e,i,s,o,n){o?(t.opacity=(0,A.t)(0,void 0!==i.opacity?i.opacity:1,Et(s)),t.opacityExit=(0,A.t)(void 0!==e.opacity?e.opacity:1,0,St(s))):n&&(t.opacity=(0,A.t)(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let r=0;r{rt.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){const s=(0,Zt.i)(t)?t:(0,Ht.BX)(t);return s.start((0,H.v)("",s,e,i)),s.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:s,latestValues:o}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&Te(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||(0,G.dO)();const e=w(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const s=w(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}At(e,i),(0,wt.D2)(e,o),C(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Wt);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){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:i}={}){const s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const s={};i.z&&Kt("z",t,s,this.animationValues);for(let o=0;o{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()})),this.root.nodes.forEach(re),this.root.sharedNodes.clear()}}}function ee(t){t.updateLayout()}function ie(t){var e;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:o}=t.options,n=i.source!==t.layout.source;"size"===o?$((t=>{const s=n?i.measuredBox[t]:i.layoutBox[t],o=w(s);s.min=e[t].min,s.max=s.min+o})):Te(o,i.layoutBox,e)&&$((s=>{const o=n?i.measuredBox[s]:i.layoutBox[s],r=w(e[s]);o.max=o.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+r)}));const r=(0,G.wc)();C(r,e,i.layoutBox);const a=(0,G.wc)();n?C(a,t.applyTransform(s,!0),i.measuredBox):C(a,e,i.layoutBox);const h=!Ut(r);let l=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:o,layout:n}=s;if(o&&n){const r=(0,G.dO)();b(r,i.layoutBox,o.layoutBox);const a=(0,G.dO)();b(a,e,n.layoutBox),Ot(r,a)||(l=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:r,hasLayoutChanged:h,hasRelativeTargetChanged:l})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function se(t){Jt.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function oe(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ne(t){t.clearSnapshot()}function re(t){t.clearMeasurements()}function ae(t){t.isLayoutDirty=!1}function he(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function le(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ce(t){t.resolveTargetDelta()}function ue(t){t.calcProjection()}function de(t){t.resetSkewAndRotation()}function me(t){t.removeLeadSnapshot()}function pe(t,e,i){t.translate=(0,A.t)(e.translate,0,i),t.scale=(0,A.t)(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function ge(t,e,i,s){t.min=(0,A.t)(e.min,i.min,s),t.max=(0,A.t)(e.max,i.max,s)}function ve(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ye={duration:.45,ease:[.4,0,.1,1]},fe=t=>"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xe=fe("applewebkit/")&&!fe("chrome/")?Math.round:h.Z;function Pe(t){t.min=xe(t.min),t.max=xe(t.max)}function Te(t,e,i){return"position"===t||"preserve-aspect"===t&&!j(Ft(e),Ft(i),.2)}const De=te({attachResizeListener:(t,e)=>(0,Y.E)(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ee={current:void 0},Se=te({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ee.current){const t=new De({});t.mount(window),t.setOptions({layoutScroll:!0}),Ee.current=t}return Ee.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Le={pan:{Feature:tt},drag:{Feature:J,ProjectionNode:Se,MeasureLayout:pt}};var Re=i(70553);const Ae={layout:{ProjectionNode:Se,MeasureLayout:pt}},we={...r.s,...n.E,...Le,...Ae},je=(0,s.D)(((t,e)=>(0,o.w)(t,e,we,Re.b)))}}]);