@bmx-labs/chat-widget 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +11 -16
  2. package/dist/adapters/context/PineconeRAGAdapter.d.ts +58 -23
  3. package/dist/adapters/context/debug.d.ts +11 -0
  4. package/dist/adapters/context/fetchers.d.ts +40 -0
  5. package/dist/adapters/context/index.d.ts +0 -1
  6. package/dist/adapters/context/processing.d.ts +96 -0
  7. package/dist/adapters/index.d.ts +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/types.d.ts +57 -0
  11. package/package.json +10 -9
  12. package/dist/adapters/AnthropicAdapter.d.ts +0 -16
  13. package/dist/adapters/ContextAdapter.d.ts +0 -19
  14. package/dist/adapters/CustomAPIAdapter.d.ts +0 -20
  15. package/dist/adapters/KnowledgeBaseAdapter.d.ts +0 -20
  16. package/dist/adapters/MockAdapter.d.ts +0 -6
  17. package/dist/adapters/MorphexAdapter.d.ts +0 -16
  18. package/dist/adapters/OpenAIAdapter.d.ts +0 -17
  19. package/dist/adapters/RAGAdapter.d.ts +0 -29
  20. package/dist/adapters/RestRAGAdapter.d.ts +0 -9
  21. package/dist/adapters/TestAdapter.d.ts +0 -6
  22. package/dist/adapters/context/ContextAdapter.d.ts +0 -19
  23. package/dist/adapters/context/KnowledgeBaseAdapter.d.ts +0 -20
  24. package/dist/adapters/context/MorphexAdapter.d.ts +0 -16
  25. package/dist/adapters/context/RAGAdapter.d.ts +0 -29
  26. package/dist/adapters/rest.d.ts +0 -7
  27. package/dist/components/LazyComponents.d.ts +0 -3
  28. package/dist/components/Orb.d.ts +0 -8
  29. package/dist/components/OrbButton.d.ts +0 -10
  30. package/dist/components/SimpleIridescence.d.ts +0 -8
  31. package/dist/components/SimpleOrb.d.ts +0 -8
  32. package/dist/components/ogl/DarkVeil.d.ts +0 -11
  33. package/dist/framer.js +0 -1
  34. package/dist/index.js.map +0 -1
  35. package/dist/ogl.js +0 -1
  36. package/dist/styles.css.map +0 -1
  37. package/dist/styles.js.map +0 -1
  38. package/dist/vendors.js +0 -1
