framer-motion 12.4.13 → 12.6.0
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/README.md +1 -1
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/{create-DkTZDHiS.js → create-CgwP8YNL.js} +4234 -4792
- package/dist/cjs/debug.js +5 -281
- package/dist/cjs/dom-mini.js +9 -7
- package/dist/cjs/dom.js +81 -639
- package/dist/cjs/index.js +1555 -1553
- package/dist/cjs/m.js +11 -179
- package/dist/cjs/mini.js +8 -0
- package/dist/debug.d.ts +2 -35
- package/dist/dom-mini.d.ts +1 -181
- package/dist/dom-mini.js +1 -1
- package/dist/dom.d.ts +3 -242
- package/dist/dom.js +1 -1
- package/dist/es/animation/animate/single-value.mjs +1 -1
- package/dist/es/animation/animators/BaseAnimation.mjs +1 -1
- package/dist/es/animation/animators/MainThreadAnimation.mjs +1 -2
- package/dist/es/animation/animators/drivers/driver-frameloop.mjs +1 -2
- package/dist/es/animation/animators/waapi/index.mjs +1 -3
- package/dist/es/animation/generators/utils/velocity.mjs +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs +2 -4
- package/dist/es/animation/interfaces/visual-element-target.mjs +1 -2
- package/dist/es/animation/optimized-appear/start.mjs +3 -3
- package/dist/es/animation/sequence/utils/edit.mjs +1 -1
- package/dist/es/components/AnimatePresence/index.mjs +1 -1
- package/dist/es/components/Reorder/utils/check-reorder.mjs +1 -1
- package/dist/es/debug.mjs +1 -1
- package/dist/es/dom.mjs +1 -5
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -2
- package/dist/es/gestures/hover.mjs +1 -2
- package/dist/es/gestures/pan/PanSession.mjs +1 -2
- package/dist/es/gestures/pan/index.mjs +1 -1
- package/dist/es/gestures/press.mjs +1 -2
- package/dist/es/index.mjs +14 -19
- package/dist/es/motion/features/layout/MeasureLayout.mjs +1 -2
- package/dist/es/motion/utils/use-visual-element.mjs +6 -6
- package/dist/es/projection/node/create-projection-node.mjs +2 -8
- package/dist/es/projection/shared/stack.mjs +1 -1
- package/dist/es/projection.mjs +1 -3
- package/dist/es/render/VisualElement.mjs +2 -5
- package/dist/es/render/components/create-proxy.mjs +1 -1
- package/dist/es/render/dom/DOMVisualElement.mjs +1 -1
- package/dist/es/render/dom/scroll/info.mjs +1 -2
- package/dist/es/render/dom/scroll/observe.mjs +1 -1
- package/dist/es/render/dom/scroll/on-scroll-handler.mjs +1 -1
- package/dist/es/render/dom/scroll/track.mjs +1 -1
- package/dist/es/render/svg/SVGVisualElement.mjs +1 -1
- package/dist/es/render/svg/config-motion.mjs +1 -1
- package/dist/es/render/utils/KeyframesResolver.mjs +1 -1
- package/dist/es/render/utils/flat-tree.mjs +1 -1
- package/dist/es/render/utils/motion-values.mjs +3 -3
- package/dist/es/render/utils/setters.mjs +1 -1
- package/dist/es/utils/delay.mjs +1 -2
- package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -1
- 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/scroll/use-element-scroll.mjs +1 -1
- package/dist/es/value/scroll/use-viewport-scroll.mjs +1 -1
- package/dist/es/value/use-combine-values.mjs +2 -2
- package/dist/es/value/use-computed.mjs +1 -1
- package/dist/es/value/use-inverted-scale.mjs +3 -3
- package/dist/es/value/use-motion-value.mjs +1 -1
- package/dist/es/value/use-scroll.mjs +4 -4
- package/dist/es/value/use-spring.mjs +1 -1
- package/dist/es/value/use-transform.mjs +1 -1
- package/dist/es/value/use-velocity.mjs +1 -1
- package/dist/es/value/use-will-change/WillChangeMotionValue.mjs +2 -2
- package/dist/framer-motion.dev.js +8227 -8251
- package/dist/framer-motion.js +1 -1
- package/dist/m.d.ts +49 -241
- package/dist/size-rollup-animate.js +1 -1
- 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-rollup-scroll.js +1 -1
- package/dist/types/client.d.ts +2 -2
- package/dist/types/index.d.ts +43 -79
- package/dist/{types.d-6pKw1mTI.d.ts → types.d-B50aGbjN.d.ts} +81 -289
- package/package.json +4 -6
- package/dist/es/frameloop/batcher.mjs +0 -69
- package/dist/es/frameloop/frame.mjs +0 -6
- package/dist/es/frameloop/index-legacy.mjs +0 -20
- package/dist/es/frameloop/microtask.mjs +0 -5
- package/dist/es/frameloop/order.mjs +0 -10
- package/dist/es/frameloop/render-step.mjs +0 -92
- package/dist/es/frameloop/sync-time.mjs +0 -31
- package/dist/es/stats/animation-count.mjs +0 -7
- package/dist/es/stats/buffer.mjs +0 -6
- package/dist/es/stats/index.mjs +0 -113
- package/dist/es/utils/GlobalConfig.mjs +0 -6
- package/dist/es/utils/array.mjs +0 -21
- package/dist/es/utils/subscription-manager.mjs +0 -40
- package/dist/es/utils/velocity-per-second.mjs +0 -11
- package/dist/es/utils/warn-once.mjs +0 -11
- package/dist/es/value/index.mjs +0 -319
- package/dist/three.d.ts +0 -2833
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as t,y as e,z as i,A as s,B as n,C as o,D as r,E as a,u as l,F as h,G as u,H as c,I as d,J as p,K as m,t as f,d as v,b as g,o as y,p as x,M as P,c as T,i as S,l as w,f as A,v as b,N as E,O as V,q as M,h as D,w as C,j as R,Q as k,R as L,g as B,s as j,T as F,m as O,r as I,U,P as N,L as K,S as z,V as W,a as Y,W as $,n as X,X as G,Y as H,k as q}from"./size-rollup-dom-max-assets.js";import{jsx as _}from"react/jsx-runtime";import{useContext as Z,useId as J,useEffect as Q,useCallback as tt,Component as et,Fragment as it}from"react";let st=t;function nt(t){let e;return()=>(void 0===e&&(e=t()),e)}const ot=(t,e,i)=>{const s=e-t;return 0===s?1:(i-t)/s},rt=t=>1e3*t,at=t=>t/1e3,lt=!1;class ht{constructor(t){this.isMounted=!1,this.node=t}update(){}}const ut=nt(()=>void 0!==window.ScrollTimeline);class ct extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let i=0;i<this.animations.length;i++)this.animations[i][t]=e}attachTimeline(t,e){const i=this.animations.map(i=>ut()&&i.attachTimeline?i.attachTimeline(t):"function"==typeof e?e(i):void 0);return()=>{i.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function dt(t,e){return t?t[e]||t.default||t:void 0}function pt(t){let e=0;let i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}function mt(t){return"function"==typeof t}function ft(t,e){t.timeline=e,t.onfinish=null}const vt=t=>Array.isArray(t)&&"number"==typeof t[0],gt={linearEasing:void 0};function yt(t,e){const i=nt(t);return()=>{var t;return null!==(t=gt[e])&&void 0!==t?t:i()}}const xt=yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Pt=(t,e,i=10)=>{let s="";const n=Math.max(Math.round(e/i),2);for(let e=0;e<n;e++)s+=t(ot(0,n-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function Tt(t){return Boolean("function"==typeof t&&xt()||!t||"string"==typeof t&&(t in wt||xt())||vt(t)||Array.isArray(t)&&t.every(Tt))}const St=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,wt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:St([0,.65,.55,1]),circOut:St([.55,0,1,.45]),backIn:St([.31,.01,.66,-.59]),backOut:St([.33,1.53,.69,.99])};const At={x:!1,y:!1};function bt(){return At.x||At.y}function Et(t,e){const i=function(t,e,i){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);const o=null!==(s=null==i?void 0:i[t])&&void 0!==s?s:n.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}(t),s=new AbortController;return[i,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function Vt(t){return!("touch"===t.pointerType||bt())}function Mt(t,e){const i=e+"PointerCapture";if(t.target instanceof Element&&i in t.target&&void 0!==t.pointerId)try{t.target[i](t.pointerId)}catch(t){}}const Dt=(t,e)=>!!e&&(t===e||Dt(t,e.parentElement)),Ct=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Rt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const kt=new WeakSet;function Lt(t){return e=>{"Enter"===e.key&&t(e)}}function Bt(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function jt(t){return Ct(t)&&!bt()}function Ft(t,e,i={}){const[s,n,o]=Et(t,i),r=t=>{const i=t.currentTarget;if(!i||!jt(t)||kt.has(i))return;kt.add(i),Mt(t,"set");const s=e(i,t),o=(t,e)=>{i.removeEventListener("pointerup",r),i.removeEventListener("pointercancel",a),Mt(t,"release"),jt(t)&&kt.has(i)&&(kt.delete(i),"function"==typeof s&&s(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(s=t,n=i instanceof Element?i.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<n.left||s.clientX>n.right||s.clientY<n.top||s.clientY>n.bottom);var s,n;o(t,!e&&(!(i instanceof Element)||Dt(i,t.target)))},a=t=>{o(t,!1)};i.addEventListener("pointerup",r,n),i.addEventListener("pointercancel",a,n),i.addEventListener("lostpointercapture",a,n)};return s.forEach(t=>{let e=!1;var s;(t=i.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,Rt.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,n),e&&t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const s=Lt(()=>{if(kt.has(i))return;Bt(i,"down");const t=Lt(()=>{Bt(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>Bt(i,"cancel"),e)});i.addEventListener("keydown",s,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),e)})(t,n),n)}),o}const Ot=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function It(e,i,s,n){if(e===i&&s===n)return t;const o=t=>function(t,e,i,s,n){let o,r,a=0;do{r=e+(i-e)/2,o=Ot(r,s,n)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,s);return t=>0===t||1===t?t:Ot(o(t),i,n)}const Ut=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Nt=t=>e=>1-t(1-e),Kt=It(.33,1.53,.69,.99),zt=Nt(Kt),Wt=Ut(zt),Yt=t=>(t*=2)<1?.5*zt(t):.5*(2-Math.pow(2,-10*(t-1))),$t=t=>1-Math.sin(Math.acos(t)),Xt=Nt($t),Gt=Ut($t),Ht=t=>/^0[^.\s]+$/u.test(t);const qt=new Set(["width","height","top","left","right","bottom",...e]),_t=t=>Math.round(1e5*t)/1e5,Zt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Jt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qt=(t,e)=>i=>Boolean("string"==typeof i&&Jt.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),te=(t,e,i)=>s=>{if("string"!=typeof s)return s;const[n,o,r,a]=s.match(Zt);return{[t]:parseFloat(n),[e]:parseFloat(o),[i]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},ee={...i,transform:t=>Math.round((t=>n(0,255,t))(t))},ie={test:Qt("rgb","red"),parse:te("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+ee.transform(t)+", "+ee.transform(e)+", "+ee.transform(i)+", "+_t(s.transform(n))+")"};const se={test:Qt("#"),parse:function(t){let e="",i="",s="",n="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),n=t.substring(4,5),e+=e,i+=i,s+=s,n+=n),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}},transform:ie.transform},ne={test:Qt("hsl","hue"),parse:te("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+o.transform(_t(e))+", "+o.transform(_t(i))+", "+_t(s.transform(n))+")"},oe={test:t=>ie.test(t)||se.test(t)||ne.test(t),parse:t=>ie.test(t)?ie.parse(t):ne.test(t)?ne.parse(t):se.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ie.transform(t):ne.transform(t)},re=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ae=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function le(t){const e=t.toString(),i=[],s={color:[],number:[],var:[]},n=[];let o=0;const r=e.replace(ae,t=>(oe.test(t)?(s.color.push(o),n.push("color"),i.push(oe.parse(t))):t.startsWith("var(")?(s.var.push(o),n.push("var"),i.push(t)):(s.number.push(o),n.push("number"),i.push(parseFloat(t))),++o,"${}")).split("${}");return{values:i,split:r,indexes:s,types:n}}function he(t){return le(t).values}function ue(t){const{split:e,types:i}=le(t),s=e.length;return t=>{let n="";for(let o=0;o<s;o++)if(n+=e[o],void 0!==t[o]){const e=i[o];n+="number"===e?_t(t[o]):"color"===e?oe.transform(t[o]):t[o]}return n}}const ce=t=>"number"==typeof t?0:t;const de={test:function(t){var e,i;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Zt))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(re))||void 0===i?void 0:i.length)||0)>0},parse:he,createTransformer:ue,getAnimatableNone:function(t){const e=he(t);return ue(t)(e.map(ce))}},pe=new Set(["brightness","contrast","saturate","opacity"]);function me(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=i.match(Zt)||[];if(!s)return t;const n=i.replace(s,"");let o=pe.has(e)?1:0;return s!==i&&(o*=100),e+"("+o+n+")"}const fe=/\b([a-z-]*)\(.*?\)/gu,ve={...de,getAnimatableNone:t=>{const e=t.match(fe);return e?e.map(me).join(" "):t}},ge={...r,color:oe,backgroundColor:oe,outlineColor:oe,fill:oe,stroke:oe,borderColor:oe,borderTopColor:oe,borderRightColor:oe,borderBottomColor:oe,borderLeftColor:oe,filter:ve,WebkitFilter:ve},ye=t=>ge[t];function xe(t,e){let i=ye(t);return i!==ve&&(i=de),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const Pe=new Set(["auto","none","0"]);const Te=t=>180*t/Math.PI,Se=t=>{const e=Te(Math.atan2(t[1],t[0]));return Ae(e)},we={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Se,rotateZ:Se,skewX:t=>Te(Math.atan(t[1])),skewY:t=>Te(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ae=t=>((t%=360)<0&&(t+=360),t),be=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ee=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ve={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:be,scaleY:Ee,scale:t=>(be(t)+Ee(t))/2,rotateX:t=>Ae(Te(Math.atan2(t[6],t[5]))),rotateY:t=>Ae(Te(Math.atan2(-t[2],t[0]))),rotateZ:Se,rotate:Se,skewX:t=>Te(Math.atan(t[4])),skewY:t=>Te(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Me(t){return t.includes("scale")?1:0}function De(t,e){if(!t||"none"===t)return Me(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,n;if(i)s=Ve,n=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=we,n=e}if(!n)return Me(e);const o=s[e],r=n[1].split(",").map(Ce);return"function"==typeof o?o(r):r[o]}function Ce(t){return parseFloat(t.trim())}const Re=t=>t===i||t===a,ke=new Set(["x","y","z"]),Le=e.filter(t=>!ke.has(t));const Be={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),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:(t,{transform:e})=>De(e,"x"),y:(t,{transform:e})=>De(e,"y")};Be.translateX=Be.x,Be.translateY=Be.y;const je=new Set;let Fe=!1,Oe=!1;function Ie(){if(Oe){const t=Array.from(je).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return Le.forEach(i=>{const s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Oe=!1,Fe=!1,je.forEach(t=>t.complete()),je.clear()}function Ue(){je.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Oe=!0)})}class Ne{constructor(t,e,i,s,n,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(je.add(this),Fe||(Fe=!0,l.read(Ue),l.resolveKeyframes(Ie))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;for(let n=0;n<t.length;n++)if(null===t[n])if(0===n){const n=null==s?void 0:s.get(),o=t[t.length-1];if(void 0!==n)t[0]=n;else if(i&&e){const s=i.readValue(e,o);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=o),s&&void 0===n&&s.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),je.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,je.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ke=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function We(t,e,i=1){const[s,n]=function(t){const e=ze.exec(t);if(!e)return[,];const[,i,s,n]=e;return["--"+(null!=i?i:s),n]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return Ke(t)?parseFloat(t):t}return h(n)?We(n,e,i+1):n}const Ye=t=>e=>e.test(t),$e=[i,a,o,u,c,d,{test:t=>"auto"===t,parse:t=>t}],Xe=t=>$e.find(Ye(t));class Ge extends Ne{constructor(t,e,i,s,n){super(t,e,i,s,n,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let s=t[i];if("string"==typeof s&&(s=s.trim(),h(s))){const n=We(s,e.current);void 0!==n&&(t[i]=n),i===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!qt.has(i)||2!==t.length)return;const[s,n]=t,o=Xe(s),r=Xe(n);if(o!==r)if(Re(o)&&Re(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||Ht(s))&&i.push(e);var s;i.length&&function(t,e,i){let s=0,n=void 0;for(;s<t.length&&!n;){const e=t[s];"string"==typeof e&&!Pe.has(e)&&le(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=xe(i,n)}(t,i,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Be[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(i,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:i,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const n=e.getValue(i);n&&n.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=Be[i](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,i])=>{e.getValue(t).set(i)}),this.resolveNoneKeyframes()}}let He;function qe(){He=void 0}const _e={now:()=>(void 0===He&&_e.set(p.isProcessing||lt?p.timestamp:performance.now()),He),set:t=>{He=t,queueMicrotask(qe)}},Ze=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!de.test(t)&&"0"!==t||t.startsWith("url(")));function Je(t,e,i,s){const n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Ze(n,e),a=Ze(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||mt(i))&&s)}const Qe=t=>null!==t;function ti(t,{repeat:e,repeatType:i="loop"},s){const n=t.filter(Qe),o=e&&"loop"!==i&&e%2==1?0:n.length-1;return o&&void 0!==s?s:n[o]}class ei{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=_e.now(),this.options={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:n,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ue(),Ie()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=_e.now(),this.hasAttemptedResolve=!0;const{name:i,type:s,velocity:n,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Je(t,i,s,n)){if(!o)return a&&a(ti(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const h=this.initPlayback(t,e);!1!==h&&(this._resolved={keyframes:t,finalKeyframe:e,...h},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const ii=(t,e,i)=>t+(e-t)*i;function si(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function ni(t,e){return i=>i>0?e:t}const oi=(t,e,i)=>{const s=t*t,n=i*(e*e-s)+s;return n<0?0:Math.sqrt(n)},ri=[se,ie,ne];function ai(t){const e=(i=t,ri.find(t=>t.test(i)));var i;if(!Boolean(e))return!1;let s=e.parse(t);return e===ne&&(s=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let n=0,o=0,r=0;if(e/=100){const s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=si(a,s,t+1/3),o=si(a,s,t),r=si(a,s,t-1/3)}else n=o=r=i;return{red:Math.round(255*n),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const li=(t,e)=>{const i=ai(t),s=ai(e);if(!i||!s)return ni(t,e);const n={...i};return t=>(n.red=oi(i.red,s.red,t),n.green=oi(i.green,s.green,t),n.blue=oi(i.blue,s.blue,t),n.alpha=ii(i.alpha,s.alpha,t),ie.transform(n))},hi=(t,e)=>i=>e(t(i)),ui=(...t)=>t.reduce(hi),ci=new Set(["none","hidden"]);function di(t,e){return i=>ii(t,e,i)}function pi(t){return"number"==typeof t?di:"string"==typeof t?h(t)?ni:oe.test(t)?li:vi:Array.isArray(t)?mi:"object"==typeof t?oe.test(t)?li:fi:ni}function mi(t,e){const i=[...t],s=i.length,n=t.map((t,i)=>pi(t)(t,e[i]));return t=>{for(let e=0;e<s;e++)i[e]=n[e](t);return i}}function fi(t,e){const i={...t,...e},s={};for(const n in i)void 0!==t[n]&&void 0!==e[n]&&(s[n]=pi(t[n])(t[n],e[n]));return t=>{for(const e in s)i[e]=s[e](t);return i}}const vi=(t,e)=>{const i=de.createTransformer(e),s=le(t),n=le(e);return s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length?ci.has(t)&&!n.values.length||ci.has(e)&&!s.values.length?function(t,e){return ci.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):ui(mi(function(t,e){var i;const s=[],n={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][n[r]],l=null!==(i=t.values[a])&&void 0!==i?i:0;s[o]=l,n[r]++}return s}(s,n),n.values),i):ni(t,e)};function gi(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return ii(t,e,i);return pi(t)(t,e)}function yi(t,e){return e?t*(1e3/e):0}function xi(t,e,i){const s=Math.max(e-5,0);return yi(i-t(s),e-s)}const Pi=100,Ti=10,Si=1,wi=0,Ai=800,bi=.3,Ei=.3,Vi={granular:.01,default:2},Mi={granular:.005,default:.5},Di=.01,Ci=10,Ri=.05,ki=1;function Li({duration:t=Ai,bounce:e=bi,velocity:i=wi,mass:s=Si}){let o,r,a=1-e;a=n(Ri,ki,a),t=n(Di,Ci,at(t)),a<1?(o=e=>{const s=e*a,n=s*t;return.001-(s-i)/Bi(e,a)*Math.exp(-n)},r=e=>{const s=e*a*t,n=s*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),h=Bi(Math.pow(e,2),a);return(.001-o(e)>0?-1:1)*((n-r)*l)/h}):(o=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,i){let s=i;for(let i=1;i<12;i++)s-=t(s)/e(s);return s}(o,r,5/t);if(t=rt(t),isNaN(l))return{stiffness:Pi,damping:Ti,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}function Bi(t,e){return t*Math.sqrt(1-e*e)}const ji=["duration","bounce"],Fi=["stiffness","damping","mass"];function Oi(t,e){return e.some(e=>void 0!==t[e])}function Ii(t=Ei,e=bi){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:o}=i;const r=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:h,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:wi,stiffness:Pi,damping:Ti,mass:Si,isResolvedFromDuration:!1,...t};if(!Oi(t,Fi)&&Oi(t,ji))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),o=s*s,r=2*n(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:Si,stiffness:o,damping:r}}else{const i=Li(t);e={...e,...i,mass:Si},e.isResolvedFromDuration=!0}return e}({...i,velocity:-at(i.velocity||0)}),f=p||0,v=u/(2*Math.sqrt(h*c)),g=a-r,y=at(Math.sqrt(h/c)),x=Math.abs(g)<5;let P;if(s||(s=x?Vi.granular:Vi.default),o||(o=x?Mi.granular:Mi.default),v<1){const t=Bi(y,v);P=e=>{const i=Math.exp(-v*y*e);return a-i*((f+v*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===v)P=t=>a-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(v*v-1);P=e=>{const i=Math.exp(-v*y*e),s=Math.min(t*e,300);return a-i*((f+v*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=P(t);if(m)l.done=t>=d;else{let i=0;v<1&&(i=0===t?rt(f):xi(P,t,e));const n=Math.abs(i)<=s,r=Math.abs(a-e)<=o;l.done=n&&r}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(pt(T),2e4),e=Pt(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}function Ui({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:n=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/s),y=t=>v+g(t),x=t=>{const e=g(t),i=y(t);d.done=Math.abs(e)<=h,d.value=d.done?v:i};let P,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,T=Ii({keyframes:[d.value,p(d.value)],velocity:xi(y,t,d.value),damping:n,stiffness:o,restDelta:h,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),S(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const Ni=It(.42,0,1,1),Ki=It(0,0,.58,1),zi=It(.42,0,.58,1),Wi={linear:t,easeIn:Ni,easeInOut:zi,easeOut:Ki,circIn:$t,circInOut:Gt,circOut:Xt,backIn:zt,backInOut:Wt,backOut:Kt,anticipate:Yt},Yi=t=>{if(vt(t)){st(4===t.length);const[e,i,s,n]=t;return It(e,i,s,n)}return"string"==typeof t?Wi[t]:t};function $i(e,i,{clamp:s=!0,ease:o,mixer:r}={}){const a=e.length;if(st(a===i.length),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const h=function(e,i,s){const n=[],o=s||gi,r=e.length-1;for(let s=0;s<r;s++){let r=o(e[s],e[s+1]);if(i){const e=Array.isArray(i)?i[s]||t:i;r=ui(e,r)}n.push(r)}return n}(i,o,r),u=h.length,c=t=>{if(l&&t<e[0])return i[0];let s=0;if(u>1)for(;s<e.length-2&&!(t<e[s+1]);s++);const n=ot(e[s],e[s+1],t);return h[s](n)};return s?t=>c(n(e[0],e[a-1],t)):c}function Xi(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const n=ot(0,e,s);t.push(ii(i,1,n))}}(e,t.length-1),e}function Gi({duration:t=300,keyframes:e,times:i,ease:s="easeInOut"}){const n=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(Yi):Yi(s),o={done:!1,value:e[0]},r=$i(function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Xi(e),t),e,{ease:Array.isArray(n)?n:(a=e,l=n,a.map(()=>l||zi).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Hi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>l.update(e,!0),stop:()=>m(e),now:()=>p.isProcessing?p.timestamp:_e.now()}},qi={decay:Ui,inertia:Ui,tween:Gi,keyframes:Gi,spring:Ii},_i=t=>t/100;class Zi extends ei{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:i,element:s,keyframes:n}=this.options,o=(null==s?void 0:s.KeyframeResolver)||Ne;this.resolver=new o(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=this.options,r=mt(e)?e:qi[e]||Gi;let a,l;r!==Gi&&"number"!=typeof t[0]&&(a=ui(_i,gi(t[0],t[1])),t=[0,100]);const h=r({...this.options,keyframes:t});"mirror"===n&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===h.calculatedDuration&&(h.calculatedDuration=pt(h));const{calculatedDuration:u}=h,c=u+s;return{generator:h,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:c,totalDuration:c*(i+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:i}=this;if(!i){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:h,totalDuration:u,resolvedDuration:c}=i;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:m,repeatDelay:f,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let x=this.currentTime,P=o;if(p){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,p+1);Boolean(e%2)&&("reverse"===m?(i=1-i,f&&(i-=f/c)):"mirror"===m&&(P=r)),x=n(0,1,i)*c}const T=y?{done:!1,value:l[0]}:P.next(x);a&&(T.value=a(T.value));let{done:S}=T;y||null===h||(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return w&&void 0!==s&&(T.value=ti(l,this.options,s)),v&&v(T.value),w&&this.finish(),T}get duration(){const{resolved:t}=this;return t?at(t.calculatedDuration):0}get time(){return at(this.currentTime)}set time(t){t=rt(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=at(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Hi,onPlay:e,startTime:i}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ji=new Set(["opacity","clipPath","filter","transform"]);function Qi(t,e,i,{delay:s=0,duration:n=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const h={[e]:i};l&&(h.offset=l);const u=function t(e,i){return e?"function"==typeof e&&xt()?Pt(e,i):vt(e)?St(e):Array.isArray(e)?e.map(e=>t(e,i)||wt.easeOut):wt[e]:void 0}(a,n);Array.isArray(u)&&(h.easing=u);return t.animate(h,{delay:s,duration:n,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const ts=nt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const es={anticipate:Yt,backInOut:Wt,circInOut:Gt};class is extends ei{constructor(t){super(t);const{name:e,motionValue:i,element:s,keyframes:n}=this.options;this.resolver=new Ge(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:i=300,times:s,ease:n,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var h;if("string"==typeof n&&xt()&&n in es&&(n=es[n]),mt((h=this.options).type)||"spring"===h.type||!Tt(h.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...h}=this.options,u=function(t,e){const i=new Zi({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const n=[];let o=0;for(;!s.done&&o<2e4;)s=i.sample(o),n.push(s.value),o+=10;return{times:void 0,keyframes:n,duration:o-10,ease:"linear"}}(t,h);1===(t=u.keyframes).length&&(t[1]=t[0]),i=u.duration,s=u.times,n=u.ease,o="keyframes"}const u=Qi(r.owner.current,a,t,{...this.options,duration:i,times:s,ease:n});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(ft(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:i}=this.options;r.set(ti(t,this.options,e)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:s,type:o,ease:n,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return at(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return at(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.currentTime=rt(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(e){if(this._resolved){const{resolved:i}=this;if(!i)return t;const{animation:s}=i;ft(s,e)}else this.pendingTimeline=e;return t}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:i,duration:s,type:n,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...h}=this.options,u=new Zi({...h,keyframes:i,duration:s,type:n,ease:o,times:r,isGenerator:!0}),c=rt(this.time);t.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:i,repeatDelay:s,repeatType:n,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return ts()&&i&&Ji.has(i)&&!a&&!l&&!s&&"mirror"!==n&&0!==o&&"inertia"!==r}}const ss={type:"spring",stiffness:500,damping:25,restSpeed:10},ns={type:"keyframes",duration:.8},os={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rs=(t,{keyframes:e})=>e.length>2?ns:f.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ss:os;const as=(t,e,i,s={},n,o)=>r=>{const a=dt(s,t)||{},h=a.delay||s.delay||0;let{elapsed:u=0}=s;u-=rt(h);let c={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:n};(function({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:n,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(a)||(c={...c,...rs(t,c)}),c.duration&&(c.duration=rt(c.duration)),c.repeatDelay&&(c.repeatDelay=rt(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(d=!0)),c.allowFlatten=!a.type&&!a.ease,d&&!o&&void 0!==e.get()){const t=ti(c.keyframes,a);if(void 0!==t)return l.update(()=>{c.onUpdate(t),c.onComplete()}),new ct([])}return!o&&is.supports(c)?new is(c):new Zi(c)};function ls(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}function hs(t){return{point:{x:t.pageX,y:t.pageY}}}function us(t,e,i,s){return ls(t,e,(t=>e=>Ct(e)&&t(e,hs(e)))(i),s)}function cs({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function ds(t){return t.max-t.min}function ps(t,e,i,s=.5){t.origin=s,t.originPoint=ii(e.min,e.max,t.origin),t.scale=ds(i)/ds(e),t.translate=ii(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ms(t,e,i,s){ps(t.x,e.x,i.x,s?s.originX:void 0),ps(t.y,e.y,i.y,s?s.originY:void 0)}function fs(t,e,i){t.min=i.min+e.min,t.max=t.min+ds(e)}function vs(t,e,i){t.min=e.min-i.min,t.max=t.min+ds(e)}function gs(t,e,i){vs(t.x,e.x,i.x),vs(t.y,e.y,i.y)}const ys=()=>({x:{min:0,max:0},y:{min:0,max:0}});function xs(t){return[t("x"),t("y")]}function Ps(t){return void 0===t||1===t}function Ts({scale:t,scaleX:e,scaleY:i}){return!Ps(t)||!Ps(e)||!Ps(i)}function Ss(t){return Ts(t)||ws(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ws(t){return As(t.x)||As(t.y)}function As(t){return t&&"0%"!==t}function bs(t,e,i){return i+e*(t-i)}function Es(t,e,i,s,n){return void 0!==n&&(t=bs(t,n,s)),bs(t,i,s)+e}function Vs(t,e=0,i=1,s,n){t.min=Es(t.min,e,i,s,n),t.max=Es(t.max,e,i,s,n)}function Ms(t,{x:e,y:i}){Vs(t.x,e.translate,e.scale,e.originPoint),Vs(t.y,i.translate,i.scale,i.originPoint)}function Ds(t,e){t.min=t.min+e,t.max=t.max+e}function Cs(t,e,i,s,n=.5){Vs(t,e,i,ii(t.min,t.max,n),s)}function Rs(t,e){Cs(t.x,e.x,e.scaleX,e.scale,e.originX),Cs(t.y,e.y,e.scaleY,e.scale,e.originY)}function ks(t,e){return cs(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}const Ls=({current:t})=>t?t.ownerDocument.defaultView:null;function Bs(t,e){const i=t.getValue("willChange");if(s=i,Boolean(v(s)&&s.add))return i.add(e);var s}const js=(t,e)=>Math.abs(t-e);class Fs{constructor(t,e,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:n=!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=Us(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=js(t.x,e.x),s=js(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:n}=p;this.history.push({...s,timestamp:n});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Os(e,this.transformPagePoint),l.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:s,resumeAnimation:n}=this.handlers;if(this.dragSnapToOrigin&&n&&n(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Us("pointercancel"===t.type?this.lastMoveEventInfo:Os(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),s&&s(t,o)},!Ct(t))return;this.dragSnapToOrigin=n,this.handlers=e,this.transformPagePoint=i,this.contextWindow=s||window;const o=Os(hs(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=p;this.history=[{...r,timestamp:a}];const{onSessionStart:h}=e;h&&h(t,Us(o,this.history)),this.removeListeners=ui(us(this.contextWindow,"pointermove",this.handlePointerMove),us(this.contextWindow,"pointerup",this.handlePointerUp),us(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),m(this.updatePoint)}}function Os(t,e){return e?{point:e(t.point)}:t}function Is(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Us({point:t},e){return{point:t,delta:Is(t,Ks(e)),offset:Is(t,Ns(e)),velocity:zs(e,.1)}}function Ns(t){return t[0]}function Ks(t){return t[t.length-1]}function zs(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null;const n=Ks(t);for(;i>=0&&(s=t[i],!(n.timestamp-s.timestamp>rt(e)));)i--;if(!s)return{x:0,y:0};const o=at(n.timestamp-s.timestamp);if(0===o)return{x:0,y:0};const r={x:(n.x-s.x)/o,y:(n.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Ws(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 Ys(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,s]=[s,i]),{min:i,max:s}}const $s=.35;function Xs(t,e,i){return{min:Gs(t,e),max:Gs(t,i)}}function Gs(t,e){return"number"==typeof t?t:t[e]||0}const Hs=new WeakMap;class qs{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new Fs(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(hs(t).point)},onStart:(t,e)=>{const{drag:i,dragPropagation:s,onDragStart:n}=this.getProps();if(i&&!s&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(r=i)||"y"===r?At[r]?null:(At[r]=!0,()=>{At[r]=!1}):At.x||At.y?null:(At.x=At.y=!0,()=>{At.x=At.y=!1}),!this.openDragLock))return;var r;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xs(t=>{let e=this.getAxisMotionValue(t).get()||0;if(o.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const s=i.layout.layoutBox[t];if(s){e=ds(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),n&&l.postRender(()=>n(t,e)),Bs(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:i,dragDirectionLock:s,onDirectionLock:n,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)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&&n&&n(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>xs(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:Ls(this.visualElement)})}stop(t,e){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:n}=this.getProps();n&&l.postRender(()=>n(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.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!_s(t,s,this.currentDirection))return;const n=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:i},s){return void 0!==e&&t<e?t=s?ii(e,t,s.min):Math.max(t,e):void 0!==i&&t>i&&(t=s?ii(i,t,s.max):Math.min(t,i)),t}(o,this.constraints[t],this.elastic[t])),n.set(o)}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,n=this.constraints;e&&g(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!s)&&function(t,{top:e,left:i,bottom:s,right:n}){return{x:Ws(t.x,i,n),y:Ws(t.y,e,s)}}(s.layoutBox,e),this.elastic=function(t=$s){return!1===t?t=0:!0===t&&(t=$s),{x:Xs(t,"left","right"),y:Xs(t,"top","bottom")}}(i),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&xs(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||!g(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const n=function(t,e,i){const s=ks(t,i),{scroll:n}=e;return n&&(Ds(s.x,n.offset.x),Ds(s.y,n.offset.y)),s}(i,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Ys(t.x,e.x),y:Ys(t.y,e.y)}}(s.layout.layoutBox,n);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=cs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:s,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=xs(r=>{if(!_s(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,u=s?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return Bs(this.visualElement,t),i.start(as(t,i,0,e,this.visualElement,!1))}stopAnimation(){xs(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xs(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){xs(e=>{const{drag:i}=this.getProps();if(!_s(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,n=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:o}=s.layout.layoutBox[e];n.set(t[e]-ii(i,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!g(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};xs(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=ds(t),o=ds(e);return o>s?i=ot(e.min,e.max-s,t.min):s>o&&(i=ot(t.min,t.max-o,e.min)),n(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(),xs(e=>{if(!_s(e,t,null))return;const i=this.getAxisMotionValue(e),{min:n,max:o}=this.constraints[e];i.set(ii(n,o,s[e]))})}addListeners(){if(!this.visualElement.current)return;Hs.set(this.visualElement,this);const t=us(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();g(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),l.read(e);const n=ls(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(xs(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(),t(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:n=!1,dragElastic:o=$s,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:n,dragElastic:o,dragMomentum:r}}}function _s(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const Zs=t=>(e,i)=>{t&&l.postRender(()=>t(e,i))};function Js(t,e){-1===t.indexOf(e)&&t.push(e)}function Qs(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}class tn{constructor(){this.subscriptions=[]}add(t){return Js(this.subscriptions,t),()=>Qs(this.subscriptions,t)}notify(t,e,i){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,i);else for(let n=0;n<s;n++){const s=this.subscriptions[n];s&&s(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class en{constructor(t,e={}){this.version="12.4.13",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const i=_e.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=_e.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new tn);const i=this.events[t].add(e);return"change"===t?()=>{i(),l.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=_e.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return yi(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sn(t,e){return new en(t,e)}function nn(t){return t.props[y]}const on=new WeakMap;function rn(t,e,i){const s=t.getProps();return x(s,e,void 0!==i?i:s.custom,t)}function an(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,sn(i))}function ln({protectedKeys:t,needsAnimating:e},i){const s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}function hn(t,e,{delay:i=0,transitionOverride:s,type:n}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...h}=e;s&&(r=s);const u=[],c=n&&t.animationState&&t.animationState.getState()[n];for(const e in h){const s=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),n=h[e];if(void 0===n||c&&ln(c,e))continue;const a={delay:i,...dt(r||{},e)};let d=!1;if(window.MotionHandoffAnimation){const i=nn(t);if(i){const t=window.MotionHandoffAnimation(i,e,l);null!==t&&(a.startTime=t,d=!0)}}Bs(t,e),s.start(as(e,s,n,t.shouldReduceMotion&&qt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&u.push(p)}return a&&Promise.all(u).then(()=>{l.update(()=>{a&&function(t,e){const i=rn(t,e);let{transitionEnd:s={},transition:n={},...o}=i||{};o={...o,...s};for(const e in o){an(t,e,P(o[e]))}}(t,a)})}),u}const un={current:null},cn={current:!1};const dn=[...$e,oe,de];const pn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mn extends class{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ne,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=_e.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,l.render(this.render,!1,!0))};const{latestValues:a,renderState:h,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=r,this.blockInitialAnimation=Boolean(n),this.isControllingVariants=S(e),this.isVariantNode=w(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==a[t]&&v(e)&&e.set(a[t],!1)}}mount(t){this.current=t,on.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),cn.current||function(){if(cn.current=!0,T)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>un.current=t.matches;t.addListener(e),e()}else un.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||un.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),m(this.notifyUpdate),m(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=f.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&l.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),n=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),n(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in A){const e=A[t];if(!e)continue;const{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,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}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<pn.length;e++){const i=pn[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s=t["on"+i];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=function(t,e,i){for(const s in e){const n=e[s],o=i[s];if(v(n))t.addValue(s,n);else if(v(o))t.addValue(s,sn(n,{owner:t}));else if(o!==n)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(n):e.hasAnimated||e.set(n)}else{const e=t.getStaticValue(s);t.addValue(s,sn(void 0!==e?e:n,{owner:t}))}}for(const s in i)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=sn(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){var i;let s=void 0===this.latestValues[t]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,t))&&void 0!==i?i:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(Ke(s)||Ht(s))?s=parseFloat(s):(n=s,!dn.find(Ye(n))&&de.test(e)&&(s=xe(t,e))),this.setBaseTarget(t,v(s)?s.get():s)),v(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:i}=this.props;let s;if("string"==typeof i||"object"==typeof i){const n=x(this.props,i,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);n&&(s=n[t])}if(i&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||v(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new tn),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=Ge}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;v(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}class fn extends mn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ys,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&b(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(f.has(e)){const t=ye(e);return t&&t.default||0}return e=E.has(e)?e:V(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return M(t,e,i)}onBindTransform(){this.current&&!this.renderState.dimensions&&l.postRender(this.updateDimensions)}build(t,e,i){D(t,e,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,i,s){C(t,e,i,s)}mount(t){this.isSVGTag=R(t.tagName),super.mount(t)}}class vn extends mn{constructor(){super(...arguments),this.type="html",this.renderInstance=k}readValueFromInstance(t,e){if(f.has(e))return((t,e)=>{const{transform:i="none"}=getComputedStyle(t);return De(i,e)})(t,e);{const s=(i=t,window.getComputedStyle(i)),n=(L(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof n?n.trim():n}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return ks(t,e)}build(t,e,i){B(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return j(t,e,i)}}const gn=(t,e)=>t.depth-e.depth;class yn{constructor(){this.children=[],this.isDirty=!1}add(t){Js(this.children,t),this.isDirty=!0}remove(t){Qs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gn),this.isDirty=!1,this.children.forEach(t)}}const xn=["TopLeft","TopRight","BottomLeft","BottomRight"],Pn=xn.length,Tn=t=>"string"==typeof t?parseFloat(t):t,Sn=t=>"number"==typeof t||a.test(t);function wn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const An=En(0,.5,Xt),bn=En(.5,.95,t);function En(t,e,i){return s=>s<t?0:s>e?1:i(ot(t,e,s))}function Vn(t,e){t.min=e.min,t.max=e.max}function Mn(t,e){Vn(t.x,e.x),Vn(t.y,e.y)}function Dn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Cn(t,e,i,s,n){return t=bs(t-=e,1/i,s),void 0!==n&&(t=bs(t,1/n,s)),t}function Rn(t,e,[i,s,n],r,a){!function(t,e=0,i=1,s=.5,n,r=t,a=t){if(o.test(e)){e=parseFloat(e);e=ii(a.min,a.max,e/100)-a.min}if("number"!=typeof e)return;let l=ii(r.min,r.max,s);t===r&&(l-=e),t.min=Cn(t.min,e,i,l,n),t.max=Cn(t.max,e,i,l,n)}(t,e[i],e[s],e[n],e.scale,r,a)}const kn=["x","scaleX","originX"],Ln=["y","scaleY","originY"];function Bn(t,e,i,s){Rn(t.x,e,kn,i?i.x:void 0,s?s.x:void 0),Rn(t.y,e,Ln,i?i.y:void 0,s?s.y:void 0)}function jn(t){return 0===t.translate&&1===t.scale}function Fn(t){return jn(t.x)&&jn(t.y)}function On(t,e){return t.min===e.min&&t.max===e.max}function In(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Un(t,e){return In(t.x,e.x)&&In(t.y,e.y)}function Nn(t){return ds(t.x)/ds(t.y)}function Kn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class zn{constructor(){this.members=[]}add(t){Js(this.members,t),t.scheduleRender()}remove(t){if(Qs(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 t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){i=e;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)}}const Wn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Yn=["","X","Y","Z"],$n={visibility:"hidden"};let Xn=0;function Gn(t,e,i,s){const{latestValues:n}=e;n[t]&&(i[t]=n[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Hn({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(t={},i=(null==e?void 0:e())){this.id=Xn++,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.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Zn),this.nodes.forEach(no),this.nodes.forEach(oo),this.nodes.forEach(Jn)},this.resolvedRelativeTargetAt=0,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 t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new yn)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new tn),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,i=this.root.hasTreeAnimated){if(this.instance)return;var s;this.isSVG=(s=e)instanceof SVGElement&&"svg"!==s.tagName,this.instance=e;const{layoutId:n,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(o||n)&&(this.isLayoutDirty=!0),t){let i;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=_e.now(),s=({timestamp:n})=>{const o=n-i;o>=e&&(m(s),t(o-e))};return l.read(s,!0),()=>m(s)}(s,250),Wn.hasAnimatedSinceResize&&(Wn.hasAnimatedSinceResize=!1,this.nodes.forEach(so))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&r&&(n||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const n=this.options.transition||r.getDefaultTransition()||co,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!Un(this.targetLayout,s),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...dt(n,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||so(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,m(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(ro),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(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:i}=e.options;if(!i)return;const s=nn(i);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",l,!(t||i))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&t(n)}(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(to);this.isUpdating||this.nodes.forEach(eo),this.isUpdating=!1,this.nodes.forEach(io),this.nodes.forEach(qn),this.nodes.forEach(_n),this.clearAllSnapshots();const t=_e.now();p.delta=n(0,1e3/60,t-p.timestamp),p.timestamp=t,p.isProcessing=!0,F.update.process(p),F.preRender.process(p),F.render.process(p),p.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,O.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Qn),this.sharedNodes.forEach(ao)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,l.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){l.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ds(this.snapshot.measuredBox.x)||ds(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!r)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Fn(this.projectionDelta),i=this.getTransformTemplate(),s=i?i(this.latestValues,""):void 0,n=s!==this.prevTransformTemplateValue;t&&(e||Ss(this.latestValues)||n)&&(r(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let i=this.removeElementScroll(e);var s;return t&&(i=this.removeTransform(i)),fo((s=i).x),fo(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const i=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(go))){const{scroll:t}=this.root;t&&(Ds(i.x,t.offset.x),Ds(i.y,t.offset.y))}return i}removeElementScroll(t){var e;const i={x:{min:0,max:0},y:{min:0,max:0}};if(Mn(i,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return i;for(let e=0;e<this.path.length;e++){const s=this.path[e],{scroll:n,options:o}=s;s!==this.root&&n&&o.layoutScroll&&(n.wasRoot&&Mn(i,t),Ds(i.x,n.offset.x),Ds(i.y,n.offset.y))}return i}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};Mn(i,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Rs(i,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),Ss(s.latestValues)&&Rs(i,s.latestValues)}return Ss(this.latestValues)&&Rs(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Mn(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Ss(i.latestValues))continue;Ts(i.latestValues)&&i.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};Mn(s,i.measurePageBox()),Bn(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,s)}return Ss(this.latestValues)&&Bn(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==p.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);const s=Boolean(this.resumingFrom)||this!==i;if(!(t||s&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(this.resolvedRelativeTargetAt=p.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},gs(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,a,l;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&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,fs(r.x,a.x,l.x),fs(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Mn(this.target,this.layout.layoutBox),Ms(this.target,this.targetDelta)):Mn(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&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},gs(this.relativeTargetOrigin,this.target,t.target),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Ts(this.parent.latestValues)&&!ws(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),i=Boolean(this.resumingFrom)||this!==e;let s=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(s=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===p.timestamp&&(s=!1),s)return;const{layout:n,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!n&&!o)return;Mn(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,i,s=!1){const n=i.length;if(!n)return;let o,r;e.x=e.y=1;for(let a=0;a<n;a++){o=i[a],r=o.projectionDelta;const{visualElement:n}=o.options;n&&n.props.style&&"contents"===n.props.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Rs(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ms(t,r)),s&&Ss(o.latestValues)&&Rs(t,o.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,i),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(Dn(this.prevProjectionDelta.x,this.projectionDelta.x),Dn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),ms(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Kn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Kn(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},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}}}setAnimationOrigin(t,e=!1){const i=this.snapshot,s=i?i.latestValues:{},n={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(uo));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var h,p,m,f,v,g;lo(r.x,t.x,i),lo(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gs(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,f=this.relativeTargetOrigin,v=a,g=i,ho(m.x,f.x,v.x,g),ho(m.y,f.y,v.y,g),d&&(h=this.relativeTarget,p=d,On(h.x,p.x)&&On(h.y,p.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Mn(d,this.relativeTarget)),l&&(this.animationValues=n,function(t,e,i,s,n,r){n?(t.opacity=ii(0,void 0!==i.opacity?i.opacity:1,An(s)),t.opacityExit=ii(void 0!==e.opacity?e.opacity:1,0,bn(s))):r&&(t.opacity=ii(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let n=0;n<Pn;n++){const r=`border${xn[n]}Radius`;let a=wn(e,r),l=wn(i,r);if(void 0===a&&void 0===l)continue;a||(a=0),l||(l=0);0===a||0===l||Sn(a)===Sn(l)?(t[r]=Math.max(ii(Tn(a),Tn(l),s),0),(o.test(l)||o.test(a))&&(t[r]+="%")):t[r]=l}(e.rotate||i.rotate)&&(t.rotate=ii(e.rotate||0,i.rotate||0,s))}(n,s,this.latestValues,i,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=l.update(()=>{Wn.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){const s=v(t)?t:sn(t);return s.start(as("",s,e,i)),s.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},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:n}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&vo(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ds(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const s=ds(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}Mn(e,i),Rs(e,n),ms(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new zn);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&&Gn("z",t,s,this.animationValues);for(let e=0;e<Yn.length;e++)Gn("rotate"+Yn[e],t,s,this.animationValues),Gn("skew"+Yn[e],t,s,this.animationValues);t.render();for(const e in s)t.setStaticValue(e,s[e]),this.animationValues&&(this.animationValues[e]=s[e]);t.scheduleRender()}getProjectionStyles(t){var e,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return $n;const s={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=I(null==t?void 0:t.pointerEvents)||"",s.transform=n?n(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=I(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Ss(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=function(t,e,i){let s="";const n=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==i?void 0:i.z)||0;if((n||o||r)&&(s=`translate3d(${n}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:n,rotateY:o,skewX:r,skewY:a}=i;t&&(s=`perspective(${t}px) ${s}`),e&&(s+=`rotate(${e}deg) `),n&&(s+=`rotateX(${n}deg) `),o&&(s+=`rotateY(${o}deg) `),r&&(s+=`skewX(${r}deg) `),a&&(s+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(s+=`scale(${a}, ${l})`),s||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),n&&(s.transform=n(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(i=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in U){if(void 0===r[t])continue;const{correct:e,applyTo:i,isCSSVariable:n}=U[t],a="none"===s.transform?r[t]:e(r[t],o);if(i){const t=i.length;for(let e=0;e<t;e++)s[i[e]]=a}else n?this.options.visualElement.renderState.vars[t]=a:s[t]=a}return this.options.layoutId&&(s.pointerEvents=o===this?I(null==t?void 0:t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(to),this.root.sharedNodes.clear()}}}function qn(t){t.updateLayout()}function _n(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:n}=t.options,o=i.source!==t.layout.source;"size"===n?xs(t=>{const s=o?i.measuredBox[t]:i.layoutBox[t],n=ds(s);s.min=e[t].min,s.max=s.min+n}):vo(n,i.layoutBox,e)&&xs(s=>{const n=o?i.measuredBox[s]:i.layoutBox[s],r=ds(e[s]);n.max=n.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ms(r,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?ms(a,t.applyTransform(s,!0),i.measuredBox):ms(a,e,i.layoutBox);const l=!Fn(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:n,layout:o}=s;if(n&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};gs(r,i.layoutBox,n.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};gs(a,e,o.layoutBox),Un(r,a)||(h=!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:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Zn(t){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 Jn(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Qn(t){t.clearSnapshot()}function to(t){t.clearMeasurements()}function eo(t){t.isLayoutDirty=!1}function io(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function so(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function no(t){t.resolveTargetDelta()}function oo(t){t.calcProjection()}function ro(t){t.resetSkewAndRotation()}function ao(t){t.removeLeadSnapshot()}function lo(t,e,i){t.translate=ii(e.translate,0,i),t.scale=ii(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function ho(t,e,i,s){t.min=ii(e.min,i.min,s),t.max=ii(e.max,i.max,s)}function uo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const co={duration:.45,ease:[.4,0,.1,1]},po=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),mo=po("applewebkit/")&&!po("chrome/")?Math.round:t;function fo(t){t.min=mo(t.min),t.max=mo(t.max)}function vo(t,e,i){return"position"===t||"preserve-aspect"===t&&(s=Nn(e),n=Nn(i),o=.2,!(Math.abs(s-n)<=o));var s,n,o}function go(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const yo=Hn({attachResizeListener:(t,e)=>ls(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xo={current:void 0},Po=Hn({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xo.current){const t=new yo({});t.mount(window),t.setOptions({layoutScroll:!0}),xo.current=t}return xo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function To(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const So={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!a.test(t))return t;t=parseFloat(t)}return`${To(t,e.target.x)}% ${To(t,e.target.y)}%`}},wo={correct:(t,{treeScale:e,projectionDelta:i})=>{const s=t,n=de.parse(t);if(n.length>5)return s;const o=de.createTransformer(t),r="number"!=typeof n[0]?1:0,a=i.x.scale*e.x,l=i.y.scale*e.y;n[0+r]/=a,n[1+r]/=l;const h=ii(a,l,.5);return"number"==typeof n[2+r]&&(n[2+r]/=h),"number"==typeof n[3+r]&&(n[3+r]/=h),o(n)}};class Ao extends et{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:n}=t;W(Eo),n&&(e.group&&e.group.add(n),i&&i.register&&s&&i.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Wn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:s,isPresent:n}=this.props,o=i.projection;return o?(o.isPresent=n,s||t.layoutDependency!==e||void 0===e||t.isPresent!==n?o.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?o.promote():o.relegate()||l.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),O.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 bo(t){const[e,i]=function(t=!0){const e=Z(N);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:s,register:n}=e,o=J();Q(()=>{if(t)return n(o)},[t]);const r=tt(()=>t&&s&&s(o),[o,s,t]);return!i&&s?[!1,r]:[!0]}(),s=Z(K);return _(Ao,{...t,layoutGroup:s,switchLayoutGroup:Z(z),isPresent:e,safeToRemove:i})}const Eo={borderRadius:{...So,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:So,borderTopRightRadius:So,borderBottomLeftRadius:So,borderBottomRightRadius:So,boxShadow:wo},Vo={pan:{Feature:class extends ht{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Fs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ls(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Zs(t),onStart:Zs(e),onMove:i,onEnd:(t,e)=>{delete this.session,s&&l.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=us(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ht{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new qs(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Po,MeasureLayout:bo}},Mo={layout:{ProjectionNode:Po,MeasureLayout:bo}};function Do(t,e,i={}){var s;const n=rn(t,e,"exit"===i.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(o=i.transitionOverride);const r=n?()=>Promise.all(hn(t,n,i)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:n=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,i=0,s=0,n=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===n?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Co).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(Do(t,e,{...o,delay:i+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,n+s,r,a,i)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(i.delay)])}function Co(t,e){return t.sortNodePosition(e)}function Ro(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let s=0;s<i;s++)if(e[s]!==t[s])return!1;return!0}const ko=$.length;const Lo=[...H].reverse(),Bo=H.length;function jo(t){return e=>Promise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const n=e.map(e=>Do(t,e,i));s=Promise.all(n)}else if("string"==typeof e)s=Do(t,e,i);else{const n="function"==typeof e?rn(t,e,i.custom):e;s=Promise.all(hn(t,n,i))}return s.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function Fo(t){let e=jo(t),i=Uo(),s=!0;const n=e=>(i,s)=>{var n;const o=rn(t,s,"exit"===e?null===(n=t.presenceContext)||void 0===n?void 0:n.custom:void 0);if(o){const{transition:t,transitionEnd:e,...s}=o;i={...i,...s,...e}}return i};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}const i={};for(let t=0;t<ko;t++){const s=$[t],n=e.props[s];(Y(n)||!1===n)&&(i[s]=n)}return i}(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;e<Bo;e++){const d=Lo[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=Y(m),v=d===o?p.isActive:null;!1===v&&(c=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&s&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...u},!p.isActive&&null===v||!m&&!p.prevProp||X(m)||"boolean"==typeof m)continue;const y=Oo(p.prevProp,m);let x=y||d===o&&p.isActive&&!g&&f||e>c&&f,P=!1;const T=Array.isArray(m)?m:[m];let S=T.reduce(n(d),{});!1===v&&(S={});const{prevResolvedValues:w={}}=p,A={...w,...S},b=e=>{x=!0,h.has(e)&&(P=!0,h.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=S[t],i=w[t];if(u.hasOwnProperty(t))continue;let s=!1;s=G(e)&&G(i)?!Ro(e,i):e!==i,s?null!=e?b(t):h.add(t):void 0!==e&&h.has(t)?b(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),s&&t.blockInitialAnimation&&(x=!1);const E=!(g&&y)||P;x&&E&&l.push(...T.map(t=>({animation:t,options:{type:d}})))}if(h.size){const e={};if("boolean"!=typeof r.initial){const i=rn(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}h.forEach(i=>{const s=t.getBaseTarget(i),n=t.getValue(i);n&&(n.liveStyle=!0),e[i]=null!=s?s:null}),l.push({animation:e})}let d=Boolean(l.length);return!s||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,s){var n;if(i[e].isActive===s)return Promise.resolve();null===(n=t.variantChildren)||void 0===n||n.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,s)}),i[e].isActive=s;const r=o(e);for(const t in i)i[t].protectedKeys={};return r},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=Uo(),s=!0}}}function Oo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ro(e,t)}function Io(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Uo(){return{animate:Io(!0),whileInView:Io(),whileHover:Io(),whileTap:Io(),whileDrag:Io(),whileFocus:Io(),exit:Io()}}let No=0;const Ko={animation:{Feature:class extends ht{constructor(t){super(t),t.animationState||(t.animationState=Fo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();X(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends ht{constructor(){super(...arguments),this.id=No++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function zo(t,e,i){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===i);const n=s["onHover"+i];n&&l.postRender(()=>n(e,hs(e)))}function Wo(t,e,i){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===i);const n=s["onTap"+("End"===i?"":i)];n&&l.postRender(()=>n(e,hs(e)))}const Yo=new WeakMap,$o=new WeakMap,Xo=t=>{const e=Yo.get(t.target);e&&e(t)},Go=t=>{t.forEach(Xo)};function Ho(t,e,i){const s=function({root:t,...e}){const i=t||document;$o.has(i)||$o.set(i,{});const s=$o.get(i),n=JSON.stringify(e);return s[n]||(s[n]=new IntersectionObserver(Go,{root:t,...e})),s[n]}(e);return Yo.set(t,i),s.observe(t),()=>{Yo.delete(t),s.unobserve(t)}}const qo={some:0,all:1};const _o={...{renderer:(t,e)=>q(t)?new fn(e):new vn(e,{allowProjection:t!==it}),...Ko,...{inView:{Feature:class extends ht{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:s="some",once:n}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof s?s:qo[s]};return Ho(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,n&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),o=e?i:s;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ht{mount(){const{current:t}=this.node;t&&(this.unmount=Ft(t,(t,e)=>(Wo(this.node,e,"Start"),(t,{success:e})=>Wo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ht{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ui(ls(this.node.current,"focus",()=>this.onFocus()),ls(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ht{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){const[s,n,o]=Et(t,i),r=t=>{if(!Vt(t))return;const{target:i}=t,s=e(i,t);if("function"!=typeof s||!i)return;const o=t=>{Vt(t)&&(s(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,n)};return s.forEach(t=>{t.addEventListener("pointerenter",r,n)}),o}(t,(t,e)=>(zo(this.node,e,"Start"),t=>zo(this.node,t,"End"))))}unmount(){}}}}},...Vo,...Mo};export{_o as domMax};
|
|
1
|
+
import{x as t,y as e,u as i,z as s,A as n,B as o,C as r,D as a,E as l,F as h,G as u,H as c,I as d,J as p,K as m,t as f,d as v,b as g,o as y,M as x,m as P,r as T,N as S,c as w,i as A,l as b,f as E,p as V,O as M,Q as D,g as C,s as R,P as k,L,S as B,R as j,T as F,a as O,U as I,n as U,V as N,W as K,v as z,X as W,Y,q as $,h as X,w as G,j as H,k as q}from"./size-rollup-dom-max-assets.js";import{jsx as _}from"react/jsx-runtime";import{useContext as Z,useId as J,useEffect as Q,useCallback as tt,Component as et,Fragment as it}from"react";function st(t,e){-1===t.indexOf(e)&&t.push(e)}function nt(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}let ot=t;const rt=!1;function at(t){let e;return()=>(void 0===e&&(e=t()),e)}const lt=(t,e,i)=>{const s=e-t;return 0===s?1:(i-t)/s};class ht{constructor(){this.subscriptions=[]}add(t){return st(this.subscriptions,t),()=>nt(this.subscriptions,t)}notify(t,e,i){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,i);else for(let n=0;n<s;n++){const s=this.subscriptions[n];s&&s(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ut=t=>1e3*t,ct=t=>t/1e3;function dt(t,e){return e?t*(1e3/e):0}const pt=at(()=>void 0!==window.ScrollTimeline);class mt extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let i=0;i<this.animations.length;i++)this.animations[i][t]=e}attachTimeline(t,e){const i=this.animations.map(i=>pt()&&i.attachTimeline?i.attachTimeline(t):"function"==typeof e?e(i):void 0);return()=>{i.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function ft(t,e){return t?t[e]||t.default||t:void 0}function vt(t){let e=0;let i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}function gt(t){return"function"==typeof t}function yt(t,e){t.timeline=e,t.onfinish=null}const xt=t=>Array.isArray(t)&&"number"==typeof t[0],Pt={linearEasing:void 0};function Tt(t,e){const i=at(t);return()=>{var t;return null!==(t=Pt[e])&&void 0!==t?t:i()}}const St=Tt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),wt=(t,e,i=10)=>{let s="";const n=Math.max(Math.round(e/i),2);for(let e=0;e<n;e++)s+=t(lt(0,n-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function At(t){return Boolean("function"==typeof t&&St()||!t||"string"==typeof t&&(t in Et||St())||xt(t)||Array.isArray(t)&&t.every(At))}const bt=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,Et={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bt([0,.65,.55,1]),circOut:bt([.55,0,1,.45]),backIn:bt([.31,.01,.66,-.59]),backOut:bt([.33,1.53,.69,.99])};let Vt;function Mt(){Vt=void 0}const Dt={now:()=>(void 0===Vt&&Dt.set(e.isProcessing||rt?e.timestamp:performance.now()),Vt),set:t=>{Vt=t,queueMicrotask(Mt)}},Ct={x:!1,y:!1};function Rt(){return Ct.x||Ct.y}function kt(t,e){const i=function(t,e,i){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);const o=null!==(s=null==i?void 0:i[t])&&void 0!==s?s:n.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}(t),s=new AbortController;return[i,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function Lt(t){return!("touch"===t.pointerType||Rt())}function Bt(t,e){const i=e+"PointerCapture";if(t.target instanceof Element&&i in t.target&&void 0!==t.pointerId)try{t.target[i](t.pointerId)}catch(t){}}const jt=(t,e)=>!!e&&(t===e||jt(t,e.parentElement)),Ft=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ot=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const It=new WeakSet;function Ut(t){return e=>{"Enter"===e.key&&t(e)}}function Nt(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Kt(t){return Ft(t)&&!Rt()}function zt(t,e,i={}){const[s,n,o]=kt(t,i),r=t=>{const i=t.currentTarget;if(!i||!Kt(t)||It.has(i))return;It.add(i),Bt(t,"set");const s=e(i,t),o=(t,e)=>{i.removeEventListener("pointerup",r),i.removeEventListener("pointercancel",a),Bt(t,"release"),Kt(t)&&It.has(i)&&(It.delete(i),"function"==typeof s&&s(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(s=t,n=i instanceof Element?i.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<n.left||s.clientX>n.right||s.clientY<n.top||s.clientY>n.bottom);var s,n;o(t,!e&&(!(i instanceof Element)||jt(i,t.target)))},a=t=>{o(t,!1)};i.addEventListener("pointerup",r,n),i.addEventListener("pointercancel",a,n),i.addEventListener("lostpointercapture",a,n)};return s.forEach(t=>{let e=!1;var s;(t=i.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,Ot.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,n),e&&t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const s=Ut(()=>{if(It.has(i))return;Nt(i,"down");const t=Ut(()=>{Nt(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>Nt(i,"cancel"),e)});i.addEventListener("keydown",s,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),e)})(t,n),n)}),o}class Wt{constructor(t,e={}){this.version="12.6.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const i=Dt.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ht);const s=this.events[t].add(e);return"change"===t?()=>{s(),i.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return dt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yt(t,e){return new Wt(t,e)}class $t{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Xt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function Gt(e,i,s,n){if(e===i&&s===n)return t;const o=t=>function(t,e,i,s,n){let o,r,a=0;do{r=e+(i-e)/2,o=Xt(r,s,n)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,s);return t=>0===t||1===t?t:Xt(o(t),i,n)}const Ht=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,qt=t=>e=>1-t(1-e),_t=Gt(.33,1.53,.69,.99),Zt=qt(_t),Jt=Ht(Zt),Qt=t=>(t*=2)<1?.5*Zt(t):.5*(2-Math.pow(2,-10*(t-1))),te=t=>1-Math.sin(Math.acos(t)),ee=qt(te),ie=Ht(te),se=t=>/^0[^.\s]+$/u.test(t);const ne=new Set(["width","height","top","left","right","bottom",...s]),oe=t=>Math.round(1e5*t)/1e5,re=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,le=(t,e)=>i=>Boolean("string"==typeof i&&ae.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),he=(t,e,i)=>s=>{if("string"!=typeof s)return s;const[n,o,r,a]=s.match(re);return{[t]:parseFloat(n),[e]:parseFloat(o),[i]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},ue={...n,transform:t=>Math.round((t=>r(0,255,t))(t))},ce={test:le("rgb","red"),parse:he("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+ue.transform(t)+", "+ue.transform(e)+", "+ue.transform(i)+", "+oe(o.transform(s))+")"};const de={test:le("#"),parse:function(t){let e="",i="",s="",n="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),n=t.substring(4,5),e+=e,i+=i,s+=s,n+=n),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}},transform:ce.transform},pe={test:le("hsl","hue"),parse:he("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+a.transform(oe(e))+", "+a.transform(oe(i))+", "+oe(o.transform(s))+")"},me={test:t=>ce.test(t)||de.test(t)||pe.test(t),parse:t=>ce.test(t)?ce.parse(t):pe.test(t)?pe.parse(t):de.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ce.transform(t):pe.transform(t)},fe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ve=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ge(t){const e=t.toString(),i=[],s={color:[],number:[],var:[]},n=[];let o=0;const r=e.replace(ve,t=>(me.test(t)?(s.color.push(o),n.push("color"),i.push(me.parse(t))):t.startsWith("var(")?(s.var.push(o),n.push("var"),i.push(t)):(s.number.push(o),n.push("number"),i.push(parseFloat(t))),++o,"${}")).split("${}");return{values:i,split:r,indexes:s,types:n}}function ye(t){return ge(t).values}function xe(t){const{split:e,types:i}=ge(t),s=e.length;return t=>{let n="";for(let o=0;o<s;o++)if(n+=e[o],void 0!==t[o]){const e=i[o];n+="number"===e?oe(t[o]):"color"===e?me.transform(t[o]):t[o]}return n}}const Pe=t=>"number"==typeof t?0:t;const Te={test:function(t){var e,i;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(re))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(fe))||void 0===i?void 0:i.length)||0)>0},parse:ye,createTransformer:xe,getAnimatableNone:function(t){const e=ye(t);return xe(t)(e.map(Pe))}},Se=new Set(["brightness","contrast","saturate","opacity"]);function we(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=i.match(re)||[];if(!s)return t;const n=i.replace(s,"");let o=Se.has(e)?1:0;return s!==i&&(o*=100),e+"("+o+n+")"}const Ae=/\b([a-z-]*)\(.*?\)/gu,be={...Te,getAnimatableNone:t=>{const e=t.match(Ae);return e?e.map(we).join(" "):t}},Ee={...l,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:be,WebkitFilter:be},Ve=t=>Ee[t];function Me(t,e){let i=Ve(t);return i!==be&&(i=Te),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const De=new Set(["auto","none","0"]);const Ce=t=>180*t/Math.PI,Re=t=>{const e=Ce(Math.atan2(t[1],t[0]));return Le(e)},ke={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Re,rotateZ:Re,skewX:t=>Ce(Math.atan(t[1])),skewY:t=>Ce(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>((t%=360)<0&&(t+=360),t),Be=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),je=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Be,scaleY:je,scale:t=>(Be(t)+je(t))/2,rotateX:t=>Le(Ce(Math.atan2(t[6],t[5]))),rotateY:t=>Le(Ce(Math.atan2(-t[2],t[0]))),rotateZ:Re,rotate:Re,skewX:t=>Ce(Math.atan(t[4])),skewY:t=>Ce(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Oe(t){return t.includes("scale")?1:0}function Ie(t,e){if(!t||"none"===t)return Oe(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,n;if(i)s=Fe,n=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ke,n=e}if(!n)return Oe(e);const o=s[e],r=n[1].split(",").map(Ue);return"function"==typeof o?o(r):r[o]}function Ue(t){return parseFloat(t.trim())}const Ne=t=>t===n||t===h,Ke=new Set(["x","y","z"]),ze=s.filter(t=>!Ke.has(t));const We={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),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:(t,{transform:e})=>Ie(e,"x"),y:(t,{transform:e})=>Ie(e,"y")};We.translateX=We.x,We.translateY=We.y;const Ye=new Set;let $e=!1,Xe=!1;function Ge(){if(Xe){const t=Array.from(Ye).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return ze.forEach(i=>{const s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Xe=!1,$e=!1,Ye.forEach(t=>t.complete()),Ye.clear()}function He(){Ye.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Xe=!0)})}class qe{constructor(t,e,i,s,n,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),$e||($e=!0,i.read(He),i.resolveKeyframes(Ge))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;for(let n=0;n<t.length;n++)if(null===t[n])if(0===n){const n=null==s?void 0:s.get(),o=t[t.length-1];if(void 0!==n)t[0]=n;else if(i&&e){const s=i.readValue(e,o);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=o),s&&void 0===n&&s.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const _e=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Je(t,e,i=1){const[s,n]=function(t){const e=Ze.exec(t);if(!e)return[,];const[,i,s,n]=e;return["--"+(null!=i?i:s),n]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return _e(t)?parseFloat(t):t}return u(n)?Je(n,e,i+1):n}const Qe=t=>e=>e.test(t),ti=[n,h,a,c,d,p,{test:t=>"auto"===t,parse:t=>t}],ei=t=>ti.find(Qe(t));class ii extends qe{constructor(t,e,i,s,n){super(t,e,i,s,n,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let s=t[i];if("string"==typeof s&&(s=s.trim(),u(s))){const n=Je(s,e.current);void 0!==n&&(t[i]=n),i===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!ne.has(i)||2!==t.length)return;const[s,n]=t,o=ei(s),r=ei(n);if(o!==r)if(Ne(o)&&Ne(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||se(s))&&i.push(e);var s;i.length&&function(t,e,i){let s=0,n=void 0;for(;s<t.length&&!n;){const e=t[s];"string"==typeof e&&!De.has(e)&&ge(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=Me(i,n)}(t,i,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=We[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(i,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:i,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const n=e.getValue(i);n&&n.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=We[i](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,i])=>{e.getValue(t).set(i)}),this.resolveNoneKeyframes()}}const si=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Te.test(t)&&"0"!==t||t.startsWith("url(")));function ni(t,e,i,s){const n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=si(n,e),a=si(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||gt(i))&&s)}const oi=t=>null!==t;function ri(t,{repeat:e,repeatType:i="loop"},s){const n=t.filter(oi),o=e&&"loop"!==i&&e%2==1?0:n.length-1;return o&&void 0!==s?s:n[o]}class ai{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Dt.now(),this.options={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:n,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(He(),Ge()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Dt.now(),this.hasAttemptedResolve=!0;const{name:i,type:s,velocity:n,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!ni(t,i,s,n)){if(!o)return a&&a(ri(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const h=this.initPlayback(t,e);!1!==h&&(this._resolved={keyframes:t,finalKeyframe:e,...h},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const li=(t,e,i)=>t+(e-t)*i;function hi(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function ui(t,e){return i=>i>0?e:t}const ci=(t,e,i)=>{const s=t*t,n=i*(e*e-s)+s;return n<0?0:Math.sqrt(n)},di=[de,ce,pe];function pi(t){const e=(i=t,di.find(t=>t.test(i)));var i;if(!Boolean(e))return!1;let s=e.parse(t);return e===pe&&(s=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let n=0,o=0,r=0;if(e/=100){const s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=hi(a,s,t+1/3),o=hi(a,s,t),r=hi(a,s,t-1/3)}else n=o=r=i;return{red:Math.round(255*n),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const mi=(t,e)=>{const i=pi(t),s=pi(e);if(!i||!s)return ui(t,e);const n={...i};return t=>(n.red=ci(i.red,s.red,t),n.green=ci(i.green,s.green,t),n.blue=ci(i.blue,s.blue,t),n.alpha=li(i.alpha,s.alpha,t),ce.transform(n))},fi=(t,e)=>i=>e(t(i)),vi=(...t)=>t.reduce(fi),gi=new Set(["none","hidden"]);function yi(t,e){return i=>li(t,e,i)}function xi(t){return"number"==typeof t?yi:"string"==typeof t?u(t)?ui:me.test(t)?mi:Si:Array.isArray(t)?Pi:"object"==typeof t?me.test(t)?mi:Ti:ui}function Pi(t,e){const i=[...t],s=i.length,n=t.map((t,i)=>xi(t)(t,e[i]));return t=>{for(let e=0;e<s;e++)i[e]=n[e](t);return i}}function Ti(t,e){const i={...t,...e},s={};for(const n in i)void 0!==t[n]&&void 0!==e[n]&&(s[n]=xi(t[n])(t[n],e[n]));return t=>{for(const e in s)i[e]=s[e](t);return i}}const Si=(t,e)=>{const i=Te.createTransformer(e),s=ge(t),n=ge(e);return s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length?gi.has(t)&&!n.values.length||gi.has(e)&&!s.values.length?function(t,e){return gi.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):vi(Pi(function(t,e){var i;const s=[],n={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][n[r]],l=null!==(i=t.values[a])&&void 0!==i?i:0;s[o]=l,n[r]++}return s}(s,n),n.values),i):ui(t,e)};function wi(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return li(t,e,i);return xi(t)(t,e)}function Ai(t,e,i){const s=Math.max(e-5,0);return dt(i-t(s),e-s)}const bi=100,Ei=10,Vi=1,Mi=0,Di=800,Ci=.3,Ri=.3,ki={granular:.01,default:2},Li={granular:.005,default:.5},Bi=.01,ji=10,Fi=.05,Oi=1;function Ii({duration:t=Di,bounce:e=Ci,velocity:i=Mi,mass:s=Vi}){let n,o,a=1-e;a=r(Fi,Oi,a),t=r(Bi,ji,ct(t)),a<1?(n=e=>{const s=e*a,n=s*t;return.001-(s-i)/Ui(e,a)*Math.exp(-n)},o=e=>{const s=e*a*t,o=s*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),h=Ui(Math.pow(e,2),a);return(.001-n(e)>0?-1:1)*((o-r)*l)/h}):(n=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,i){let s=i;for(let i=1;i<12;i++)s-=t(s)/e(s);return s}(n,o,5/t);if(t=ut(t),isNaN(l))return{stiffness:bi,damping:Ei,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}function Ui(t,e){return t*Math.sqrt(1-e*e)}const Ni=["duration","bounce"],Ki=["stiffness","damping","mass"];function zi(t,e){return e.some(e=>void 0!==t[e])}function Wi(t=Ri,e=Ci){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:n}=i;const o=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:o},{stiffness:h,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:Mi,stiffness:bi,damping:Ei,mass:Vi,isResolvedFromDuration:!1,...t};if(!zi(t,Ki)&&zi(t,Ni))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),n=s*s,o=2*r(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:Vi,stiffness:n,damping:o}}else{const i=Ii(t);e={...e,...i,mass:Vi},e.isResolvedFromDuration=!0}return e}({...i,velocity:-ct(i.velocity||0)}),f=p||0,v=u/(2*Math.sqrt(h*c)),g=a-o,y=ct(Math.sqrt(h/c)),x=Math.abs(g)<5;let P;if(s||(s=x?ki.granular:ki.default),n||(n=x?Li.granular:Li.default),v<1){const t=Ui(y,v);P=e=>{const i=Math.exp(-v*y*e);return a-i*((f+v*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===v)P=t=>a-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(v*v-1);P=e=>{const i=Math.exp(-v*y*e),s=Math.min(t*e,300);return a-i*((f+v*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=P(t);if(m)l.done=t>=d;else{let i=0;v<1&&(i=0===t?ut(f):Ai(P,t,e));const o=Math.abs(i)<=s,r=Math.abs(a-e)<=n;l.done=o&&r}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(vt(T),2e4),e=wt(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}function Yi({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:n=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/s),y=t=>v+g(t),x=t=>{const e=g(t),i=y(t);d.done=Math.abs(e)<=h,d.value=d.done?v:i};let P,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,T=Wi({keyframes:[d.value,p(d.value)],velocity:Ai(y,t,d.value),damping:n,stiffness:o,restDelta:h,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),S(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const $i=Gt(.42,0,1,1),Xi=Gt(0,0,.58,1),Gi=Gt(.42,0,.58,1),Hi={linear:t,easeIn:$i,easeInOut:Gi,easeOut:Xi,circIn:te,circInOut:ie,circOut:ee,backIn:Zt,backInOut:Jt,backOut:_t,anticipate:Qt},qi=t=>{if(xt(t)){ot(4===t.length);const[e,i,s,n]=t;return Gt(e,i,s,n)}return"string"==typeof t?Hi[t]:t};function _i(e,i,{clamp:s=!0,ease:n,mixer:o}={}){const a=e.length;if(ot(a===i.length),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const h=function(e,i,s){const n=[],o=s||wi,r=e.length-1;for(let s=0;s<r;s++){let r=o(e[s],e[s+1]);if(i){const e=Array.isArray(i)?i[s]||t:i;r=vi(e,r)}n.push(r)}return n}(i,n,o),u=h.length,c=t=>{if(l&&t<e[0])return i[0];let s=0;if(u>1)for(;s<e.length-2&&!(t<e[s+1]);s++);const n=lt(e[s],e[s+1],t);return h[s](n)};return s?t=>c(r(e[0],e[a-1],t)):c}function Zi(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const n=lt(0,e,s);t.push(li(i,1,n))}}(e,t.length-1),e}function Ji({duration:t=300,keyframes:e,times:i,ease:s="easeInOut"}){const n=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(qi):qi(s),o={done:!1,value:e[0]},r=_i(function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Zi(e),t),e,{ease:Array.isArray(n)?n:(a=e,l=n,a.map(()=>l||Gi).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Qi=t=>{const s=({timestamp:e})=>t(e);return{start:()=>i.update(s,!0),stop:()=>m(s),now:()=>e.isProcessing?e.timestamp:Dt.now()}},ts={decay:Yi,inertia:Yi,tween:Ji,keyframes:Ji,spring:Wi},es=t=>t/100;class is extends ai{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:i,element:s,keyframes:n}=this.options,o=(null==s?void 0:s.KeyframeResolver)||qe;this.resolver=new o(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=this.options,r=gt(e)?e:ts[e]||Ji;let a,l;r!==Ji&&"number"!=typeof t[0]&&(a=vi(es,wi(t[0],t[1])),t=[0,100]);const h=r({...this.options,keyframes:t});"mirror"===n&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===h.calculatedDuration&&(h.calculatedDuration=vt(h));const{calculatedDuration:u}=h,c=u+s;return{generator:h,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:c,totalDuration:c*(i+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:i}=this;if(!i){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:n,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:h,totalDuration:u,resolvedDuration:c}=i;if(null===this.startTime)return n.next(0);const{delay:d,repeat:p,repeatType:m,repeatDelay:f,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let x=this.currentTime,P=n;if(p){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,p+1);Boolean(e%2)&&("reverse"===m?(i=1-i,f&&(i-=f/c)):"mirror"===m&&(P=o)),x=r(0,1,i)*c}const T=y?{done:!1,value:l[0]}:P.next(x);a&&(T.value=a(T.value));let{done:S}=T;y||null===h||(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return w&&void 0!==s&&(T.value=ri(l,this.options,s)),v&&v(T.value),w&&this.finish(),T}get duration(){const{resolved:t}=this;return t?ct(t.calculatedDuration):0}get time(){return ct(this.currentTime)}set time(t){t=ut(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=ct(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Qi,onPlay:e,startTime:i}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const ss=new Set(["opacity","clipPath","filter","transform"]);function ns(t,e,i,{delay:s=0,duration:n=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const h={[e]:i};l&&(h.offset=l);const u=function t(e,i){return e?"function"==typeof e&&St()?wt(e,i):xt(e)?bt(e):Array.isArray(e)?e.map(e=>t(e,i)||Et.easeOut):Et[e]:void 0}(a,n);Array.isArray(u)&&(h.easing=u);return t.animate(h,{delay:s,duration:n,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const os=at(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const rs={anticipate:Qt,backInOut:Jt,circInOut:ie};class as extends ai{constructor(t){super(t);const{name:e,motionValue:i,element:s,keyframes:n}=this.options;this.resolver=new ii(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:i=300,times:s,ease:n,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var h;if("string"==typeof n&&St()&&n in rs&&(n=rs[n]),gt((h=this.options).type)||"spring"===h.type||!At(h.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...h}=this.options,u=function(t,e){const i=new is({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const n=[];let o=0;for(;!s.done&&o<2e4;)s=i.sample(o),n.push(s.value),o+=10;return{times:void 0,keyframes:n,duration:o-10,ease:"linear"}}(t,h);1===(t=u.keyframes).length&&(t[1]=t[0]),i=u.duration,s=u.times,n=u.ease,o="keyframes"}const u=ns(r.owner.current,a,t,{...this.options,duration:i,times:s,ease:n});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(yt(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:i}=this.options;r.set(ri(t,this.options,e)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:s,type:o,ease:n,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return ct(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return ct(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.currentTime=ut(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(e){if(this._resolved){const{resolved:i}=this;if(!i)return t;const{animation:s}=i;yt(s,e)}else this.pendingTimeline=e;return t}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:i,duration:s,type:n,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...h}=this.options,u=new is({...h,keyframes:i,duration:s,type:n,ease:o,times:r,isGenerator:!0}),c=ut(this.time);t.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:i,repeatDelay:s,repeatType:n,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return os()&&i&&ss.has(i)&&!a&&!l&&!s&&"mirror"!==n&&0!==o&&"inertia"!==r}}const ls={type:"spring",stiffness:500,damping:25,restSpeed:10},hs={type:"keyframes",duration:.8},us={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},cs=(t,{keyframes:e})=>e.length>2?hs:f.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ls:us;const ds=(t,e,s,n={},o,r)=>a=>{const l=ft(n,t)||{},h=l.delay||n.delay||0;let{elapsed:u=0}=n;u-=ut(h);let c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:o};(function({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:n,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(l)||(c={...c,...cs(t,c)}),c.duration&&(c.duration=ut(c.duration)),c.repeatDelay&&(c.repeatDelay=ut(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(d=!0)),c.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=ri(c.keyframes,l);if(void 0!==t)return i.update(()=>{c.onUpdate(t),c.onComplete()}),new mt([])}return!r&&as.supports(c)?new as(c):new is(c)};function ps(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}function ms(t){return{point:{x:t.pageX,y:t.pageY}}}function fs(t,e,i,s){return ps(t,e,(t=>e=>Ft(e)&&t(e,ms(e)))(i),s)}function vs({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function gs(t){return t.max-t.min}function ys(t,e,i,s=.5){t.origin=s,t.originPoint=li(e.min,e.max,t.origin),t.scale=gs(i)/gs(e),t.translate=li(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function xs(t,e,i,s){ys(t.x,e.x,i.x,s?s.originX:void 0),ys(t.y,e.y,i.y,s?s.originY:void 0)}function Ps(t,e,i){t.min=i.min+e.min,t.max=t.min+gs(e)}function Ts(t,e,i){t.min=e.min-i.min,t.max=t.min+gs(e)}function Ss(t,e,i){Ts(t.x,e.x,i.x),Ts(t.y,e.y,i.y)}const ws=()=>({x:{min:0,max:0},y:{min:0,max:0}});function As(t){return[t("x"),t("y")]}function bs(t){return void 0===t||1===t}function Es({scale:t,scaleX:e,scaleY:i}){return!bs(t)||!bs(e)||!bs(i)}function Vs(t){return Es(t)||Ms(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ms(t){return Ds(t.x)||Ds(t.y)}function Ds(t){return t&&"0%"!==t}function Cs(t,e,i){return i+e*(t-i)}function Rs(t,e,i,s,n){return void 0!==n&&(t=Cs(t,n,s)),Cs(t,i,s)+e}function ks(t,e=0,i=1,s,n){t.min=Rs(t.min,e,i,s,n),t.max=Rs(t.max,e,i,s,n)}function Ls(t,{x:e,y:i}){ks(t.x,e.translate,e.scale,e.originPoint),ks(t.y,i.translate,i.scale,i.originPoint)}function Bs(t,e){t.min=t.min+e,t.max=t.max+e}function js(t,e,i,s,n=.5){ks(t,e,i,li(t.min,t.max,n),s)}function Fs(t,e){js(t.x,e.x,e.scaleX,e.scale,e.originX),js(t.y,e.y,e.scaleY,e.scale,e.originY)}function Os(t,e){return vs(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}const Is=({current:t})=>t?t.ownerDocument.defaultView:null;function Us(t,e){const i=t.getValue("willChange");if(s=i,Boolean(v(s)&&s.add))return i.add(e);var s}const Ns=(t,e)=>Math.abs(t-e);class Ks{constructor(t,s,{transformPagePoint:n,contextWindow:o,dragSnapToOrigin:r=!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=Ys(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,s=function(t,e){const i=Ns(t.x,e.x),s=Ns(t.y,e.y);return Math.sqrt(i**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!i&&!s)return;const{point:n}=t,{timestamp:o}=e;this.history.push({...n,timestamp:o});const{onStart:r,onMove:a}=this.handlers;i||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=zs(e,this.transformPagePoint),i.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:s,resumeAnimation:n}=this.handlers;if(this.dragSnapToOrigin&&n&&n(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Ys("pointercancel"===t.type?this.lastMoveEventInfo:zs(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),s&&s(t,o)},!Ft(t))return;this.dragSnapToOrigin=r,this.handlers=s,this.transformPagePoint=n,this.contextWindow=o||window;const a=zs(ms(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=e;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=s;u&&u(t,Ys(a,this.history)),this.removeListeners=vi(fs(this.contextWindow,"pointermove",this.handlePointerMove),fs(this.contextWindow,"pointerup",this.handlePointerUp),fs(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),m(this.updatePoint)}}function zs(t,e){return e?{point:e(t.point)}:t}function Ws(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ys({point:t},e){return{point:t,delta:Ws(t,Xs(e)),offset:Ws(t,$s(e)),velocity:Gs(e,.1)}}function $s(t){return t[0]}function Xs(t){return t[t.length-1]}function Gs(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null;const n=Xs(t);for(;i>=0&&(s=t[i],!(n.timestamp-s.timestamp>ut(e)));)i--;if(!s)return{x:0,y:0};const o=ct(n.timestamp-s.timestamp);if(0===o)return{x:0,y:0};const r={x:(n.x-s.x)/o,y:(n.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Hs(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 qs(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,s]=[s,i]),{min:i,max:s}}const _s=.35;function Zs(t,e,i){return{min:Js(t,e),max:Js(t,i)}}function Js(t,e){return"number"==typeof t?t:t[e]||0}const Qs=new WeakMap;class tn{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&!1===s.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new Ks(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(ms(t).point)},onStart:(t,e)=>{const{drag:s,dragPropagation:n,onDragStart:o}=this.getProps();if(s&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(r=s)||"y"===r?Ct[r]?null:(Ct[r]=!0,()=>{Ct[r]=!1}):Ct.x||Ct.y?null:(Ct.x=Ct.y=!0,()=>{Ct.x=Ct.y=!1}),!this.openDragLock))return;var r;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),As(t=>{let e=this.getAxisMotionValue(t).get()||0;if(a.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const s=i.layout.layoutBox[t];if(s){e=gs(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&i.postRender(()=>o(t,e)),Us(this.visualElement,"transform");const{animationState:l}=this.visualElement;l&&l.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:i,dragDirectionLock:s,onDirectionLock:n,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)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&&n&&n(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>As(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:n,contextWindow:Is(this.visualElement)})}stop(t,e){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:n}=e;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&i.postRender(()=>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.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!en(t,s,this.currentDirection))return;const n=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:i},s){return void 0!==e&&t<e?t=s?li(e,t,s.min):Math.max(t,e):void 0!==i&&t>i&&(t=s?li(i,t,s.max):Math.min(t,i)),t}(o,this.constraints[t],this.elastic[t])),n.set(o)}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,n=this.constraints;e&&g(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!s)&&function(t,{top:e,left:i,bottom:s,right:n}){return{x:Hs(t.x,i,n),y:Hs(t.y,e,s)}}(s.layoutBox,e),this.elastic=function(t=_s){return!1===t?t=0:!0===t&&(t=_s),{x:Zs(t,"left","right"),y:Zs(t,"top","bottom")}}(i),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&As(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||!g(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const n=function(t,e,i){const s=Os(t,i),{scroll:n}=e;return n&&(Bs(s.x,n.offset.x),Bs(s.y,n.offset.y)),s}(i,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:qs(t.x,e.x),y:qs(t.y,e.y)}}(s.layout.layoutBox,n);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=vs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:s,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=As(r=>{if(!en(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,u=s?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return Us(this.visualElement,t),i.start(ds(t,i,0,e,this.visualElement,!1))}stopAnimation(){As(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){As(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){As(e=>{const{drag:i}=this.getProps();if(!en(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,n=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:o}=s.layout.layoutBox[e];n.set(t[e]-li(i,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!g(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};As(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=gs(t),n=gs(e);return n>s?i=lt(e.min,e.max-s,t.min):s>n&&(i=lt(t.min,t.max-n,e.min)),r(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),As(e=>{if(!en(e,t,null))return;const i=this.getAxisMotionValue(e),{min:n,max:o}=this.constraints[e];i.set(li(n,o,s[e]))})}addListeners(){if(!this.visualElement.current)return;Qs.set(this.visualElement,this);const t=fs(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();g(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,n=s.addEventListener("measure",e);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i.read(e);const o=ps(window,"resize",()=>this.scalePositionWithinConstraints()),r=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(As(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),t(),n(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:n=!1,dragElastic:o=_s,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:n,dragElastic:o,dragMomentum:r}}}function en(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const sn=t=>(e,s)=>{t&&i.postRender(()=>t(e,s))};function nn(t){return t.props[y]}const on=(t,e)=>t.depth-e.depth;class rn{constructor(){this.children=[],this.isDirty=!1}add(t){st(this.children,t),this.isDirty=!0}remove(t){nt(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(on),this.isDirty=!1,this.children.forEach(t)}}const an=["TopLeft","TopRight","BottomLeft","BottomRight"],ln=an.length,hn=t=>"string"==typeof t?parseFloat(t):t,un=t=>"number"==typeof t||h.test(t);function cn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const dn=mn(0,.5,ee),pn=mn(.5,.95,t);function mn(t,e,i){return s=>s<t?0:s>e?1:i(lt(t,e,s))}function fn(t,e){t.min=e.min,t.max=e.max}function vn(t,e){fn(t.x,e.x),fn(t.y,e.y)}function gn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function yn(t,e,i,s,n){return t=Cs(t-=e,1/i,s),void 0!==n&&(t=Cs(t,1/n,s)),t}function xn(t,e,[i,s,n],o,r){!function(t,e=0,i=1,s=.5,n,o=t,r=t){if(a.test(e)){e=parseFloat(e);e=li(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let l=li(o.min,o.max,s);t===o&&(l-=e),t.min=yn(t.min,e,i,l,n),t.max=yn(t.max,e,i,l,n)}(t,e[i],e[s],e[n],e.scale,o,r)}const Pn=["x","scaleX","originX"],Tn=["y","scaleY","originY"];function Sn(t,e,i,s){xn(t.x,e,Pn,i?i.x:void 0,s?s.x:void 0),xn(t.y,e,Tn,i?i.y:void 0,s?s.y:void 0)}function wn(t){return 0===t.translate&&1===t.scale}function An(t){return wn(t.x)&&wn(t.y)}function bn(t,e){return t.min===e.min&&t.max===e.max}function En(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Vn(t,e){return En(t.x,e.x)&&En(t.y,e.y)}function Mn(t){return gs(t.x)/gs(t.y)}function Dn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Cn{constructor(){this.members=[]}add(t){st(this.members,t),t.scheduleRender()}remove(t){if(nt(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 t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){i=e;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)}}const Rn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},kn=["","X","Y","Z"],Ln={visibility:"hidden"};let Bn=0;function jn(t,e,i,s){const{latestValues:n}=e;n[t]&&(i[t]=n[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Fn({attachResizeListener:t,defaultParent:s,measureScroll:n,checkIsScrollRoot:o,resetTransform:l}){return class{constructor(t={},e=(null==s?void 0:s())){this.id=Bn++,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.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Un),this.nodes.forEach(Xn),this.nodes.forEach(Gn),this.nodes.forEach(Nn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new rn)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ht),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,s=this.root.hasTreeAnimated){if(this.instance)return;var n;this.isSVG=(n=e)instanceof SVGElement&&"svg"!==n.tagName,this.instance=e;const{layoutId:o,layout:r,visualElement:a}=this.options;if(a&&!a.current&&a.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(r||o)&&(this.isLayoutDirty=!0),t){let s;const n=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,s&&s(),s=function(t,e){const s=Dt.now(),n=({timestamp:i})=>{const o=i-s;o>=e&&(m(n),t(o-e))};return i.read(n,!0),()=>m(n)}(n,250),Rn.hasAnimatedSinceResize&&(Rn.hasAnimatedSinceResize=!1,this.nodes.forEach($n))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&a&&(o||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const n=this.options.transition||a.getDefaultTransition()||Qn,{onLayoutAnimationStart:o,onLayoutAnimationComplete:r}=a.getProps(),l=!this.targetLayout||!Vn(this.targetLayout,s),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...ft(n,"layout"),onPlay:o,onComplete:r};(a.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||$n(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,m(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(Hn),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(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:s}=e.options;if(!s)return;const n=nn(s);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",i,!(t||s))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&t(o)}(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:s}=this.options;if(void 0===e&&!s)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(zn);this.isUpdating||this.nodes.forEach(Wn),this.isUpdating=!1,this.nodes.forEach(Yn),this.nodes.forEach(On),this.nodes.forEach(In),this.clearAllSnapshots();const t=Dt.now();e.delta=r(0,1e3/60,t-e.timestamp),e.timestamp=t,e.isProcessing=!0,x.update.process(e),x.preRender.process(e),x.render.process(e),e.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,P.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Kn),this.sharedNodes.forEach(qn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,i.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){i.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||gs(this.snapshot.measuredBox.x)||gs(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=o(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!l)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!An(this.projectionDelta),i=this.getTransformTemplate(),s=i?i(this.latestValues,""):void 0,n=s!==this.prevTransformTemplateValue;t&&(e||Vs(this.latestValues)||n)&&(l(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let i=this.removeElementScroll(e);var s;return t&&(i=this.removeTransform(i)),io((s=i).x),io(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const i=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(no))){const{scroll:t}=this.root;t&&(Bs(i.x,t.offset.x),Bs(i.y,t.offset.y))}return i}removeElementScroll(t){var e;const i={x:{min:0,max:0},y:{min:0,max:0}};if(vn(i,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return i;for(let e=0;e<this.path.length;e++){const s=this.path[e],{scroll:n,options:o}=s;s!==this.root&&n&&o.layoutScroll&&(n.wasRoot&&vn(i,t),Bs(i.x,n.offset.x),Bs(i.y,n.offset.y))}return i}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};vn(i,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fs(i,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),Vs(s.latestValues)&&Fs(i,s.latestValues)}return Vs(this.latestValues)&&Fs(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};vn(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Vs(i.latestValues))continue;Es(i.latestValues)&&i.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};vn(s,i.measurePageBox()),Sn(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,s)}return Vs(this.latestValues)&&Sn(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==e.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var i;const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==s;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(i=this.parent)||void 0===i?void 0:i.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:r}=this.options;if(this.layout&&(o||r)){if(this.resolvedRelativeTargetAt=e.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ss(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var a,l,h;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&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a=this.target,l=this.relativeTarget,h=this.relativeParent.target,Ps(a.x,l.x,h.x),Ps(a.y,l.y,h.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):vn(this.target,this.layout.layoutBox),Ls(this.target,this.targetDelta)):vn(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&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ss(this.relativeTargetOrigin,this.target,t.target),vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Es(this.parent.latestValues)&&!Ms(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const i=this.getLead(),s=Boolean(this.resumingFrom)||this!==i;let n=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(n=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===e.timestamp&&(n=!1),n)return;const{layout:o,layoutId:r}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!r)return;vn(this.layoutCorrected,this.layout.layoutBox);const a=this.treeScale.x,l=this.treeScale.y;!function(t,e,i,s=!1){const n=i.length;if(!n)return;let o,r;e.x=e.y=1;for(let a=0;a<n;a++){o=i[a],r=o.projectionDelta;const{visualElement:n}=o.options;n&&n.props.style&&"contents"===n.props.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Fs(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ls(t,r)),s&&Vs(o.latestValues)&&Fs(t,o.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,s),!i.layout||i.target||1===this.treeScale.x&&1===this.treeScale.y||(i.target=i.layout.layoutBox,i.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:h}=i;h?(this.projectionDelta&&this.prevProjectionDelta?(gn(this.prevProjectionDelta.x,this.projectionDelta.x),gn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),xs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),this.treeScale.x===a&&this.treeScale.y===l&&Dn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Dn(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},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}}}setAnimationOrigin(t,e=!1){const i=this.snapshot,s=i?i.latestValues:{},n={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Jn));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var h,p,m,f,v,g;_n(o.x,t.x,i),_n(o.y,t.y,i),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ss(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,f=this.relativeTargetOrigin,v=r,g=i,Zn(m.x,f.x,v.x,g),Zn(m.y,f.y,v.y,g),d&&(h=this.relativeTarget,p=d,bn(h.x,p.x)&&bn(h.y,p.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),vn(d,this.relativeTarget)),l&&(this.animationValues=n,function(t,e,i,s,n,o){n?(t.opacity=li(0,void 0!==i.opacity?i.opacity:1,dn(s)),t.opacityExit=li(void 0!==e.opacity?e.opacity:1,0,pn(s))):o&&(t.opacity=li(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let n=0;n<ln;n++){const o=`border${an[n]}Radius`;let r=cn(e,o),l=cn(i,o);if(void 0===r&&void 0===l)continue;r||(r=0),l||(l=0);0===r||0===l||un(r)===un(l)?(t[o]=Math.max(li(hn(r),hn(l),s),0),(a.test(l)||a.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||i.rotate)&&(t.rotate=li(e.rotate||0,i.rotate||0,s))}(n,s,this.latestValues,i,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=i.update(()=>{Rn.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){const s=v(t)?t:Yt(t);return s.start(ds("",s,e,i)),s.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},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:n}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&so(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=gs(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const s=gs(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}vn(e,i),Fs(e,n),xs(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Cn);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&&jn("z",t,s,this.animationValues);for(let e=0;e<kn.length;e++)jn("rotate"+kn[e],t,s,this.animationValues),jn("skew"+kn[e],t,s,this.animationValues);t.render();for(const e in s)t.setStaticValue(e,s[e]),this.animationValues&&(this.animationValues[e]=s[e]);t.scheduleRender()}getProjectionStyles(t){var e,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ln;const s={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=T(null==t?void 0:t.pointerEvents)||"",s.transform=n?n(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=T(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Vs(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=function(t,e,i){let s="";const n=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==i?void 0:i.z)||0;if((n||o||r)&&(s=`translate3d(${n}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:n,rotateY:o,skewX:r,skewY:a}=i;t&&(s=`perspective(${t}px) ${s}`),e&&(s+=`rotate(${e}deg) `),n&&(s+=`rotateX(${n}deg) `),o&&(s+=`rotateY(${o}deg) `),r&&(s+=`skewX(${r}deg) `),a&&(s+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(s+=`scale(${a}, ${l})`),s||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),n&&(s.transform=n(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(i=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in S){if(void 0===r[t])continue;const{correct:e,applyTo:i,isCSSVariable:n}=S[t],a="none"===s.transform?r[t]:e(r[t],o);if(i){const t=i.length;for(let e=0;e<t;e++)s[i[e]]=a}else n?this.options.visualElement.renderState.vars[t]=a:s[t]=a}return this.options.layoutId&&(s.pointerEvents=o===this?T(null==t?void 0:t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(zn),this.root.sharedNodes.clear()}}}function On(t){t.updateLayout()}function In(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:n}=t.options,o=i.source!==t.layout.source;"size"===n?As(t=>{const s=o?i.measuredBox[t]:i.layoutBox[t],n=gs(s);s.min=e[t].min,s.max=s.min+n}):so(n,i.layoutBox,e)&&As(s=>{const n=o?i.measuredBox[s]:i.layoutBox[s],r=gs(e[s]);n.max=n.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};xs(r,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?xs(a,t.applyTransform(s,!0),i.measuredBox):xs(a,e,i.layoutBox);const l=!An(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:n,layout:o}=s;if(n&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ss(r,i.layoutBox,n.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ss(a,e,o.layoutBox),Vn(r,a)||(h=!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:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Un(t){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 Nn(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Kn(t){t.clearSnapshot()}function zn(t){t.clearMeasurements()}function Wn(t){t.isLayoutDirty=!1}function Yn(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function $n(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Xn(t){t.resolveTargetDelta()}function Gn(t){t.calcProjection()}function Hn(t){t.resetSkewAndRotation()}function qn(t){t.removeLeadSnapshot()}function _n(t,e,i){t.translate=li(e.translate,0,i),t.scale=li(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Zn(t,e,i,s){t.min=li(e.min,i.min,s),t.max=li(e.max,i.max,s)}function Jn(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Qn={duration:.45,ease:[.4,0,.1,1]},to=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),eo=to("applewebkit/")&&!to("chrome/")?Math.round:t;function io(t){t.min=eo(t.min),t.max=eo(t.max)}function so(t,e,i){return"position"===t||"preserve-aspect"===t&&(s=Mn(e),n=Mn(i),o=.2,!(Math.abs(s-n)<=o));var s,n,o}function no(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const oo=Fn({attachResizeListener:(t,e)=>ps(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ro={current:void 0},ao=Fn({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ro.current){const t=new oo({});t.mount(window),t.setOptions({layoutScroll:!0}),ro.current=t}return ro.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function lo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ho={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!h.test(t))return t;t=parseFloat(t)}return`${lo(t,e.target.x)}% ${lo(t,e.target.y)}%`}},uo={correct:(t,{treeScale:e,projectionDelta:i})=>{const s=t,n=Te.parse(t);if(n.length>5)return s;const o=Te.createTransformer(t),r="number"!=typeof n[0]?1:0,a=i.x.scale*e.x,l=i.y.scale*e.y;n[0+r]/=a,n[1+r]/=l;const h=li(a,l,.5);return"number"==typeof n[2+r]&&(n[2+r]/=h),"number"==typeof n[3+r]&&(n[3+r]/=h),o(n)}},co={current:null},po={current:!1};const mo=[...ti,me,Te],fo=new WeakMap;const vo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class go extends class{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,i.render(this.render,!1,!0))};const{latestValues:l,renderState:h,onUpdate:u}=r;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=A(e),this.isVariantNode=b(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==l[t]&&v(e)&&e.set(l[t],!1)}}mount(t){this.current=t,fo.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),po.current||function(){if(po.current=!0,w)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>co.current=t.matches;t.addListener(e),e()}else co.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||co.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),m(this.notifyUpdate),m(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=f.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&i.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),o(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in E){const e=E[t];if(!e)continue;const{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,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}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<vo.length;e++){const i=vo[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s=t["on"+i];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=function(t,e,i){for(const s in e){const n=e[s],o=i[s];if(v(n))t.addValue(s,n);else if(v(o))t.addValue(s,Yt(n,{owner:t}));else if(o!==n)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(n):e.hasAnimated||e.set(n)}else{const e=t.getStaticValue(s);t.addValue(s,Yt(void 0!==e?e:n,{owner:t}))}}for(const s in i)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=Yt(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){var i;let s=void 0===this.latestValues[t]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,t))&&void 0!==i?i:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(_e(s)||se(s))?s=parseFloat(s):(n=s,!mo.find(Qe(n))&&Te.test(e)&&(s=Me(t,e))),this.setBaseTarget(t,v(s)?s.get():s)),v(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:i}=this.props;let s;if("string"==typeof i||"object"==typeof i){const n=V(this.props,i,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);n&&(s=n[t])}if(i&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||v(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new ht),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=ii}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;v(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}class yo extends go{constructor(){super(...arguments),this.type="html",this.renderInstance=M}readValueFromInstance(t,e){if(f.has(e))return((t,e)=>{const{transform:i="none"}=getComputedStyle(t);return Ie(i,e)})(t,e);{const s=(i=t,window.getComputedStyle(i)),n=(D(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof n?n.trim():n}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return Os(t,e)}build(t,e,i){C(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return R(t,e,i)}}class xo extends et{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:n}=t;j(To),n&&(e.group&&e.group.add(n),i&&i.register&&s&&i.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Rn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:s,drag:n,isPresent:o}=this.props,r=s.projection;return r?(r.isPresent=o,n||t.layoutDependency!==e||void 0===e||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||i.postRender(()=>{const t=r.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),P.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 Po(t){const[e,i]=function(t=!0){const e=Z(k);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:s,register:n}=e,o=J();Q(()=>{if(t)return n(o)},[t]);const r=tt(()=>t&&s&&s(o),[o,s,t]);return!i&&s?[!1,r]:[!0]}(),s=Z(L);return _(xo,{...t,layoutGroup:s,switchLayoutGroup:Z(B),isPresent:e,safeToRemove:i})}const To={borderRadius:{...ho,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ho,borderTopRightRadius:ho,borderBottomLeftRadius:ho,borderBottomRightRadius:ho,boxShadow:uo},So={pan:{Feature:class extends $t{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Ks(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Is(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:s,onPanEnd:n}=this.node.getProps();return{onSessionStart:sn(t),onStart:sn(e),onMove:s,onEnd:(t,e)=>{delete this.session,n&&i.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=fs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends $t{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new tn(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ao,MeasureLayout:Po}},wo={layout:{ProjectionNode:ao,MeasureLayout:Po}};function Ao(t,e,i){const s=t.getProps();return V(s,e,void 0!==i?i:s.custom,t)}function bo(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,Yt(i))}function Eo({protectedKeys:t,needsAnimating:e},i){const s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}function Vo(t,e,{delay:s=0,transitionOverride:n,type:o}={}){var r;let{transition:a=t.getDefaultTransition(),transitionEnd:l,...h}=e;n&&(a=n);const u=[],c=o&&t.animationState&&t.animationState.getState()[o];for(const e in h){const n=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),o=h[e];if(void 0===o||c&&Eo(c,e))continue;const l={delay:s,...ft(a||{},e)};let d=!1;if(window.MotionHandoffAnimation){const s=nn(t);if(s){const t=window.MotionHandoffAnimation(s,e,i);null!==t&&(l.startTime=t,d=!0)}}Us(t,e),n.start(ds(e,n,o,t.shouldReduceMotion&&ne.has(e)?{type:!1}:l,t,d));const p=n.animation;p&&u.push(p)}return l&&Promise.all(u).then(()=>{i.update(()=>{l&&function(t,e){const i=Ao(t,e);let{transitionEnd:s={},transition:n={},...o}=i||{};o={...o,...s};for(const e in o){bo(t,e,F(o[e]))}}(t,l)})}),u}function Mo(t,e,i={}){var s;const n=Ao(t,e,"exit"===i.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(o=i.transitionOverride);const r=n?()=>Promise.all(Vo(t,n,i)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:n=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,i=0,s=0,n=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===n?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Do).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(Mo(t,e,{...o,delay:i+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,n+s,r,a,i)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(i.delay)])}function Do(t,e){return t.sortNodePosition(e)}function Co(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let s=0;s<i;s++)if(e[s]!==t[s])return!1;return!0}const Ro=I.length;const ko=[...K].reverse(),Lo=K.length;function Bo(t){return e=>Promise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const n=e.map(e=>Mo(t,e,i));s=Promise.all(n)}else if("string"==typeof e)s=Mo(t,e,i);else{const n="function"==typeof e?Ao(t,e,i.custom):e;s=Promise.all(Vo(t,n,i))}return s.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function jo(t){let e=Bo(t),i=Io(),s=!0;const n=e=>(i,s)=>{var n;const o=Ao(t,s,"exit"===e?null===(n=t.presenceContext)||void 0===n?void 0:n.custom:void 0);if(o){const{transition:t,transitionEnd:e,...s}=o;i={...i,...s,...e}}return i};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}const i={};for(let t=0;t<Ro;t++){const s=I[t],n=e.props[s];(O(n)||!1===n)&&(i[s]=n)}return i}(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;e<Lo;e++){const d=ko[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=O(m),v=d===o?p.isActive:null;!1===v&&(c=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&s&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...u},!p.isActive&&null===v||!m&&!p.prevProp||U(m)||"boolean"==typeof m)continue;const y=Fo(p.prevProp,m);let x=y||d===o&&p.isActive&&!g&&f||e>c&&f,P=!1;const T=Array.isArray(m)?m:[m];let S=T.reduce(n(d),{});!1===v&&(S={});const{prevResolvedValues:w={}}=p,A={...w,...S},b=e=>{x=!0,h.has(e)&&(P=!0,h.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=S[t],i=w[t];if(u.hasOwnProperty(t))continue;let s=!1;s=N(e)&&N(i)?!Co(e,i):e!==i,s?null!=e?b(t):h.add(t):void 0!==e&&h.has(t)?b(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),s&&t.blockInitialAnimation&&(x=!1);const E=!(g&&y)||P;x&&E&&l.push(...T.map(t=>({animation:t,options:{type:d}})))}if(h.size){const e={};if("boolean"!=typeof r.initial){const i=Ao(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}h.forEach(i=>{const s=t.getBaseTarget(i),n=t.getValue(i);n&&(n.liveStyle=!0),e[i]=null!=s?s:null}),l.push({animation:e})}let d=Boolean(l.length);return!s||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,s){var n;if(i[e].isActive===s)return Promise.resolve();null===(n=t.variantChildren)||void 0===n||n.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,s)}),i[e].isActive=s;const r=o(e);for(const t in i)i[t].protectedKeys={};return r},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=Io(),s=!0}}}function Fo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Co(e,t)}function Oo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Io(){return{animate:Oo(!0),whileInView:Oo(),whileHover:Oo(),whileTap:Oo(),whileDrag:Oo(),whileFocus:Oo(),exit:Oo()}}let Uo=0;const No={animation:{Feature:class extends $t{constructor(t){super(t),t.animationState||(t.animationState=jo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();U(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends $t{constructor(){super(...arguments),this.id=Uo++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Ko(t,e,s){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===s);const o=n["onHover"+s];o&&i.postRender(()=>o(e,ms(e)))}function zo(t,e,s){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===s);const o=n["onTap"+("End"===s?"":s)];o&&i.postRender(()=>o(e,ms(e)))}const Wo=new WeakMap,Yo=new WeakMap,$o=t=>{const e=Wo.get(t.target);e&&e(t)},Xo=t=>{t.forEach($o)};function Go(t,e,i){const s=function({root:t,...e}){const i=t||document;Yo.has(i)||Yo.set(i,{});const s=Yo.get(i),n=JSON.stringify(e);return s[n]||(s[n]=new IntersectionObserver(Xo,{root:t,...e})),s[n]}(e);return Wo.set(t,i),s.observe(t),()=>{Wo.delete(t),s.unobserve(t)}}const Ho={some:0,all:1};const qo={inView:{Feature:class extends $t{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:s="some",once:n}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof s?s:Ho[s]};return Go(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,n&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),o=e?i:s;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends $t{mount(){const{current:t}=this.node;t&&(this.unmount=zt(t,(t,e)=>(zo(this.node,e,"Start"),(t,{success:e})=>zo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends $t{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=vi(ps(this.node.current,"focus",()=>this.onFocus()),ps(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends $t{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){const[s,n,o]=kt(t,i),r=t=>{if(!Lt(t))return;const{target:i}=t,s=e(i,t);if("function"!=typeof s||!i)return;const o=t=>{Lt(t)&&(s(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,n)};return s.forEach(t=>{t.addEventListener("pointerenter",r,n)}),o}(t,(t,e)=>(Ko(this.node,e,"Start"),t=>Ko(this.node,t,"End"))))}unmount(){}}}};class _o extends go{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ws,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&z(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(f.has(e)){const t=Ve(e);return t&&t.default||0}return e=W.has(e)?e:Y(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return $(t,e,i)}onBindTransform(){this.current&&!this.renderState.dimensions&&i.postRender(this.updateDimensions)}build(t,e,i){X(t,e,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,i,s){G(t,e,i,s)}mount(t){this.isSVGTag=H(t.tagName),super.mount(t)}}const Zo={...{renderer:(t,e)=>q(t)?new _o(e):new yo(e,{allowProjection:t!==it}),...No,...qo},...So,...wo};export{Zo as domMax};
|
package/dist/size-rollup-m.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as r,useMemo as o,useCallback as a,useLayoutEffect as i,useEffect as s,useRef as l,useInsertionEffect as c,forwardRef as u,Fragment as d,createElement as f}from"react";const p=n({}),m=n({strict:!1}),g=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),y=n({});function h(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function v(t){return"string"==typeof t||Array.isArray(t)}const w=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function b(t){return h(t.animate)||w.some(e=>v(t[e]))}function S(t){const{initial:e,animate:n}=function(t,e){if(b(t)){const{initial:e,animate:n}=t;return{initial:!1===e||v(e)?e:void 0,animate:v(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,r(y));return o(()=>({initial:e,animate:n}),[x(e),x(n)])}function x(t){return Array.isArray(t)?t.join(" "):t}const P="undefined"!=typeof window,k={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},M={};for(const t in k)M[t]={isEnabled:e=>k[t].some(t=>!!e[t])};const T=Symbol.for("motionComponentSymbol");function V(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function E(t,e,n){return a(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):V(n)&&(n.current=r))},[e])}const A=n(null),C=P?i:s,W=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),L="data-"+W("framerAppearId"),O=["read","resolveKeyframes","update","preRender","render","postRender"],R={value:null,addProjectionMetrics:null};function j(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=O.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,r=new Set,o=!1,a=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){i.has(e)&&(u.schedule(e),t()),l++,e(s)}const u={schedule:(t,e=!1,a=!1)=>{const s=a&&o?n:r;return e&&i.add(t),s.has(t)||s.add(t),t},cancel:t=>{r.delete(t),i.delete(t)},process:t=>{s=t,o?a=!0:(o=!0,[n,r]=[r,n],n.forEach(c),e&&R.value&&R.value.frameloop[e].push(l),l=0,n.clear(),o=!1,a&&(a=!1,u.process(t)))}};return u}(a,e?n:void 0),t),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,p=()=>{const a=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(p))};return{schedule:O.reduce((e,a)=>{const s=i[a];return e[a]=(e,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||t(p)),s.schedule(e,a,i)),e},{}),cancel:t=>{for(let e=0;e<O.length;e++)i[O[e]].cancel(t)},state:o,steps:i}}const{schedule:B,cancel:I}=j(queueMicrotask,!1),X=n({});function Y(t,e,n,o,a){var i,u;const{visualElement:d}=r(y),f=r(m),p=r(A),h=r(g).reducedMotion,v=l(null);o=o||f.renderer,!v.current&&o&&(v.current=o(t,{visualState:e,parent:d,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:h}));const w=v.current,b=r(X);!w||w.projection||!a||"html"!==w.type&&"svg"!==w.type||function(t,e,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||s&&V(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(v.current,n,a,b);const S=l(!1);c(()=>{w&&S.current&&w.update(n,p)});const x=n[L],P=l(Boolean(x)&&!(null===(i=window.MotionHandoffIsComplete)||void 0===i?void 0:i.call(window,x))&&(null===(u=window.MotionHasOptimisedAnimation)||void 0===u?void 0:u.call(window,x)));return C(()=>{w&&(S.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),B.render(w.render),P.current&&w.animationState&&w.animationState.animateChanges())}),s(()=>{w&&(!P.current&&w.animationState&&w.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),P.current=!1))}),w}function F({preloadedFeatures:n,createVisualElement:o,useRender:a,useVisualState:i,Component:s}){var l,c;function d(n,l){let c;const u={...r(g),...n,layoutId:$(n)},{isStatic:d}=u,f=S(n),p=i(n,d);if(!d&&P){r(m).strict;const t=function(t){const{drag:e,layout:n}=M;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);c=t.MeasureLayout,f.visualElement=Y(s,p,u,o,t.ProjectionNode)}return t(y.Provider,{value:f,children:[c&&f.visualElement?e(c,{visualElement:f.visualElement,...u}):null,a(s,n,E(p,f.visualElement,l),p,d,f.visualElement)]})}n&&function(t){for(const e in t)M[e]={...M[e],...t[e]}}(n),d.displayName="motion."+("string"==typeof s?s:`create(${null!==(c=null!==(l=s.displayName)&&void 0!==l?l:s.name)&&void 0!==c?c:""})`);const f=u(d);return f[T]=s,f}function $({layoutId:t}){const e=r(p).id;return e&&void 0!==t?e+"-"+t:t}const D=(t=>e=>"string"==typeof e&&e.startsWith(t))("--"),H={},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(Z);function q(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!H[t]||"opacity"===t)}const z=t=>Boolean(t&&t.getVelocity),N=(t,e)=>e&&"number"==typeof t?e.transform(t):t,K={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},_={...K,transform:t=>((t,e,n)=>n>e?e:n<t?t:n)(0,1,t)},G={...K,default:1},J=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Q=J("deg"),tt=J("%"),et=J("px"),nt={...tt,parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)},rt={borderWidth:et,borderTopWidth:et,borderRightWidth:et,borderBottomWidth:et,borderLeftWidth:et,borderRadius:et,radius:et,borderTopLeftRadius:et,borderTopRightRadius:et,borderBottomRightRadius:et,borderBottomLeftRadius:et,width:et,maxWidth:et,height:et,maxHeight:et,top:et,right:et,bottom:et,left:et,padding:et,paddingTop:et,paddingRight:et,paddingBottom:et,paddingLeft:et,margin:et,marginTop:et,marginRight:et,marginBottom:et,marginLeft:et,backgroundPositionX:et,backgroundPositionY:et},ot={rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:Q,skewX:Q,skewY:Q,distance:et,translateX:et,translateY:et,translateZ:et,x:et,y:et,z:et,perspective:et,transformPerspective:et,opacity:_,originX:nt,originY:nt,originZ:et},at={...K,transform:Math.round},it={...rt,...ot,zIndex:at,size:et,fillOpacity:_,strokeOpacity:_,numOctaves:at},st={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lt=Z.length;function ct(t,e,n){const{style:r,vars:o,transformOrigin:a}=t;let i=!1,s=!1;for(const t in e){const n=e[t];if(U.has(t))i=!0;else if(D(t))o[t]=n;else{const e=N(n,it[t]);t.startsWith("origin")?(s=!0,a[t]=e):r[t]=e}}if(e.transform||(i||n?r.transform=function(t,e,n){let r="",o=!0;for(let a=0;a<lt;a++){const i=Z[a],s=t[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||n){const t=N(s,it[i]);if(!l){o=!1;r+=`${st[i]||i}(${t}) `}n&&(e[i]=t)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}(e,t.transform,n):r.transform&&(r.transform="none")),s){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;r.transformOrigin=`${t} ${e} ${n}`}}const ut=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dt(t,e,n){for(const r in e)z(e[r])||q(r,n)||(t[r]=e[r])}function ft(t,e){const n={};return dt(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return o(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return ct(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function pt(t,e){const n={},r=ft(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const mt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function gt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||mt.has(t)}let yt=t=>!gt(t);try{(ht=require("@emotion/is-prop-valid").default)&&(yt=t=>t.startsWith("on")?!gt(t):ht(t))}catch(t){}var ht;const vt=["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 wt(t){return"string"==typeof t&&!t.includes("-")&&!!(vt.indexOf(t)>-1||/[A-Z]/u.test(t))}const bt={offset:"stroke-dashoffset",array:"stroke-dasharray"},St={offset:"strokeDashoffset",array:"strokeDasharray"};function xt(t,e,n){return"string"==typeof t?t:et.transform(e+n*t)}function Pt(t,{attrX:e,attrY:n,attrScale:r,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(ct(t,c,d),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:p,dimensions:m}=t;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==a||p.transform)&&(p.transformOrigin=function(t,e,n){return`${xt(e,t.x,t.width)} ${xt(n,t.y,t.height)}`}(m,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==e&&(f.x=e),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==i&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const a=o?bt:St;t[a.offset]=et.transform(-r);const i=et.transform(e),s=et.transform(n);t[a.array]=`${i} ${s}`}(f,i,s,l,!1)}const kt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Mt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Tt(t,e,n,r){const a=o(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Pt(n,e,Mt(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};dt(e,t.style,t),a.style={...e,...a.style}}return a}function Vt(t=!1){return(e,n,r,{latestValues:a},i)=>{const s=(wt(e)?Tt:pt)(n,a,i,e),l=function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(yt(o)||!0===n&>(o)||!e&&!gt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),c=e!==d?{...l,...s,ref:r}:{},{children:u}=n,p=o(()=>z(u)?u.get():u,[u]);return f(e,{...c,children:p})}}function Et(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function At(t,e,n,r){if("function"==typeof e){const[o,a]=Et(r);e=e(void 0!==n?n:t.custom,o,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,a]=Et(r);e=e(void 0!==n?n:t.custom,o,a)}return e}function Ct(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Wt=t=>(e,n)=>{const o=r(y),a=r(A),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,o,a){const i={latestValues:Lt(r,o,a,t),renderState:e()};return n&&(i.onMount=t=>n({props:r,current:t,...i}),i.onUpdate=t=>n(t)),i}(t,e,o,a);return n?i():function(t){const e=l(null);return null===e.current&&(e.current=t()),e.current}(i)};function Lt(t,e,n,r){const o={},a=r(t,{});for(const t in a)o[t]=Ct(a[t]);let{initial:i,animate:s}=t;const l=b(t),c=function(t){return Boolean(b(t)||t.variants)}(t);e&&c&&!l&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===s&&(s=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!h(d)){const e=Array.isArray(d)?d:[d];for(let n=0;n<e.length;n++){const r=At(t,e[n]);if(r){const{transitionEnd:t,transition:e,...n}=r;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const e in t)o[e]=t[e]}}}return o}function Ot(t,e,n){var r;const{style:o}=t,a={};for(const i in o)(z(o[i])||e.style&&z(e.style[i])||q(i,t)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(a[i]=o[i]);return a}const Rt={useVisualState:Wt({scrapeMotionValuesFromProps:Ot,createRenderState:ut})},{schedule:jt,cancel:Bt,state:It,steps:Xt}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0);const Yt=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 Ft(t,e,n,r){!function(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Yt.has(n)?n:W(n),e.attrs[n])}const $t=["x","y","width","height","cx","cy","r"],Dt={useVisualState:Wt({scrapeMotionValuesFromProps:function(t,e,n){const r=Ot(t,e,n);for(const n in t)if(z(t[n])||z(e[n])){r[-1!==Z.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return r},createRenderState:kt,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:o})=>{if(!n)return;let a=!!t.drag;if(!a)for(const t in o)if(U.has(t)){a=!0;break}if(!a)return;let i=!e;if(e)for(let n=0;n<$t.length;n++){const r=$t[n];t[r]!==e[r]&&(i=!0)}i&&jt.read(()=>{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(n,r),jt.render(()=>{Pt(r,o,Mt(n.tagName),t.transformTemplate),Ft(n,r)})})}})};function Ht(t,e){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return F({...wt(n)?Dt:Rt,preloadedFeatures:t,useRender:Vt(r),createVisualElement:e,Component:n})}}const Zt=Ht()("div");export{Zt as MotionDiv};
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as r,useMemo as o,useCallback as a,useLayoutEffect as i,useEffect as s,useRef as l,useInsertionEffect as c,forwardRef as u,Fragment as d,createElement as f}from"react";const p=n({}),m=n({strict:!1}),g=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),y=n({});function h(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function v(t){return"string"==typeof t||Array.isArray(t)}const w=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function b(t){return h(t.animate)||w.some(e=>v(t[e]))}function S(t){const{initial:e,animate:n}=function(t,e){if(b(t)){const{initial:e,animate:n}=t;return{initial:!1===e||v(e)?e:void 0,animate:v(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,r(y));return o(()=>({initial:e,animate:n}),[x(e),x(n)])}function x(t){return Array.isArray(t)?t.join(" "):t}const P="undefined"!=typeof window,k={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},M={};for(const t in k)M[t]={isEnabled:e=>k[t].some(t=>!!e[t])};const T=Symbol.for("motionComponentSymbol");function V(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function E(t,e,n){return a(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):V(n)&&(n.current=r))},[e])}const A=["read","resolveKeyframes","update","preRender","render","postRender"],C={value:null,addProjectionMetrics:null};function W(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=A.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,r=new Set,o=!1,a=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){i.has(e)&&(u.schedule(e),t()),l++,e(s)}const u={schedule:(t,e=!1,a=!1)=>{const s=a&&o?n:r;return e&&i.add(t),s.has(t)||s.add(t),t},cancel:t=>{r.delete(t),i.delete(t)},process:t=>{s=t,o?a=!0:(o=!0,[n,r]=[r,n],n.forEach(c),e&&C.value&&C.value.frameloop[e].push(l),l=0,n.clear(),o=!1,a&&(a=!1,u.process(t)))}};return u}(a,e?n:void 0),t),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,p=()=>{const a=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(p))};return{schedule:A.reduce((e,a)=>{const s=i[a];return e[a]=(e,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||t(p)),s.schedule(e,a,i)),e},{}),cancel:t=>{for(let e=0;e<A.length;e++)i[A[e]].cancel(t)},state:o,steps:i}}const{schedule:L,cancel:O,state:R,steps:j}=W("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0),{schedule:B,cancel:I}=W(queueMicrotask,!1),X=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Y="data-"+X("framerAppearId"),F=n(null),$=n({}),D=P?i:s;function H(t,e,n,o,a){var i,u;const{visualElement:d}=r(y),f=r(m),p=r(F),h=r(g).reducedMotion,v=l(null);o=o||f.renderer,!v.current&&o&&(v.current=o(t,{visualState:e,parent:d,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:h}));const w=v.current,b=r($);!w||w.projection||!a||"html"!==w.type&&"svg"!==w.type||function(t,e,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||s&&V(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(v.current,n,a,b);const S=l(!1);c(()=>{w&&S.current&&w.update(n,p)});const x=n[Y],P=l(Boolean(x)&&!(null===(i=window.MotionHandoffIsComplete)||void 0===i?void 0:i.call(window,x))&&(null===(u=window.MotionHasOptimisedAnimation)||void 0===u?void 0:u.call(window,x)));return D(()=>{w&&(S.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),B.render(w.render),P.current&&w.animationState&&w.animationState.animateChanges())}),s(()=>{w&&(!P.current&&w.animationState&&w.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),P.current=!1))}),w}function Z({preloadedFeatures:n,createVisualElement:o,useRender:a,useVisualState:i,Component:s}){var l,c;function d(n,l){let c;const u={...r(g),...n,layoutId:U(n)},{isStatic:d}=u,f=S(n),p=i(n,d);if(!d&&P){r(m).strict;const t=function(t){const{drag:e,layout:n}=M;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);c=t.MeasureLayout,f.visualElement=H(s,p,u,o,t.ProjectionNode)}return t(y.Provider,{value:f,children:[c&&f.visualElement?e(c,{visualElement:f.visualElement,...u}):null,a(s,n,E(p,f.visualElement,l),p,d,f.visualElement)]})}n&&function(t){for(const e in t)M[e]={...M[e],...t[e]}}(n),d.displayName="motion."+("string"==typeof s?s:`create(${null!==(c=null!==(l=s.displayName)&&void 0!==l?l:s.name)&&void 0!==c?c:""})`);const f=u(d);return f[T]=s,f}function U({layoutId:t}){const e=r(p).id;return e&&void 0!==t?e+"-"+t:t}const q=(t=>e=>"string"==typeof e&&e.startsWith(t))("--"),z={},N=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],K=new Set(N);function _(t,{layout:e,layoutId:n}){return K.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!z[t]||"opacity"===t)}const G=t=>Boolean(t&&t.getVelocity),J=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt={...Q,transform:t=>((t,e,n)=>n>e?e:n<t?t:n)(0,1,t)},et={...Q,default:1},nt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),rt=nt("deg"),ot=nt("%"),at=nt("px"),it={...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)},st={borderWidth:at,borderTopWidth:at,borderRightWidth:at,borderBottomWidth:at,borderLeftWidth:at,borderRadius:at,radius:at,borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomRightRadius:at,borderBottomLeftRadius:at,width:at,maxWidth:at,height:at,maxHeight:at,top:at,right:at,bottom:at,left:at,padding:at,paddingTop:at,paddingRight:at,paddingBottom:at,paddingLeft:at,margin:at,marginTop:at,marginRight:at,marginBottom:at,marginLeft:at,backgroundPositionX:at,backgroundPositionY:at},lt={rotate:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:rt,skewX:rt,skewY:rt,distance:at,translateX:at,translateY:at,translateZ:at,x:at,y:at,z:at,perspective:at,transformPerspective:at,opacity:tt,originX:it,originY:it,originZ:at},ct={...Q,transform:Math.round},ut={...st,...lt,zIndex:ct,size:at,fillOpacity:tt,strokeOpacity:tt,numOctaves:ct},dt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ft=N.length;function pt(t,e,n){const{style:r,vars:o,transformOrigin:a}=t;let i=!1,s=!1;for(const t in e){const n=e[t];if(K.has(t))i=!0;else if(q(t))o[t]=n;else{const e=J(n,ut[t]);t.startsWith("origin")?(s=!0,a[t]=e):r[t]=e}}if(e.transform||(i||n?r.transform=function(t,e,n){let r="",o=!0;for(let a=0;a<ft;a++){const i=N[a],s=t[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||n){const t=J(s,ut[i]);if(!l){o=!1;r+=`${dt[i]||i}(${t}) `}n&&(e[i]=t)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}(e,t.transform,n):r.transform&&(r.transform="none")),s){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;r.transformOrigin=`${t} ${e} ${n}`}}const mt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gt(t,e,n){for(const r in e)G(e[r])||_(r,n)||(t[r]=e[r])}function yt(t,e){const n={};return gt(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return o(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return pt(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function ht(t,e){const n={},r=yt(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const vt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function wt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||vt.has(t)}let bt=t=>!wt(t);try{(St=require("@emotion/is-prop-valid").default)&&(bt=t=>t.startsWith("on")?!wt(t):St(t))}catch(t){}var St;const xt=["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 Pt(t){return"string"==typeof t&&!t.includes("-")&&!!(xt.indexOf(t)>-1||/[A-Z]/u.test(t))}const kt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Mt={offset:"strokeDashoffset",array:"strokeDasharray"};function Tt(t,e,n){return"string"==typeof t?t:at.transform(e+n*t)}function Vt(t,{attrX:e,attrY:n,attrScale:r,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(pt(t,c,d),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:p,dimensions:m}=t;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==a||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Tt(e,t.x,t.width)} ${Tt(n,t.y,t.height)}`}(m,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==e&&(f.x=e),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==i&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const a=o?kt:Mt;t[a.offset]=at.transform(-r);const i=at.transform(e),s=at.transform(n);t[a.array]=`${i} ${s}`}(f,i,s,l,!1)}const Et=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),At=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ct(t,e,n,r){const a=o(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Vt(n,e,At(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};gt(e,t.style,t),a.style={...e,...a.style}}return a}function Wt(t=!1){return(e,n,r,{latestValues:a},i)=>{const s=(Pt(e)?Ct:ht)(n,a,i,e),l=function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(bt(o)||!0===n&&wt(o)||!e&&!wt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),c=e!==d?{...l,...s,ref:r}:{},{children:u}=n,p=o(()=>G(u)?u.get():u,[u]);return f(e,{...c,children:p})}}function Lt(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ot(t,e,n,r){if("function"==typeof e){const[o,a]=Lt(r);e=e(void 0!==n?n:t.custom,o,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,a]=Lt(r);e=e(void 0!==n?n:t.custom,o,a)}return e}function Rt(t){const e=G(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const jt=t=>(e,n)=>{const o=r(y),a=r(F),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,o,a){const i={latestValues:Bt(r,o,a,t),renderState:e()};return n&&(i.onMount=t=>n({props:r,current:t,...i}),i.onUpdate=t=>n(t)),i}(t,e,o,a);return n?i():function(t){const e=l(null);return null===e.current&&(e.current=t()),e.current}(i)};function Bt(t,e,n,r){const o={},a=r(t,{});for(const t in a)o[t]=Rt(a[t]);let{initial:i,animate:s}=t;const l=b(t),c=function(t){return Boolean(b(t)||t.variants)}(t);e&&c&&!l&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===s&&(s=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!h(d)){const e=Array.isArray(d)?d:[d];for(let n=0;n<e.length;n++){const r=Ot(t,e[n]);if(r){const{transitionEnd:t,transition:e,...n}=r;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const e in t)o[e]=t[e]}}}return o}function It(t,e,n){var r;const{style:o}=t,a={};for(const i in o)(G(o[i])||e.style&&G(e.style[i])||_(i,t)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(a[i]=o[i]);return a}const Xt={useVisualState:jt({scrapeMotionValuesFromProps:It,createRenderState:mt})};const Yt=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 Ft(t,e,n,r){!function(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(Yt.has(n)?n:X(n),e.attrs[n])}const $t=["x","y","width","height","cx","cy","r"],Dt={useVisualState:jt({scrapeMotionValuesFromProps:function(t,e,n){const r=It(t,e,n);for(const n in t)if(G(t[n])||G(e[n])){r[-1!==N.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return r},createRenderState:Et,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:o})=>{if(!n)return;let a=!!t.drag;if(!a)for(const t in o)if(K.has(t)){a=!0;break}if(!a)return;let i=!e;if(e)for(let n=0;n<$t.length;n++){const r=$t[n];t[r]!==e[r]&&(i=!0)}i&&L.read(()=>{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(n,r),L.render(()=>{Vt(r,o,At(n.tagName),t.transformTemplate),Ft(n,r)})})}})};function Ht(t,e){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Z({...Pt(n)?Dt:Xt,preloadedFeatures:t,useRender:Wt(r),createVisualElement:e,Component:n})}}const Zt=Ht()("div");export{Zt as MotionDiv};
|