size-rollup-dom-max.js 95 KB

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