size-rollup-motion.js 109 KB

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