react-pro-messenger 1.0.42 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -16,6 +16,6 @@ Check the top-level render call using <`+M+">.")}return S}}function ta(d,S){{if(
16
16
  ${h}px !important;
17
17
  top: ${u}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(ua,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const da=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=on(ha),u=x.useId(),c=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:u,initial:t,isPresent:n,custom:s,onExitComplete:c,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),c]:[n,c]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(fa,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function ha(){return new Map}function $r(e=!0){const t=x.useContext(kt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const _t=e=>e.key||"";function Ur(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Wr=ln?x.useLayoutEffect:x.useEffect,zr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=$r(o),c=x.useMemo(()=>Ur(e),[e]),f=o&&!l?[]:c.map(_t),h=x.useRef(!0),m=x.useRef(c),v=on(()=>new Map),[y,w]=x.useState(c),[b,C]=x.useState(c);Wr(()=>{h.current=!1,m.current=c;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const P=[];if(c!==y){let g=[...c];for(let O=0;O<b.length;O++){const Y=b[O],R=_t(Y);f.includes(R)||(g.splice(O,0,Y),P.push(Y))}return i==="wait"&&P.length&&(g=P),C(Ur(g)),w(c),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:L}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),Y=o&&!l?!1:c===b||f.includes(O),R=()=>{if(v.has(O))v.set(O,!0);else return;let Q=!0;v.forEach(F=>{F||(Q=!1)}),Q&&(L==null||L(),C(m.current),o&&(u==null||u()),r&&r())};return p.exports.jsx(da,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:R,anchorX:a,children:g},O)})})},Te=e=>e;let Ze=Te,_e=Te;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function cn(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,Yr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function pa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){o.has(f)&&(c.schedule(f),e()),l++,f(a)}const c={schedule:(f,h=!1,m=!1)=>{const y=m&&s?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(u),t&&Ie.value&&Ie.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,c.process(f))}};return c}const ma=40;function Kr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,C)=>(b[C]=pa(i,t?C:void 0),b),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ma),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,C)=>{const P=o[C];return b[C]=(L,g=!1,O=!1)=>(n||v(),P.schedule(L,g,O)),b},{}),cancel:b=>{for(let C=0;C<It.length;C++)o[It[C]].cancel(b)},state:s,steps:o}}const{schedule:ne,cancel:Ne,state:ge,steps:un}=Kr(typeof requestAnimationFrame<"u"?requestAnimationFrame:Te,!0),Hr=x.createContext({strict:!1}),qr={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"]},Qe={};for(const e in qr)Qe[e]={isEnabled:t=>qr[e].some(n=>!!t[n])};function ga(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ya=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ya.has(e)}let Gr=e=>!Nt(e);function va(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{va(require("@emotion/is-prop-valid").default)}catch{}function xa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Xr=new Set;function Ft(e,t,n){e||Xr.has(t)||(console.warn(t),n&&console.warn(n),Xr.add(t))}function ba(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Zr(e){return Boolean(Ut(e)||e.variants)}function wa(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ta(e){const{initial:t,animate:n}=wa(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Jr(t),Jr(n)])}function Jr(e){return Array.isArray(e)?e.join(" "):e}const Sa=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ca(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qr="data-"+hn("framerAppearId"),{schedule:pn,cancel:Ud}=Kr(queueMicrotask,!1),es=x.createContext({});function Pa(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(Bt),l=x.useContext(Hr),u=x.useContext(kt),c=x.useContext(an).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const h=f.current,m=x.useContext(es);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Ea(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,u)});const y=n[Qr],w=x.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Wr(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),w.current=!1))}),h}function Ea(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ts(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&et(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function ts(e){if(e)return e.options.allowProjection!==!1?e.projection:ts(e.parent)}function ja({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ga(e);function a(u,c){let f;const h={...x.useContext(an),...u,layoutId:Aa(u)},{isStatic:m}=h,v=Ta(u),y=r(u,m);if(!m&&ln){Ma(h,e);const w=Da(h);f=w.MeasureLayout,v.visualElement=Pa(s,y,h,t,w.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,u,Ca(y,v.visualElement,c),y,m,v.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Sa]=s,l}function Aa({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function Ma(e,t){const n=x.useContext(Hr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ze(!1,r):_e(!1,r)}}function Da(e){const{drag:t,layout:n}=Qe;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ns=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ns("--"),Va=ns("var(--"),gn=e=>Va(e)?Ra.test(e.split("/*")[0].trim()):!1,Ra=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Oa(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function rs(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ye=e=>Boolean(e&&e.getVelocity),ss=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),N=yt("px"),La=yt("vh"),ka=yt("vw"),is={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},_a={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,radius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,backgroundPositionX:N,backgroundPositionY:N},Ia={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:gt,originX:is,originY:is,originZ:N},os={...nt,transform:Math.round},yn={..._a,...Ia,zIndex:os,size:N,fillOpacity:gt,strokeOpacity:gt,numOctaves:os},Na={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fa=tt.length;function Ba(e,t,n){let r="",s=!0;for(let i=0;i<Fa;i++){const o=tt[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ss(a,yn[o]);if(!l){s=!1;const c=Na[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(We.has(l)){o=!0;continue}else if(mn(l)){s[l]=u;continue}else{const c=ss(u,yn[l]);l.startsWith("origin")?(a=!0,i[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=Ba(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=i;r.transformOrigin=`${l} ${u} ${c}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function as(e,t,n){for(const r in t)!ye(t[r])&&!rs(r,n)&&(e[r]=t[r])}function $a({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ua(e,t){const n=e.style||{},r={};return as(r,n,e),Object.assign(r,$a(e,t)),r}function Wa(e,t){const n={},r=Ua(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const za=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(za.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ya={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ka={offset:"strokeDashoffset",array:"strokeDasharray"};function Ha(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ya:Ka;e[i.offset]=N.transform(-r);const o=N.transform(t),a=N.transform(n);e[i.array]=`${o} ${a}`}function ls(e,t,n){return typeof e=="string"?e:N.transform(t+n*e)}function qa(e,t,n){const r=ls(t,e.x,e.width),s=ls(n,e.y,e.height);return`${r} ${s}`}function wn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(vn(e,u,f),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=qa(v,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ha(h,o,a,l,!1)}const cs=()=>({...xn(),attrs:{}}),Tn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ga(e,t,n,r){const s=x.useMemo(()=>{const i=cs();return wn(i,t,Tn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};as(i,e.style,e),s.style={...i,...s.style}}return s}function Xa(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(bn(n)?Ga:Wa)(r,i,o,n),u=xa(r,typeof n=="string",e),c=n!==x.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ye(f)?f.get():f,[f]);return x.createElement(n,{...c,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Cn=e=>Array.isArray(e),Za=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ja=e=>Cn(e)?e[e.length-1]||0:e;function zt(e){const t=ye(e)?e.get():e;return Za(t)?t.toValue():t}function Qa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:el(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const fs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Qa(e,t,r,s);return n?i():on(i)};function el(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:a}=e;const l=Ut(e),u=Zr(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;if(f&&typeof f!="boolean"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:w,...b}=v;for(const C in b){let P=b[C];if(Array.isArray(P)){const L=c?P.length-1:0;P=P[L]}P!==null&&(s[C]=P)}for(const C in y)s[C]=y[C]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ye(s[o])||t.style&&ye(t.style[o])||rs(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const tl={useVisualState:fs({scrapeMotionValuesFromProps:Pn,createRenderState:xn})};function ds(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function hs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ps=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 ms(e,t,n,r){hs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ps.has(s)?s:hn(s),t.attrs[s])}function gs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(ye(e[s])||ye(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ys=["x","y","width","height","cx","cy","r"],nl={useVisualState:fs({scrapeMotionValuesFromProps:gs,createRenderState:cs,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(We.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<ys.length;a++){const l=ys[a];e[l]!==t[l]&&(o=!0)}o&&ne.read(()=>{ds(n,r),ne.render(()=>{wn(r,s,Tn(n.tagName),e.transformTemplate),ms(n,r)})})}})};function rl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?nl:tl,preloadedFeatures:e,useRender:Xa(s),createVisualElement:t,Component:r};return ja(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const sl=cn(()=>window.ScrollTimeline!==void 0);class il{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(sl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ol extends il{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function vs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function xs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",al={linearEasing:void 0};function ll(e,t){const n=cn(e);return()=>{var r;return(r=al[t])!==null&&r!==void 0?r:n()}}const Yt=ll(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function ws(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(ws))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?bs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function Ss(){return Ae.x||Ae.y}function cl(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Cs(e,t){const n=cl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||Ss())}function ul(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{if(!Ps(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const c=f=>{Ps(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Kt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Es=(e,t)=>t?e===t?!0:Es(e,t.parentElement):!1,Vn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dl(e){return fl.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function js(e){return t=>{t.key==="Enter"&&e(t)}}function Rn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=js(()=>{if(bt.has(n))return;Rn(n,"down");const s=js(()=>{Rn(n,"up")}),i=()=>Rn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function As(e){return Vn(e)&&!Ss()}function pl(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{const l=a.currentTarget;if(!l||!As(a)||bt.has(l))return;bt.add(l),Kt(a,"set");const u=t(l,a),c=(m,v)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Kt(m,"release"),!(!As(m)||!bt.has(l))&&(bt.delete(l),typeof u=="function"&&u(m,{success:v}))},f=m=>{(m.isTrusted?ml(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?c(m,!1):c(m,!(l instanceof Element)||Es(l,m.target))},h=m=>{c(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!dl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",u=>hl(u,s),s)}),i}function ml(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function gl(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const Ms=new Set(["width","height","top","left","right","bottom",...tt]);let Ht;function yl(){Ht=void 0}const Ve={now:()=>(Ht===void 0&&Ve.set(ge.isProcessing||Yr.useManualTiming?ge.timestamp:performance.now()),Ht),set:e=>{Ht=e,queueMicrotask(yl)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ds(e,t){return t?e*(1e3/t):0}const Vs=30,vl=e=>!isNaN(parseFloat(e));class xl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ve.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ve.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kn);const r=this.events[t].add(n);return t==="change"?()=>{r(),ne.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ve.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vs);return Ds(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 wt(e,t){return new xl(e,t)}function bl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wt(n))}function wl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Ja(i[o]);bl(e,o,a)}}function Tl(e){return Boolean(ye(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(Tl(n))return n.add(t)}function Rs(e){return e.props[Qr]}const Sl={current:!1},Os=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cl=1e-7,Pl=12;function El(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Os(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Cl&&++a<Pl);return o}function Tt(e,t,n,r){if(e===t&&n===r)return Te;const s=i=>El(i,0,1,e,n);return i=>i===0||i===1?i:Os(s(i),t,r)}const Ls=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ks=e=>t=>1-e(1-t),_s=Tt(.33,1.53,.69,.99),In=ks(_s),Is=Ls(In),Ns=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Fs=ks(Nn),Bs=Ls(Nn),$s=e=>/^0[^.\s]+$/u.test(e);function jl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$s(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Al(e){return e==null}const Ml=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&Ml.test(n)&&n.startsWith(e)||t&&!Al(n)&&Object.prototype.hasOwnProperty.call(n,t)),Us=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Dl(e))},ze={test:Bn("rgb","red"),parse:Us("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Vl(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Un={test:Bn("#"),parse:Vl,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:Us("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ve={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Rl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ol(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Rl))===null||n===void 0?void 0:n.length)||0)>0}const Ws="number",zs="color",Ll="var",kl="var(",Ys="${}",_l=/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 Ct(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(_l,l=>(ve.test(l)?(r.color.push(i),s.push(zs),n.push(ve.parse(l))):l.startsWith(kl)?(r.var.push(i),s.push(Ll),n.push(l)):(r.number.push(i),s.push(Ws),n.push(parseFloat(l))),++i,Ys)).split(Ys);return{values:n,split:a,indexes:r,types:s}}function Ks(e){return Ct(e).values}function Hs(e){const{split:t,types:n}=Ct(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ws?i+=St(s[o]):a===zs?i+=ve.transform(s[o]):i+=s[o]}return i}}const Il=e=>typeof e=="number"?0:e;function Nl(e){const t=Ks(e);return Hs(e)(t.map(Il))}const Be={test:Ol,parse:Ks,createTransformer:Hs,getAnimatableNone:Nl},Fl=new Set(["brightness","contrast","saturate","opacity"]);function Bl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Fl.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const $l=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match($l);return t?t.map(Bl).join(" "):e}},Ul={...yn,color:ve,backgroundColor:ve,outlineColor:ve,fill:ve,stroke:ve,borderColor:ve,borderTopColor:ve,borderRightColor:ve,borderBottomColor:ve,borderLeftColor:ve,filter:Wn,WebkitFilter:Wn},zn=e=>Ul[e];function qs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wl=new Set(["auto","none","0"]);function zl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Wl.has(i)&&Ct(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=qs(n,s)}const Gs=e=>e===nt||e===N,Xs=(e,t)=>parseFloat(e.split(", ")[t]),Zs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Xs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Xs(i[1],e):0}},Yl=new Set(["x","y","z"]),Kl=tt.filter(e=>!Yl.has(e));function Hl(e){const t=[];return Kl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Zs(4,13),y:Zs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Js(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Hl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Qs(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function ql(){Qs(),Js()}class Hn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Yn||(Yn=!0,ne.read(Qs),ne.resolveKeyframes(Js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ei=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Gl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xl(e){const t=Gl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Zl=4;function ti(e,t,n=1){_e(n<=Zl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Xl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ei(o)?parseFloat(o):o}return gn(s)?ti(s,t,n+1):s}const ni=e=>t=>t.test(e),ri=[nt,N,De,Fe,ka,La,{test:e=>e==="auto",parse:e=>e}],si=e=>ri.find(ni(e));class ii extends Hn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),gn(u))){const c=ti(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ms.has(r)||t.length!==2)return;const[s,i]=t,o=si(s),a=si(i);if(o!==a)if(Gs(o)&&Gs(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)jl(t[s])&&r.push(s);r.length&&zl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=st[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=st[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const oi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Jl(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ql(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=oi(s,t),a=oi(i,t);return Ze(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:Jl(e)||(n==="spring"||An(n))&&r}const ec=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(ec),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const tc=40;class ai{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ve.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ql(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ve.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Ql(t,r,s,i))if(o)this.options.duration=0;else{l&&l(qt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pt={layout:0,mainThread:0,waapi:0},re=(e,t,n)=>e+(t-e)*n;function qn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=qn(l,a,e+1/3),i=qn(l,a,e),o=qn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Gt(e,t){return n=>n>0?t:e}const Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},rc=[Un,ze,rt],sc=e=>rc.find(t=>t.test(e));function li(e){const t=sc(e);if(Ze(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===rt&&(n=nc(n)),n}const ci=(e,t)=>{const n=li(e),r=li(t);if(!n||!r)return Gt(e,t);const s={...n};return i=>(s.red=Gn(n.red,r.red,i),s.green=Gn(n.green,r.green,i),s.blue=Gn(n.blue,r.blue,i),s.alpha=re(n.alpha,r.alpha,i),ze.transform(s))},ic=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(ic),Xn=new Set(["none","hidden"]);function oc(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ac(e,t){return n=>re(e,t,n)}function Zn(e){return typeof e=="number"?ac:typeof e=="string"?gn(e)?Gt:ve.test(e)?ci:uc:Array.isArray(e)?ui:typeof e=="object"?ve.test(e)?ci:lc:Gt}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function lc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function cc(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const uc=(e,t)=>{const n=Be.createTransformer(t),r=Ct(e),s=Ct(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?oc(e,t):Et(ui(cc(r,s),s.values),n):(Ze(!0,`Complex values '${e}' and '${t}' 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.`),Gt(e,t))};function fi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):Zn(e)(e,t)}const fc=5;function di(e,t,n){const r=Math.max(t-fc,0);return Ds(n-e(r),t-r)}const se={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Jn=.001;function dc({duration:e=se.duration,bounce:t=se.bounce,velocity:n=se.velocity,mass:r=se.mass}){let s,i;Ze(e<=Me(se.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(se.minDamping,se.maxDamping,o),e=Le(se.minDuration,se.maxDuration,Oe(e)),o<1?(s=u=>{const c=u*o,f=c*e,h=c-n,m=Qn(u,o),v=Math.exp(-f);return Jn-h/m*v},i=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),y=Qn(Math.pow(u,2),o);return(-s(u)+Jn>0?-1:1)*((h-m)*v)/y}):(s=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-Jn+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=pc(s,i,a);if(e=Me(e),isNaN(l))return{stiffness:se.stiffness,damping:se.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const hc=12;function pc(e,t,n){let r=n;for(let s=1;s<hc;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const mc=["duration","bounce"],gc=["stiffness","damping","mass"];function hi(e,t){return t.some(n=>e[n]!==void 0)}function yc(e){let t={velocity:se.velocity,stiffness:se.stiffness,damping:se.damping,mass:se.mass,isResolvedFromDuration:!1,...e};if(!hi(e,gc)&&hi(e,mc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:se.mass,stiffness:s,damping:i}}else{const n=dc(e);t={...t,...n,mass:se.mass},t.isResolvedFromDuration=!0}return t}function pi(e=se.visualDuration,t=se.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:m}=yc({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=u/(2*Math.sqrt(l*c)),w=o-i,b=Oe(Math.sqrt(l/c)),C=Math.abs(w)<5;r||(r=C?se.restSpeed.granular:se.restSpeed.default),s||(s=C?se.restDelta.granular:se.restDelta.default);let P;if(y<1){const g=Qn(b,y);P=O=>{const Y=Math.exp(-y*b*O);return o-Y*((v+y*b*w)/g*Math.sin(g*O)+w*Math.cos(g*O))}}else if(y===1)P=g=>o-Math.exp(-b*g)*(w+(v+b*w)*g);else{const g=b*Math.sqrt(y*y-1);P=O=>{const Y=Math.exp(-y*b*O),R=Math.min(g*O,300);return o-Y*((v+y*b*w)*Math.sinh(R)+g*w*Math.cosh(R))/g}}const L={calculatedDuration:m&&f||null,next:g=>{const O=P(g);if(m)a.done=g>=f;else{let Y=0;y<1&&(Y=g===0?Me(v):di(P,g,O));const R=Math.abs(Y)<=r,Q=Math.abs(o-O)<=s;a.done=R&&Q}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(vs(L),jn),O=bs(Y=>L.next(g*Y).value,g,30);return g+"ms "+O}};return L}function mi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],h={done:!1,value:f},m=R=>a!==void 0&&R<a||l!==void 0&&R>l,v=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let y=n*t;const w=f+y,b=o===void 0?w:o(w);b!==w&&(y=b-f);const C=R=>-y*Math.exp(-R/r),P=R=>b+C(R),L=R=>{const Q=C(R),F=P(R);h.done=Math.abs(Q)<=u,h.value=h.done?b:F};let g,O;const Y=R=>{m(h.value)&&(g=R,O=pi({keyframes:[h.value,v(h.value)],velocity:di(P,R,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return Y(0),{calculatedDuration:null,next:R=>{let Q=!1;return!O&&g===void 0&&(Q=!0,L(R),Y(R)),g!==void 0&&R>=g?O.next(R-g):(!Q&&L(R),h)}}}const vc=Tt(.42,0,1,1),xc=Tt(0,0,.58,1),gi=Tt(.42,0,.58,1),bc=e=>Array.isArray(e)&&typeof e[0]!="number",yi={linear:Te,easeIn:vc,easeInOut:gi,easeOut:xc,circIn:Nn,circInOut:Bs,circOut:Fs,backIn:In,backInOut:Is,backOut:_s,anticipate:Ns},vi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Tt(t,n,r,s)}else if(typeof e=="string")return _e(yi[e]!==void 0,`Invalid easing type '${e}'`),yi[e];return e};function wc(e,t,n){const r=[],s=n||fi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Te:t;a=Et(l,a)}r.push(a)}return r}function Tc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=wc(t,r,s),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=Je(e[f],e[f+1],c);return a[f](h)};return n?c=>u(Le(e[0],e[i-1],c)):u}function Sc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(re(n,1,s))}}function Cc(e){const t=[0];return Sc(t,e.length-1),t}function Pc(e,t){return e.map(n=>n*t)}function Ec(e,t){return e.map(()=>t||gi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=bc(r)?r.map(vi):vi(r),i={done:!1,value:t[0]},o=Pc(n&&n.length===t.length?n:Cc(t),e),a=Tc(o,t,{ease:Array.isArray(s)?s:Ec(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const jc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ne.update(t,!0),stop:()=>Ne(t),now:()=>ge.isProcessing?ge.timestamp:Ve.now()}},Ac={decay:mi,inertia:mi,tween:jt,keyframes:jt,spring:pi},Mc=e=>e/100;class er extends ai{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Hn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=An(n)?n:Ac[n]||jt;let l,u;process.env.NODE_ENV!=="production"&&a!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==jt&&typeof t[0]!="number"&&(l=Et(Mc,fi(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});i==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=vs(c));const{calculatedDuration:f}=c,h=f+s,m=h*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Pt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:v,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),C=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let P=this.currentTime,L=i;if(m){const R=Math.min(this.currentTime,c)/f;let Q=Math.floor(R),F=R%1;!F&&R>=1&&(F=1),F===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(v==="reverse"?(F=1-F,y&&(F-=y/f)):v==="mirror"&&(L=o)),P=Le(0,1,F)*f}const g=C?{done:!1,value:l[0]}:L.next(P);a&&(g.value=a(g.value));let{done:O}=g;!C&&u!==null&&(O=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=qt(l,this.options,s)),w&&w(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=jc,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&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(),Pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Dc=new Set(["opacity","clipPath","filter","transform"]);function Vc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Ts(a,s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Rc=cn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Oc=2e4;function Lc(e){return An(e.type)||e.type==="spring"||!ws(e.ease)}function kc(e,t){const n=new er({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Oc;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const xi={anticipate:Ns,backInOut:Is,circInOut:Bs};function _c(e){return e in xi}class bi extends ai{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ii(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Yt()&&_c(i)&&(i=xi[i]),Lc(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,w=kc(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,o="keyframes"}const c=Vc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(xs(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;a.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Te;const{animation:r}=n;xs(r,t)}return Te}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:f,element:h,...m}=this.options,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),y=Me(this.time);u.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}const{onStop:l}=this.options;l&&l(),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:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return Rc()&&r&&Dc.has(r)&&!l&&!u&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Ic={type:"spring",stiffness:500,damping:25,restSpeed:10},Nc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fc={type:"keyframes",duration:.8},Bc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$c=(e,{keyframes:t})=>t.length>2?Fc:We.has(e)?e.startsWith("scale")?Nc(t[1]):Ic:Bc;function Uc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const tr=(e,t,n,r={},s,i)=>o=>{const a=En(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Me(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};Uc(a)||(c={...c,...$c(e,c)}),c.duration&&(c.duration=Me(c.duration)),c.repeatDelay&&(c.repeatDelay=Me(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),(Sl.current||Yr.skipAnimations)&&(f=!0,c.duration=0,c.delay=0),f&&!i&&t.get()!==void 0){const h=qt(c.keyframes,a);if(h!==void 0)return ne.update(()=>{c.onUpdate(h),c.onComplete()}),new ol([])}return!i&&bi.supports(c)?new bi(c):new er(c)};function Wc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||c&&Wc(c,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const C=window.MotionHandoffAnimation(b,f,ne);C!==null&&(v.startTime=C,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&Ms.has(f)?{type:!1}:v,e,y));const w=h.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{ne.update(()=>{a&&wl(e,a)})}),u}function nr(e,t,n={}){var r;const s=vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(wi(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=i;return zc(e,t,c+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function zc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(Yc).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(nr(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Yc(e,t){return e.sortNodePosition(t)}function Kc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(wi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Hc=dn.length;function Si(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Si(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Hc;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const qc=[...fn].reverse(),Gc=fn.length;function Xc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Kc(e,n,r)))}function Zc(e){let t=Xc(e),n=Ci(),r=!0;const s=l=>(u,c)=>{var f;const h=vt(e,c,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;u={...u,...y,...v}}return u};function i(l){t=l(e)}function o(l){const{props:u}=e,c=Si(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let w=0;w<Gc;w++){const b=qc[w],C=n[b],P=u[b]!==void 0?u[b]:c[b],L=pt(P),g=b===l?C.isActive:null;g===!1&&(v=w);let O=P===c[b]&&P!==u[b]&&L;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),C.protectedKeys={...m},!C.isActive&&g===null||!P&&!C.prevProp||$t(P)||typeof P=="boolean")continue;const Y=Jc(C.prevProp,P);let R=Y||b===l&&C.isActive&&!O&&L||w>v&&L,Q=!1;const F=Array.isArray(P)?P:[P];let I=F.reduce(s(b),{});g===!1&&(I={});const{prevResolvedValues:oe={}}=C,ee={...oe,...I},ae=q=>{R=!0,h.has(q)&&(Q=!0,h.delete(q)),C.needsAnimating[q]=!0;const le=e.getValue(q);le&&(le.liveStyle=!1)};for(const q in ee){const le=I[q],K=oe[q];if(m.hasOwnProperty(q))continue;let T=!1;Cn(le)&&Cn(K)?T=!Ti(le,K):T=le!==K,T?le!=null?ae(q):h.add(q):le!==void 0&&h.has(q)?ae(q):C.protectedKeys[q]=!0}C.prevProp=P,C.prevResolvedValues=I,C.isActive&&(m={...m,...I}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(O&&Y)||Q)&&f.push(...F.map(q=>({animation:q,options:{type:b}})))}if(h.size){const w={};if(typeof u.initial!="boolean"){const b=vt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);b&&b.transition&&(w.transition=b.transition)}h.forEach(b=>{const C=e.getBaseTarget(b),P=e.getValue(b);P&&(P.liveStyle=!0),w[b]=C??null}),f.push({animation:w})}let y=Boolean(f.length);return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ci(),r=!0}}}function Jc(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ci(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Qc extends $e{constructor(t){super(t),t.animationState||(t.animationState=Zc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let eu=0;class tu extends $e{constructor(){super(...arguments),this.id=eu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nu={animation:{Feature:Qc},exit:{Feature:tu}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const ru=e=>t=>Vn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,ru(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function su({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iu(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ei=1e-4,ou=1-Ei,au=1+Ei,ji=.01,lu=0-ji,cu=0+ji;function xe(e){return e.max-e.min}function uu(e,t,n){return Math.abs(e-t)<=n}function Ai(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=xe(n)/xe(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ou&&e.scale<=au||isNaN(e.scale))&&(e.scale=1),(e.translate>=lu&&e.translate<=cu||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){Ai(e.x,t.x,n.x,r?r.originX:void 0),Ai(e.y,t.y,n.y,r?r.originY:void 0)}function Mi(e,t,n){e.min=n.min+t.min,e.max=e.min+xe(t)}function fu(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}function Di(e,t,n){e.min=t.min-n.min,e.max=e.min+xe(t)}function Vt(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}const Vi=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Vi(),y:Vi()}),Ri=()=>({min:0,max:0}),ue=()=>({x:Ri(),y:Ri()});function Ce(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function He(e){return sr(e)||Oi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Oi(e){return Li(e.x)||Li(e.y)}function Li(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function ki(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=ki(e.min,t,n,r,s),e.max=ki(e.max,t,n,r,s)}function _i(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const Ii=.999999999999,Ni=1.0000000000001;function du(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,_i(e,o)),r&&He(i.latestValues)&&lt(e,i.latestValues))}t.x<Ni&&t.x>Ii&&(t.x=1),t.y<Ni&&t.y>Ii&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Fi(e,t,n,r,s=.5){const i=re(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Fi(e.x,t.x,t.scaleX,t.scale,t.originX),Fi(e.y,t.y,t.scaleY,t.scale,t.originY)}function Bi(e,t){return Pi(iu(e.getBoundingClientRect(),t))}function hu(e,t,n){const r=Bi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const $i=(e,t)=>Math.abs(e-t);function pu(e,t){const n=$i(e.x,t.x),r=$i(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ui{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=pu(c.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=c,{timestamp:v}=ge;this.history.push({...m,timestamp:v});const{onStart:y,onMove:w}=this.handlers;f||(y&&y(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{if(c.target instanceof Element&&c.target.hasPointerCapture&&c.pointerId!==void 0)try{if(!c.target.hasPointerCapture(c.pointerId))return}catch{}this.lastMoveEvent=c,this.lastMoveEventInfo=or(f,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{Kt(c,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(c.type==="pointercancel"||c.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(c,y),m&&m(c,y)},!Vn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=ge;this.history=[{...a,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Wi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Wi(e,zi(t)),offset:Wi(e,mu(t)),velocity:gu(t,.1)}}function mu(e){return e[0]}function zi(e){return e[e.length-1]}function gu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=zi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function yu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function Yi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function vu(e,{top:t,left:n,bottom:r,right:s}){return{x:Yi(e.x,n,s),y:Yi(e.y,t,r)}}function Ki(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function xu(e,t){return{x:Ki(e.x,t.x),y:Ki(e.y,t.y)}}function bu(e,t){let n=.5;const r=xe(e),s=xe(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function wu(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lr=.35;function Tu(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Hi(e,"left","right"),y:Hi(e,"top","bottom")}}function Hi(e,t,n){return{min:qi(e,t),max:qi(e,n)}}function qi(e,t){return typeof e=="number"?e:e[t]||0}const Su=new WeakMap;class Cu{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=ue(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mt(c).point)},i=(c,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=gl(h),!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),Ce(w=>{let b=this.getAxisMotionValue(w).get()||0;if(De.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[w];P&&(b=xe(P)*(parseFloat(b)/100))}}this.originPoint[w]=b}),v&&ne.postRender(()=>v(c,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(m&&this.currentDirection===null){this.currentDirection=Pu(w),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(c,f)},a=(c,f)=>this.stop(c,f),l=()=>Ce(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Ui(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ne.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=yu(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=vu(s.layoutBox,n):this.constraints=!1,this.elastic=Tu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ce(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=hu(r,s.root,this.visualElement.getTransformPagePoint());let o=xu(s.layout.layoutBox,i);if(n){const a=n(su(o));this.hasMutatedConstraints=!!a,a&&(o=Pi(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ce(c=>{if(!Jt(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ce(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ce(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ce(n=>{const{drag:r}=this.getProps();if(!Jt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-re(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ce(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=bu({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ce(o=>{if(!Jt(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(re(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Su.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();et(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ne.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ce(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=lr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Pu(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Eu extends $e{constructor(t){super(t),this.removeGroupControls=Te,this.removeListeners=Te,this.controls=new Cu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Te}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&ne.postRender(()=>e(t,n))};class ju extends $e{constructor(){super(...arguments),this.removePointerDownListener=Te}onPointerDown(t){this.session=new Ui(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ne.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(N.test(e))e=parseFloat(e);else return e;const n=Xi(e,t.target.x),r=Xi(e,t.target.y);return`${n}% ${r}%`}},Au={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const u=re(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Mu extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Oa(Du),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ne.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Zi(e){const[t,n]=$r(),r=x.useContext(sn);return p.exports.jsx(Mu,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(es),isPresent:t,safeToRemove:n})}const Du={borderRadius:{...Rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rt,borderTopRightRadius:Rt,borderBottomLeftRadius:Rt,borderBottomRightRadius:Rt,boxShadow:Au};function Vu(e,t,n){const r=ye(e)?e:wt(e);return r.start(tr("",r,t,n)),r.animation}function Ru(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Ou=(e,t)=>e.depth-t.depth;class Lu{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ou),this.isDirty=!1,this.children.forEach(t)}}function ku(e,t){const n=Ve.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return ne.read(r,!0),()=>Ne(r)}const Ji=["TopLeft","TopRight","BottomLeft","BottomRight"],_u=Ji.length,Qi=e=>typeof e=="string"?parseFloat(e):e,eo=e=>typeof e=="number"||N.test(e);function Iu(e,t,n,r,s,i){s?(e.opacity=re(0,n.opacity!==void 0?n.opacity:1,Nu(r)),e.opacityExit=re(t.opacity!==void 0?t.opacity:1,0,Fu(r))):i&&(e.opacity=re(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_u;o++){const a=`border${Ji[o]}Radius`;let l=to(t,a),u=to(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||eo(l)===eo(u)?(e[a]=Math.max(re(Qi(l),Qi(u),r),0),(De.test(u)||De.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function to(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nu=no(0,.5,Fs),Fu=no(.5,.95,Te);function no(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function ro(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){ro(e.x,t.x),ro(e.y,t.y)}function so(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function io(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Bu(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=re(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=re(i.min,i.max,r);e===i&&(a-=t),e.min=io(e.min,t,n,a,s),e.max=io(e.max,t,n,a,s)}function oo(e,t,[n,r,s],i,o){Bu(e,t[n],t[r],t[s],t.scale,i,o)}const $u=["x","scaleX","originX"],Uu=["y","scaleY","originY"];function ao(e,t,n,r){oo(e.x,t,$u,n?n.x:void 0,r?r.x:void 0),oo(e.y,t,Uu,n?n.y:void 0,r?r.y:void 0)}function lo(e){return e.translate===0&&e.scale===1}function co(e){return lo(e.x)&&lo(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function Wu(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function fo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ho(e,t){return fo(e.x,t.x)&&fo(e.y,t.y)}function po(e){return xe(e.x)/xe(e.y)}function mo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zu{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Yu(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:h,skewX:m,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cr=["","X","Y","Z"],Ku={visibility:"hidden"},go=1e3;let Hu=0;function ur(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ne,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yo(r)}function vo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Hu++,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,Ie.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(Xu),this.nodes.forEach(tf),this.nodes.forEach(nf),this.nodes.forEach(Zu),Ie.addProjectionMetrics&&Ie.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ru(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=ku(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(bo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||lf,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=c.getProps(),C=!this.targetLayout||!ho(this.targetLayout,v),P=!h&&m;if(this.options.layoutRoot||this.resumeFrom||P||h&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,P);const L={...En(y,"layout"),onPlay:w,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else h||bo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ne(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(rf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xo);return}this.isUpdating||this.nodes.forEach(Qu),this.isUpdating=!1,this.nodes.forEach(ef),this.nodes.forEach(qu),this.nodes.forEach(Gu),this.clearAllSnapshots();const a=Ve.now();ge.delta=Le(0,1e3/60,a-ge.timestamp),ge.timestamp=a,ge.isProcessing=!0,un.update.process(ge),un.preRender.process(ge),un.render.process(ge),ge.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ju),this.sharedNodes.forEach(sf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xe(this.snapshot.measuredBox.x)&&!xe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ue(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!co(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||He(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),cf(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ue();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(uf))){const{scroll:c}=this.root;c&&(at(l.x,c.offset.x),at(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=ue();if(Pe(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pe(l,o),at(l.x,f.offset.x),at(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ue();Pe(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&lt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),He(c.latestValues)&&lt(l,c.latestValues)}return He(this.latestValues)&&lt(l,this.latestValues),l}removeTransform(o){const a=ue();Pe(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!He(u.latestValues))continue;sr(u.latestValues)&&u.updateSnapshot();const c=ue(),f=u.measurePageBox();Pe(c,f),ao(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return He(this.latestValues)&&ao(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==ge.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=Boolean(this.resumingFrom)||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=ge.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ue(),this.targetWithTransforms=ue()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Pe(this.target,this.layout.layoutBox),_i(this.target,this.targetDelta)):Pe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Oi(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 o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ge.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=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||!(c||f))return;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;du(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ue());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(so(this.prevProjectionDelta.x,this.projectionDelta.x),so(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ue(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,w=this.getStack(),b=!w||w.members.length<=1,C=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(af));this.animationProgress=0;let P;this.mixTargetDelta=L=>{const g=L/1e3;wo(f.x,o.x,g),wo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),of(this.relativeTarget,this.relativeTargetOrigin,h,g),P&&Wu(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=ue()),Pe(P,this.relativeTarget)),y&&(this.animationValues=c,Iu(c,u,this.latestValues,g,C,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{Qt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=Vu(0,go,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Pt.layout--},onComplete:()=>{Pt.layout--,o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(go),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Eo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ue();const f=xe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=xe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Pe(a,l),lt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zu),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&ur("z",o,u,this.animationValues);for(let c=0;c<cr.length;c++)ur(`rotate${cr[c]}`,o,u,this.animationValues),ur(`skew${cr[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ku;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!He(this.latestValues)&&(y.transform=c?c({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=Yu(this.projectionDeltaWithTransform,this.treeScale,h),c&&(u.transform=c(h,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in mt){if(h[y]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:C}=mt[y],P=u.transform==="none"?h[y]:w(h[y],f);if(b){const L=b.length;for(let g=0;g<L;g++)u[b[g]]=P}else C?this.options.visualElement.renderState.vars[y]=P:u[y]=P}return this.options.layoutId&&(u.pointerEvents=f===this?zt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(xo),this.root.sharedNodes.clear()}}}function qu(e){e.updateLayout()}function Gu(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(h);h.min=r[f].min,h.max=h.min+m}):Eo(i,n.layoutBox,r)&&Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ot();Dt(a,r,n.layoutBox);const l=ot();o?Dt(l,e.applyTransform(s,!0),n.measuredBox):Dt(l,r,n.layoutBox);const u=!co(a);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const v=ue();Vt(v,n.layoutBox,h.layoutBox);const y=ue();Vt(y,r,m.layoutBox),ho(v,y)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Xu(e){Ie.value&&qe.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Zu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ju(e){e.clearSnapshot()}function xo(e){e.clearMeasurements()}function Qu(e){e.isLayoutDirty=!1}function ef(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tf(e){e.resolveTargetDelta()}function nf(e){e.calcProjection()}function rf(e){e.resetSkewAndRotation()}function sf(e){e.removeLeadSnapshot()}function wo(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function To(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function of(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function af(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lf={duration:.45,ease:[.4,0,.1,1]},So=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Co=So("applewebkit/")&&!So("chrome/")?Math.round:Te;function Po(e){e.min=Co(e.min),e.max=Co(e.max)}function cf(e){Po(e.x),Po(e.y)}function Eo(e,t,n){return e==="position"||e==="preserve-aspect"&&!uu(po(t),po(n),.2)}function uf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ff=vo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},jo=vo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new ff({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),df={pan:{Feature:ju},drag:{Feature:Eu,ProjectionNode:jo,MeasureLayout:Zi}};function Ao(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ne.postRender(()=>i(t,Mt(t)))}class hf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(Ao(this.node,r,"Start"),s=>Ao(this.node,s,"End"))))}unmount(){}}class pf extends $e{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ne.postRender(()=>i(t,Mt(t)))}class mf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=pl(t,(n,r)=>(Mo(this.node,r,"Start"),(s,{success:i})=>Mo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,gf=e=>{const t=dr.get(e.target);t&&t(e)},yf=e=>{e.forEach(gf)};function vf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(yf,{root:e,...t})),r[s]}function xf(e,t,n){const r=vf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const bf={some:0,all:1};class wf extends $e{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:bf[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return xf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tf(t,n))&&this.startObserver()}unmount(){}}function Tf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Sf={inView:{Feature:wf},tap:{Feature:mf},focus:{Feature:pf},hover:{Feature:hf}},Cf={layout:{ProjectionNode:jo,MeasureLayout:Zi}},pr={current:null},Do={current:!1};function Pf(){if(Do.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Ef=[...ri,ve,Be],jf=e=>Ef.find(ni(e)),Af=new WeakMap;function Mf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ye(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(ye(i))e.addValue(r,wt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,wt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hn,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 m=Ve.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ne.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ut(n),this.isVariantNode=Zr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const v=h[m];l[m]!==void 0&&ye(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Af.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((n,r)=>this.bindToMotionValue(r,n)),Do.current||Pf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.current,process.env.NODE_ENV!=="production"&&Ft(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ne(this.notifyUpdate),Ne(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 n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ne.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qe){const n=Qe[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ue()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Vo.length;r++){const s=Vo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Mf(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 n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=wt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ei(s)||$s(s))?s=parseFloat(s):!jf(s)&&Be.test(n)&&(s=qs(t,n)),this.setBaseTarget(t,ye(s)?s.get():s)),ye(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Sn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ye(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Df{constructor(){super(...arguments),this.KeyframeResolver=ii}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Vf(e){return window.getComputedStyle(e)}class Rf extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=hs}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Vf(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Of extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ue,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ds(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=ps.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return gs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ne.postRender(this.updateDimensions)}build(t,n,r){wn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ms(t,n,r,s)}mount(t){this.isSVGTag=Tn(t.tagName),super.mount(t)}}const Lf=(e,t)=>bn(e)?new Of(t):new Rf(t,{allowProjection:e!==x.Fragment}),kf=rl({...nu,...Sf,...df,...Cf},Lf),mr=ba(kf),_f=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[p.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,If=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ue.createPortal(p.exports.jsx(zr,{children:t&&p.exports.jsx(mr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,u)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},u))})}),i.current)},Nf=(e,t)=>{if(!t.current)return 0;const n=window.getComputedStyle(t.current),r=parseInt(n.lineHeight,10)||20;return Math.ceil(t.current.scrollHeight/r)-1},Ff=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Bf=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),$f=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),p.exports.jsx("path",{className:"fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),p.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),p.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Uf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:a,setMessageToEdit:l})=>{const[u,c]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,w]=x.useState(null),[b,C]=x.useState(null),[P,L]=x.useState(0),g=x.useRef(null),O=x.useRef([]),Y=x.useRef(null),R=x.useRef(null),Q=x.useRef(null),[F,I]=x.useState(!1),oe=150,ee=41.6;x.useEffect(()=>{const D=document.getElementById("static-display");D&&!D.textContent&&(a!=null&&a.text)&&(D.textContent=a==null?void 0:a.text)},[a==null?void 0:a.text]);const ae=D=>{const E=D.target.value;a?l(k=>k?new Xe({...k,text:E,isEdited:!0}):void 0):c(E);const A=E.match(/(\S+)$/);if(Se(A),console.log("numberOfLineBreaks",Nf(E,R)),R.current){const k=R.current.scrollHeight,B=Math.ceil(R.current.scrollHeight/k)-1;console.log(B),k>ee?k>oe?(R.current.style.height=`${oe}px`,R.current.style.overflowY="auto"):(R.current.style.height=`${k}px`,R.current.style.overflowY="hidden"):(console.log("buy"),R.current.style.height=`${ee}px`,R.current.style.overflowY="hidden")}},Se=D=>{if(D){const E=D[0];if(y){const A=D[0].split(y)[1];C(A)}o!=null&&o.some(A=>A.symbol===E)&&w(E)}else w(null),C(null)},pe=(D,E)=>{a?l(A=>A?new Xe({...A,text:A.text+E+" "}):void 0):c(A=>A+E+" "),w(null),C(null),R.current.focus()},q=()=>{if(a){if(a.text.trim()==="")return;t(a),l(void 0)}else{if(u.trim()==="")return;e(u),c("")}w(null),C(null),R.current&&(R.current.style.height=`${ee}px`)},le=async()=>{h(!0),v(0),O.current=[],Y.current=setInterval(()=>{v(A=>A+1)},1e3);const D=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(D);g.current=E,E.ondataavailable=A=>{A.data.size>0&&O.current.push(A.data)},E.onstop=()=>{clearInterval(Y.current);const A=new Blob(O.current,{type:"audio/mp3"});n(A),h(!1)},E.start()},K=()=>{var D;(D=g.current)==null||D.stop()},T=D=>{const{scrollTop:E,scrollHeight:A,clientHeight:k}=D.currentTarget;if(E>P){if(E+k>=A-1){const _=o==null?void 0:o.find(ce=>ce.symbol===y);_&&(_!=null&&_.updatePageNumber)&&(I(!0),_==null||_.updatePageNumber(_.pagNumber+1),L(E),setTimeout(()=>{I(!1)},500))}}else L(E)},V=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),z=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),W=()=>{var D;(D=Q.current)==null||D.click()},$=D=>{var k,B;const E=(k=D.target.files)==null?void 0:k[0];if(!E)return;let A="";if(E.type){const _=E.type.split("/");_.length===2&&(A=_[1])}A||(A=((B=E.name.split(".").pop())==null?void 0:B.toLowerCase())||""),V.has(A)?r(E):z.has(A)?s(E):i(E)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Ff(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:K,children:p.exports.jsx(gr,{})})]}):a?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>l(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:a.text,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:q,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:W,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx(Bf,{})}),p.exports.jsx("input",{type:"file",ref:Q,style:{display:"none"},onChange:$}),p.exports.jsx("textarea",{ref:R,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",style:{height:ee},placeholder:"Type a message...",value:u,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:u?q:le,children:u?p.exports.jsx(gr,{}):p.exports.jsx($f,{})})]}),y&&p.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:T,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>w(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(D=>D.symbol===y).map(D=>{var k;const{component:E,lists:A}=D;return E?b?(k=A==null?void 0:A.filter(B=>B==null?void 0:B.name.includes(b)))==null?void 0:k.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):A==null?void 0:A.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):null}):null,p.exports.jsx("div",{className:"h-8",children:F&&"Loading more items..."})]})]})]})};var Re=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Re||{}),ie=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ie||{});const yr=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[u,c]=x.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-u/100*h;return x.useEffect(()=>{const v=Date.now(),y=v+i,w=()=>{const b=Date.now(),P=Math.min(1,(b-v)/i)*e;c(P),b<y?requestAnimationFrame(w):c(e)};requestAnimationFrame(w)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(u),"%"]})]})},Oo=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const u={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&u[n]?u[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=u=>u>1048576?(u/1048576).toFixed(1)+" MB":(u/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===ie.Simple?" border-white ":s===ie.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ie.Simple?"text-white":s===ie.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===ie.Simple?"text-gray-800":s===ie.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},Wf=e=>p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),zf=e=>p.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const Yf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=x.useState(!1),[o,a]=x.useState(0),l=x.useRef(null);x.useEffect(()=>{const c=l.current;if(!c)return;const f=()=>{a(c.currentTime/c.duration*100)},h=()=>i(!0),m=()=>i(!1),v=()=>{i(!1),a(0)};return c.addEventListener("timeupdate",f),c.addEventListener("play",h),c.addEventListener("pause",m),c.addEventListener("ended",v),()=>{c.removeEventListener("timeupdate",f),c.removeEventListener("play",h),c.removeEventListener("pause",m),c.removeEventListener("ended",v)}},[]);const u=()=>{const c=l.current;c&&(s?c.pause():(Ot&&Ot!==c&&(Ot.pause(),Ot.currentTime=0),c.play(),Ot=c))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:u,children:s?p.exports.jsx(zf,{}):p.exports.jsx(Wf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Kf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r,uploadProgres:s,cancellationToken:i})=>e?t===Re.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Yf,{onCancelClick:i,uploadProgres:s,src:e})}):t===Re.Image?p.exports.jsxs("div",{className:"relative w-full",children:[s?p.exports.jsx(yr,{progress:(s==null?void 0:s.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:i,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${s?"filter blur-lg":" blur-none"}`,src:e})]}):t===Re.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):t===Re.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):null:null,Hf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,u,c,f,h,m,v,y;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:w=>n(w,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===ie.Simple?"bg-[#f8fbff]":s===ie.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(u=e.user)==null?void 0:u.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(v=e.user)==null?void 0:v.firstName:(y=e.user)==null?void 0:y.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ie.Simple?"text-gray-700":s===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===ie.Simple?"[&>g>path]:fill-[#f8fbff]":s===ie.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},qf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Lo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Gf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(mr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===ie.Telegram?" bg-green-200":ie.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Lo,{size:13,color:"text-black"}):p.exports.jsx(qf,{className:r===ie.Telegram?" ":ie.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ie.Simple?"text-gray-200":r===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ie.Telegram?"[&>g>path]:fill-green-200":ie.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var me={exports:{}},vr={exports:{}},Z={};var ko;function Xf(){if(ko)return Z;ko=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case u:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case c:case v:case m:case o:return g;default:return O}}case n:return O}}}function L(g){return P(g)===u}return Z.AsyncMode=l,Z.ConcurrentMode=u,Z.ContextConsumer=a,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=c,Z.Fragment=r,Z.Lazy=v,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return L(g)||P(g)===l},Z.isConcurrentMode=L,Z.isContextConsumer=function(g){return P(g)===a},Z.isContextProvider=function(g){return P(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return P(g)===c},Z.isFragment=function(g){return P(g)===r},Z.isLazy=function(g){return P(g)===v},Z.isMemo=function(g){return P(g)===m},Z.isPortal=function(g){return P(g)===n},Z.isProfiler=function(g){return P(g)===i},Z.isStrictMode=function(g){return P(g)===s},Z.isSuspense=function(g){return P(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===u||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===c||g.$$typeof===w||g.$$typeof===b||g.$$typeof===C||g.$$typeof===y)},Z.typeOf=P,Z}var J={};var _o;function Zf(){return _o||(_o=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(j){return typeof j=="string"||typeof j=="function"||j===r||j===u||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===v||j.$$typeof===m||j.$$typeof===o||j.$$typeof===a||j.$$typeof===c||j.$$typeof===w||j.$$typeof===b||j.$$typeof===C||j.$$typeof===y)}function L(j){if(typeof j=="object"&&j!==null){var Ee=j.$$typeof;switch(Ee){case t:var ct=j.type;switch(ct){case l:case u:case r:case i:case s:case f:return ct;default:var Ge=ct&&ct.$$typeof;switch(Ge){case a:case c:case v:case m:case o:return Ge;default:return Ee}}case n:return Ee}}}var g=l,O=u,Y=a,R=o,Q=t,F=c,I=r,oe=v,ee=m,ae=n,Se=i,pe=s,q=f,le=!1;function K(j){return le||(le=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(j)||L(j)===l}function T(j){return L(j)===u}function V(j){return L(j)===a}function z(j){return L(j)===o}function W(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function $(j){return L(j)===c}function D(j){return L(j)===r}function E(j){return L(j)===v}function A(j){return L(j)===m}function k(j){return L(j)===n}function B(j){return L(j)===i}function _(j){return L(j)===s}function ce(j){return L(j)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=Y,J.ContextProvider=R,J.Element=Q,J.ForwardRef=F,J.Fragment=I,J.Lazy=oe,J.Memo=ee,J.Portal=ae,J.Profiler=Se,J.StrictMode=pe,J.Suspense=q,J.isAsyncMode=K,J.isConcurrentMode=T,J.isContextConsumer=V,J.isContextProvider=z,J.isElement=W,J.isForwardRef=$,J.isFragment=D,J.isLazy=E,J.isMemo=A,J.isPortal=k,J.isProfiler=B,J.isStrictMode=_,J.isSuspense=ce,J.isValidElementType=P,J.typeOf=L}()),J}var Io;function No(){return Io||(Io=1,function(e){process.env.NODE_ENV==="production"?e.exports=Xf():e.exports=Zf()}(vr)),vr.exports}var xr,Fo;function Jf(){if(Fo)return xr;Fo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xr=s()?Object.assign:function(i,o){for(var a,l=r(i),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},xr}var br,Bo;function wr(){if(Bo)return br;Bo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return br=e,br}var Tr,$o;function Uo(){return $o||($o=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var Sr,Wo;function Qf(){if(Wo)return Sr;Wo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=wr(),n={},r=Uo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var f;try{if(typeof i[c]!="function"){var h=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[c](o,c,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=u?u():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sr=s,Sr}var Cr,zo;function ed(){if(zo)return Cr;zo=1;var e=No(),t=Jf(),n=wr(),r=Uo(),s=Qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Cr=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(T){var V=T&&(u&&T[u]||T[c]);if(typeof V=="function")return V}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:C(),arrayOf:P,element:L(),elementType:g(),instanceOf:O,node:F(),objectOf:R,oneOf:Y,oneOfType:Q,shape:oe,exact:ee};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function y(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}y.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var V={},z=0;function W(D,E,A,k,B,_,ce){if(k=k||h,_=_||A,ce!==n){if(l){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ee=k+":"+A;!V[Ee]&&z<3&&(i("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+k+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[Ee]=!0,z++)}}return E[A]==null?D?E[A]===null?new y("The "+B+" `"+_+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new y("The "+B+" `"+_+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:T(E,A,k,B,_)}var $=W.bind(null,!1);return $.isRequired=W.bind(null,!0),$}function b(T){function V(z,W,$,D,E,A){var k=z[W],B=pe(k);if(B!==T){var _=q(k);return new y("Invalid "+D+" `"+E+"` of type "+("`"+_+"` supplied to `"+$+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(V)}function C(){return w(o)}function P(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var A=z[W];if(!Array.isArray(A)){var k=pe(A);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an array."))}for(var B=0;B<A.length;B++){var _=T(A,B,$,D,E+"["+B+"]",n);if(_ instanceof Error)return _}return null}return w(V)}function L(){function T(V,z,W,$,D){var E=V[z];if(!a(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return w(T)}function g(){function T(V,z,W,$,D){var E=V[z];if(!e.isValidElementType(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return w(T)}function O(T){function V(z,W,$,D,E){if(!(z[W]instanceof T)){var A=T.name||h,k=K(z[W]);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected ")+("instance of `"+A+"`."))}return null}return w(V)}function Y(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function V(z,W,$,D,E){for(var A=z[W],k=0;k<T.length;k++)if(v(A,T[k]))return null;var B=JSON.stringify(T,function(ce,j){var Ee=q(j);return Ee==="symbol"?String(j):j});return new y("Invalid "+D+" `"+E+"` of value `"+String(A)+"` "+("supplied to `"+$+"`, expected one of "+B+"."))}return w(V)}function R(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an object."));for(var B in A)if(r(A,B)){var _=T(A,B,$,D,E+"."+B,n);if(_ instanceof Error)return _}return null}return w(V)}function Q(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var V=0;V<T.length;V++){var z=T[V];if(typeof z!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(z)+" at index "+V+"."),o}function W($,D,E,A,k){for(var B=[],_=0;_<T.length;_++){var ce=T[_],j=ce($,D,E,A,k,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&B.push(j.data.expectedType)}var Ee=B.length>0?", expected one of type ["+B.join(", ")+"]":"";return new y("Invalid "+A+" `"+k+"` supplied to "+("`"+E+"`"+Ee+"."))}return w(W)}function F(){function T(V,z,W,$,D){return ae(V[z])?null:new y("Invalid "+$+" `"+D+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return w(T)}function I(T,V,z,W,$){return new y((T||"React class")+": "+V+" type `"+z+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function oe(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));for(var B in T){var _=T[B];if(typeof _!="function")return I($,D,E,B,q(_));var ce=_(A,B,$,D,E+"."+B,n);if(ce)return ce}return null}return w(V)}function ee(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));var B=t({},z[W],T);for(var _ in B){var ce=T[_];if(r(T,_)&&typeof ce!="function")return I($,D,E,_,q(ce));if(!ce)return new y("Invalid "+D+" `"+E+"` key `"+_+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(z[W],null," ")+`
19
+ `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(ua,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const da=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=on(ha),u=x.useId(),c=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:u,initial:t,isPresent:n,custom:s,onExitComplete:c,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),c]:[n,c]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(fa,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function ha(){return new Map}function $r(e=!0){const t=x.useContext(kt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const _t=e=>e.key||"";function Ur(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Wr=ln?x.useLayoutEffect:x.useEffect,zr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=$r(o),c=x.useMemo(()=>Ur(e),[e]),f=o&&!l?[]:c.map(_t),h=x.useRef(!0),m=x.useRef(c),v=on(()=>new Map),[y,w]=x.useState(c),[b,C]=x.useState(c);Wr(()=>{h.current=!1,m.current=c;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const P=[];if(c!==y){let g=[...c];for(let O=0;O<b.length;O++){const Y=b[O],R=_t(Y);f.includes(R)||(g.splice(O,0,Y),P.push(Y))}return i==="wait"&&P.length&&(g=P),C(Ur(g)),w(c),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:L}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),Y=o&&!l?!1:c===b||f.includes(O),R=()=>{if(v.has(O))v.set(O,!0);else return;let Q=!0;v.forEach(F=>{F||(Q=!1)}),Q&&(L==null||L(),C(m.current),o&&(u==null||u()),r&&r())};return p.exports.jsx(da,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:R,anchorX:a,children:g},O)})})},Te=e=>e;let Ze=Te,_e=Te;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function cn(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,Yr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function pa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){o.has(f)&&(c.schedule(f),e()),l++,f(a)}const c={schedule:(f,h=!1,m=!1)=>{const y=m&&s?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(u),t&&Ie.value&&Ie.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,c.process(f))}};return c}const ma=40;function Kr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,C)=>(b[C]=pa(i,t?C:void 0),b),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ma),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,C)=>{const P=o[C];return b[C]=(L,g=!1,O=!1)=>(n||v(),P.schedule(L,g,O)),b},{}),cancel:b=>{for(let C=0;C<It.length;C++)o[It[C]].cancel(b)},state:s,steps:o}}const{schedule:ne,cancel:Ne,state:ge,steps:un}=Kr(typeof requestAnimationFrame<"u"?requestAnimationFrame:Te,!0),Hr=x.createContext({strict:!1}),qr={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"]},Qe={};for(const e in qr)Qe[e]={isEnabled:t=>qr[e].some(n=>!!t[n])};function ga(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ya=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ya.has(e)}let Gr=e=>!Nt(e);function va(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{va(require("@emotion/is-prop-valid").default)}catch{}function xa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Xr=new Set;function Ft(e,t,n){e||Xr.has(t)||(console.warn(t),n&&console.warn(n),Xr.add(t))}function ba(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Zr(e){return Boolean(Ut(e)||e.variants)}function wa(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ta(e){const{initial:t,animate:n}=wa(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Jr(t),Jr(n)])}function Jr(e){return Array.isArray(e)?e.join(" "):e}const Sa=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ca(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qr="data-"+hn("framerAppearId"),{schedule:pn,cancel:Ud}=Kr(queueMicrotask,!1),es=x.createContext({});function Pa(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(Bt),l=x.useContext(Hr),u=x.useContext(kt),c=x.useContext(an).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const h=f.current,m=x.useContext(es);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Ea(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,u)});const y=n[Qr],w=x.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Wr(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),w.current=!1))}),h}function Ea(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ts(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&et(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function ts(e){if(e)return e.options.allowProjection!==!1?e.projection:ts(e.parent)}function ja({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ga(e);function a(u,c){let f;const h={...x.useContext(an),...u,layoutId:Aa(u)},{isStatic:m}=h,v=Ta(u),y=r(u,m);if(!m&&ln){Ma(h,e);const w=Da(h);f=w.MeasureLayout,v.visualElement=Pa(s,y,h,t,w.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,u,Ca(y,v.visualElement,c),y,m,v.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Sa]=s,l}function Aa({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function Ma(e,t){const n=x.useContext(Hr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ze(!1,r):_e(!1,r)}}function Da(e){const{drag:t,layout:n}=Qe;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ns=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ns("--"),Va=ns("var(--"),gn=e=>Va(e)?Ra.test(e.split("/*")[0].trim()):!1,Ra=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Oa(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function rs(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ye=e=>Boolean(e&&e.getVelocity),ss=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),N=yt("px"),La=yt("vh"),ka=yt("vw"),is={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},_a={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,radius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,backgroundPositionX:N,backgroundPositionY:N},Ia={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:gt,originX:is,originY:is,originZ:N},os={...nt,transform:Math.round},yn={..._a,...Ia,zIndex:os,size:N,fillOpacity:gt,strokeOpacity:gt,numOctaves:os},Na={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fa=tt.length;function Ba(e,t,n){let r="",s=!0;for(let i=0;i<Fa;i++){const o=tt[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ss(a,yn[o]);if(!l){s=!1;const c=Na[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(We.has(l)){o=!0;continue}else if(mn(l)){s[l]=u;continue}else{const c=ss(u,yn[l]);l.startsWith("origin")?(a=!0,i[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=Ba(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=i;r.transformOrigin=`${l} ${u} ${c}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function as(e,t,n){for(const r in t)!ye(t[r])&&!rs(r,n)&&(e[r]=t[r])}function $a({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ua(e,t){const n=e.style||{},r={};return as(r,n,e),Object.assign(r,$a(e,t)),r}function Wa(e,t){const n={},r=Ua(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const za=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(za.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ya={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ka={offset:"strokeDashoffset",array:"strokeDasharray"};function Ha(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ya:Ka;e[i.offset]=N.transform(-r);const o=N.transform(t),a=N.transform(n);e[i.array]=`${o} ${a}`}function ls(e,t,n){return typeof e=="string"?e:N.transform(t+n*e)}function qa(e,t,n){const r=ls(t,e.x,e.width),s=ls(n,e.y,e.height);return`${r} ${s}`}function wn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(vn(e,u,f),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=qa(v,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ha(h,o,a,l,!1)}const cs=()=>({...xn(),attrs:{}}),Tn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ga(e,t,n,r){const s=x.useMemo(()=>{const i=cs();return wn(i,t,Tn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};as(i,e.style,e),s.style={...i,...s.style}}return s}function Xa(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(bn(n)?Ga:Wa)(r,i,o,n),u=xa(r,typeof n=="string",e),c=n!==x.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ye(f)?f.get():f,[f]);return x.createElement(n,{...c,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Cn=e=>Array.isArray(e),Za=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ja=e=>Cn(e)?e[e.length-1]||0:e;function zt(e){const t=ye(e)?e.get():e;return Za(t)?t.toValue():t}function Qa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:el(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const fs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Qa(e,t,r,s);return n?i():on(i)};function el(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:a}=e;const l=Ut(e),u=Zr(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;if(f&&typeof f!="boolean"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:w,...b}=v;for(const C in b){let P=b[C];if(Array.isArray(P)){const L=c?P.length-1:0;P=P[L]}P!==null&&(s[C]=P)}for(const C in y)s[C]=y[C]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ye(s[o])||t.style&&ye(t.style[o])||rs(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const tl={useVisualState:fs({scrapeMotionValuesFromProps:Pn,createRenderState:xn})};function ds(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function hs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ps=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 ms(e,t,n,r){hs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ps.has(s)?s:hn(s),t.attrs[s])}function gs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(ye(e[s])||ye(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ys=["x","y","width","height","cx","cy","r"],nl={useVisualState:fs({scrapeMotionValuesFromProps:gs,createRenderState:cs,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(We.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<ys.length;a++){const l=ys[a];e[l]!==t[l]&&(o=!0)}o&&ne.read(()=>{ds(n,r),ne.render(()=>{wn(r,s,Tn(n.tagName),e.transformTemplate),ms(n,r)})})}})};function rl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?nl:tl,preloadedFeatures:e,useRender:Xa(s),createVisualElement:t,Component:r};return ja(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const sl=cn(()=>window.ScrollTimeline!==void 0);class il{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(sl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ol extends il{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function vs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function xs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",al={linearEasing:void 0};function ll(e,t){const n=cn(e);return()=>{var r;return(r=al[t])!==null&&r!==void 0?r:n()}}const Yt=ll(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function ws(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(ws))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?bs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function Ss(){return Ae.x||Ae.y}function cl(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Cs(e,t){const n=cl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||Ss())}function ul(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{if(!Ps(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const c=f=>{Ps(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Kt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Es=(e,t)=>t?e===t?!0:Es(e,t.parentElement):!1,Vn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dl(e){return fl.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function js(e){return t=>{t.key==="Enter"&&e(t)}}function Rn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=js(()=>{if(bt.has(n))return;Rn(n,"down");const s=js(()=>{Rn(n,"up")}),i=()=>Rn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function As(e){return Vn(e)&&!Ss()}function pl(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{const l=a.currentTarget;if(!l||!As(a)||bt.has(l))return;bt.add(l),Kt(a,"set");const u=t(l,a),c=(m,v)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Kt(m,"release"),!(!As(m)||!bt.has(l))&&(bt.delete(l),typeof u=="function"&&u(m,{success:v}))},f=m=>{(m.isTrusted?ml(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?c(m,!1):c(m,!(l instanceof Element)||Es(l,m.target))},h=m=>{c(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!dl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",u=>hl(u,s),s)}),i}function ml(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function gl(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const Ms=new Set(["width","height","top","left","right","bottom",...tt]);let Ht;function yl(){Ht=void 0}const Ve={now:()=>(Ht===void 0&&Ve.set(ge.isProcessing||Yr.useManualTiming?ge.timestamp:performance.now()),Ht),set:e=>{Ht=e,queueMicrotask(yl)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ds(e,t){return t?e*(1e3/t):0}const Vs=30,vl=e=>!isNaN(parseFloat(e));class xl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ve.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ve.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kn);const r=this.events[t].add(n);return t==="change"?()=>{r(),ne.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ve.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vs);return Ds(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 wt(e,t){return new xl(e,t)}function bl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wt(n))}function wl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Ja(i[o]);bl(e,o,a)}}function Tl(e){return Boolean(ye(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(Tl(n))return n.add(t)}function Rs(e){return e.props[Qr]}const Sl={current:!1},Os=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cl=1e-7,Pl=12;function El(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Os(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Cl&&++a<Pl);return o}function Tt(e,t,n,r){if(e===t&&n===r)return Te;const s=i=>El(i,0,1,e,n);return i=>i===0||i===1?i:Os(s(i),t,r)}const Ls=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ks=e=>t=>1-e(1-t),_s=Tt(.33,1.53,.69,.99),In=ks(_s),Is=Ls(In),Ns=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Fs=ks(Nn),Bs=Ls(Nn),$s=e=>/^0[^.\s]+$/u.test(e);function jl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$s(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Al(e){return e==null}const Ml=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&Ml.test(n)&&n.startsWith(e)||t&&!Al(n)&&Object.prototype.hasOwnProperty.call(n,t)),Us=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Dl(e))},ze={test:Bn("rgb","red"),parse:Us("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Vl(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Un={test:Bn("#"),parse:Vl,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:Us("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ve={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Rl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ol(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Rl))===null||n===void 0?void 0:n.length)||0)>0}const Ws="number",zs="color",Ll="var",kl="var(",Ys="${}",_l=/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 Ct(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(_l,l=>(ve.test(l)?(r.color.push(i),s.push(zs),n.push(ve.parse(l))):l.startsWith(kl)?(r.var.push(i),s.push(Ll),n.push(l)):(r.number.push(i),s.push(Ws),n.push(parseFloat(l))),++i,Ys)).split(Ys);return{values:n,split:a,indexes:r,types:s}}function Ks(e){return Ct(e).values}function Hs(e){const{split:t,types:n}=Ct(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ws?i+=St(s[o]):a===zs?i+=ve.transform(s[o]):i+=s[o]}return i}}const Il=e=>typeof e=="number"?0:e;function Nl(e){const t=Ks(e);return Hs(e)(t.map(Il))}const Be={test:Ol,parse:Ks,createTransformer:Hs,getAnimatableNone:Nl},Fl=new Set(["brightness","contrast","saturate","opacity"]);function Bl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Fl.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const $l=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match($l);return t?t.map(Bl).join(" "):e}},Ul={...yn,color:ve,backgroundColor:ve,outlineColor:ve,fill:ve,stroke:ve,borderColor:ve,borderTopColor:ve,borderRightColor:ve,borderBottomColor:ve,borderLeftColor:ve,filter:Wn,WebkitFilter:Wn},zn=e=>Ul[e];function qs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wl=new Set(["auto","none","0"]);function zl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Wl.has(i)&&Ct(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=qs(n,s)}const Gs=e=>e===nt||e===N,Xs=(e,t)=>parseFloat(e.split(", ")[t]),Zs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Xs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Xs(i[1],e):0}},Yl=new Set(["x","y","z"]),Kl=tt.filter(e=>!Yl.has(e));function Hl(e){const t=[];return Kl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Zs(4,13),y:Zs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Js(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Hl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Qs(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function ql(){Qs(),Js()}class Hn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Yn||(Yn=!0,ne.read(Qs),ne.resolveKeyframes(Js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ei=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Gl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xl(e){const t=Gl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Zl=4;function ti(e,t,n=1){_e(n<=Zl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Xl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ei(o)?parseFloat(o):o}return gn(s)?ti(s,t,n+1):s}const ni=e=>t=>t.test(e),ri=[nt,N,De,Fe,ka,La,{test:e=>e==="auto",parse:e=>e}],si=e=>ri.find(ni(e));class ii extends Hn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),gn(u))){const c=ti(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ms.has(r)||t.length!==2)return;const[s,i]=t,o=si(s),a=si(i);if(o!==a)if(Gs(o)&&Gs(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)jl(t[s])&&r.push(s);r.length&&zl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=st[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=st[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const oi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Jl(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ql(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=oi(s,t),a=oi(i,t);return Ze(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:Jl(e)||(n==="spring"||An(n))&&r}const ec=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(ec),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const tc=40;class ai{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ve.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ql(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ve.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Ql(t,r,s,i))if(o)this.options.duration=0;else{l&&l(qt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pt={layout:0,mainThread:0,waapi:0},re=(e,t,n)=>e+(t-e)*n;function qn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=qn(l,a,e+1/3),i=qn(l,a,e),o=qn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Gt(e,t){return n=>n>0?t:e}const Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},rc=[Un,ze,rt],sc=e=>rc.find(t=>t.test(e));function li(e){const t=sc(e);if(Ze(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===rt&&(n=nc(n)),n}const ci=(e,t)=>{const n=li(e),r=li(t);if(!n||!r)return Gt(e,t);const s={...n};return i=>(s.red=Gn(n.red,r.red,i),s.green=Gn(n.green,r.green,i),s.blue=Gn(n.blue,r.blue,i),s.alpha=re(n.alpha,r.alpha,i),ze.transform(s))},ic=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(ic),Xn=new Set(["none","hidden"]);function oc(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ac(e,t){return n=>re(e,t,n)}function Zn(e){return typeof e=="number"?ac:typeof e=="string"?gn(e)?Gt:ve.test(e)?ci:uc:Array.isArray(e)?ui:typeof e=="object"?ve.test(e)?ci:lc:Gt}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function lc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function cc(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const uc=(e,t)=>{const n=Be.createTransformer(t),r=Ct(e),s=Ct(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?oc(e,t):Et(ui(cc(r,s),s.values),n):(Ze(!0,`Complex values '${e}' and '${t}' 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.`),Gt(e,t))};function fi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):Zn(e)(e,t)}const fc=5;function di(e,t,n){const r=Math.max(t-fc,0);return Ds(n-e(r),t-r)}const se={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Jn=.001;function dc({duration:e=se.duration,bounce:t=se.bounce,velocity:n=se.velocity,mass:r=se.mass}){let s,i;Ze(e<=Me(se.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(se.minDamping,se.maxDamping,o),e=Le(se.minDuration,se.maxDuration,Oe(e)),o<1?(s=u=>{const c=u*o,f=c*e,h=c-n,m=Qn(u,o),v=Math.exp(-f);return Jn-h/m*v},i=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),y=Qn(Math.pow(u,2),o);return(-s(u)+Jn>0?-1:1)*((h-m)*v)/y}):(s=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-Jn+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=pc(s,i,a);if(e=Me(e),isNaN(l))return{stiffness:se.stiffness,damping:se.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const hc=12;function pc(e,t,n){let r=n;for(let s=1;s<hc;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const mc=["duration","bounce"],gc=["stiffness","damping","mass"];function hi(e,t){return t.some(n=>e[n]!==void 0)}function yc(e){let t={velocity:se.velocity,stiffness:se.stiffness,damping:se.damping,mass:se.mass,isResolvedFromDuration:!1,...e};if(!hi(e,gc)&&hi(e,mc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:se.mass,stiffness:s,damping:i}}else{const n=dc(e);t={...t,...n,mass:se.mass},t.isResolvedFromDuration=!0}return t}function pi(e=se.visualDuration,t=se.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:m}=yc({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=u/(2*Math.sqrt(l*c)),w=o-i,b=Oe(Math.sqrt(l/c)),C=Math.abs(w)<5;r||(r=C?se.restSpeed.granular:se.restSpeed.default),s||(s=C?se.restDelta.granular:se.restDelta.default);let P;if(y<1){const g=Qn(b,y);P=O=>{const Y=Math.exp(-y*b*O);return o-Y*((v+y*b*w)/g*Math.sin(g*O)+w*Math.cos(g*O))}}else if(y===1)P=g=>o-Math.exp(-b*g)*(w+(v+b*w)*g);else{const g=b*Math.sqrt(y*y-1);P=O=>{const Y=Math.exp(-y*b*O),R=Math.min(g*O,300);return o-Y*((v+y*b*w)*Math.sinh(R)+g*w*Math.cosh(R))/g}}const L={calculatedDuration:m&&f||null,next:g=>{const O=P(g);if(m)a.done=g>=f;else{let Y=0;y<1&&(Y=g===0?Me(v):di(P,g,O));const R=Math.abs(Y)<=r,Q=Math.abs(o-O)<=s;a.done=R&&Q}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(vs(L),jn),O=bs(Y=>L.next(g*Y).value,g,30);return g+"ms "+O}};return L}function mi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],h={done:!1,value:f},m=R=>a!==void 0&&R<a||l!==void 0&&R>l,v=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let y=n*t;const w=f+y,b=o===void 0?w:o(w);b!==w&&(y=b-f);const C=R=>-y*Math.exp(-R/r),P=R=>b+C(R),L=R=>{const Q=C(R),F=P(R);h.done=Math.abs(Q)<=u,h.value=h.done?b:F};let g,O;const Y=R=>{m(h.value)&&(g=R,O=pi({keyframes:[h.value,v(h.value)],velocity:di(P,R,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return Y(0),{calculatedDuration:null,next:R=>{let Q=!1;return!O&&g===void 0&&(Q=!0,L(R),Y(R)),g!==void 0&&R>=g?O.next(R-g):(!Q&&L(R),h)}}}const vc=Tt(.42,0,1,1),xc=Tt(0,0,.58,1),gi=Tt(.42,0,.58,1),bc=e=>Array.isArray(e)&&typeof e[0]!="number",yi={linear:Te,easeIn:vc,easeInOut:gi,easeOut:xc,circIn:Nn,circInOut:Bs,circOut:Fs,backIn:In,backInOut:Is,backOut:_s,anticipate:Ns},vi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Tt(t,n,r,s)}else if(typeof e=="string")return _e(yi[e]!==void 0,`Invalid easing type '${e}'`),yi[e];return e};function wc(e,t,n){const r=[],s=n||fi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Te:t;a=Et(l,a)}r.push(a)}return r}function Tc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=wc(t,r,s),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=Je(e[f],e[f+1],c);return a[f](h)};return n?c=>u(Le(e[0],e[i-1],c)):u}function Sc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(re(n,1,s))}}function Cc(e){const t=[0];return Sc(t,e.length-1),t}function Pc(e,t){return e.map(n=>n*t)}function Ec(e,t){return e.map(()=>t||gi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=bc(r)?r.map(vi):vi(r),i={done:!1,value:t[0]},o=Pc(n&&n.length===t.length?n:Cc(t),e),a=Tc(o,t,{ease:Array.isArray(s)?s:Ec(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const jc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ne.update(t,!0),stop:()=>Ne(t),now:()=>ge.isProcessing?ge.timestamp:Ve.now()}},Ac={decay:mi,inertia:mi,tween:jt,keyframes:jt,spring:pi},Mc=e=>e/100;class er extends ai{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Hn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=An(n)?n:Ac[n]||jt;let l,u;process.env.NODE_ENV!=="production"&&a!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==jt&&typeof t[0]!="number"&&(l=Et(Mc,fi(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});i==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=vs(c));const{calculatedDuration:f}=c,h=f+s,m=h*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Pt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:v,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),C=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let P=this.currentTime,L=i;if(m){const R=Math.min(this.currentTime,c)/f;let Q=Math.floor(R),F=R%1;!F&&R>=1&&(F=1),F===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(v==="reverse"?(F=1-F,y&&(F-=y/f)):v==="mirror"&&(L=o)),P=Le(0,1,F)*f}const g=C?{done:!1,value:l[0]}:L.next(P);a&&(g.value=a(g.value));let{done:O}=g;!C&&u!==null&&(O=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=qt(l,this.options,s)),w&&w(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=jc,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&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(),Pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Dc=new Set(["opacity","clipPath","filter","transform"]);function Vc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Ts(a,s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Rc=cn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Oc=2e4;function Lc(e){return An(e.type)||e.type==="spring"||!ws(e.ease)}function kc(e,t){const n=new er({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Oc;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const xi={anticipate:Ns,backInOut:Is,circInOut:Bs};function _c(e){return e in xi}class bi extends ai{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ii(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Yt()&&_c(i)&&(i=xi[i]),Lc(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,w=kc(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,o="keyframes"}const c=Vc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(xs(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;a.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Te;const{animation:r}=n;xs(r,t)}return Te}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:f,element:h,...m}=this.options,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),y=Me(this.time);u.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}const{onStop:l}=this.options;l&&l(),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:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return Rc()&&r&&Dc.has(r)&&!l&&!u&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Ic={type:"spring",stiffness:500,damping:25,restSpeed:10},Nc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fc={type:"keyframes",duration:.8},Bc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$c=(e,{keyframes:t})=>t.length>2?Fc:We.has(e)?e.startsWith("scale")?Nc(t[1]):Ic:Bc;function Uc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const tr=(e,t,n,r={},s,i)=>o=>{const a=En(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Me(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};Uc(a)||(c={...c,...$c(e,c)}),c.duration&&(c.duration=Me(c.duration)),c.repeatDelay&&(c.repeatDelay=Me(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),(Sl.current||Yr.skipAnimations)&&(f=!0,c.duration=0,c.delay=0),f&&!i&&t.get()!==void 0){const h=qt(c.keyframes,a);if(h!==void 0)return ne.update(()=>{c.onUpdate(h),c.onComplete()}),new ol([])}return!i&&bi.supports(c)?new bi(c):new er(c)};function Wc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||c&&Wc(c,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const C=window.MotionHandoffAnimation(b,f,ne);C!==null&&(v.startTime=C,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&Ms.has(f)?{type:!1}:v,e,y));const w=h.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{ne.update(()=>{a&&wl(e,a)})}),u}function nr(e,t,n={}){var r;const s=vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(wi(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=i;return zc(e,t,c+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function zc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(Yc).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(nr(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Yc(e,t){return e.sortNodePosition(t)}function Kc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(wi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Hc=dn.length;function Si(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Si(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Hc;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const qc=[...fn].reverse(),Gc=fn.length;function Xc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Kc(e,n,r)))}function Zc(e){let t=Xc(e),n=Ci(),r=!0;const s=l=>(u,c)=>{var f;const h=vt(e,c,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;u={...u,...y,...v}}return u};function i(l){t=l(e)}function o(l){const{props:u}=e,c=Si(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let w=0;w<Gc;w++){const b=qc[w],C=n[b],P=u[b]!==void 0?u[b]:c[b],L=pt(P),g=b===l?C.isActive:null;g===!1&&(v=w);let O=P===c[b]&&P!==u[b]&&L;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),C.protectedKeys={...m},!C.isActive&&g===null||!P&&!C.prevProp||$t(P)||typeof P=="boolean")continue;const Y=Jc(C.prevProp,P);let R=Y||b===l&&C.isActive&&!O&&L||w>v&&L,Q=!1;const F=Array.isArray(P)?P:[P];let I=F.reduce(s(b),{});g===!1&&(I={});const{prevResolvedValues:oe={}}=C,ee={...oe,...I},ae=q=>{R=!0,h.has(q)&&(Q=!0,h.delete(q)),C.needsAnimating[q]=!0;const le=e.getValue(q);le&&(le.liveStyle=!1)};for(const q in ee){const le=I[q],K=oe[q];if(m.hasOwnProperty(q))continue;let T=!1;Cn(le)&&Cn(K)?T=!Ti(le,K):T=le!==K,T?le!=null?ae(q):h.add(q):le!==void 0&&h.has(q)?ae(q):C.protectedKeys[q]=!0}C.prevProp=P,C.prevResolvedValues=I,C.isActive&&(m={...m,...I}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(O&&Y)||Q)&&f.push(...F.map(q=>({animation:q,options:{type:b}})))}if(h.size){const w={};if(typeof u.initial!="boolean"){const b=vt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);b&&b.transition&&(w.transition=b.transition)}h.forEach(b=>{const C=e.getBaseTarget(b),P=e.getValue(b);P&&(P.liveStyle=!0),w[b]=C??null}),f.push({animation:w})}let y=Boolean(f.length);return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ci(),r=!0}}}function Jc(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ci(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Qc extends $e{constructor(t){super(t),t.animationState||(t.animationState=Zc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let eu=0;class tu extends $e{constructor(){super(...arguments),this.id=eu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nu={animation:{Feature:Qc},exit:{Feature:tu}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const ru=e=>t=>Vn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,ru(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function su({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iu(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ei=1e-4,ou=1-Ei,au=1+Ei,ji=.01,lu=0-ji,cu=0+ji;function xe(e){return e.max-e.min}function uu(e,t,n){return Math.abs(e-t)<=n}function Ai(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=xe(n)/xe(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ou&&e.scale<=au||isNaN(e.scale))&&(e.scale=1),(e.translate>=lu&&e.translate<=cu||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){Ai(e.x,t.x,n.x,r?r.originX:void 0),Ai(e.y,t.y,n.y,r?r.originY:void 0)}function Mi(e,t,n){e.min=n.min+t.min,e.max=e.min+xe(t)}function fu(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}function Di(e,t,n){e.min=t.min-n.min,e.max=e.min+xe(t)}function Vt(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}const Vi=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Vi(),y:Vi()}),Ri=()=>({min:0,max:0}),ue=()=>({x:Ri(),y:Ri()});function Ce(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function He(e){return sr(e)||Oi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Oi(e){return Li(e.x)||Li(e.y)}function Li(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function ki(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=ki(e.min,t,n,r,s),e.max=ki(e.max,t,n,r,s)}function _i(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const Ii=.999999999999,Ni=1.0000000000001;function du(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,_i(e,o)),r&&He(i.latestValues)&&lt(e,i.latestValues))}t.x<Ni&&t.x>Ii&&(t.x=1),t.y<Ni&&t.y>Ii&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Fi(e,t,n,r,s=.5){const i=re(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Fi(e.x,t.x,t.scaleX,t.scale,t.originX),Fi(e.y,t.y,t.scaleY,t.scale,t.originY)}function Bi(e,t){return Pi(iu(e.getBoundingClientRect(),t))}function hu(e,t,n){const r=Bi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const $i=(e,t)=>Math.abs(e-t);function pu(e,t){const n=$i(e.x,t.x),r=$i(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ui{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=pu(c.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=c,{timestamp:v}=ge;this.history.push({...m,timestamp:v});const{onStart:y,onMove:w}=this.handlers;f||(y&&y(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{if(c.target instanceof Element&&c.target.hasPointerCapture&&c.pointerId!==void 0)try{if(!c.target.hasPointerCapture(c.pointerId))return}catch{}this.lastMoveEvent=c,this.lastMoveEventInfo=or(f,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{Kt(c,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(c.type==="pointercancel"||c.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(c,y),m&&m(c,y)},!Vn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=ge;this.history=[{...a,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Wi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Wi(e,zi(t)),offset:Wi(e,mu(t)),velocity:gu(t,.1)}}function mu(e){return e[0]}function zi(e){return e[e.length-1]}function gu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=zi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function yu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function Yi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function vu(e,{top:t,left:n,bottom:r,right:s}){return{x:Yi(e.x,n,s),y:Yi(e.y,t,r)}}function Ki(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function xu(e,t){return{x:Ki(e.x,t.x),y:Ki(e.y,t.y)}}function bu(e,t){let n=.5;const r=xe(e),s=xe(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function wu(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lr=.35;function Tu(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Hi(e,"left","right"),y:Hi(e,"top","bottom")}}function Hi(e,t,n){return{min:qi(e,t),max:qi(e,n)}}function qi(e,t){return typeof e=="number"?e:e[t]||0}const Su=new WeakMap;class Cu{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=ue(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mt(c).point)},i=(c,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=gl(h),!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),Ce(w=>{let b=this.getAxisMotionValue(w).get()||0;if(De.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[w];P&&(b=xe(P)*(parseFloat(b)/100))}}this.originPoint[w]=b}),v&&ne.postRender(()=>v(c,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(m&&this.currentDirection===null){this.currentDirection=Pu(w),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(c,f)},a=(c,f)=>this.stop(c,f),l=()=>Ce(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Ui(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ne.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=yu(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=vu(s.layoutBox,n):this.constraints=!1,this.elastic=Tu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ce(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=hu(r,s.root,this.visualElement.getTransformPagePoint());let o=xu(s.layout.layoutBox,i);if(n){const a=n(su(o));this.hasMutatedConstraints=!!a,a&&(o=Pi(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ce(c=>{if(!Jt(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ce(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ce(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ce(n=>{const{drag:r}=this.getProps();if(!Jt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-re(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ce(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=bu({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ce(o=>{if(!Jt(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(re(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Su.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();et(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ne.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ce(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=lr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Pu(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Eu extends $e{constructor(t){super(t),this.removeGroupControls=Te,this.removeListeners=Te,this.controls=new Cu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Te}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&ne.postRender(()=>e(t,n))};class ju extends $e{constructor(){super(...arguments),this.removePointerDownListener=Te}onPointerDown(t){this.session=new Ui(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ne.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(N.test(e))e=parseFloat(e);else return e;const n=Xi(e,t.target.x),r=Xi(e,t.target.y);return`${n}% ${r}%`}},Au={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const u=re(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Mu extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Oa(Du),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ne.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Zi(e){const[t,n]=$r(),r=x.useContext(sn);return p.exports.jsx(Mu,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(es),isPresent:t,safeToRemove:n})}const Du={borderRadius:{...Rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rt,borderTopRightRadius:Rt,borderBottomLeftRadius:Rt,borderBottomRightRadius:Rt,boxShadow:Au};function Vu(e,t,n){const r=ye(e)?e:wt(e);return r.start(tr("",r,t,n)),r.animation}function Ru(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Ou=(e,t)=>e.depth-t.depth;class Lu{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ou),this.isDirty=!1,this.children.forEach(t)}}function ku(e,t){const n=Ve.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return ne.read(r,!0),()=>Ne(r)}const Ji=["TopLeft","TopRight","BottomLeft","BottomRight"],_u=Ji.length,Qi=e=>typeof e=="string"?parseFloat(e):e,eo=e=>typeof e=="number"||N.test(e);function Iu(e,t,n,r,s,i){s?(e.opacity=re(0,n.opacity!==void 0?n.opacity:1,Nu(r)),e.opacityExit=re(t.opacity!==void 0?t.opacity:1,0,Fu(r))):i&&(e.opacity=re(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_u;o++){const a=`border${Ji[o]}Radius`;let l=to(t,a),u=to(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||eo(l)===eo(u)?(e[a]=Math.max(re(Qi(l),Qi(u),r),0),(De.test(u)||De.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function to(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nu=no(0,.5,Fs),Fu=no(.5,.95,Te);function no(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function ro(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){ro(e.x,t.x),ro(e.y,t.y)}function so(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function io(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Bu(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=re(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=re(i.min,i.max,r);e===i&&(a-=t),e.min=io(e.min,t,n,a,s),e.max=io(e.max,t,n,a,s)}function oo(e,t,[n,r,s],i,o){Bu(e,t[n],t[r],t[s],t.scale,i,o)}const $u=["x","scaleX","originX"],Uu=["y","scaleY","originY"];function ao(e,t,n,r){oo(e.x,t,$u,n?n.x:void 0,r?r.x:void 0),oo(e.y,t,Uu,n?n.y:void 0,r?r.y:void 0)}function lo(e){return e.translate===0&&e.scale===1}function co(e){return lo(e.x)&&lo(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function Wu(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function fo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ho(e,t){return fo(e.x,t.x)&&fo(e.y,t.y)}function po(e){return xe(e.x)/xe(e.y)}function mo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zu{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Yu(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:h,skewX:m,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cr=["","X","Y","Z"],Ku={visibility:"hidden"},go=1e3;let Hu=0;function ur(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ne,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yo(r)}function vo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Hu++,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,Ie.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(Xu),this.nodes.forEach(tf),this.nodes.forEach(nf),this.nodes.forEach(Zu),Ie.addProjectionMetrics&&Ie.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ru(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=ku(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(bo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||lf,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=c.getProps(),C=!this.targetLayout||!ho(this.targetLayout,v),P=!h&&m;if(this.options.layoutRoot||this.resumeFrom||P||h&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,P);const L={...En(y,"layout"),onPlay:w,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else h||bo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ne(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(rf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xo);return}this.isUpdating||this.nodes.forEach(Qu),this.isUpdating=!1,this.nodes.forEach(ef),this.nodes.forEach(qu),this.nodes.forEach(Gu),this.clearAllSnapshots();const a=Ve.now();ge.delta=Le(0,1e3/60,a-ge.timestamp),ge.timestamp=a,ge.isProcessing=!0,un.update.process(ge),un.preRender.process(ge),un.render.process(ge),ge.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ju),this.sharedNodes.forEach(sf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xe(this.snapshot.measuredBox.x)&&!xe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ue(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!co(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||He(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),cf(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ue();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(uf))){const{scroll:c}=this.root;c&&(at(l.x,c.offset.x),at(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=ue();if(Pe(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pe(l,o),at(l.x,f.offset.x),at(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ue();Pe(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&lt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),He(c.latestValues)&&lt(l,c.latestValues)}return He(this.latestValues)&&lt(l,this.latestValues),l}removeTransform(o){const a=ue();Pe(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!He(u.latestValues))continue;sr(u.latestValues)&&u.updateSnapshot();const c=ue(),f=u.measurePageBox();Pe(c,f),ao(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return He(this.latestValues)&&ao(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==ge.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=Boolean(this.resumingFrom)||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=ge.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ue(),this.targetWithTransforms=ue()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Pe(this.target,this.layout.layoutBox),_i(this.target,this.targetDelta)):Pe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Oi(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 o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ge.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=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||!(c||f))return;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;du(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ue());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(so(this.prevProjectionDelta.x,this.projectionDelta.x),so(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ue(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,w=this.getStack(),b=!w||w.members.length<=1,C=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(af));this.animationProgress=0;let P;this.mixTargetDelta=L=>{const g=L/1e3;wo(f.x,o.x,g),wo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),of(this.relativeTarget,this.relativeTargetOrigin,h,g),P&&Wu(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=ue()),Pe(P,this.relativeTarget)),y&&(this.animationValues=c,Iu(c,u,this.latestValues,g,C,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{Qt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=Vu(0,go,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Pt.layout--},onComplete:()=>{Pt.layout--,o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(go),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Eo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ue();const f=xe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=xe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Pe(a,l),lt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zu),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&ur("z",o,u,this.animationValues);for(let c=0;c<cr.length;c++)ur(`rotate${cr[c]}`,o,u,this.animationValues),ur(`skew${cr[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ku;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!He(this.latestValues)&&(y.transform=c?c({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=Yu(this.projectionDeltaWithTransform,this.treeScale,h),c&&(u.transform=c(h,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in mt){if(h[y]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:C}=mt[y],P=u.transform==="none"?h[y]:w(h[y],f);if(b){const L=b.length;for(let g=0;g<L;g++)u[b[g]]=P}else C?this.options.visualElement.renderState.vars[y]=P:u[y]=P}return this.options.layoutId&&(u.pointerEvents=f===this?zt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(xo),this.root.sharedNodes.clear()}}}function qu(e){e.updateLayout()}function Gu(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(h);h.min=r[f].min,h.max=h.min+m}):Eo(i,n.layoutBox,r)&&Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ot();Dt(a,r,n.layoutBox);const l=ot();o?Dt(l,e.applyTransform(s,!0),n.measuredBox):Dt(l,r,n.layoutBox);const u=!co(a);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const v=ue();Vt(v,n.layoutBox,h.layoutBox);const y=ue();Vt(y,r,m.layoutBox),ho(v,y)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Xu(e){Ie.value&&qe.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Zu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ju(e){e.clearSnapshot()}function xo(e){e.clearMeasurements()}function Qu(e){e.isLayoutDirty=!1}function ef(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tf(e){e.resolveTargetDelta()}function nf(e){e.calcProjection()}function rf(e){e.resetSkewAndRotation()}function sf(e){e.removeLeadSnapshot()}function wo(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function To(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function of(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function af(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lf={duration:.45,ease:[.4,0,.1,1]},So=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Co=So("applewebkit/")&&!So("chrome/")?Math.round:Te;function Po(e){e.min=Co(e.min),e.max=Co(e.max)}function cf(e){Po(e.x),Po(e.y)}function Eo(e,t,n){return e==="position"||e==="preserve-aspect"&&!uu(po(t),po(n),.2)}function uf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ff=vo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},jo=vo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new ff({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),df={pan:{Feature:ju},drag:{Feature:Eu,ProjectionNode:jo,MeasureLayout:Zi}};function Ao(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ne.postRender(()=>i(t,Mt(t)))}class hf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(Ao(this.node,r,"Start"),s=>Ao(this.node,s,"End"))))}unmount(){}}class pf extends $e{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ne.postRender(()=>i(t,Mt(t)))}class mf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=pl(t,(n,r)=>(Mo(this.node,r,"Start"),(s,{success:i})=>Mo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,gf=e=>{const t=dr.get(e.target);t&&t(e)},yf=e=>{e.forEach(gf)};function vf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(yf,{root:e,...t})),r[s]}function xf(e,t,n){const r=vf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const bf={some:0,all:1};class wf extends $e{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:bf[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return xf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tf(t,n))&&this.startObserver()}unmount(){}}function Tf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Sf={inView:{Feature:wf},tap:{Feature:mf},focus:{Feature:pf},hover:{Feature:hf}},Cf={layout:{ProjectionNode:jo,MeasureLayout:Zi}},pr={current:null},Do={current:!1};function Pf(){if(Do.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Ef=[...ri,ve,Be],jf=e=>Ef.find(ni(e)),Af=new WeakMap;function Mf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ye(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(ye(i))e.addValue(r,wt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,wt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hn,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 m=Ve.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ne.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ut(n),this.isVariantNode=Zr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const v=h[m];l[m]!==void 0&&ye(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Af.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((n,r)=>this.bindToMotionValue(r,n)),Do.current||Pf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.current,process.env.NODE_ENV!=="production"&&Ft(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ne(this.notifyUpdate),Ne(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 n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ne.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qe){const n=Qe[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ue()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Vo.length;r++){const s=Vo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Mf(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 n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=wt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ei(s)||$s(s))?s=parseFloat(s):!jf(s)&&Be.test(n)&&(s=qs(t,n)),this.setBaseTarget(t,ye(s)?s.get():s)),ye(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Sn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ye(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Df{constructor(){super(...arguments),this.KeyframeResolver=ii}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Vf(e){return window.getComputedStyle(e)}class Rf extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=hs}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Vf(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Of extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ue,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ds(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=ps.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return gs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ne.postRender(this.updateDimensions)}build(t,n,r){wn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ms(t,n,r,s)}mount(t){this.isSVGTag=Tn(t.tagName),super.mount(t)}}const Lf=(e,t)=>bn(e)?new Of(t):new Rf(t,{allowProjection:e!==x.Fragment}),kf=rl({...nu,...Sf,...df,...Cf},Lf),mr=ba(kf),_f=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[p.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,If=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ue.createPortal(p.exports.jsx(zr,{children:t&&p.exports.jsx(mr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,u)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},u))})}),i.current)},Nf=(e,t)=>{if(!t.current)return 0;const n=window.getComputedStyle(t.current),r=parseInt(n.lineHeight,10)||20;return Math.ceil(t.current.scrollHeight/r)-1},Ff=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Bf=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),$f=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),p.exports.jsx("path",{className:"fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),p.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),p.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Uf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:a,setMessageToEdit:l})=>{const[u,c]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,w]=x.useState(null),[b,C]=x.useState(null),[P,L]=x.useState(0),g=x.useRef(null),O=x.useRef([]),Y=x.useRef(null),R=x.useRef(null),Q=x.useRef(null),[F,I]=x.useState(!1),oe=150,ee=41.6;x.useEffect(()=>{const D=document.getElementById("static-display");D&&!D.textContent&&(a!=null&&a.text)&&(D.textContent=a==null?void 0:a.text)},[a==null?void 0:a.text]);const ae=D=>{const E=D.target.value;a?l(k=>k?new Xe({...k,text:E,isEdited:!0}):void 0):c(E);const A=E.match(/(\S+)$/);if(Se(A),console.log("numberOfLineBreaks",Nf(E,R)),R.current){const k=R.current.scrollHeight,B=Math.ceil(R.current.scrollHeight/k)-1;console.log(B),k>ee?k>oe?(R.current.style.height=`${oe}px`,R.current.style.overflowY="auto"):(R.current.style.height=`${k}px`,R.current.style.overflowY="hidden"):(console.log("buy"),R.current.style.height=`${ee}px`,R.current.style.overflowY="hidden")}},Se=D=>{if(D){const E=D[0];if(y){const A=D[0].split(y)[1];C(A)}o!=null&&o.some(A=>A.symbol===E)&&w(E)}else w(null),C(null)},pe=(D,E)=>{a?l(A=>A?new Xe({...A,text:A.text+E+" "}):void 0):c(A=>A+E+" "),w(null),C(null),R.current.focus()},q=()=>{if(a){if(a.text.trim()==="")return;t(a),l(void 0)}else{if(u.trim()==="")return;e(u),c("")}w(null),C(null),R.current&&(R.current.style.height=`${ee}px`)},le=async()=>{h(!0),v(0),O.current=[],Y.current=setInterval(()=>{v(A=>A+1)},1e3);const D=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(D);g.current=E,E.ondataavailable=A=>{A.data.size>0&&O.current.push(A.data)},E.onstop=()=>{clearInterval(Y.current);const A=new Blob(O.current,{type:"audio/mp3"});n(A),h(!1)},E.start()},K=()=>{var D;(D=g.current)==null||D.stop()},T=D=>{const{scrollTop:E,scrollHeight:A,clientHeight:k}=D.currentTarget;if(E>P){if(E+k>=A-1){const _=o==null?void 0:o.find(ce=>ce.symbol===y);_&&(_!=null&&_.updatePageNumber)&&(I(!0),_==null||_.updatePageNumber(_.pagNumber+1),L(E),setTimeout(()=>{I(!1)},500))}}else L(E)},V=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),z=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),W=()=>{var D;(D=Q.current)==null||D.click()},$=D=>{var k,B;const E=(k=D.target.files)==null?void 0:k[0];if(!E)return;let A="";if(E.type){const _=E.type.split("/");_.length===2&&(A=_[1])}A||(A=((B=E.name.split(".").pop())==null?void 0:B.toLowerCase())||""),V.has(A)?r(E):z.has(A)?s(E):i(E)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Ff(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:K,children:p.exports.jsx(gr,{})})]}):a?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>l(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:a.text,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:q,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:W,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx(Bf,{})}),p.exports.jsx("input",{type:"file",ref:Q,style:{display:"none"},onChange:$}),p.exports.jsx("textarea",{ref:R,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",style:{height:ee},placeholder:"Type a message...",value:u,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:u?q:le,children:u?p.exports.jsx(gr,{}):p.exports.jsx($f,{})})]}),y&&p.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:T,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>w(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(D=>D.symbol===y).map(D=>{var k;const{component:E,lists:A}=D;return E?b?(k=A==null?void 0:A.filter(B=>B==null?void 0:B.name.includes(b)))==null?void 0:k.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):A==null?void 0:A.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):null}):null,p.exports.jsx("div",{className:"h-8",children:F&&"Loading more items..."})]})]})]})};var Re=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Re||{}),ie=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ie||{});const yr=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[u,c]=x.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-u/100*h;return x.useEffect(()=>{const v=Date.now(),y=v+i,w=()=>{const b=Date.now(),P=Math.min(1,(b-v)/i)*e;c(P),b<y?requestAnimationFrame(w):c(e)};requestAnimationFrame(w)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(u),"%"]})]})},Oo=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const u={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&u[n]?u[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=u=>u>1048576?(u/1048576).toFixed(1)+" MB":(u/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===ie.Simple?" border-white ":s===ie.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ie.Simple?"text-white":s===ie.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===ie.Simple?"text-gray-800":s===ie.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},Wf=e=>p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),zf=e=>p.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const Yf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=x.useState(!1),[o,a]=x.useState(0),l=x.useRef(null);x.useEffect(()=>{const c=l.current;if(!c)return;const f=()=>{a(c.currentTime/c.duration*100)},h=()=>i(!0),m=()=>i(!1),v=()=>{i(!1),a(0)};return c.addEventListener("timeupdate",f),c.addEventListener("play",h),c.addEventListener("pause",m),c.addEventListener("ended",v),()=>{c.removeEventListener("timeupdate",f),c.removeEventListener("play",h),c.removeEventListener("pause",m),c.removeEventListener("ended",v)}},[]);const u=()=>{const c=l.current;c&&(s?c.pause():(Ot&&Ot!==c&&(Ot.pause(),Ot.currentTime=0),c.play(),Ot=c))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:u,children:s?p.exports.jsx(zf,{}):p.exports.jsx(Wf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Kf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r,uploadProgres:s,cancellationToken:i})=>e?t===Re.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Yf,{onCancelClick:i,uploadProgres:s,src:e})}):t===Re.Image?p.exports.jsxs("div",{className:"relative w-full",children:[s?p.exports.jsx(yr,{progress:s==null?void 0:s.progres,size:50,strokeWidth:4,showCancel:!0,onCancelClick:i,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${s?"filter blur-lg":" blur-none"}`,src:e})]}):t===Re.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):t===Re.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):null:null,Hf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,u,c,f,h,m,v,y;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:w=>n(w,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===ie.Simple?"bg-[#f8fbff]":s===ie.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(u=e.user)==null?void 0:u.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(v=e.user)==null?void 0:v.firstName:(y=e.user)==null?void 0:y.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ie.Simple?"text-gray-700":s===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===ie.Simple?"[&>g>path]:fill-[#f8fbff]":s===ie.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},qf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Lo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Gf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(mr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===ie.Telegram?" bg-green-200":ie.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Lo,{size:13,color:"text-black"}):p.exports.jsx(qf,{className:r===ie.Telegram?" ":ie.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ie.Simple?"text-gray-200":r===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ie.Telegram?"[&>g>path]:fill-green-200":ie.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var me={exports:{}},vr={exports:{}},Z={};var ko;function Xf(){if(ko)return Z;ko=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case u:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case c:case v:case m:case o:return g;default:return O}}case n:return O}}}function L(g){return P(g)===u}return Z.AsyncMode=l,Z.ConcurrentMode=u,Z.ContextConsumer=a,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=c,Z.Fragment=r,Z.Lazy=v,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return L(g)||P(g)===l},Z.isConcurrentMode=L,Z.isContextConsumer=function(g){return P(g)===a},Z.isContextProvider=function(g){return P(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return P(g)===c},Z.isFragment=function(g){return P(g)===r},Z.isLazy=function(g){return P(g)===v},Z.isMemo=function(g){return P(g)===m},Z.isPortal=function(g){return P(g)===n},Z.isProfiler=function(g){return P(g)===i},Z.isStrictMode=function(g){return P(g)===s},Z.isSuspense=function(g){return P(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===u||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===c||g.$$typeof===w||g.$$typeof===b||g.$$typeof===C||g.$$typeof===y)},Z.typeOf=P,Z}var J={};var _o;function Zf(){return _o||(_o=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(j){return typeof j=="string"||typeof j=="function"||j===r||j===u||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===v||j.$$typeof===m||j.$$typeof===o||j.$$typeof===a||j.$$typeof===c||j.$$typeof===w||j.$$typeof===b||j.$$typeof===C||j.$$typeof===y)}function L(j){if(typeof j=="object"&&j!==null){var Ee=j.$$typeof;switch(Ee){case t:var ct=j.type;switch(ct){case l:case u:case r:case i:case s:case f:return ct;default:var Ge=ct&&ct.$$typeof;switch(Ge){case a:case c:case v:case m:case o:return Ge;default:return Ee}}case n:return Ee}}}var g=l,O=u,Y=a,R=o,Q=t,F=c,I=r,oe=v,ee=m,ae=n,Se=i,pe=s,q=f,le=!1;function K(j){return le||(le=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(j)||L(j)===l}function T(j){return L(j)===u}function V(j){return L(j)===a}function z(j){return L(j)===o}function W(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function $(j){return L(j)===c}function D(j){return L(j)===r}function E(j){return L(j)===v}function A(j){return L(j)===m}function k(j){return L(j)===n}function B(j){return L(j)===i}function _(j){return L(j)===s}function ce(j){return L(j)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=Y,J.ContextProvider=R,J.Element=Q,J.ForwardRef=F,J.Fragment=I,J.Lazy=oe,J.Memo=ee,J.Portal=ae,J.Profiler=Se,J.StrictMode=pe,J.Suspense=q,J.isAsyncMode=K,J.isConcurrentMode=T,J.isContextConsumer=V,J.isContextProvider=z,J.isElement=W,J.isForwardRef=$,J.isFragment=D,J.isLazy=E,J.isMemo=A,J.isPortal=k,J.isProfiler=B,J.isStrictMode=_,J.isSuspense=ce,J.isValidElementType=P,J.typeOf=L}()),J}var Io;function No(){return Io||(Io=1,function(e){process.env.NODE_ENV==="production"?e.exports=Xf():e.exports=Zf()}(vr)),vr.exports}var xr,Fo;function Jf(){if(Fo)return xr;Fo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xr=s()?Object.assign:function(i,o){for(var a,l=r(i),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},xr}var br,Bo;function wr(){if(Bo)return br;Bo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return br=e,br}var Tr,$o;function Uo(){return $o||($o=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var Sr,Wo;function Qf(){if(Wo)return Sr;Wo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=wr(),n={},r=Uo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var f;try{if(typeof i[c]!="function"){var h=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[c](o,c,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=u?u():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sr=s,Sr}var Cr,zo;function ed(){if(zo)return Cr;zo=1;var e=No(),t=Jf(),n=wr(),r=Uo(),s=Qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Cr=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(T){var V=T&&(u&&T[u]||T[c]);if(typeof V=="function")return V}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:C(),arrayOf:P,element:L(),elementType:g(),instanceOf:O,node:F(),objectOf:R,oneOf:Y,oneOfType:Q,shape:oe,exact:ee};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function y(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}y.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var V={},z=0;function W(D,E,A,k,B,_,ce){if(k=k||h,_=_||A,ce!==n){if(l){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ee=k+":"+A;!V[Ee]&&z<3&&(i("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+k+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[Ee]=!0,z++)}}return E[A]==null?D?E[A]===null?new y("The "+B+" `"+_+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new y("The "+B+" `"+_+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:T(E,A,k,B,_)}var $=W.bind(null,!1);return $.isRequired=W.bind(null,!0),$}function b(T){function V(z,W,$,D,E,A){var k=z[W],B=pe(k);if(B!==T){var _=q(k);return new y("Invalid "+D+" `"+E+"` of type "+("`"+_+"` supplied to `"+$+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(V)}function C(){return w(o)}function P(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var A=z[W];if(!Array.isArray(A)){var k=pe(A);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an array."))}for(var B=0;B<A.length;B++){var _=T(A,B,$,D,E+"["+B+"]",n);if(_ instanceof Error)return _}return null}return w(V)}function L(){function T(V,z,W,$,D){var E=V[z];if(!a(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return w(T)}function g(){function T(V,z,W,$,D){var E=V[z];if(!e.isValidElementType(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return w(T)}function O(T){function V(z,W,$,D,E){if(!(z[W]instanceof T)){var A=T.name||h,k=K(z[W]);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected ")+("instance of `"+A+"`."))}return null}return w(V)}function Y(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function V(z,W,$,D,E){for(var A=z[W],k=0;k<T.length;k++)if(v(A,T[k]))return null;var B=JSON.stringify(T,function(ce,j){var Ee=q(j);return Ee==="symbol"?String(j):j});return new y("Invalid "+D+" `"+E+"` of value `"+String(A)+"` "+("supplied to `"+$+"`, expected one of "+B+"."))}return w(V)}function R(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an object."));for(var B in A)if(r(A,B)){var _=T(A,B,$,D,E+"."+B,n);if(_ instanceof Error)return _}return null}return w(V)}function Q(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var V=0;V<T.length;V++){var z=T[V];if(typeof z!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(z)+" at index "+V+"."),o}function W($,D,E,A,k){for(var B=[],_=0;_<T.length;_++){var ce=T[_],j=ce($,D,E,A,k,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&B.push(j.data.expectedType)}var Ee=B.length>0?", expected one of type ["+B.join(", ")+"]":"";return new y("Invalid "+A+" `"+k+"` supplied to "+("`"+E+"`"+Ee+"."))}return w(W)}function F(){function T(V,z,W,$,D){return ae(V[z])?null:new y("Invalid "+$+" `"+D+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return w(T)}function I(T,V,z,W,$){return new y((T||"React class")+": "+V+" type `"+z+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function oe(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));for(var B in T){var _=T[B];if(typeof _!="function")return I($,D,E,B,q(_));var ce=_(A,B,$,D,E+"."+B,n);if(ce)return ce}return null}return w(V)}function ee(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));var B=t({},z[W],T);for(var _ in B){var ce=T[_];if(r(T,_)&&typeof ce!="function")return I($,D,E,_,q(ce));if(!ce)return new y("Invalid "+D+" `"+E+"` key `"+_+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(z[W],null," ")+`
20
20
  Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ce(A,_,$,D,E+"."+_,n);if(j)return j}return null}return w(V)}function ae(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(ae);if(T===null||a(T))return!0;var V=f(T);if(V){var z=V.call(T),W;if(V!==T.entries){for(;!(W=z.next()).done;)if(!ae(W.value))return!1}else for(;!(W=z.next()).done;){var $=W.value;if($&&!ae($[1]))return!1}}else return!1;return!0;default:return!1}}function Se(T,V){return T==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function pe(T){var V=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":Se(V,T)?"symbol":V}function q(T){if(typeof T>"u"||T===null)return""+T;var V=pe(T);if(V==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return V}function le(T){var V=q(T);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function K(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Cr}var Pr,Yo;function td(){if(Yo)return Pr;Yo=1;var e=wr();function t(){}function n(){}return n.resetWarningCache=t,Pr=function(){function r(o,a,l,u,c,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Pr}if(process.env.NODE_ENV!=="production"){var nd=No(),rd=!0;me.exports=ed()(nd.isElement,rd)}else me.exports=td()();function Er(){return Er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}function sd(e,t){if(e==null)return{};var n=id(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function id(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var jr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=sd(e,["color","size"]);return x.createElement("svg",Er({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"20 6 9 17 4 12"}))});jr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},jr.displayName="Check";const od=jr;function Ar(){return Ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(this,arguments)}function ad(e,t){if(e==null)return{};var n=ld(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ld(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Mr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ad(e,["color","size"]);return x.createElement("svg",Ar({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),x.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Mr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Mr.displayName="Copy";const cd=Mr;function Dr(){return Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dr.apply(this,arguments)}function ud(e,t){if(e==null)return{};var n=fd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Vr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ud(e,["color","size"]);return x.createElement("svg",Dr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});Vr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Vr.displayName="Edit";const dd=Vr;function Rr(){return Rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(this,arguments)}function hd(e,t){if(e==null)return{};var n=pd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Or=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=hd(e,["color","size"]);return x.createElement("svg",Rr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"3 6 5 6 21 6"}),x.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Or.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Or.displayName="Trash";const md=Or,gd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:a})=>{const l=x.useRef(null),[u,c]=x.useState(!1),[f,h]=x.useState(null),[m,v]=x.useState(),[y,w]=x.useState(null),b=()=>{setTimeout(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},100)};x.useEffect(()=>{const F=()=>{w(null)};return window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("scroll",F,!0)}},[w]);const C=(F,I)=>{F.preventDefault();const oe=window.scrollX,ee=window.scrollY;w({x:F.clientX+oe,y:F.clientY+ee,message:I})},P=()=>{w(null)},L=F=>{const I=new Xe({id:new Date().toString(),text:F,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,I]),r(I),b()},g=F=>{n(t.map(I=>I.id===F.id?(F.updateIsSending(Boolean(o)),F):I)),s(F)},O=F=>{const I=URL.createObjectURL(F),oe=new Xe({id:new Date().toString(),text:"",attachmentUrl:I,attachmentType:Re.Voice,attachmentBlob:F,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,oe]),r(oe),b()},Y=(F,I)=>{const oe=URL.createObjectURL(F),ee=new Xe({id:new Date().toString(),text:"",attachmentUrl:oe,attachmentBlob:F,attachmentType:I,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ee]),r(ee),b()};return{handleDeleteConfirmation:()=>{f&&(a(f),h(null)),c(!1)},handleCloseContextMenu:P,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(dd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:F=>{v(t.find(I=>I.id===F)),P()}},{name:"Delete",icon:p.exports.jsx(md,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:F=>{h(F),c(!0),P()}},{name:"Select",icon:p.exports.jsx(od,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),P()}},{name:"Copy",icon:p.exports.jsx(cd,{className:"text-blue-600"}),onClick:F=>{const I=t.find(oe=>oe.id===F);I&&navigator.clipboard.writeText(I.text),P()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:L,handleContextMenu:C,isModalOpen:u,contextMenu:y,chatRef:l,setIsModalOpen:c,messageToEdit:m,setMessageToEdit:v,handleEditMessage:g}},yd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:a,onMessageSent:l,onDeleteMessage:u,onEditMessage:c,dynamicSymbolAssignments:f,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m,backgroundImage:v,messageBubbleBiggerSize:y,uploadProgress:w,onUploadCancellationToken:b,them:C=ie.Telegram})=>{var q,le;const{handleDeleteConfirmation:P,handleCloseContextMenu:L,handleSendFile:g,handleSendVoice:O,handleSendMessage:Y,handleContextMenu:R,contextMenuItems:Q,isModalOpen:F,contextMenu:I,chatRef:oe,setIsModalOpen:ee,messageToEdit:ae,setMessageToEdit:Se,handleEditMessage:pe}=gd({user:o,messages:i,updateMessages:a,onMessageSent:l,onEditMessage:c,onDeleteMessage:u,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+v+")",...s},onClick:L,children:[p.exports.jsx("div",{ref:oe,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${I?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(Lo,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(zr,{children:i.length>0?i.map((K,T)=>{var W,$,D;const V=K!=null&&K.attachmentUrl?p.exports.jsx(Kf,{attachmentUrl:K.attachmentUrl,attachmentType:K==null?void 0:K.attachmentType,attachmentFormat:K==null?void 0:K.attachmentFormat,uploadProgres:w==null?void 0:w.find(E=>E.messageId===K.id),cancellationToken:()=>b?b(K.id):null},T):null;if(K.isRightSided)return p.exports.jsx(Gf,{maxWidth:y,media:V,handleContextMenu:R,message:K,them:C},T);const z=(($=(W=i[T-1])==null?void 0:W.user)==null?void 0:$.id)!==((D=K==null?void 0:K.user)==null?void 0:D.id);return p.exports.jsx(Hf,{maxWidth:y,showUserProfile:z,media:V,handleContextMenu:R,message:K,them:C},T)}):null})}),p.exports.jsx(_f,{isOpen:F,onClose:()=>ee(!1),onConfirm:P,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),I&&((q=I==null?void 0:I.message)!=null&&q.id)?p.exports.jsx(If,{items:Q,isVisible:Boolean(I),messageId:String(I==null?void 0:I.message.id),isCurrentUserMessage:((le=I==null?void 0:I.message)==null?void 0:le.user.id)===o.id,position:{x:I==null?void 0:I.x,y:I==null?void 0:I.y}}):null,p.exports.jsx(Uf,{onSendVoice:O,onSendMessage:Y,onFileSend:K=>g(K,Re.File),onImageSend:K=>g(K,Re.Image),onVideoSend:K=>g(K,Re.Video),dynamicSymbolAssignments:f,messageToEdit:ae,setMessageToEdit:Se,onEditMessage:pe})]})};he.AttachmentTypeEnum=Re,he.Button=la,he.Chat=yd,he.ChatThemEntity=ie,he.MessageEntity=Xe,he.SymbolsListComponent=ca,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map