package/dist/framer.js DELETED
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=356;export const __webpack_esm_ids__=[356];export const __webpack_esm_modules__={763:(t,e,i)=>{i.d(e,{PY:()=>Qo});var n=i(178),s=i(649);const o=(0,s.createContext)({}),r=(0,s.createContext)(null),a=(0,s.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});s.Component;const l="undefined"!=typeof window,u=l?s.useLayoutEffect:s.useEffect;(0,s.createContext)(null);var h=i(58);const c=["read","resolveKeyframes","update","preRender","render","postRender"];function d(t,e){let i=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>i=!0,r=c.reduce((t,e)=>(t[e]=function(t){let e=new Set,i=new Set,n=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&n?e:i;return s&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),o.delete(t)},process:t=>{r=t,n?s=!0:(n=!0,[e,i]=[i,e],e.forEach(a),e.clear(),n=!1,s&&(s=!1,l.process(t)))}};return l}(o),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:d,postRender:p}=r,m=()=>{const o=performance.now();i=!1,s.delta=n?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),h.process(s),d.process(s),p.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(m))};return{schedule:c.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,n=!0,s.isProcessing||t(m)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<c.length;e++)r[c[e]].cancel(t)},state:s,steps:r}}const{schedule:p,cancel:m,state:f,steps:v}=d("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h.lQ,!0),g=(0,s.createContext)({strict:!1}),y={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},x={};for(const t in y)x[t]={isEnabled:e=>y[t].some(t=>!!e[t])};const P=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function w(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||P.has(t)}let T=t=>!w(t);try{(S=require("@emotion/is-prop-valid").default)&&(T=t=>t.startsWith("on")?!w(t):S(t))}catch(t){}var S;function b(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>t(...e),{get:(i,n)=>"create"===n?t:(e.has(n)||e.set(n,t(n)),e.get(n))})}new Set;const A=(0,s.createContext)({});function V(t){return"string"==typeof t||Array.isArray(t)}function C(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const M=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],D=["initial",...M];function E(t){return C(t.animate)||D.some(e=>V(t[e]))}function R(t){return Boolean(E(t)||t.variants)}function k(t){return Array.isArray(t)?t.join(" "):t}const j=Symbol.for("motionComponentSymbol");function B(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function F(t,e,i){return(0,s.useCallback)(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),i&&("function"==typeof i?i(n):B(i)&&(i.current=n))},[e])}const L=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),O="data-"+L("framerAppearId"),{schedule:I,cancel:U}=d(queueMicrotask,!1),$=(0,s.createContext)({});function W(t,e,i,n,o){var l,h;const{visualElement:c}=(0,s.useContext)(A),d=(0,s.useContext)(g),p=(0,s.useContext)(r),m=(0,s.useContext)(a).reducedMotion,f=(0,s.useRef)(null);n=n||d.renderer,!f.current&&n&&(f.current=n(t,{visualState:e,parent:c,props:i,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:m}));const v=f.current,y=(0,s.useContext)($);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,i,n){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:N(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&B(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}(f.current,i,o,y);const x=(0,s.useRef)(!1);(0,s.useInsertionEffect)(()=>{v&&x.current&&v.update(i,p)});const P=i[O],w=(0,s.useRef)(Boolean(P)&&!(null===(l=window.MotionHandoffIsComplete)||void 0===l?void 0:l.call(window,P))&&(null===(h=window.MotionHasOptimisedAnimation)||void 0===h?void 0:h.call(window,P)));return u(()=>{v&&(x.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),I.render(v.render),w.current&&v.animationState&&v.animationState.animateChanges())}),(0,s.useEffect)(()=>{v&&(!w.current&&v.animationState&&v.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,P)}),w.current=!1))}),v}function N(t){if(t)return!1!==t.options.allowProjection?t.projection:N(t.parent)}function X({preloadedFeatures:t,createVisualElement:e,useRender:i,useVisualState:o,Component:r}){var u,h;function c(t,u){let h;const c={...(0,s.useContext)(a),...t,layoutId:Y(t)},{isStatic:d}=c,p=function(t){const{initial:e,animate:i}=function(t,e){if(E(t)){const{initial:e,animate:i}=t;return{initial:!1===e||V(e)?e:void 0,animate:V(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,s.useContext)(A));return(0,s.useMemo)(()=>({initial:e,animate:i}),[k(e),k(i)])}(t),m=o(t,d);if(!d&&l){(0,s.useContext)(g).strict;const t=function(t){const{drag:e,layout:i}=x;if(!e&&!i)return{};const n={...e,...i};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==i?void 0:i.isEnabled(t))?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(c);h=t.MeasureLayout,p.visualElement=W(r,m,c,e,t.ProjectionNode)}return(0,n.jsxs)(A.Provider,{value:p,children:[h&&p.visualElement?(0,n.jsx)(h,{visualElement:p.visualElement,...c}):null,i(r,t,F(m,p.visualElement,u),m,d,p.visualElement)]})}t&&function(t){for(const e in t)x[e]={...x[e],...t[e]}}(t),c.displayName=`motion.${"string"==typeof r?r:`create(${null!==(h=null!==(u=r.displayName)&&void 0!==u?u:r.name)&&void 0!==h?h:""})`}`;const d=(0,s.forwardRef)(c);return d[j]=r,d}function Y({layoutId:t}){const e=(0,s.useContext)(o).id;return e&&void 0!==t?e+"-"+t:t}const K=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function z(t){return"string"==typeof t&&!t.includes("-")&&!!(K.indexOf(t)>-1||/[A-Z]/u.test(t))}function H(t){const e=[{},{}];return null==t||t.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function _(t,e,i,n){if("function"==typeof e){const[s,o]=H(n);e=e(void 0!==i?i:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=H(n);e=e(void 0!==i?i:t.custom,s,o)}return e}const q=t=>Array.isArray(t),G=t=>q(t)?t[t.length-1]||0:t,Z=t=>Boolean(t&&t.getVelocity);function Q(t){const e=Z(t)?t.get():t;return i=e,Boolean(i&&"object"==typeof i&&i.mix&&i.toValue)?e.toValue():e;var i}const J=t=>(e,i)=>{const n=(0,s.useContext)(A),o=(0,s.useContext)(r),a=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:i},n,s,o){const r={latestValues:tt(n,s,o,t),renderState:e()};return i&&(r.onMount=t=>i({props:n,current:t,...r}),r.onUpdate=t=>i(t)),r}(t,e,n,o);return i?a():function(t){const e=(0,s.useRef)(null);return null===e.current&&(e.current=t()),e.current}(a)};function tt(t,e,i,n){const s={},o=n(t,{});for(const t in o)s[t]=Q(o[t]);let{initial:r,animate:a}=t;const l=E(t),u=R(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!i&&!1===i.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!C(c)){const e=Array.isArray(c)?c:[c];for(let i=0;i<e.length;i++){const n=_(t,e[i]);if(n){const{transitionEnd:t,transition:e,...i}=n;for(const t in i){let e=i[t];Array.isArray(e)&&(e=e[h?e.length-1:0]),null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const et=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],it=new Set(et),nt=t=>e=>"string"==typeof e&&e.startsWith(t),st=nt("--"),ot=nt("var(--"),rt=t=>!!ot(t)&&at.test(t.split("/*")[0].trim()),at=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,lt=(t,e)=>e&&"number"==typeof t?e.transform(t):t,ut=(t,e,i)=>i>e?e:i<t?t:i,ht={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ct={...ht,transform:t=>ut(0,1,t)},dt={...ht,default:1},pt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),mt=pt("deg"),ft=pt("%"),vt=pt("px"),gt=pt("vh"),yt=pt("vw"),xt={...ft,parse:t=>ft.parse(t)/100,transform:t=>ft.transform(100*t)},Pt={borderWidth:vt,borderTopWidth:vt,borderRightWidth:vt,borderBottomWidth:vt,borderLeftWidth:vt,borderRadius:vt,radius:vt,borderTopLeftRadius:vt,borderTopRightRadius:vt,borderBottomRightRadius:vt,borderBottomLeftRadius:vt,width:vt,maxWidth:vt,height:vt,maxHeight:vt,top:vt,right:vt,bottom:vt,left:vt,padding:vt,paddingTop:vt,paddingRight:vt,paddingBottom:vt,paddingLeft:vt,margin:vt,marginTop:vt,marginRight:vt,marginBottom:vt,marginLeft:vt,backgroundPositionX:vt,backgroundPositionY:vt},wt={rotate:mt,rotateX:mt,rotateY:mt,rotateZ:mt,scale:dt,scaleX:dt,scaleY:dt,scaleZ:dt,skew:mt,skewX:mt,skewY:mt,distance:vt,translateX:vt,translateY:vt,translateZ:vt,x:vt,y:vt,z:vt,perspective:vt,transformPerspective:vt,opacity:ct,originX:xt,originY:xt,originZ:vt},Tt={...ht,transform:Math.round},St={...Pt,...wt,zIndex:Tt,size:vt,fillOpacity:ct,strokeOpacity:ct,numOctaves:Tt},bt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},At=et.length;function Vt(t,e,i){const{style:n,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const i=e[t];if(it.has(t))r=!0;else if(st(t))s[t]=i;else{const e=lt(i,St[t]);t.startsWith("origin")?(a=!0,o[t]=e):n[t]=e}}if(e.transform||(r||i?n.transform=function(t,e,i){let n="",s=!0;for(let o=0;o<At;o++){const r=et[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||i){const t=lt(a,St[r]);l||(s=!1,n+=`${bt[r]||r}(${t}) `),i&&(e[r]=t)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}(e,t.transform,i):n.transform&&(n.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:i=0}=o;n.transformOrigin=`${t} ${e} ${i}`}}const Ct={offset:"stroke-dashoffset",array:"stroke-dasharray"},Mt={offset:"strokeDashoffset",array:"strokeDasharray"};function Dt(t,e,i){return"string"==typeof t?t:vt.transform(e+i*t)}function Et(t,{attrX:e,attrY:i,attrScale:n,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},h,c){if(Vt(t,u,c),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,i){return`${Dt(e,t.x,t.width)} ${Dt(i,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==i&&(d.y=i),void 0!==n&&(d.scale=n),void 0!==r&&function(t,e,i=1,n=0,s=!0){t.pathLength=1;const o=s?Ct:Mt;t[o.offset]=vt.transform(-n);const r=vt.transform(e),a=vt.transform(i);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}const Rt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function kt(t,{style:e,vars:i},n,s){Object.assign(t.style,e,s&&s.getProjectionStyles(n));for(const e in i)t.style.setProperty(e,i[e])}const jt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Bt(t,e,i,n){kt(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(jt.has(i)?i:L(i),e.attrs[i])}const Ft={};function Lt(t,{layout:e,layoutId:i}){return it.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!Ft[t]||"opacity"===t)}function Ot(t,e,i){var n;const{style:s}=t,o={};for(const r in s)(Z(s[r])||e.style&&Z(e.style[r])||Lt(r,t)||void 0!==(null===(n=null==i?void 0:i.getValue(r))||void 0===n?void 0:n.liveStyle))&&(o[r]=s[r]);return o}function It(t,e,i){const n=Ot(t,e,i);for(const i in t)(Z(t[i])||Z(e[i]))&&(n[-1!==et.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return n}const Ut=["x","y","width","height","cx","cy","r"],$t={useVisualState:J({scrapeMotionValuesFromProps:It,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:t,prevProps:e,current:i,renderState:n,latestValues:s})=>{if(!i)return;let o=!!t.drag;if(!o)for(const t in s)if(it.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let i=0;i<Ut.length;i++){const n=Ut[i];t[n]!==e[n]&&(r=!0)}r&&p.read(()=>{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(i,n),p.render(()=>{Et(n,s,Rt(i.tagName),t.transformTemplate),Bt(i,n)})})}})},Wt={useVisualState:J({scrapeMotionValuesFromProps:Ot,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function Nt(t,e,i){for(const n in e)Z(e[n])||Lt(n,i)||(t[n]=e[n])}function Xt(t,e){const i={},n=function(t,e){const i={};return Nt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},e){return(0,s.useMemo)(()=>{const i={style:{},transform:{},transformOrigin:{},vars:{}};return Vt(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),i}(t,e);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=n,i}function Yt(t,e,i,n){const o=(0,s.useMemo)(()=>{const i={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Et(i,e,Rt(n),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const e={};Nt(e,t.style,t),o.style={...e,...o.style}}return o}function Kt(t=!1){return(e,i,n,{latestValues:o},r)=>{const a=(z(e)?Yt:Xt)(i,o,r,e),l=function(t,e,i){const n={};for(const s in t)"values"===s&&"object"==typeof t.values||(T(s)||!0===i&&w(s)||!e&&!w(s)||t.draggable&&s.startsWith("onDrag"))&&(n[s]=t[s]);return n}(i,"string"==typeof e,t),u=e!==s.Fragment?{...l,...a,ref:n}:{},{children:h}=i,c=(0,s.useMemo)(()=>Z(h)?h.get():h,[h]);return(0,s.createElement)(e,{...u,children:c})}}function zt(t,e){return function(i,{forwardMotionProps:n}={forwardMotionProps:!1}){return X({...z(i)?$t:Wt,preloadedFeatures:t,useRender:Kt(n),createVisualElement:e,Component:i})}}function Ht(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function _t(t,e,i){const n=t.getProps();return _(n,e,void 0!==i?i:n.custom,t)}var qt=i(760);const Gt=new Set(["width","height","top","left","right","bottom",...et]);let Zt;function Qt(){Zt=void 0}const Jt={now:()=>(void 0===Zt&&Jt.set(f.isProcessing?f.timestamp:performance.now()),Zt),set:t=>{Zt=t,queueMicrotask(Qt)}};function te(t,e){-1===t.indexOf(e)&&t.push(e)}function ee(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}class ie{constructor(){this.subscriptions=[]}add(t){return te(this.subscriptions,t),()=>ee(this.subscriptions,t)}notify(t,e,i){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s<n;s++){const n=this.subscriptions[s];n&&n(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ne(t,e){return e?t*(1e3/e):0}const se={current:void 0};class oe{constructor(t,e={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const i=Jt.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Jt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ie);const i=this.events[t].add(e);return"change"===t?()=>{i(),p.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return se.current&&se.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Jt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ne(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 re(t,e){return new oe(t,e)}function ae(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,re(i))}function le(t,e){const i=t.getValue("willChange");if(n=i,Boolean(Z(n)&&n.add))return i.add(e);var n}function ue(t){return t.props[O]}const he=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function ce(t,e,i,n){if(t===e&&i===n)return h.lQ;return s=>0===s||1===s?s:he(function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=he(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(s,0,1,t,i),e,n)}const de=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pe=t=>e=>1-t(1-e),me=ce(.33,1.53,.69,.99),fe=pe(me),ve=de(fe),ge=t=>(t*=2)<1?.5*fe(t):.5*(2-Math.pow(2,-10*(t-1))),ye=t=>1-Math.sin(Math.acos(t)),xe=pe(ye),Pe=de(ye),we=t=>/^0[^.\s]+$/u.test(t);function Te(t){return"number"==typeof t?0===t:null===t||"none"===t||"0"===t||we(t)}const Se=t=>Math.round(1e5*t)/1e5,be=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Ae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ve=(t,e)=>i=>Boolean("string"==typeof i&&Ae.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),Ce=(t,e,i)=>n=>{if("string"!=typeof n)return n;const[s,o,r,a]=n.match(be);return{[t]:parseFloat(s),[e]:parseFloat(o),[i]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Me={...ht,transform:t=>Math.round((t=>ut(0,255,t))(t))},De={test:Ve("rgb","red"),parse:Ce("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+Me.transform(t)+", "+Me.transform(e)+", "+Me.transform(i)+", "+Se(ct.transform(n))+")"},Ee={test:Ve("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:De.transform},Re={test:Ve("hsl","hue"),parse:Ce("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+ft.transform(Se(e))+", "+ft.transform(Se(i))+", "+Se(ct.transform(n))+")"},ke={test:t=>De.test(t)||Ee.test(t)||Re.test(t),parse:t=>De.test(t)?De.parse(t):Re.test(t)?Re.parse(t):Ee.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?De.transform(t):Re.transform(t)},je=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Be="number",Fe="color",Le=/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 Oe(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Le,t=>(ke.test(t)?(n.color.push(o),s.push(Fe),i.push(ke.parse(t))):t.startsWith("var(")?(n.var.push(o),s.push("var"),i.push(t)):(n.number.push(o),s.push(Be),i.push(parseFloat(t))),++o,"${}")).split("${}");return{values:i,split:r,indexes:n,types:s}}function Ie(t){return Oe(t).values}function Ue(t){const{split:e,types:i}=Oe(t),n=e.length;return t=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],void 0!==t[o]){const e=i[o];s+=e===Be?Se(t[o]):e===Fe?ke.transform(t[o]):t[o]}return s}}const $e=t=>"number"==typeof t?0:t,We={test:function(t){var e,i;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(be))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(je))||void 0===i?void 0:i.length)||0)>0},parse:Ie,createTransformer:Ue,getAnimatableNone:function(t){const e=Ie(t);return Ue(t)(e.map($e))}},Ne=new Set(["brightness","contrast","saturate","opacity"]);function Xe(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=i.match(be)||[];if(!n)return t;const s=i.replace(n,"");let o=Ne.has(e)?1:0;return n!==i&&(o*=100),e+"("+o+s+")"}const Ye=/\b([a-z-]*)\(.*?\)/gu,Ke={...We,getAnimatableNone:t=>{const e=t.match(Ye);return e?e.map(Xe).join(" "):t}},ze={...St,color:ke,backgroundColor:ke,outlineColor:ke,fill:ke,stroke:ke,borderColor:ke,borderTopColor:ke,borderRightColor:ke,borderBottomColor:ke,borderLeftColor:ke,filter:Ke,WebkitFilter:Ke},He=t=>ze[t];function _e(t,e){let i=He(t);return i!==Ke&&(i=We),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const qe=new Set(["auto","none","0"]),Ge=t=>t===ht||t===vt,Ze=(t,e)=>parseFloat(t.split(", ")[e]),Qe=(t,e)=>(i,{transform:n})=>{if("none"===n||!n)return 0;const s=n.match(/^matrix3d\((.+)\)$/u);if(s)return Ze(s[1],e);{const e=n.match(/^matrix\((.+)\)$/u);return e?Ze(e[1],t):0}},Je=new Set(["x","y","z"]),ti=et.filter(t=>!Je.has(t)),ei={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Qe(4,13),y:Qe(5,14)};ei.translateX=ei.x,ei.translateY=ei.y;const ii=new Set;let ni=!1,si=!1;function oi(){if(si){const t=Array.from(ii).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return ti.forEach(i=>{const n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{var n;null===(n=t.getValue(e))||void 0===n||n.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}si=!1,ni=!1,ii.forEach(t=>t.complete()),ii.clear()}function ri(){ii.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(si=!0)})}class ai{constructor(t,e,i,n,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ii.add(this),ni||(ni=!0,p.read(ri),p.resolveKeyframes(oi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==n?void 0:n.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){const n=i.readValue(e,o);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=o),n&&void 0===s&&n.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ii.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ii.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const li=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ui=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hi(t,e,i=1){(0,h.V1)(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[n,s]=function(t){const e=ui.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${null!=i?i:n}`,s]}(t);if(!n)return;const o=window.getComputedStyle(e).getPropertyValue(n);if(o){const t=o.trim();return li(t)?parseFloat(t):t}return rt(s)?hi(s,e,i+1):s}const ci=t=>e=>e.test(t),di=[ht,vt,ft,mt,yt,gt,{test:t=>"auto"===t,parse:t=>t}],pi=t=>di.find(ci(t));class mi extends ai{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let n=t[i];if("string"==typeof n&&(n=n.trim(),rt(n))){const s=hi(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Gt.has(i)||2!==t.length)return;const[n,s]=t,o=pi(n),r=pi(s);if(o!==r)if(Ge(o)&&Ge(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)Te(t[e])&&i.push(e);i.length&&function(t,e,i){let n,s=0;for(;s<t.length&&!n;){const e=t[s];"string"==typeof e&&!qe.has(e)&&Oe(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=_e(i,n)}(t,i,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ei[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const n=e[e.length-1];void 0!==n&&t.getValue(i,n).jump(n,!1)}measureEndState(){var t;const{element:e,name:i,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const s=e.getValue(i);s&&s.jump(this.measuredOrigin,!1);const o=n.length-1,r=n[o];n[o]=ei[i](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,i])=>{e.getValue(t).set(i)}),this.resolveNoneKeyframes()}}const fi=(t,e)=>!("zIndex"===e||"number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!We.test(t)&&"0"!==t||t.startsWith("url("))),vi=t=>null!==t;function gi(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(vi),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}class yi{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Jt.now(),this.options={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(ri(),oi()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Jt.now(),this.hasAttemptedResolve=!0;const{name:i,type:n,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=fi(s,e),a=fi(o,e);return(0,h.$e)(r===a,`You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||(0,qt.WH)(i))&&n)}(t,i,n,s)){if(!o)return a&&a(gi(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const xi=(t,e,i)=>t+(e-t)*i;function Pi(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function wi(t,e){return i=>i>0?e:t}const Ti=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Si=[Ee,De,Re];function bi(t){const e=(i=t,Si.find(t=>t.test(i)));var i;if((0,h.$e)(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let n=e.parse(t);return e===Re&&(n=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=Pi(a,n,t+1/3),o=Pi(a,n,t),r=Pi(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}(n)),n}const Ai=(t,e)=>{const i=bi(t),n=bi(e);if(!i||!n)return wi(t,e);const s={...i};return t=>(s.red=Ti(i.red,n.red,t),s.green=Ti(i.green,n.green,t),s.blue=Ti(i.blue,n.blue,t),s.alpha=xi(i.alpha,n.alpha,t),De.transform(s))},Vi=(t,e)=>i=>e(t(i)),Ci=(...t)=>t.reduce(Vi),Mi=new Set(["none","hidden"]);function Di(t,e){return i=>xi(t,e,i)}function Ei(t){return"number"==typeof t?Di:"string"==typeof t?rt(t)?wi:ke.test(t)?Ai:ji:Array.isArray(t)?Ri:"object"==typeof t?ke.test(t)?Ai:ki:wi}function Ri(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>Ei(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function ki(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=Ei(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const ji=(t,e)=>{const i=We.createTransformer(e),n=Oe(t),s=Oe(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?Mi.has(t)&&!s.values.length||Mi.has(e)&&!n.values.length?function(t,e){return Mi.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):Ci(Ri(function(t,e){var i;const n=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(i=t.values[a])&&void 0!==i?i:0;n[o]=l,s[r]++}return n}(n,s),s.values),i):((0,h.$e)(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),wi(t,e))};function Bi(t,e,i){return"number"==typeof t&&"number"==typeof e&&"number"==typeof i?xi(t,e,i):Ei(t)(t,e)}function Fi(t,e,i){const n=Math.max(e-5,0);return ne(i-t(n),e-n)}const Li=.01,Oi=2,Ii=.005,Ui=.5;const $i=12;function Wi(t,e){return t*Math.sqrt(1-e*e)}const Ni=["duration","bounce"],Xi=["stiffness","damping","mass"];function Yi(t,e){return e.some(e=>void 0!==t[e])}function Ki(t=.3,e=.3){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Yi(t,Xi)&&Yi(t,Ni))if(t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*ut(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:1,stiffness:s,damping:o}}else{const i=function({duration:t=800,bounce:e=.3,velocity:i=0,mass:n=1}){let s,o;(0,h.$e)(t<=(0,h.fD)(10),"Spring duration must be 10 seconds or less");let r=1-e;r=ut(.05,1,r),t=ut(.01,10,(0,h.Xu)(t)),r<1?(s=e=>{const n=e*r,s=n*t;return.001-(n-i)/Wi(e,r)*Math.exp(-s)},o=e=>{const n=e*r*t,o=n*i+i,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-n),u=Wi(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const a=function(t,e,i){let n=i;for(let i=1;i<$i;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=(0,h.fD)(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}(t);e={...e,...i,mass:1},e.isResolvedFromDuration=!0}return e}({...i,velocity:-(0,h.Xu)(i.velocity||0)}),f=p||0,v=u/(2*Math.sqrt(l*c)),g=r-o,y=(0,h.Xu)(Math.sqrt(l/c)),x=Math.abs(g)<5;let P;if(n||(n=x?Li:Oi),s||(s=x?Ii:Ui),v<1){const t=Wi(y,v);P=e=>{const i=Math.exp(-v*y*e);return r-i*((f+v*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===v)P=t=>r-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(v*v-1);P=e=>{const i=Math.exp(-v*y*e),n=Math.min(t*e,300);return r-i*((f+v*y*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const w={calculatedDuration:m&&d||null,next:t=>{const e=P(t);if(m)a.done=t>=d;else{let i=0;v<1&&(i=0===t?(0,h.fD)(f):Fi(P,t,e));const o=Math.abs(i)<=n,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min((0,qt.tu)(w),qt.YE),e=(0,qt.KZ)(e=>w.next(t*e).value,t,30);return t+"ms "+e}};return w}function zi({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/n),y=t=>v+g(t),x=t=>{const e=g(t),i=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:i};let P,w;const T=t=>{var e;e=d.value,(void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,w=Ki({keyframes:[d.value,p(d.value)],velocity:Fi(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==P||(e=!0,x(t),T(t)),void 0!==P&&t>=P?w.next(t-P):(!e&&x(t),d)}}}const Hi=ce(.42,0,1,1),_i=ce(0,0,.58,1),qi=ce(.42,0,.58,1),Gi={linear:h.lQ,easeIn:Hi,easeInOut:qi,easeOut:_i,circIn:ye,circInOut:Pe,circOut:xe,backIn:fe,backInOut:ve,backOut:me,anticipate:ge},Zi=t=>{if((0,qt.DW)(t)){(0,h.V1)(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,i,n,s]=t;return ce(e,i,n,s)}return"string"==typeof t?((0,h.V1)(void 0!==Gi[t],`Invalid easing type '${t}'`),Gi[t]):t};function Qi(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const s=(0,h.qB)(0,e,n);t.push(xi(i,1,s))}}(e,t.length-1),e}function Ji({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Zi):Zi(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Qi(e),t),a=function(t,e,{clamp:i=!0,ease:n,mixer:s}={}){const o=t.length;if((0,h.V1)(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,i){const n=[],s=i||Bi,o=t.length-1;for(let i=0;i<o;i++){let o=s(t[i],t[i+1]);if(e){const t=Array.isArray(e)?e[i]||h.lQ:e;o=Ci(t,o)}n.push(o)}return n}(e,n,s),l=a.length,u=i=>{if(r&&i<t[0])return e[0];let n=0;if(l>1)for(;n<t.length-2&&!(i<t[n+1]);n++);const s=(0,h.qB)(t[n],t[n+1],i);return a[n](s)};return i?e=>u(ut(t[0],t[o-1],e)):u}(r,e,{ease:Array.isArray(s)?s:(l=e,u=s,l.map(()=>u||qi).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const tn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>p.update(e,!0),stop:()=>m(e),now:()=>f.isProcessing?f.timestamp:Jt.now()}},en={decay:zi,inertia:zi,tween:Ji,keyframes:Ji,spring:Ki},nn=t=>t/100;class sn extends yi{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:i,element:n,keyframes:s}=this.options,o=(null==n?void 0:n.KeyframeResolver)||ai;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,i,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=this.options,r=(0,qt.WH)(e)?e:en[e]||Ji;let a,l;r!==Ji&&"number"!=typeof t[0]&&(a=Ci(nn,Bi(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=(0,qt.tu)(u));const{calculatedDuration:h}=u,c=h+n;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(i+1)-n}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:i}=this;if(!i){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:n,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=i;if(null===this.startTime)return s.next(0);const{delay:c,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,d+1),Boolean(e%2)&&("reverse"===p?(i=1-i,m&&(i-=m/h)):"mirror"===p&&(x=o)),y=ut(0,1,i)*h}const P=g?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:w}=P;g||null===l||(w=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&void 0!==n&&(P.value=gi(a,this.options,n)),f&&f(P.value),T&&this.finish(),P}get duration(){const{resolved:t}=this;return t?(0,h.Xu)(t.calculatedDuration):0}get time(){return(0,h.Xu)(this.currentTime)}set time(t){t=(0,h.fD)(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=(0,h.Xu)(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=tn,onPlay:e,startTime:i}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const on=new Set(["opacity","clipPath","filter","transform"]);const rn=(0,h.ph)(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),an={anticipate:ge,backInOut:ve,circInOut:Pe};class ln extends yi{constructor(t){super(t);const{name:e,motionValue:i,element:n,keyframes:s}=this.options;this.resolver=new mi(s,(t,e)=>this.onKeyframesResolved(t,e),e,i,n),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:i=300,times:n,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&(0,qt.nL)()&&s in an&&(s=an[s]),u=this.options,(0,qt.WH)(u.type)||"spring"===u.type||!(0,qt.yL)(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,h=function(t,e){const i=new sn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const s=[];let o=0;for(;!n.done&&o<2e4;)n=i.sample(o),s.push(n.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),i=h.duration,n=h.times,s=h.ease,o="keyframes"}const h=function(t,e,i,{delay:n=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:i};l&&(u.offset=l);const h=(0,qt.TU)(a,s);return Array.isArray(h)&&(u.easing=h),t.animate(u,{delay:n,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(r.owner.current,a,t,{...this.options,duration:i,times:n,ease:s});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?((0,qt.vG)(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:i}=this.options;r.set(gi(t,this.options,e)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:n,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return(0,h.Xu)(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return(0,h.Xu)(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.currentTime=(0,h.fD)(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return h.lQ;const{animation:i}=e;(0,qt.vG)(i,t)}else this.pendingTimeline=t;return h.lQ}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:i,duration:n,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new sn({...u,keyframes:i,duration:n,type:s,ease:o,times:r,isGenerator:!0}),d=(0,h.fD)(this.time);t.setWithVelocity(c.sample(d-10).value,c.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return rn()&&i&&on.has(i)&&!a&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}}const un={type:"spring",stiffness:500,damping:25,restSpeed:10},hn={type:"keyframes",duration:.8},cn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dn=(t,{keyframes:e})=>e.length>2?hn:it.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:un:cn,pn=(t,e,i,n={},s,o)=>r=>{const a=(0,qt.rU)(n,t)||{},l=a.delay||n.delay||0;let{elapsed:u=0}=n;u-=(0,h.fD)(l);let c={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(a)||(c={...c,...dn(t,c)}),c.duration&&(c.duration=(0,h.fD)(c.duration)),c.repeatDelay&&(c.repeatDelay=(0,h.fD)(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)),d&&!o&&void 0!==e.get()){const t=gi(c.keyframes,a);if(void 0!==t)return p.update(()=>{c.onUpdate(t),c.onComplete()}),new qt.P6([])}return!o&&ln.supports(c)?new ln(c):new sn(c)};function mn({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function fn(t,e,{delay:i=0,transitionOverride:n,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;n&&(r=n);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const n=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||h&&mn(h,e))continue;const a={delay:i,...(0,qt.rU)(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const i=ue(t);if(i){const t=window.MotionHandoffAnimation(i,e,p);null!==t&&(a.startTime=t,c=!0)}}le(t,e),n.start(pn(e,n,s,t.shouldReduceMotion&&Gt.has(e)?{type:!1}:a,t,c));const d=n.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{p.update(()=>{a&&function(t,e){const i=_t(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)ae(t,e,G(o[e]))}(t,a)})}),u}function vn(t,e,i={}){var n;const s=_t(t,e,"exit"===i.type?null===(n=t.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(o=i.transitionOverride);const r=s?()=>Promise.all(fn(t,s,i)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,i=0,n=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*n,l=1===s?(t=0)=>t*n:(t=0)=>a-t*n;return Array.from(t.variantChildren).sort(gn).forEach((t,n)=>{t.notify("AnimationStart",e),r.push(vn(t,e,{...o,delay:i+l(n)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+n,r,a,i)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(i.delay)])}function gn(t,e){return t.sortNodePosition(e)}const yn=D.length;function xn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&xn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<yn;i++){const n=D[i],s=t.props[n];(V(s)||!1===s)&&(e[n]=s)}return e}const Pn=[...M].reverse(),wn=M.length;function Tn(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>vn(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=vn(t,e,i);else{const s="function"==typeof e?_t(t,e,i.custom):e;n=Promise.all(fn(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}(t),i=An(),n=!0;const s=e=>(i,n)=>{var s;const o=_t(t,n,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...n}=o;i={...i,...n,...e}}return i};function o(o){const{props:r}=t,a=xn(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<wn;e++){const d=Pn[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=V(m),v=d===o?p.isActive:null;!1===v&&(c=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&n&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...h},!p.isActive&&null===v||!m&&!p.prevProp||C(m)||"boolean"==typeof m)continue;const y=Sn(p.prevProp,m);let x=y||d===o&&p.isActive&&!g&&f||e>c&&f,P=!1;const w=Array.isArray(m)?m:[m];let T=w.reduce(s(d),{});!1===v&&(T={});const{prevResolvedValues:S={}}=p,b={...S,...T},A=e=>{x=!0,u.has(e)&&(P=!0,u.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in b){const e=T[t],i=S[t];if(h.hasOwnProperty(t))continue;let n=!1;n=q(e)&&q(i)?!Ht(e,i):e!==i,n?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=T,p.isActive&&(h={...h,...T}),n&&t.blockInitialAnimation&&(x=!1),x&&(!g||!y||P)&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=null!=n?n:null}),l.push({animation:e})}let d=Boolean(l.length);return!n||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),n=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){var s;if(i[e].isActive===n)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,n)}),i[e].isActive=n;const r=o(e);for(const t in i)i[t].protectedKeys={};return r},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=An(),n=!0}}}function Sn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ht(e,t)}function bn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function An(){return{animate:bn(!0),whileInView:bn(),whileHover:bn(),whileTap:bn(),whileDrag:bn(),whileFocus:bn(),exit:bn()}}class Vn{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Cn=0;const Mn={animation:{Feature:class extends Vn{constructor(t){super(t),t.animationState||(t.animationState=Tn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();C(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Vn{constructor(){super(...arguments),this.id=Cn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function Dn(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}function En(t){return{point:{x:t.pageX,y:t.pageY}}}function Rn(t,e,i,n){return Dn(t,e,(t=>e=>(0,qt.Mc)(e)&&t(e,En(e)))(i),n)}const kn=(t,e)=>Math.abs(t-e);class jn{constructor(t,e,{transformPagePoint:i,contextWindow:n,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Ln(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=kn(t.x,e.x),n=kn(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=f;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Bn(e,this.transformPagePoint),p.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Ln("pointercancel"===t.type?this.lastMoveEventInfo:Bn(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!(0,qt.Mc)(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.contextWindow=n||window;const o=Bn(En(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=f;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Ln(o,this.history)),this.removeListeners=Ci(Rn(this.contextWindow,"pointermove",this.handlePointerMove),Rn(this.contextWindow,"pointerup",this.handlePointerUp),Rn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),m(this.updatePoint)}}function Bn(t,e){return e?{point:e(t.point)}:t}function Fn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ln({point:t},e){return{point:t,delta:Fn(t,In(e)),offset:Fn(t,On(e)),velocity:Un(e,.1)}}function On(t){return t[0]}function In(t){return t[t.length-1]}function Un(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=In(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>(0,h.fD)(e)));)i--;if(!n)return{x:0,y:0};const o=(0,h.Xu)(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function $n(t){return t.max-t.min}function Wn(t,e,i,n=.5){t.origin=n,t.originPoint=xi(e.min,e.max,t.origin),t.scale=$n(i)/$n(e),t.translate=xi(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Nn(t,e,i,n){Wn(t.x,e.x,i.x,n?n.originX:void 0),Wn(t.y,e.y,i.y,n?n.originY:void 0)}function Xn(t,e,i){t.min=i.min+e.min,t.max=t.min+$n(e)}function Yn(t,e,i){t.min=e.min-i.min,t.max=t.min+$n(e)}function Kn(t,e,i){Yn(t.x,e.x,i.x),Yn(t.y,e.y,i.y)}function zn(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Hn(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}const _n=.35;function qn(t,e,i){return{min:Gn(t,e),max:Gn(t,i)}}function Gn(t,e){return"number"==typeof t?t:t[e]||0}const Zn=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Qn(t){return[t("x"),t("y")]}function Jn({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function ts(t){return void 0===t||1===t}function es({scale:t,scaleX:e,scaleY:i}){return!ts(t)||!ts(e)||!ts(i)}function is(t){return es(t)||ns(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ns(t){return ss(t.x)||ss(t.y)}function ss(t){return t&&"0%"!==t}function os(t,e,i){return i+e*(t-i)}function rs(t,e,i,n,s){return void 0!==s&&(t=os(t,s,n)),os(t,i,n)+e}function as(t,e=0,i=1,n,s){t.min=rs(t.min,e,i,n,s),t.max=rs(t.max,e,i,n,s)}function ls(t,{x:e,y:i}){as(t.x,e.translate,e.scale,e.originPoint),as(t.y,i.translate,i.scale,i.originPoint)}const us=.999999999999,hs=1.0000000000001;function cs(t,e){t.min=t.min+e,t.max=t.max+e}function ds(t,e,i,n,s=.5){as(t,e,i,xi(t.min,t.max,s),n)}function ps(t,e){ds(t.x,e.x,e.scaleX,e.scale,e.originX),ds(t.y,e.y,e.scaleY,e.scale,e.originY)}function ms(t,e){return Jn(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}const fs=({current:t})=>t?t.ownerDocument.defaultView:null,vs=new WeakMap;class gs{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new jn(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(En(t).point)},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=(0,qt.Wp)(i),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ft.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];n&&(e=$n(n)*(parseFloat(e)/100))}}this.originPoint[t]=e}),s&&p.postRender(()=>s(t,e)),le(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Qn(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:fs(this.visualElement)})}stop(t,e){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:n}=e;this.startAnimation(n);const{onDragEnd:s}=this.getProps();s&&p.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){const{drag:n}=this.getProps();if(!i||!ys(t,n,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:i},n){return void 0!==e&&t<e?t=n?xi(e,t,n.min):Math.max(t,e):void 0!==i&&t>i&&(t=n?xi(i,t,n.max):Math.min(t,i)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&B(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:zn(t.x,i,s),y:zn(t.y,e,n)}}(n.layoutBox,e),this.elastic=function(t=_n){return!1===t?t=0:!0===t&&(t=_n),{x:qn(t,"left","right"),y:qn(t,"top","bottom")}}(i),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Qn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!B(t))return!1;const i=t.current;(0,h.V1)(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const s=function(t,e,i){const n=ms(t,i),{scroll:s}=e;return s&&(cs(n.x,s.offset.x),cs(n.y,s.offset.y)),n}(i,n.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Hn(t.x,e.x),y:Hn(t.y,e.y)}}(n.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Jn(t))}return o}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Qn(r=>{if(!ys(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=n?200:1e6,h=n?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return le(this.visualElement,t),i.start(pn(t,i,0,e,this.visualElement,!1))}stopAnimation(){Qn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Qn(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Qn(e=>{const{drag:i}=this.getProps();if(!ys(e,i,this.currentDirection))return;const{projection:n}=this.visualElement,s=this.getAxisMotionValue(e);if(n&&n.layout){const{min:i,max:o}=n.layout.layoutBox[e];s.set(t[e]-xi(i,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!B(e)||!i||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Qn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();n[t]=function(t,e){let i=.5;const n=$n(t),s=$n(e);return s>n?i=(0,h.qB)(e.min,e.max-n,t.min):n>s&&(i=(0,h.qB)(t.min,t.max-s,e.min)),ut(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Qn(e=>{if(!ys(e,t,null))return;const i=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];i.set(xi(s,o,n[e]))})}addListeners(){if(!this.visualElement.current)return;vs.set(this.visualElement,this);const t=Rn(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();B(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,n=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),p.read(e);const s=Dn(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Qn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),n(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=_n,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function ys(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const xs=t=>(e,i)=>{t&&p.postRender(()=>t(e,i))},Ps={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ws(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ts={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!vt.test(t))return t;t=parseFloat(t)}return`${ws(t,e.target.x)}% ${ws(t,e.target.y)}%`}},Ss={correct:(t,{treeScale:e,projectionDelta:i})=>{const n=t,s=We.parse(t);if(s.length>5)return n;const o=We.createTransformer(t),r="number"!=typeof s[0]?1:0,a=i.x.scale*e.x,l=i.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=xi(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}};class bs extends s.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;var o;o=Vs,Object.assign(Ft,o),s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Ps.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,o=i.projection;return o?(o.isPresent=s,n||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||p.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),I.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function As(t){const[e,i]=function(t=!0){const e=(0,s.useContext)(r);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:o}=e,a=(0,s.useId)();(0,s.useEffect)(()=>{t&&o(a)},[t]);const l=(0,s.useCallback)(()=>t&&n&&n(a),[a,n,t]);return!i&&n?[!1,l]:[!0]}(),a=(0,s.useContext)(o);return(0,n.jsx)(bs,{...t,layoutGroup:a,switchLayoutGroup:(0,s.useContext)($),isPresent:e,safeToRemove:i})}const Vs={borderRadius:{...Ts,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ts,borderTopRightRadius:Ts,borderBottomLeftRadius:Ts,borderBottomRightRadius:Ts,boxShadow:Ss};const Cs=(t,e)=>t.depth-e.depth;class Ms{constructor(){this.children=[],this.isDirty=!1}add(t){te(this.children,t),this.isDirty=!0}remove(t){ee(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Cs),this.isDirty=!1,this.children.forEach(t)}}const Ds=["TopLeft","TopRight","BottomLeft","BottomRight"],Es=Ds.length,Rs=t=>"string"==typeof t?parseFloat(t):t,ks=t=>"number"==typeof t||vt.test(t);function js(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Bs=Ls(0,.5,xe),Fs=Ls(.5,.95,h.lQ);function Ls(t,e,i){return n=>n<t?0:n>e?1:i((0,h.qB)(t,e,n))}function Os(t,e){t.min=e.min,t.max=e.max}function Is(t,e){Os(t.x,e.x),Os(t.y,e.y)}function Us(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function $s(t,e,i,n,s){return t=os(t-=e,1/i,n),void 0!==s&&(t=os(t,1/s,n)),t}function Ws(t,e,[i,n,s],o,r){!function(t,e=0,i=1,n=.5,s,o=t,r=t){if(ft.test(e)&&(e=parseFloat(e),e=xi(r.min,r.max,e/100)-r.min),"number"!=typeof e)return;let a=xi(o.min,o.max,n);t===o&&(a-=e),t.min=$s(t.min,e,i,a,s),t.max=$s(t.max,e,i,a,s)}(t,e[i],e[n],e[s],e.scale,o,r)}const Ns=["x","scaleX","originX"],Xs=["y","scaleY","originY"];function Ys(t,e,i,n){Ws(t.x,e,Ns,i?i.x:void 0,n?n.x:void 0),Ws(t.y,e,Xs,i?i.y:void 0,n?n.y:void 0)}function Ks(t){return 0===t.translate&&1===t.scale}function zs(t){return Ks(t.x)&&Ks(t.y)}function Hs(t,e){return t.min===e.min&&t.max===e.max}function _s(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function qs(t,e){return _s(t.x,e.x)&&_s(t.y,e.y)}function Gs(t){return $n(t.x)/$n(t.y)}function Zs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Qs{constructor(){this.members=[]}add(t){te(this.members,t),t.scheduleRender()}remove(t){if(ee(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let i;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){i=e;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:n}=t.options;!1===n&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Js={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},to="undefined"!=typeof window&&void 0!==window.MotionDebug,eo=["","X","Y","Z"],io={visibility:"hidden"};let no=0;function so(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function oo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=ue(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",p,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&oo(n)}function ro({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(t={},i=(null==e?void 0:e())){this.id=no++,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,to&&(Js.totalNodes=Js.resolvedTargetDeltas=Js.recalculatedProjection=0),this.nodes.forEach(uo),this.nodes.forEach(go),this.nodes.forEach(yo),this.nodes.forEach(ho),to&&window.MotionDebug.record(Js)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ms)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ie),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,i=this.root.hasTreeAnimated){if(this.instance)return;var n;this.isSVG=(n=e)instanceof SVGElement&&"svg"!==n.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(o||s)&&(this.isLayoutDirty=!0),t){let i;const n=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=Jt.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(m(n),t(o-e))};return p.read(n,!0),()=>m(n)}(n,250),Ps.hasAnimatedSinceResize&&(Ps.hasAnimatedSinceResize=!1,this.nodes.forEach(vo))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||bo,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!qs(this.targetLayout,n)||i,u=!e&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...(0,qt.rU)(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||vo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}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(xo),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&&oo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(po);this.isUpdating||this.nodes.forEach(mo),this.isUpdating=!1,this.nodes.forEach(fo),this.nodes.forEach(ao),this.nodes.forEach(lo),this.clearAllSnapshots();const t=Jt.now();f.delta=ut(0,1e3/60,t-f.timestamp),f.timestamp=t,f.isProcessing=!0,v.update.process(f),v.preRender.process(f),v.render.process(f),f.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,I.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(co),this.sharedNodes.forEach(Po)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,p.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){p.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let 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=n(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!zs(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,o=n!==this.prevTransformTemplateValue;t&&(e||is(this.latestValues)||o)&&(s(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let i=this.removeElementScroll(e);var n;return t&&(i=this.removeTransform(i)),Co((n=i).x),Co(n.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const i=e.measureViewportBox();if(!(null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)&&!this.path.some(Do)){const{scroll:t}=this.root;t&&(cs(i.x,t.offset.x),cs(i.y,t.offset.y))}return i}removeElementScroll(t){var e;const i={x:{min:0,max:0},y:{min:0,max:0}};if(Is(i,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return i;for(let e=0;e<this.path.length;e++){const n=this.path[e],{scroll:s,options:o}=n;n!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&Is(i,t),cs(i.x,s.offset.x),cs(i.y,s.offset.y))}return i}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};Is(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&ps(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),is(n.latestValues)&&ps(i,n.latestValues)}return is(this.latestValues)&&ps(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Is(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!is(i.latestValues))continue;es(i.latestValues)&&i.updateSnapshot();const n=Zn();Is(n,i.measurePageBox()),Ys(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return is(this.latestValues)&&Ys(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!==f.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==i;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=f.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}},Kn(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Is(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var r,a,l;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,Xn(r.x,a.x,l.x),Xn(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Is(this.target,this.layout.layoutBox),ls(this.target,this.targetDelta)):Is(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}},Kn(this.relativeTargetOrigin,this.target,t.target),Is(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}to&&Js.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!es(this.parent.latestValues)&&!ns(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),i=Boolean(this.resumingFrom)||this!==e;let n=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(n=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===f.timestamp&&(n=!1),n)return;const{layout:s,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||!s&&!o)return;Is(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,i,n=!1){const s=i.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=i[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(n&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ps(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,ls(t,r)),n&&is(o.latestValues)&&ps(t,o.latestValues))}e.x<hs&&e.x>us&&(e.x=1),e.y<hs&&e.y>us&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,i),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(Us(this.prevProjectionDelta.x,this.projectionDelta.x),Us(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Nn(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Zs(this.projectionDelta.x,this.prevProjectionDelta.x)&&Zs(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),to&&Js.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const i=this.snapshot,n=i?i.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(So));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var l,d,p,m,f,v;wo(o.x,t.x,i),wo(o.y,t.y,i),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kn(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=i,To(p.x,m.x,f.x,v),To(p.y,m.y,f.y,v),c&&(l=this.relativeTarget,d=c,Hs(l.x,d.x)&&Hs(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),Is(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,i,n,s,o){s?(t.opacity=xi(0,void 0!==i.opacity?i.opacity:1,Bs(n)),t.opacityExit=xi(void 0!==e.opacity?e.opacity:1,0,Fs(n))):o&&(t.opacity=xi(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,n));for(let s=0;s<Es;s++){const o=`border${Ds[s]}Radius`;let r=js(e,o),a=js(i,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||ks(r)===ks(a)?(t[o]=Math.max(xi(Rs(r),Rs(a),n),0),(ft.test(a)||ft.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||i.rotate)&&(t.rotate=xi(e.rotate||0,i.rotate||0,n))}(s,n,this.latestValues,i,h,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=p.update(()=>{Ps.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){const n=Z(t)?t:re(t);return n.start(pn("",n,e,i)),n.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&Mo(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=$n(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=$n(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}Is(e,i),ps(e,s),Nn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Qs),this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&so("z",t,n,this.animationValues);for(let e=0;e<eo.length;e++)so(`rotate${eo[e]}`,t,n,this.animationValues),so(`skew${eo[e]}`,t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}getProjectionStyles(t){var e,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return io;const n={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=Q(null==t?void 0:t.pointerEvents)||"",n.transform=s?s(this.latestValues,""):"none",n;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Q(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!is(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),n.transform=function(t,e,i){let n="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==i?void 0:i.z)||0;if((s||o||r)&&(n=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(n+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotateX(${s}deg) `),o&&(n+=`rotateY(${o}deg) `),r&&(n+=`skewX(${r}deg) `),a&&(n+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(n+=`scale(${a}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),s&&(n.transform=s(r,n.transform));const{x:a,y:l}=this.projectionDelta;n.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?n.opacity=o===this?null!==(i=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:n.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in Ft){if(void 0===r[t])continue;const{correct:e,applyTo:i}=Ft[t],s="none"===n.transform?r[t]:e(r[t],o);if(i){const t=i.length;for(let e=0;e<t;e++)n[i[e]]=s}else n[t]=s}return this.options.layoutId&&(n.pointerEvents=o===this?Q(null==t?void 0:t.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(po),this.root.sharedNodes.clear()}}}function ao(t){t.updateLayout()}function lo(t){var e;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:s}=t.options,o=i.source!==t.layout.source;"size"===s?Qn(t=>{const n=o?i.measuredBox[t]:i.layoutBox[t],s=$n(n);n.min=e[t].min,n.max=n.min+s}):Mo(s,i.layoutBox,e)&&Qn(n=>{const s=o?i.measuredBox[n]:i.layoutBox[n],r=$n(e[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Nn(r,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Nn(a,t.applyTransform(n,!0),i.measuredBox):Nn(a,e,i.layoutBox);const l=!zs(r);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Kn(r,i.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Kn(a,e,o.layoutBox),qs(r,a)||(u=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function uo(t){to&&Js.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ho(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function co(t){t.clearSnapshot()}function po(t){t.clearMeasurements()}function mo(t){t.isLayoutDirty=!1}function fo(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function vo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function go(t){t.resolveTargetDelta()}function yo(t){t.calcProjection()}function xo(t){t.resetSkewAndRotation()}function Po(t){t.removeLeadSnapshot()}function wo(t,e,i){t.translate=xi(e.translate,0,i),t.scale=xi(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function To(t,e,i,n){t.min=xi(e.min,i.min,n),t.max=xi(e.max,i.max,n)}function So(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const bo={duration:.45,ease:[.4,0,.1,1]},Ao=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Vo=Ao("applewebkit/")&&!Ao("chrome/")?Math.round:h.lQ;function Co(t){t.min=Vo(t.min),t.max=Vo(t.max)}function Mo(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Gs(e),s=Gs(i),!(Math.abs(n-s)<=.2));var n,s}function Do(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Eo=ro({attachResizeListener:(t,e)=>Dn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ro={current:void 0},ko=ro({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ro.current){const t=new Eo({});t.mount(window),t.setOptions({layoutScroll:!0}),Ro.current=t}return Ro.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),jo={pan:{Feature:class extends Vn{constructor(){super(...arguments),this.removePointerDownListener=h.lQ}onPointerDown(t){this.session=new jn(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fs(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:xs(t),onStart:xs(e),onMove:i,onEnd:(t,e)=>{delete this.session,n&&p.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=Rn(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 Vn{constructor(t){super(t),this.removeGroupControls=h.lQ,this.removeListeners=h.lQ,this.controls=new gs(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||h.lQ}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ko,MeasureLayout:As}};function Bo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&p.postRender(()=>s(e,En(e)))}function Fo(t,e,i){const{props:n}=t;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&p.postRender(()=>s(e,En(e)))}const Lo=new WeakMap,Oo=new WeakMap,Io=t=>{const e=Lo.get(t.target);e&&e(t)},Uo=t=>{t.forEach(Io)};const $o={some:0,all:1},Wo={inView:{Feature:class extends Vn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:$o[n]};return function(t,e,i){const n=function({root:t,...e}){const i=t||document;Oo.has(i)||Oo.set(i,{});const n=Oo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(Uo,{root:t,...e})),n[s]}(e);return Lo.set(t,i),n.observe(t),()=>{Lo.delete(t),n.unobserve(t)}}(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Vn{mount(){const{current:t}=this.node;t&&(this.unmount=(0,qt.c$)(t,t=>(Fo(this.node,t,"Start"),(t,{success:e})=>Fo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Vn{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=Ci(Dn(this.node.current,"focus",()=>this.onFocus()),Dn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Vn{mount(){const{current:t}=this.node;t&&(this.unmount=(0,qt.PT)(t,t=>(Bo(this.node,t,"Start"),t=>Bo(this.node,t,"End"))))}unmount(){}}}},No={layout:{ProjectionNode:ko,MeasureLayout:As}},Xo={current:null},Yo={current:!1},Ko=[...di,ke,We],zo=new WeakMap,Ho=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _o{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ai,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=Jt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,p.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=E(e),this.isVariantNode=R(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Z(e)&&e.set(a[t],!1)}}mount(t){this.current=t,zo.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)),Yo.current||function(){if(Yo.current=!0,l)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xo.current=t.matches;t.addListener(e),e()}else Xo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Xo.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){zo.delete(this.current),this.projection&&this.projection.unmount(),m(this.notifyUpdate),m(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=it.has(t),n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&p.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),s(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in x){const e=x[t];if(!e)continue;const{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(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<Ho.length;e++){const i=Ho[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const n=t["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=function(t,e,i){for(const n in e){const s=e[n],o=i[n];if(Z(s))t.addValue(n,s);else if(Z(o))t.addValue(n,re(s,{owner:t}));else if(o!==s)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(n);t.addValue(n,re(void 0!==e?e:s,{owner:t}))}}for(const n in i)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=re(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){var i;let n=void 0===this.latestValues[t]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,t))&&void 0!==i?i:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(li(n)||we(n))?n=parseFloat(n):(s=n,!Ko.find(ci(s))&&We.test(e)&&(n=_e(t,e))),this.setBaseTarget(t,Z(n)?n.get():n)),Z(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:i}=this.props;let n;if("string"==typeof i||"object"==typeof i){const s=_(this.props,i,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(n=s[t])}if(i&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Z(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new ie),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class qo extends _o{constructor(){super(...arguments),this.KeyframeResolver=mi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Z(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Go extends qo{constructor(){super(...arguments),this.type="html",this.renderInstance=kt}readValueFromInstance(t,e){if(it.has(e)){const t=He(e);return t&&t.default||0}{const n=(i=t,window.getComputedStyle(i)),s=(st(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return ms(t,e)}build(t,e,i){Vt(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return Ot(t,e,i)}}class Zo extends qo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Zn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(it.has(e)){const t=He(e);return t&&t.default||0}return e=jt.has(e)?e:L(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return It(t,e,i)}build(t,e,i){Et(t,e,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,i,n){Bt(t,e,0,n)}mount(t){this.isSVGTag=Rt(t.tagName),super.mount(t)}}const Qo=b(zt({...Mn,...Wo,...jo,...No},(t,e)=>z(t)?new Zo(e):new Go(e,{allowProjection:t!==s.Fragment})));new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap,new Map,new WeakMap,qt.uN,new Map,new Map,new Set;const Jo=()=>({});J({scrapeMotionValuesFromProps:Jo,createRenderState:Jo}),(0,s.createContext)(null),c.reduce((t,e)=>(t[e]=t=>m(t),t),{})}};